Skip to content

Commit

Permalink
When on nation picker, highlight entire nation instead of a single pr…
Browse files Browse the repository at this point in the history
…ovince
  • Loading branch information
Lizzie841 committed Apr 13, 2024
1 parent cea3d83 commit e4944bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/gamestate/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4636,6 +4636,7 @@ void execute_notify_start_game(sys::state& state, dcon::nation_id source) {
if(state.world.nation_get_is_player_controlled(n))
ai::remove_ai_data(state, n);
state.mode = sys::game_mode_type::in_game;
state.map_state.map_data.set_selected_province(state, dcon::province_id{});
}

void notify_start_game(sys::state& state, dcon::nation_id source) {
Expand Down
11 changes: 10 additions & 1 deletion src/map/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,16 @@ void display_data::gen_prov_color_texture(GLuint texture_handle, std::vector<uin
void display_data::set_selected_province(sys::state& state, dcon::province_id prov_id) {
std::vector<uint32_t> province_highlights(state.world.province_size() + 1);
if(prov_id) {
province_highlights[province::to_map_id(prov_id)] = 0x2B2B2B2B;
if(state.mode == sys::game_mode_type::pick_nation) {
auto owner = state.world.province_get_nation_from_province_ownership(prov_id);
for(const auto p : state.world.in_province) {
if(p.get_nation_from_province_ownership() == owner) {
province_highlights[province::to_map_id(p.id)] = 0x2B2B2B2B;
}
}
} else {
province_highlights[province::to_map_id(prov_id)] = 0x2B2B2B2B;
}
}
gen_prov_color_texture(textures[texture_province_highlight], province_highlights);
}
Expand Down

0 comments on commit e4944bc

Please sign in to comment.