unit orders aren't invoked if pressing a button

This commit is contained in:
devZoGok
2024-03-17 15:07:16 +02:00
parent ae93ada2c4
commit ce62c429c5
9 changed files with 72 additions and 5 deletions
+22
View File
@@ -0,0 +1,22 @@
#include "activeStateButton.h"
#include "gameManager.h"
#include "activeGameState.h"
#include <stateManager.h>
namespace battleship{
using namespace std;
using namespace vb01;
using namespace gameBase;
ActiveStateButton::ActiveStateButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath){
StateManager *stateManager = GameManager::getSingleton()->getStateManager();
ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE);
if(activeState)
activeState->addButton(this);
}
void ActiveStateButton::onClick(){
}
}