18 uint32_t causus_belli_color = 0x00AAFF;
25 uint32_t cultural_union_color = 0x00FFFF;
27 uint32_t province_size = state.world.province_size() + 1;
28 uint32_t texture_size = province_size + 256 - province_size % 256;
29 std::vector<uint32_t> prov_color(texture_size * 2);
31 auto fat_selected_id =
dcon::fatten(state.world, state.map_state.get_selected_province());
32 auto selected_nation = fat_selected_id.get_nation_from_province_ownership();
34 if(!
bool(selected_nation)) {
35 selected_nation = state.local_player_nation;
38 std::vector<dcon::nation_id> enemies, allies, sphere;
41 for(
auto wa : state.world.nation_get_war_participant(selected_nation)) {
42 bool is_attacker = wa.get_is_attacker();
43 for(
auto o : wa.get_war().get_war_participant()) {
44 if(o.get_is_attacker() != is_attacker) {
45 enemies.push_back(o.get_nation().id);
51 selected_nation.for_each_diplomatic_relation([&](dcon::diplomatic_relation_fat_id relation_id) {
52 if(relation_id.get_are_allied()) {
53 dcon::nation_id ally_id = relation_id.get_related_nations(0).id != selected_nation.id
54 ? relation_id.get_related_nations(0).id
55 : relation_id.get_related_nations(1).id;
56 allies.push_back(ally_id);
60 auto selected_primary_culture = selected_nation.get_primary_culture();
62 state.world.for_each_province([&](dcon::province_id prov_id) {
68 auto fat_owner = fat_id.get_province_ownership().get_nation();
71 if(fat_owner.id == selected_nation.id) {
72 color = selected_color;
74 stripe_color = non_cores_color;
77 auto cultural_union_identity = selected_primary_culture.get_culture_group_membership().get_group().get_identity_from_cultural_union_of();
78 fat_id.for_each_core([&](dcon::core_fat_id core_id) {
79 if(core_id.get_identity().id == cultural_union_identity.id) {
80 stripe_color = cultural_union_color;
85 if(std::find(enemies.begin(), enemies.end(), fat_owner.id) != enemies.end()) {
90 if(std::find(allies.begin(), allies.end(), fat_owner.id) != allies.end()) {
95 if(fat_owner.get_in_sphere_of() == selected_nation) {
100 auto province_overlord_id = fat_id.get_province_ownership().get_nation().get_overlord_as_subject();
101 if(
bool(province_overlord_id) && province_overlord_id.get_ruler().id == selected_nation.id) {
102 color = puppet_color;
104 auto selected_overlord_id = selected_nation.get_overlord_as_subject();
105 if(
bool(selected_overlord_id) && selected_overlord_id.get_ruler().id == fat_owner.id) {
106 color = puppet_color;
112 fat_id.for_each_core([&](dcon::core_fat_id core_id) {
113 if(core_id.get_identity().get_nation_from_identity_holder().id == selected_nation.id) {
114 stripe_color = selected_color;
120 if(stripe_color == 0x222222) {
121 stripe_color = color;
124 prov_color[i] = color;
125 prov_color[i + texture_size] = stripe_color;
132 std::vector<uint32_t> prov_color;
134 if(state.map_state.get_selected_province()) {
std::vector< uint32_t > diplomatic_map_from(sys::state &state)
std::vector< uint32_t > get_selected_diplomatic_color(sys::state &state)
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
constexpr uint16_t to_map_id(dcon::province_id id)