factored out options screen GUI elements using the new GUI subsystem

This commit is contained in:
devZoGok
2023-06-25 15:44:35 +03:00
parent 3196d9b0b9
commit adaa472fd7
21 changed files with 514 additions and 124 deletions
+26
View File
@@ -0,0 +1,26 @@
#include "tabButton.h"
#include "concreteGuiManager.h"
#include "gameManager.h"
namespace battleship{
using namespace std;
using namespace vb01;
using namespace vb01Gui;
TabButton::TabButton(Vector2 pos, Vector2 size, string name, string screenScript) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {
this->screenScript = screenScript;
}
void TabButton::onClick() {
ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton();
guiManager->removeAllButtons(vector<Button*>{this});
guiManager->removeAllListboxes();
guiManager->removeAllCheckboxes();
guiManager->removeAllSliders();
guiManager->removeAllTextboxes();
guiManager->readLuaScreenScript(screenScript);
guiManager->removeButton(this);
}
}