mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#include "activeStateButton.h"
|
|
#include "gameManager.h"
|
|
#include "activeGameState.h"
|
|
#include "concreteGuiManager.h"
|
|
|
|
#include <listbox.h>
|
|
#include <checkbox.h>
|
|
#include <slider.h>
|
|
#include <textbox.h>
|
|
|
|
#include <text.h>
|
|
|
|
#include <stateManager.h>
|
|
|
|
namespace battleship{
|
|
using namespace std;
|
|
using namespace vb01;
|
|
using namespace vb01Gui;
|
|
using namespace gameBase;
|
|
|
|
ActiveStateButton::ActiveStateButton(Vector3 pos, Vector2 size, string gs, string name, string fontPath, int trigger, string imagePath) :
|
|
PfButtonBase(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);
|
|
|
|
vector<Button*> buttons = activeState->getGuiButtons();
|
|
buttons.push_back(this);
|
|
|
|
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
|
|
);
|
|
}
|
|
}
|