aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/singletons/MenuSingleton.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-08-01 21:35:11 +0200
committer GitHub <noreply@github.com>2024-08-01 21:35:11 +0200
commit8431914a6971cbacfb20bba13a4113d9ac4d5153 (patch)
tree71c1fa0482ab845b18a577a0d7503e40d49225f2 /extension/src/openvic-extension/singletons/MenuSingleton.hpp
parente2cb2f5bd746d3928b4554252c69943df2ed5a3d (diff)
parent70f3c3cf6f9c1563d95ffb8c25bf8cd2bb7a1ad0 (diff)
Merge pull request #246 from OpenVicProject/search-panel
Search panel + text edit box UI generation
Diffstat (limited to 'extension/src/openvic-extension/singletons/MenuSingleton.hpp')
-rw-r--r--extension/src/openvic-extension/singletons/MenuSingleton.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/singletons/MenuSingleton.hpp b/extension/src/openvic-extension/singletons/MenuSingleton.hpp
index 54891bc..190e3ea 100644
--- a/extension/src/openvic-extension/singletons/MenuSingleton.hpp
+++ b/extension/src/openvic-extension/singletons/MenuSingleton.hpp
@@ -73,8 +73,18 @@ namespace OpenVic {
std::vector<Pop const*> pops, filtered_pops;
};
+ struct search_panel_t {
+ struct entry_t {
+ std::variant<ProvinceInstance const*, State const*, CountryInstance const*> target;
+ godot::String display_name, search_name, identifier;
+ };
+ std::vector<entry_t> entry_cache;
+ std::vector<size_t> result_indices;
+ };
+
private:
population_menu_t population_menu;
+ search_panel_t search_panel;
/* Emitted when the number of visible province list rows changes (list generated or state entry expanded).*/
static godot::StringName const& _signal_population_menu_province_list_changed();
@@ -83,8 +93,12 @@ namespace OpenVic {
static godot::StringName const& _signal_population_menu_province_list_selected_changed();
/* Emitted when the selected/filtered collection of pops changes. */
static godot::StringName const& _signal_population_menu_pops_changed();
+ /* Emitted when the collection of possible search results changes. */
+ static godot::StringName const& _signal_search_cache_changed();
godot::String get_state_name(State const& state) const;
+ godot::String get_country_name(CountryInstance const& country) const;
+ godot::String get_country_adjective(CountryInstance const& country) const;
protected:
static void _bind_methods();
@@ -145,6 +159,15 @@ namespace OpenVic {
godot::PackedStringArray get_population_menu_distribution_setup_info() const;
/* Array of GFXPieChartTexture::godot_pie_chart_data_t. */
godot::TypedArray<godot::Array> get_population_menu_distribution_info() const;
+
+ /* Find/Search Panel */
+ // TODO - update on country government type change and state creation/destruction
+ // (which automatically includes country creation/destruction)
+ godot::Error generate_search_cache();
+ void update_search_results(godot::String const& text);
+ godot::PackedStringArray get_search_result_rows(int32_t start, int32_t count) const;
+ int32_t get_search_result_row_count() const;
+ godot::Vector2 get_search_result_position(int32_t result_index) const;
};
}