aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/singletons/MenuSingleton.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-26 23:05:42 +0200
committer GitHub <noreply@github.com>2024-07-26 23:05:42 +0200
commit0300a10ed7839710750b3937307c1f6c11c7bd75 (patch)
treed6cb992d6d3bf8cb1b1090fa18e0002fa4539b1a /extension/src/openvic-extension/singletons/MenuSingleton.cpp
parentf61760e725de0ae4878580a93bcd8ce456aa539f (diff)
parent46c3009075be36577ab7dbea263655e428833b20 (diff)
Merge pull request #241 from OpenVicProject/locale-sort-cache
Cache sort order of localised population menu columns
Diffstat (limited to 'extension/src/openvic-extension/singletons/MenuSingleton.cpp')
-rw-r--r--extension/src/openvic-extension/singletons/MenuSingleton.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/extension/src/openvic-extension/singletons/MenuSingleton.cpp b/extension/src/openvic-extension/singletons/MenuSingleton.cpp
index 8d3de60..1c3b6ec 100644
--- a/extension/src/openvic-extension/singletons/MenuSingleton.cpp
+++ b/extension/src/openvic-extension/singletons/MenuSingleton.cpp
@@ -97,6 +97,7 @@ void MenuSingleton::_bind_methods() {
OV_BIND_METHOD(MenuSingleton::population_menu_select_province, { "province_index" });
OV_BIND_METHOD(MenuSingleton::population_menu_toggle_expanded, { "toggle_index", "emit_selected_changed" }, DEFVAL(true));
+ OV_BIND_METHOD(MenuSingleton::population_menu_update_locale_sort_cache);
OV_BIND_METHOD(MenuSingleton::population_menu_select_sort_key, { "sort_key" });
OV_BIND_METHOD(MenuSingleton::get_population_menu_pop_rows, { "start", "count" });
OV_BIND_METHOD(MenuSingleton::get_population_menu_pop_row_count);
@@ -147,7 +148,10 @@ MenuSingleton* MenuSingleton::get_singleton() {
return singleton;
}
-MenuSingleton::MenuSingleton() {
+MenuSingleton::MenuSingleton() : population_menu {
+ .pop_type_sort_cache { nullptr }, .culture_sort_cache { nullptr }, .religion_sort_cache { nullptr },
+ .province_sort_cache { nullptr }, .rebel_type_sort_cache { nullptr }
+} {
ERR_FAIL_COND(singleton != nullptr);
singleton = this;
}