keeping unit buttons when pausing the game

removing unit buttons when deselecting units
This commit is contained in:
devZoGok
2023-09-24 10:42:28 +03:00
parent 4ba11bb276
commit d43a40221b
10 changed files with 86 additions and 9 deletions
+12 -1
View File
@@ -1,9 +1,20 @@
#include "unitButton.h"
#include "gameManager.h"
#include "activeGameState.h"
#include <stateManager.h>
namespace battleship{
using namespace std;
using namespace vb01;
using namespace vb01Gui;
using namespace gameBase;
UnitButton::UnitButton(Vector2 pos, Vector2 size, string name, string fontPath, int trigger, string imagePath) : Button(pos, size, name, fontPath, true, trigger, imagePath){}
UnitButton::UnitButton(Vector2 pos, Vector2 size, string name, string fontPath, int trigger, string imagePath) : Button(pos, size, name, fontPath, true, trigger, imagePath){
StateManager *stateManager = GameManager::getSingleton()->getStateManager();
ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE);
if(activeState)
activeState->addButton(this);
}
}