aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/singletons/MenuSingleton.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-07-30 01:02:35 +0200
committer hop311 <hop3114@gmail.com>2024-07-30 01:07:56 +0200
commit70f3c3cf6f9c1563d95ffb8c25bf8cd2bb7a1ad0 (patch)
tree5f96f7520816721a058bef8e59929c961d4c7ef2 /extension/src/openvic-extension/singletons/MenuSingleton.hpp
parentbf4d061b06374cd696f1f1644548f4d7af86f5ec (diff)
Search panel + text edit box UI generationsearch-panel
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;
};
}