From 70f3c3cf6f9c1563d95ffb8c25bf8cd2bb7a1ad0 Mon Sep 17 00:00:00 2001 From: hop311 Date: Tue, 30 Jul 2024 00:02:35 +0100 Subject: Search panel + text edit box UI generation --- .../openvic-extension/singletons/MenuSingleton.hpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'extension/src/openvic-extension/singletons/MenuSingleton.hpp') 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 pops, filtered_pops; }; + struct search_panel_t { + struct entry_t { + std::variant target; + godot::String display_name, search_name, identifier; + }; + std::vector entry_cache; + std::vector 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 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; }; } -- cgit v1.2.3-56-ga3b1