mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
24 lines
809 B
C++
24 lines
809 B
C++
#include "tradingScreenButton.h"
|
|
#include "concreteGuiManager.h"
|
|
#include "offerButton.h"
|
|
#include "gameManager.h"
|
|
|
|
namespace battleship{
|
|
using namespace std;
|
|
using namespace vb01;
|
|
using namespace vb01Gui;
|
|
|
|
TradingScreenButton::TradingScreenButton(Vector3 pos, Vector2 size, int plId, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath), playerId(plId){}
|
|
|
|
//TODO add method to get buttons by name
|
|
void TradingScreenButton::onClick(){
|
|
buttons.push_back(this);
|
|
ActiveStateButton::onClick();
|
|
|
|
ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton();
|
|
int numButtons = guiManager->getButtons().size();
|
|
((OfferButton*)guiManager->getButtons()[numButtons - 1])->setPlayerId(playerId);
|
|
guiManager->removeButton(this);
|
|
}
|
|
}
|