Fixing bugs, added girl
This commit is contained in:
1 parent
d24748df1e
commit
6149182f02
21 files changed
+1255815
-654
No files matched your search
+27
-62
@@ -3,86 +3,51 @@
|
||||
#include "Environment.h"
|
||||
#include "render/TextureManager.h"
|
||||
#include "UiManager.h"
|
||||
#include "items/Item.h"
|
||||
#include "quest/QuestJournal.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace ZL {
|
||||
|
||||
extern const char* CONST_ZIP_FILE;
|
||||
|
||||
enum class GameState {
|
||||
MainMenu,
|
||||
AboutMenu,
|
||||
ShipSelectionSingle,
|
||||
ShipSelectionMulti,
|
||||
Connecting,
|
||||
ConnectionFailed,
|
||||
Gameplay,
|
||||
GameOver,
|
||||
HelpScreen,
|
||||
ConnectionLost
|
||||
QuestJournal
|
||||
};
|
||||
|
||||
class MenuManager {
|
||||
protected:
|
||||
Renderer& renderer;
|
||||
/*
|
||||
// Pre-loaded UI roots (loaded once in setupMenu)
|
||||
std::shared_ptr<UiNode> mainMenuRoot;
|
||||
std::shared_ptr<UiNode> aboutMenuRoot;
|
||||
std::shared_ptr<UiNode> shipSelectionRoot;
|
||||
std::shared_ptr<UiNode> connectingRoot;
|
||||
std::shared_ptr<UiNode> connectionFailedRoot;
|
||||
std::shared_ptr<UiNode> gameplayRoot;
|
||||
std::shared_ptr<UiNode> gameOverRoot;
|
||||
std::shared_ptr<UiNode> helpScreenRoot;
|
||||
std::shared_ptr<UiNode> connectionLostRoot;
|
||||
|
||||
// Stored for multiplayer retry
|
||||
std::string pendingMultiNick;
|
||||
int pendingMultiShipType = 0;
|
||||
|
||||
GameState state = GameState::MainMenu;
|
||||
|
||||
// State transition methods
|
||||
void enterMainMenu();
|
||||
void enterAboutMenu();
|
||||
void enterShipSelectionSingle();
|
||||
void enterShipSelectionMulti();
|
||||
void enterConnecting();
|
||||
void enterConnectionFailed();
|
||||
void enterGameplay();
|
||||
void enterGameOver(int score);
|
||||
void enterHelp();
|
||||
void enterConnectionLost();
|
||||
*/
|
||||
public:
|
||||
UiManager uiManager;
|
||||
ZL::Quest::QuestJournal questJournal;
|
||||
|
||||
MenuManager(Renderer& iRenderer);
|
||||
|
||||
//void setupMenu();
|
||||
void setup(Inventory& inv, const std::string& zipFile);
|
||||
void openQuestJournal();
|
||||
void closeQuestJournal();
|
||||
void toggleQuestJournal();
|
||||
bool isQuestJournalOpen() const { return state == GameState::QuestJournal; }
|
||||
|
||||
/*
|
||||
// Returns true for states where Space should render and run (Gameplay, GameOver, ConnectionLost)
|
||||
bool shouldRenderSpace() const;
|
||||
GameState getState() const { return state; }
|
||||
protected:
|
||||
Renderer& renderer;
|
||||
|
||||
// Called by game events
|
||||
void showGameOver(int score);
|
||||
void showConnectionLost();
|
||||
void notifyConnected();
|
||||
void notifyConnectionFailed();
|
||||
private:
|
||||
void enterGameplay();
|
||||
void refreshQuestJournalUi();
|
||||
void selectQuestByIndex(int index);
|
||||
|
||||
// Callbacks set by Game/Space
|
||||
std::function<void()> onMainMenuEntered;
|
||||
std::function<void()> onRestartPressed;
|
||||
std::function<void(float)> onVelocityChanged;
|
||||
std::function<void()> onFirePressed;
|
||||
std::function<void()> onTakeButtonPressed;
|
||||
std::function<void(const std::string&, int)> onSingleplayerPressed;
|
||||
std::function<void(const std::string&, int)> onMultiplayerPressed;
|
||||
std::function<void()> onShowPlayersPressed;
|
||||
GameState state = GameState::Gameplay;
|
||||
Inventory* inventory = nullptr;
|
||||
|
||||
std::function<void()> forceSetupSpaceUICallback;*/
|
||||
std::shared_ptr<UiNode> ingameRoot;
|
||||
std::shared_ptr<UiNode> questJournalRoot;
|
||||
|
||||
bool inventoryOpen = false;
|
||||
int selectedQuestIndex = -1;
|
||||
std::vector<std::string> visibleQuestIds;
|
||||
};
|
||||
|
||||
} // namespace ZL
|
||||
} // namespace ZL
|
||||
Reference in new issue
Block a user