aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/singletons/GameSingleton.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-03-20 23:51:08 +0100
committer hop311 <hop3114@gmail.com>2024-04-16 00:42:33 +0200
commitc79bf36ced0319572c561b82a2a9158ffa3bc94b (patch)
treeccd3292cf44396a373ae2d05ee771683b2b49668 /extension/src/openvic-extension/singletons/GameSingleton.cpp
parent0cd976341792ea30ca41e09d9c238e4e342402cd (diff)
Implement Population Menupop-menu-imp
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);
}