map editor buttons on the title screen

This commit is contained in:
devZoGok
2022-12-28 15:45:24 +02:00
parent 87503c7b48
commit d6ae678ce6
3 changed files with 75 additions and 10 deletions
+14 -6
View File
@@ -1,4 +1,6 @@
#include <sstream>
#include <algorithm>
#include <vector.h>
#include <util.h>
@@ -327,12 +329,18 @@ namespace battleship{
}
}
void GuiAppState::removeAllButtons() {
while (buttons.size() > 0) {
delete buttons[buttons.size() - 1];
buttons.pop_back();
}
}
void GuiAppState::removeAllButtons(vector<Button*> exceptions){
int targetId = 0;
while(targetId != buttons.size()){
if(find(exceptions.begin(), exceptions.end(), buttons[targetId]) == exceptions.end()){
delete buttons[targetId];
buttons.erase(buttons.begin() + targetId);
}
else
targetId++;
}
}
void GuiAppState::removeAllListboxes() {
while (listboxes.size() > 0) {