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 <string>
20#include <vector>
21
22#include "RmlUi/Core/EventListener.h"
23#include "RmlUi/Core/Types.h"
24#include "engine/application.h"
25
26namespace cqsp::client {
28 public:
30
31 void ProcessEvent(Rml::Event& event);
32
33 void AddEventListeners();
36
37 void Show();
38 void Hide();
39
40 void Close();
41
42 void LoadDocument();
43 void ReloadDocument();
44 bool Update();
45
46 // Various functions for hiding the window.
47 float GetOpacity();
48 void PushToBack();
49
50 void GetAllGames();
51 std::string GetSaveDir();
52
53 struct SaveGame {
54 SaveGame(std::string country, int date) : country(country), date(date) {}
55 std::string country;
56 std::string path;
57 int date;
58 };
59
60 std::vector<SaveGame> saves;
61
62 private:
63 const std::string document_name = "../data/core/gui/loadsave.rml";
64
66
67 Rml::ElementDocument* options_menu;
68 Rml::DataModelHandle model_handle;
69
71
72 std::string load_path;
73 bool to_load = false;
74};
75} // namespace cqsp::client
Definition: loadgamewindow.h:27
std::string load_path
Definition: loadgamewindow.h:72
void AddEventListeners()
Definition: loadgamewindow.cpp:37
std::vector< SaveGame > saves
Definition: loadgamewindow.h:60
void ReloadDocument()
Definition: loadgamewindow.cpp:125
void RemoveEventListeners()
Definition: loadgamewindow.cpp:43
cqsp::engine::Application & app
Definition: loadgamewindow.h:70
void PushToBack()
Definition: loadgamewindow.cpp:132
Rml::DataModelHandle model_handle
Definition: loadgamewindow.h:68
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:73
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:67
void Hide()
Definition: loadgamewindow.cpp:110
cqsp::engine::Application & GetApp()
Definition: loadgamewindow.h:65
void LoadDocument()
Definition: loadgamewindow.cpp:119
void Show()
Definition: loadgamewindow.cpp:100
const std::string document_name
Definition: loadgamewindow.h:63
Definition: application.h:47
Definition: clientctx.h:21
Definition: loadgamewindow.h:53
int date
Definition: loadgamewindow.h:57
SaveGame(std::string country, int date)
Definition: loadgamewindow.h:54
std::string path
Definition: loadgamewindow.h:56
std::string country
Definition: loadgamewindow.h:55
EventListener(common::Universe *universe)
Definition: turnsavewindow.h:1