aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/singletons/GameSingleton.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-04-16 11:58:39 +0200
committer GitHub <noreply@github.com>2024-04-16 11:58:39 +0200
commit21334b0040d3c2c1456e0c18e5c2a1605f22f934 (patch)
treef12a3e91c9f3cbf3ff57ef6477f91cc9f053eb45 /extension/src/openvic-extension/singletons/GameSingleton.cpp
parentb5eacaa436bb6e3400f9e80795248c67c50e9d6b (diff)
parentc79bf36ced0319572c561b82a2a9158ffa3bc94b (diff)
Merge pull request #216 from OpenVicProject/pop-menu-imp
Implement Population Menu
Diffstat (limited to 'extension/src/openvic-extension/singletons/GameSingleton.cpp')
-rw-r--r--extension/src/openvic-extension/singletons/GameSingleton.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/singletons/GameSingleton.cpp b/extension/src/openvic-extension/singletons/GameSingleton.cpp
index 459b2c8..563f1cb 100644
--- a/extension/src/openvic-extension/singletons/GameSingleton.cpp
+++ b/extension/src/openvic-extension/singletons/GameSingleton.cpp
@@ -9,6 +9,7 @@
#include "openvic-extension/singletons/AssetManager.hpp"
#include "openvic-extension/singletons/LoadLocalisation.hpp"
+#include "openvic-extension/singletons/MenuSingleton.hpp"
#include "openvic-extension/utility/ClassBindings.hpp"
#include "openvic-extension/utility/Utilities.hpp"
@@ -115,6 +116,7 @@ Error GameSingleton::setup_game(int32_t bookmark_index) {
Bookmark const* bookmark = game_manager.get_history_manager().get_bookmark_manager().get_bookmark_by_index(bookmark_index);
ERR_FAIL_NULL_V_MSG(bookmark, FAILED, vformat("Failed to get bookmark with index: %d", bookmark_index));
bool ret = game_manager.load_bookmark(bookmark);
+
for (Province& province : game_manager.get_map().get_provinces()) {
province.set_crime(
game_manager.get_crime_manager().get_crime_modifier_by_index(
@@ -122,6 +124,11 @@ Error GameSingleton::setup_game(int32_t bookmark_index) {
)
);
}
+
+ MenuSingleton* menu_singleton = MenuSingleton::get_singleton();
+ ERR_FAIL_NULL_V(menu_singleton, FAILED);
+ menu_singleton->_population_menu_update_provinces();
+
return ERR(ret);
}