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.
searchmenu.h
Go to the documentation of this file.
1/* Conquer Space
2* Copyright (C) 2021-2025 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
25
28 public:
31 void Update(double delta_time) override;
32 void OpenDocument() override;
33 void ReloadWindow() override;
34 void SetupDocument();
35
36 private:
37 std::string file_name = "../data/core/gui/mainscene/searchmenu.rml";
38
39 struct SearchResult {
40 std::string name;
41 std::string entity_id;
42 };
43
44 void AddResult(const std::string& query, entt::entity entity, const std::string& name);
45
46 std::vector<SearchResult> results;
47 Rml::DataModelHandle handle;
49
50 void UpdateSelection();
51
53 public:
55 void ProcessEvent(Rml::Event& event) override;
57 } search_listener {*this};
58
60 public:
62 void ProcessEvent(Rml::Event& event) override;
64 } click_listener {*this};
65
67 public:
69 void ProcessEvent(Rml::Event& event) override;
71 } arrow_key_listener {*this};
72};
73} // namespace cqsp::client::systems::rmlui
ClickEventListener(SearchMenu &menu)
Definition: searchmenu.h:61
void ProcessEvent(Rml::Event &event) override
Definition: searchmenu.cpp:156
SearchMenu & menu
Definition: searchmenu.h:63
void ProcessEvent(Rml::Event &event) override
Definition: searchmenu.cpp:180
KeyboardEventListener(SearchMenu &menu)
Definition: searchmenu.h:68
void ProcessEvent(Rml::Event &event) override
Definition: searchmenu.cpp:128
SearchEventListener(SearchMenu &menu)
Definition: searchmenu.h:54
Definition: searchmenu.h:27
void SetupDocument()
Definition: searchmenu.cpp:103
~SearchMenu()
Definition: searchmenu.cpp:35
void AddResult(const std::string &query, entt::entity entity, const std::string &name)
Definition: searchmenu.cpp:119
void OpenDocument() override
Definition: searchmenu.cpp:82
int selected_index
Definition: searchmenu.h:48
SearchMenu(engine::Application &_app)
Definition: searchmenu.h:29
void UpdateSelection()
Definition: searchmenu.cpp:220
Rml::DataModelHandle handle
Definition: searchmenu.h:47
std::string file_name
Definition: searchmenu.h:37
void Update(double delta_time) override
Definition: searchmenu.cpp:49
void ReloadWindow() override
Definition: searchmenu.cpp:97
std::vector< SearchResult > results
Definition: searchmenu.h:46
Definition: application.h:61
EventListener(core::Universe &universe)
Definition: explorationwindow.h:1
Definition: countryselectionmenu.cpp:19
std::string entity_id
Definition: searchmenu.h:41
std::string name
Definition: searchmenu.h:40