Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
loadgamewindow.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2023 Conquer Space
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include <RmlUi/Core/DataModelHandle.h>
20
21#include <string>
22#include <vector>
23
24#include "RmlUi/Core/EventListener.h"
25#include "RmlUi/Core/Types.h"
26#include "engine/application.h"
27
28namespace cqsp::client {
30 public:
32
33 void ProcessEvent(Rml::Event& event);
34
35 void AddEventListeners();
38
39 void Show();
40 void Hide();
41
42 void Close();
43
44 void LoadDocument();
45 void ReloadDocument();
46 bool Update();
47
48 // Various functions for hiding the window.
49 float GetOpacity();
50 void PushToBack();
51
52 void GetAllGames();
53 std::string GetSaveDir();
54
55 struct SaveGame {
56 SaveGame(std::string country, int date) : country(country), date(date) {}
57 std::string country;
58 std::string path;
59 int date;
60 };
61
62 std::vector<SaveGame> saves;
63
64 private:
65 const std::string document_name = "../data/core/gui/loadsave.rml";
66
68
69 Rml::ElementDocument* options_menu;
70 Rml::DataModelHandle model_handle;
71
73
74 std::string load_path;
75 bool to_load = false;
76};
77} // namespace cqsp::client
Definition: loadgamewindow.h:29
std::string load_path
Definition: loadgamewindow.h:74
void AddEventListeners()
Definition: loadgamewindow.cpp:37
std::vector< SaveGame > saves
Definition: loadgamewindow.h:62
void ReloadDocument()
Definition: loadgamewindow.cpp:125
void RemoveEventListeners()
Definition: loadgamewindow.cpp:43
cqsp::engine::Application & app
Definition: loadgamewindow.h:72
void PushToBack()
Definition: loadgamewindow.cpp:132
Rml::DataModelHandle model_handle
Definition: loadgamewindow.h:70
void GetAllGames()
Definition: loadgamewindow.cpp:134
void Close()
Definition: loadgamewindow.cpp:112
LoadGameWindow(cqsp::engine::Application &app)
Definition: loadgamewindow.cpp:25
void ProcessEvent(Rml::Event &event)
Definition: loadgamewindow.cpp:27
std::string GetSaveDir()
Definition: loadgamewindow.cpp:136
bool to_load
Definition: loadgamewindow.h:75
void InitializeDataModel()
Definition: loadgamewindow.cpp:49
float GetOpacity()
Definition: loadgamewindow.cpp:130
bool Update()
Definition: loadgamewindow.cpp:108
Rml::ElementDocument * options_menu
Definition: loadgamewindow.h:69
void Hide()
Definition: loadgamewindow.cpp:110
cqsp::engine::Application & GetApp()
Definition: loadgamewindow.h:67
void LoadDocument()
Definition: loadgamewindow.cpp:119
void Show()
Definition: loadgamewindow.cpp:100
const std::string document_name
Definition: loadgamewindow.h:65
Definition: application.h:49
Definition: clientctx.h:21
Definition: loadgamewindow.h:55
int date
Definition: loadgamewindow.h:59
SaveGame(std::string country, int date)
Definition: loadgamewindow.h:56
std::string path
Definition: loadgamewindow.h:58
std::string country
Definition: loadgamewindow.h:57
EventListener(common::Universe *universe)
Definition: turnsavewindow.h:1