mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
incrementing player stats
This commit is contained in:
+4
-8
@@ -15,15 +15,8 @@ namespace battleship{
|
||||
StatsButton::StatsButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath){}
|
||||
|
||||
void StatsButton::addPlayerDataGuiElements(int playerId){
|
||||
string fontPath = GameManager::getSingleton()->getPath() + "Fonts/batang.ttf";
|
||||
Player *player = Game::getSingleton()->getPlayer(playerId);
|
||||
|
||||
Root *root = Root::getSingleton();
|
||||
Material *mat = new Material(root->getLibPath() + "text");
|
||||
mat->addBoolUniform("texturingEnabled", false);
|
||||
mat->addVec4Uniform("diffuseColor", Vector4(1, 1, 1, 1));
|
||||
|
||||
const int numPairs = 7;
|
||||
Player *player = Game::getSingleton()->getPlayer(playerId);
|
||||
pair<string, wstring> unitDataPairs[numPairs]{
|
||||
make_pair("pl", stringToWstring(player->getName())),
|
||||
make_pair("vb", to_wstring(player->getNumVehiclesBuilt())),
|
||||
@@ -33,8 +26,11 @@ namespace battleship{
|
||||
make_pair("sd", to_wstring(player->getNumStructuresDestroyed())),
|
||||
make_pair("sl", to_wstring(player->getNumStructuresLost())),
|
||||
};
|
||||
|
||||
ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton();
|
||||
Vector3 plCol = player->getColor();
|
||||
Root *root = Root::getSingleton();
|
||||
string fontPath = GameManager::getSingleton()->getPath() + "Fonts/batang.ttf";
|
||||
|
||||
for(int i = 0; i < numPairs; i++){
|
||||
Text *category = guiManager->getText(unitDataPairs[i].first);
|
||||
|
||||
Reference in New Issue
Block a user