mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
bugfixes for crashing when pausing the game or selecting engineers
This commit is contained in:
@@ -18,7 +18,7 @@ namespace battleship{
|
||||
using namespace vb01Gui;
|
||||
using namespace gameBase;
|
||||
|
||||
ActiveStateButton::ActiveStateButton(Vector3 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), guiScreen(gs){
|
||||
ActiveStateButton::ActiveStateButton(Vector3 pos, Vector2 size, string gs, string name, string fontPath, int trigger, string imagePath) : Button(pos, size, name, fontPath, trigger, true, imagePath), guiScreen(gs){
|
||||
StateManager *stateManager = GameManager::getSingleton()->getStateManager();
|
||||
ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE);
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
namespace battleship{
|
||||
class ActiveStateButton : public vb01Gui::Button{
|
||||
public:
|
||||
ActiveStateButton(vb01::Vector3, vb01::Vector2, std::string, std::string, int = -1, std::string = "");
|
||||
ActiveStateButton(vb01::Vector3, vb01::Vector2, std::string, std::string, std::string, int = -1, std::string = "");
|
||||
void onClick();
|
||||
private:
|
||||
std::string guiScreen = "";
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace battleship{
|
||||
break;
|
||||
case ACTIVE_GAME_STATE:
|
||||
guiScreen = guiTable["guiScreen"];
|
||||
button = new ActiveStateButton(pos, size, guiScreen, name, (int)guiTable["trigger"], imagePath);
|
||||
button = new ActiveStateButton(pos, size, guiScreen, name, fontBasePath + "batang.ttf", (int)guiTable["trigger"], imagePath);
|
||||
break;
|
||||
case PLAYER_TRADE:
|
||||
guiScreen = guiTable["guiScreen"];
|
||||
|
||||
@@ -203,6 +203,8 @@ namespace battleship{
|
||||
}
|
||||
|
||||
void Map::Minimap::update(){
|
||||
if(!GameManager::getSingleton()->getStateManager()->getAppStateByType(AppStateType::ACTIVE_STATE)) return;
|
||||
|
||||
Button *mb = ConcreteGuiManager::getSingleton()->getButton("minimap");
|
||||
updateImage(mb);
|
||||
updateCamFrame(mb);
|
||||
|
||||
+3
-3
@@ -1,16 +1,16 @@
|
||||
#ifndef MINIMAP_BUTTON_H
|
||||
#define MINIMAP_BUTTON_H
|
||||
|
||||
#include <button.h>
|
||||
#include "activeStateButton.h"
|
||||
|
||||
namespace vb01{
|
||||
class Node;
|
||||
}
|
||||
|
||||
namespace battleship{
|
||||
class MinimapButton : public vb01Gui::Button{
|
||||
class MinimapButton : public ActiveStateButton{
|
||||
public:
|
||||
MinimapButton(vb01::Vector3 pos, vb01::Vector2 size, std::string ip) : vb01Gui::Button(pos, size, "minimap", "", -1, true, ip){}
|
||||
MinimapButton(vb01::Vector3 pos, vb01::Vector2 size, std::string ip) : ActiveStateButton(pos, size, "", "minimap", "", -1, ip){}
|
||||
~MinimapButton(){}
|
||||
void onClick();
|
||||
private:
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace battleship{
|
||||
using namespace vb01Gui;
|
||||
using namespace gameBase;
|
||||
|
||||
PlayerTradeButton::PlayerTradeButton(Vector3 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath){}
|
||||
PlayerTradeButton::PlayerTradeButton(Vector3 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath){}
|
||||
|
||||
void PlayerTradeButton::onClick(){
|
||||
ActiveStateButton::onClick();
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace battleship{
|
||||
using namespace gameBase;
|
||||
|
||||
TradingScreenButton::TradingScreenButton(Vector3 pos, Vector2 size, Listbox *lb, int plId, string gs, string name, int trigger, string imagePath) :
|
||||
ActiveStateButton(pos, size, gs, name, trigger, imagePath),
|
||||
ActiveStateButton(pos, size, gs, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath),
|
||||
listbox(lb),
|
||||
playerId(plId)
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user