mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
preserving unit buttons when (un)pausing
improved minimap element rendering
This commit is contained in:
+6
-4
@@ -120,15 +120,18 @@ namespace battleship{
|
||||
|
||||
void ActiveGameState::onAttached() {
|
||||
AbstractAppState::onAttached();
|
||||
vector<Button*> buttons = guiButtons;
|
||||
buttons.insert(buttons.end(), unitButtons.begin(), unitButtons.end());
|
||||
|
||||
ConcreteGuiManager::getSingleton()->readLuaScreenScript(
|
||||
"activeGameState.lua",
|
||||
vector<Button*>{},
|
||||
buttons,
|
||||
vector<Listbox*>{},
|
||||
vector<Checkbox*>{},
|
||||
vector<Slider*>{},
|
||||
vector<Textbox*>{},
|
||||
vector<Node*>{},
|
||||
vector<Text*>{},
|
||||
guiRects,
|
||||
guiTexts,
|
||||
"music = generateFactionMusic(" + to_string(mainPlayer->getFaction()) + ")"
|
||||
);
|
||||
|
||||
@@ -375,7 +378,6 @@ namespace battleship{
|
||||
ufCtr->removeGameObjectFrames();
|
||||
ufCtr->toggleFrameTransformations(false, false, false);
|
||||
|
||||
unitGuiScreen = "";
|
||||
ConcreteGuiManager::getSingleton()->readLuaScreenScript("activeGameState.lua");
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,6 @@ namespace battleship{
|
||||
CursorState cursorState = CursorState::NORMAL;
|
||||
Player *mainPlayer;
|
||||
GuiAppState *guiState;
|
||||
std::string unitGuiScreen = "";
|
||||
GameObject *gameObjHoveredOn = nullptr;
|
||||
vb01::Vector2 clickPoint;
|
||||
std::vector<Unit*> unitGroups[9], prevSelectedUnits;
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace battleship{
|
||||
|
||||
if (!paused) {
|
||||
gm->getStateManager()->dettachAppState(activeState);
|
||||
guiManager->readLuaScreenScript("gamePaused.lua", activeState->getGuiButtons());
|
||||
guiManager->parseLuaScript("gamePaused.lua");
|
||||
}
|
||||
else {
|
||||
sol::state_view SOL_LUA_VIEW = generateView();
|
||||
|
||||
@@ -96,6 +96,7 @@ namespace battleship{
|
||||
|
||||
Node *node = new Node(minimapPos + Vector3(iconPos.x, iconPos.y, .1) - .5 * iconSize);
|
||||
node->attachMesh(quad);
|
||||
node->setVisible(false);
|
||||
root->getGuiNode()->attachChild(node);
|
||||
|
||||
return node;
|
||||
@@ -193,6 +194,9 @@ namespace battleship{
|
||||
}
|
||||
|
||||
void Map::Minimap::load(){
|
||||
for(Node *node : depositIcons)
|
||||
node->setVisible(true);
|
||||
|
||||
AssetManager *am = AssetManager::getSingleton();
|
||||
string minimapPath = GameManager::getSingleton()->getPath() + "Models/Maps/" + Map::getSingleton()->getMapName() + "/minimap.jpg";
|
||||
|
||||
@@ -206,6 +210,9 @@ namespace battleship{
|
||||
}
|
||||
|
||||
void Map::Minimap::unload(){
|
||||
for(Node *node : depositIcons)
|
||||
node->setVisible(false);
|
||||
|
||||
delete[] oldImageData;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user