mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
accessible trading screen
This commit is contained in:
+19
-6
@@ -18,15 +18,28 @@ namespace battleship{
|
||||
using namespace vb01Gui;
|
||||
using namespace gameBase;
|
||||
|
||||
ActiveStateButton::ActiveStateButton(Vector3 pos, Vector2 size, string gs, string name, string fontPath, int trigger, string imagePath) : Button(pos, size, name, fontPath, trigger, true, imagePath), guiScreen(gs){
|
||||
ActiveStateButton::ActiveStateButton(Vector3 pos, Vector2 size, string gs, string name, string fontPath, int trigger, string imagePath) :
|
||||
Button(pos, size, name, fontPath, trigger, true, imagePath), guiScreen(gs){}
|
||||
|
||||
void ActiveStateButton::onClick(){
|
||||
StateManager *stateManager = GameManager::getSingleton()->getStateManager();
|
||||
ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE);
|
||||
|
||||
if(activeState)
|
||||
activeState->addButton(this);
|
||||
}
|
||||
vector<Button*> buttons = activeState->getGuiButtons();
|
||||
buttons.push_back(this);
|
||||
|
||||
void ActiveStateButton::onClick(){
|
||||
ConcreteGuiManager::getSingleton()->parseLuaScript(guiScreen);
|
||||
vector<Node*> rects = activeState->getGuiRects();
|
||||
vector<Text*> texts = activeState->getGuiTexts();
|
||||
|
||||
ConcreteGuiManager::getSingleton()->readLuaScreenScript(
|
||||
guiScreen,
|
||||
buttons,
|
||||
vector<Listbox*>{},
|
||||
vector<Checkbox*>{},
|
||||
vector<Slider*>{},
|
||||
vector<Textbox*>{},
|
||||
rects,
|
||||
texts
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user