mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
map editing screen accessible using the new GUI subsystem
This commit is contained in:
+9
-7
@@ -1,11 +1,15 @@
|
||||
#include "loadMapButton.h"
|
||||
#include "concreteGuiManager.h"
|
||||
#include "gameManager.h"
|
||||
#include "mapEditorAppState.h"
|
||||
|
||||
#include <stateManager.h>
|
||||
|
||||
namespace battleship{
|
||||
using namespace std;
|
||||
using namespace vb01;
|
||||
using namespace vb01Gui;
|
||||
using namespace gameBase;
|
||||
|
||||
LoadMapButton::OkButton::OkButton(vb01::Vector2 pos, vb01::Vector2 size, vb01Gui::Listbox *listbox) : Button(pos, size, "Ok", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){ this->listbox = listbox; }
|
||||
|
||||
@@ -22,18 +26,16 @@ namespace battleship{
|
||||
|
||||
guiState->removeButton(this);
|
||||
*/
|
||||
StateManager *sm = GameManager::getSingleton()->getStateManager();
|
||||
string name = wstringToString(listbox->getContents()[listbox->getSelectedOption()]);
|
||||
sm->attachAppState(new MapEditorAppState(name, Vector2::VEC_ZERO, false));
|
||||
ConcreteGuiManager::getSingleton()->readLuaScreenScript("mapEditor.lua");
|
||||
}
|
||||
|
||||
LoadMapButton::LoadMapButton(Vector2 pos, Vector2 size) : Button(pos, size, "Load map", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){}
|
||||
|
||||
void LoadMapButton::onClick(){
|
||||
ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton();
|
||||
guiManager->removeAllButtons();
|
||||
guiManager->removeAllListboxes();
|
||||
guiManager->removeAllCheckboxes();
|
||||
guiManager->removeAllSliders();
|
||||
guiManager->removeAllTextboxes();
|
||||
guiManager->readLuaScreenScript("loadMap.lua");
|
||||
ConcreteGuiManager::getSingleton()->readLuaScreenScript("loadMap.lua");
|
||||
/*
|
||||
|
||||
GameManager *gm = GameManager::getSingleton();
|
||||
|
||||
Reference in New Issue
Block a user