mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +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 vb01Gui;
|
||||||
using namespace gameBase;
|
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();
|
StateManager *stateManager = GameManager::getSingleton()->getStateManager();
|
||||||
ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE);
|
ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
namespace battleship{
|
namespace battleship{
|
||||||
class ActiveStateButton : public vb01Gui::Button{
|
class ActiveStateButton : public vb01Gui::Button{
|
||||||
public:
|
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();
|
void onClick();
|
||||||
private:
|
private:
|
||||||
std::string guiScreen = "";
|
std::string guiScreen = "";
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ namespace battleship{
|
|||||||
break;
|
break;
|
||||||
case ACTIVE_GAME_STATE:
|
case ACTIVE_GAME_STATE:
|
||||||
guiScreen = guiTable["guiScreen"];
|
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;
|
break;
|
||||||
case PLAYER_TRADE:
|
case PLAYER_TRADE:
|
||||||
guiScreen = guiTable["guiScreen"];
|
guiScreen = guiTable["guiScreen"];
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ namespace battleship{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Map::Minimap::update(){
|
void Map::Minimap::update(){
|
||||||
|
if(!GameManager::getSingleton()->getStateManager()->getAppStateByType(AppStateType::ACTIVE_STATE)) return;
|
||||||
|
|
||||||
Button *mb = ConcreteGuiManager::getSingleton()->getButton("minimap");
|
Button *mb = ConcreteGuiManager::getSingleton()->getButton("minimap");
|
||||||
updateImage(mb);
|
updateImage(mb);
|
||||||
updateCamFrame(mb);
|
updateCamFrame(mb);
|
||||||
|
|||||||
+3
-3
@@ -1,16 +1,16 @@
|
|||||||
#ifndef MINIMAP_BUTTON_H
|
#ifndef MINIMAP_BUTTON_H
|
||||||
#define MINIMAP_BUTTON_H
|
#define MINIMAP_BUTTON_H
|
||||||
|
|
||||||
#include <button.h>
|
#include "activeStateButton.h"
|
||||||
|
|
||||||
namespace vb01{
|
namespace vb01{
|
||||||
class Node;
|
class Node;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace battleship{
|
namespace battleship{
|
||||||
class MinimapButton : public vb01Gui::Button{
|
class MinimapButton : public ActiveStateButton{
|
||||||
public:
|
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(){}
|
~MinimapButton(){}
|
||||||
void onClick();
|
void onClick();
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace battleship{
|
|||||||
using namespace vb01Gui;
|
using namespace vb01Gui;
|
||||||
using namespace gameBase;
|
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(){
|
void PlayerTradeButton::onClick(){
|
||||||
ActiveStateButton::onClick();
|
ActiveStateButton::onClick();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace battleship{
|
|||||||
using namespace gameBase;
|
using namespace gameBase;
|
||||||
|
|
||||||
TradingScreenButton::TradingScreenButton(Vector3 pos, Vector2 size, Listbox *lb, int plId, string gs, string name, int trigger, string imagePath) :
|
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),
|
listbox(lb),
|
||||||
playerId(plId)
|
playerId(plId)
|
||||||
{}
|
{}
|
||||||
|
|||||||
Reference in New Issue
Block a user