6#include "dcon_generated.hpp"
9#include <unordered_map>
38 uint32_t province_size = state.world.province_size() + 1;
39 uint32_t texture_size = province_size + 256 - province_size % 256;
40 std::vector<uint32_t> prov_color(texture_size * 2);
41 if(state.map_state.get_selected_province()) {
42 auto fat_id = state.world.province_get_dominant_ideology(state.map_state.get_selected_province());
44 uint32_t full_color = fat_id.get_color();
47 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
48 empty_color = 0x222222;
51 state.world.for_each_province([&](dcon::province_id prov_id) {
55 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
57 total += pl.get_pop().get_size();
59 auto ratio = value / total;
61 prov_color[i] = color;
62 prov_color[i + texture_size] = color;
66 state.world.for_each_province([&](dcon::province_id prov_id) {
69 dcon::ideology_id primary_id;
70 dcon::ideology_id secondary_id;
71 float primary_percent = 0.f;
72 float secondary_percent = 0.f;
73 state.world.for_each_ideology([&](dcon::ideology_id
id) {
75 auto volume = state.world.province_get_demographics(prov_id, demo_key);
76 float percent = volume / total_pops;
77 if(percent > primary_percent) {
78 secondary_id = primary_id;
79 secondary_percent = primary_percent;
81 primary_percent = percent;
82 }
else if(percent > secondary_percent) {
84 secondary_percent = percent;
88 uint32_t secondary_color = 0xFFAAAAAA;
89 if(
bool(secondary_id)) {
90 secondary_color =
dcon::fatten(state.world, secondary_id).get_color();
92 if(secondary_percent >= primary_percent * 0.75f) {
93 prov_color[id] = primary_color;
94 prov_color[
id + texture_size] = secondary_color;
96 prov_color[id] = primary_color;
97 prov_color[
id + texture_size] = primary_color;
105 uint32_t province_size = state.world.province_size() + 1;
106 uint32_t texture_size = province_size + 256 - province_size % 256;
107 std::vector<uint32_t> prov_color(texture_size * 2);
108 if(state.map_state.get_selected_province()) {
109 auto fat_id = state.world.province_get_dominant_issue_option(state.map_state.get_selected_province());
114 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
115 empty_color = 0x222222;
118 state.world.for_each_province([&](dcon::province_id prov_id) {
122 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
124 total += pl.get_pop().get_size();
126 auto ratio = value / total;
128 prov_color[i] = color;
129 prov_color[i + texture_size] = color;
133 state.world.for_each_province([&](dcon::province_id prov_id) {
136 dcon::issue_option_id primary_id;
137 dcon::issue_option_id secondary_id;
138 float primary_percent = 0.f;
139 float secondary_percent = 0.f;
140 state.world.for_each_issue_option([&](dcon::issue_option_id
id) {
142 auto volume = state.world.province_get_demographics(prov_id, demo_key);
143 float percent = volume / total_pops;
144 if(percent > primary_percent) {
145 secondary_id = primary_id;
146 secondary_percent = primary_percent;
148 primary_percent = percent;
149 }
else if(percent > secondary_percent) {
151 secondary_percent = percent;
155 uint32_t secondary_color = 0xFFAAAAAA;
156 if(
bool(secondary_id)) {
159 if(secondary_percent >= primary_percent * 0.75f) {
160 prov_color[id] = primary_color;
161 prov_color[
id + texture_size] = secondary_color;
163 prov_color[id] = primary_color;
164 prov_color[
id + texture_size] = primary_color;
172 uint32_t province_size = state.world.province_size();
173 uint32_t texture_size = province_size + 256 - province_size % 256;
174 std::vector<uint32_t> prov_color(texture_size * 2);
176 state.world.for_each_province([&](dcon::province_id prov_id) {
177 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
183 if(current_lvl > 0) {
185 float(current_lvl) /
float(max_lvl),
195 stripe_color = color;
198 prov_color[i] = color;
199 prov_color[i + texture_size] = stripe_color;
205 uint32_t province_size = state.world.province_size();
206 uint32_t texture_size = province_size + 256 - province_size % 256;
207 std::vector<uint32_t> prov_color(texture_size * 2);
209 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
211 int32_t max_total = 0;
212 state.world.for_each_state_instance([&](dcon::state_instance_id sid) {
213 auto sdef = state.world.state_instance_get_definition(sid);
218 for(
const auto abm : state.world.state_definition_get_abstract_state_membership(sdef)) {
222 if(total > max_total)
227 state.world.for_each_state_instance([&](dcon::state_instance_id sid) {
229 auto sdef = state.world.state_instance_get_definition(sid);
231 for(
const auto abm : state.world.state_definition_get_abstract_state_membership(sdef)) {
232 if((sel_nation && abm.get_province().get_province_ownership().get_nation() != sel_nation)
233 || !(abm.get_province().get_nation_from_province_ownership()))
236 float value = float(total) / float(max_total);
242 prov_color[i] = color;
243 prov_color[i + texture_size] = color;
250 uint32_t province_size = state.world.province_size();
251 uint32_t texture_size = province_size + 256 - province_size % 256;
252 std::vector<uint32_t> prov_color(texture_size * 2);
253 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
254 state.world.for_each_province([&](dcon::province_id prov_id) {
255 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
256 if((sel_nation && nation == sel_nation) || !sel_nation) {
257 auto scale = 1.f / 10.f;
264 prov_color[i] = color;
265 prov_color[i + texture_size] = color;
272 uint32_t province_size = state.world.province_size();
273 uint32_t texture_size = province_size + 256 - province_size % 256;
274 std::vector<uint32_t> prov_color(texture_size * 2);
275 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
276 state.world.for_each_province([&](dcon::province_id prov_id) {
277 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
278 if((sel_nation && nation == sel_nation) || !sel_nation) {
285 prov_color[i] = color;
286 prov_color[i + texture_size] = color;
292 std::vector<float> prov_population_change(state.world.province_size() + 1);
293 std::unordered_map<int32_t, float> continent_max_growth = {};
294 std::unordered_map<int32_t, float> continent_min_growth = {};
295 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
296 state.world.for_each_province([&](dcon::province_id prov_id) {
297 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
298 if((sel_nation && nation == sel_nation) || !sel_nation) {
301 auto cid = fat_id.get_continent().id.index();
302 continent_max_growth[cid] = std::max(continent_max_growth[cid], population_change);
303 continent_min_growth[cid] = std::min(continent_min_growth[cid], population_change);
305 prov_population_change[i] = population_change;
308 uint32_t province_size = state.world.province_size() + 1;
309 uint32_t texture_size = province_size + 256 - province_size % 256;
310 std::vector<uint32_t> prov_color(texture_size * 2);
311 state.world.for_each_province([&](dcon::province_id prov_id) {
312 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
313 if((sel_nation && nation == sel_nation) || !sel_nation) {
315 auto cid = fat_id.get_continent().id.index();
318 if(prov_population_change[i] > 0.f) {
319 float gradient_index = (continent_max_growth[cid] == 0.f ? 0.f : (prov_population_change[i] / continent_max_growth[cid]));
324 }
else if(prov_population_change[i] < 0.f) {
325 float gradient_index = (continent_min_growth[cid] == 0.f ? 0.f : (prov_population_change[i] / continent_min_growth[cid]));
331 prov_color[i] = color;
332 prov_color[i + texture_size] = color;
338 std::vector<float> prov_population(state.world.province_size() + 1);
339 std::unordered_map<int32_t, float> continent_max_pop = {};
340 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
341 state.world.for_each_province([&](dcon::province_id prov_id) {
342 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
343 if((sel_nation && nation == sel_nation) || !sel_nation) {
345 float population = 0.f;
346 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id))
347 population += pl.get_pop().get_savings();
348 auto cid = fat_id.get_continent().id.index();
349 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
351 prov_population[i] = population;
354 uint32_t province_size = state.world.province_size() + 1;
355 uint32_t texture_size = province_size + 256 - province_size % 256;
356 std::vector<uint32_t> prov_color(texture_size * 2);
357 state.world.for_each_province([&](dcon::province_id prov_id) {
358 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
359 if((sel_nation && nation == sel_nation) || !sel_nation) {
361 auto cid = fat_id.get_continent().id.index();
363 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
365 prov_color[i] = color;
366 prov_color[i + texture_size] = color;
372 uint32_t province_size = state.world.province_size();
373 uint32_t texture_size = province_size + 256 - province_size % 256;
374 std::vector<uint32_t> prov_color(texture_size * 2);
375 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
376 state.world.for_each_province([&](dcon::province_id prov_id) {
377 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
378 if((sel_nation && nation == sel_nation) || !sel_nation) {
385 prov_color[i] = color;
386 prov_color[i + texture_size] = color;
393 uint32_t province_size = state.world.province_size();
394 uint32_t texture_size = province_size + 256 - province_size % 256;
396 std::vector<uint32_t> prov_color(texture_size * 2);
397 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
398 state.world.for_each_province([&](dcon::province_id prov_id) {
400 auto nation = fat_id.get_nation_from_province_ownership();
401 if((sel_nation && nation == sel_nation) || !sel_nation) {
408 prov_color[i] = color;
409 prov_color[i + texture_size] = color;
419 std::vector<float> prov_population(state.world.province_size() + 1);
420 std::unordered_map<int32_t, float> continent_max_pop = {};
421 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
422 state.world.for_each_province([&](dcon::province_id prov_id) {
423 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
424 if((sel_nation && nation == sel_nation) || !sel_nation) {
426 float population = 0.f;
427 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id))
429 auto cid = fat_id.get_continent().id.index();
430 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
432 prov_population[i] = population;
435 uint32_t province_size = state.world.province_size() + 1;
436 uint32_t texture_size = province_size + 256 - province_size % 256;
437 std::vector<uint32_t> prov_color(texture_size * 2);
438 state.world.for_each_province([&](dcon::province_id prov_id) {
439 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
440 if((sel_nation && nation == sel_nation) || !sel_nation) {
442 auto cid = fat_id.get_continent().id.index();
444 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
446 prov_color[i] = color;
447 prov_color[i + texture_size] = color;
453 std::vector<float> prov_population(state.world.province_size() + 1);
454 std::unordered_map<int32_t, float> continent_max_pop = {};
455 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
456 state.world.for_each_province([&](dcon::province_id prov_id) {
457 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
458 if((sel_nation && nation == sel_nation) || !sel_nation) {
460 float population = 0.f;
461 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id))
463 auto cid = fat_id.get_continent().id.index();
464 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
466 prov_population[i] = population;
469 uint32_t province_size = state.world.province_size() + 1;
470 uint32_t texture_size = province_size + 256 - province_size % 256;
471 std::vector<uint32_t> prov_color(texture_size * 2);
472 state.world.for_each_province([&](dcon::province_id prov_id) {
473 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
474 if((sel_nation && nation == sel_nation) || !sel_nation) {
476 auto cid = fat_id.get_continent().id.index();
478 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
480 prov_color[i] = color;
481 prov_color[i + texture_size] = color;
487 std::vector<float> prov_population(state.world.province_size() + 1);
488 std::unordered_map<int32_t, float> continent_max_pop = {};
489 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
490 state.world.for_each_province([&](dcon::province_id prov_id) {
491 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
492 if((sel_nation && nation == sel_nation) || !sel_nation) {
494 float population = 0.f;
495 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id))
497 auto cid = fat_id.get_continent().id.index();
498 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
500 prov_population[i] = population;
503 uint32_t province_size = state.world.province_size() + 1;
504 uint32_t texture_size = province_size + 256 - province_size % 256;
505 std::vector<uint32_t> prov_color(texture_size * 2);
506 state.world.for_each_province([&](dcon::province_id prov_id) {
507 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
508 if((sel_nation && nation == sel_nation) || !sel_nation) {
510 auto cid = fat_id.get_continent().id.index();
512 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
514 prov_color[i] = color;
515 prov_color[i + texture_size] = color;
521 std::vector<float> prov_population(state.world.province_size() + 1);
522 std::unordered_map<int32_t, float> continent_max_pop = {};
523 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
524 state.world.for_each_province([&](dcon::province_id prov_id) {
525 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
526 if((sel_nation && nation == sel_nation) || !sel_nation) {
528 auto cid = fat_id.get_continent().id.index();
529 continent_max_pop[cid] = std::max(continent_max_pop[cid],
float(fat_id.get_life_rating()));
531 prov_population[i] = float(fat_id.get_life_rating());
534 uint32_t province_size = state.world.province_size() + 1;
535 uint32_t texture_size = province_size + 256 - province_size % 256;
536 std::vector<uint32_t> prov_color(texture_size * 2);
537 state.world.for_each_province([&](dcon::province_id prov_id) {
538 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
539 if((sel_nation && nation == sel_nation) || !sel_nation) {
541 auto cid = fat_id.get_continent().id.index();
543 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
545 prov_color[i] = color;
546 prov_color[i + texture_size] = color;
552 std::vector<float> prov_population(state.world.province_size() + 1);
553 std::unordered_map<int32_t, float> continent_max_pop = {};
554 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
555 state.world.for_each_province([&](dcon::province_id prov_id) {
556 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
557 if((sel_nation && nation == sel_nation) || !sel_nation) {
559 auto cid = fat_id.get_continent().id.index();
560 float total_officers = fat_id.get_demographics(
demographics::to_key(state, state.culture_definitions.officers));
561 continent_max_pop[cid] = std::max(continent_max_pop[cid], total_officers);
563 prov_population[i] = total_officers;
566 uint32_t province_size = state.world.province_size() + 1;
567 uint32_t texture_size = province_size + 256 - province_size % 256;
568 std::vector<uint32_t> prov_color(texture_size * 2);
569 state.world.for_each_province([&](dcon::province_id prov_id) {
570 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
571 if((sel_nation && nation == sel_nation) || !sel_nation) {
573 auto cid = fat_id.get_continent().id.index();
575 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
577 prov_color[i] = color;
578 prov_color[i + texture_size] = color;
584 uint32_t province_size = state.world.province_size();
585 uint32_t texture_size = province_size + 256 - province_size % 256;
586 std::vector<uint32_t> prov_color(texture_size * 2);
587 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
588 state.world.for_each_province([&](dcon::province_id prov_id) {
589 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
590 if((sel_nation && nation == sel_nation) || !sel_nation) {
591 auto total_pw = state.world.province_get_demographics(prov_id,
demographics::to_key(state, state.culture_definitions.primary_factory_worker));
592 auto total_sw = state.world.province_get_demographics(prov_id,
demographics::to_key(state, state.culture_definitions.secondary_factory_worker));
593 auto total = total_pw + total_sw;
594 auto value = (total_pw == 0.f || total_sw == 0.f) ? 0.f : total_pw / (total_pw + total_sw);
595 value = 1.f - (state.economy_definitions.craftsmen_fraction - value);
601 prov_color[i] = color;
602 prov_color[i + texture_size] = color;
608 uint32_t province_size = state.world.province_size();
609 uint32_t texture_size = province_size + 256 - province_size % 256;
610 std::vector<uint32_t> prov_color(texture_size * 2);
611 state.world.for_each_province([&](dcon::province_id prov_id) {
612 dcon::crime_id cmp_crime;
613 if(state.map_state.get_selected_province()) {
614 cmp_crime = state.world.province_get_crime(state.map_state.get_selected_province());
617 if(
auto crime = state.world.province_get_crime(prov_id); crime && (!cmp_crime || crime == cmp_crime)) {
618 prov_color[i] = ogl::get_ui_color(state, crime);
619 prov_color[i + texture_size] = ogl::get_ui_color(state, crime);
622 prov_color[i + texture_size] = 0;
628 uint32_t province_size = state.world.province_size();
629 uint32_t texture_size = province_size + 256 - province_size % 256;
630 std::vector<uint32_t> prov_color(texture_size * 2);
631 state.world.for_each_province([&](dcon::province_id prov_id) {
632 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
634 prov_color[i] = state.world.province_get_land_rally_point(prov_id) ?
sys::pack_color(46, 247, 15) : 0;
635 prov_color[i + texture_size] = state.world.province_get_naval_rally_point(prov_id) ?
sys::pack_color(46, 15, 247) : 0;
640 std::vector<float> prov_population(state.world.province_size() + 1);
641 std::unordered_map<int32_t, float> continent_max_pop = {};
642 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
643 state.world.for_each_province([&](dcon::province_id prov_id) {
644 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
645 if((sel_nation && nation == sel_nation) || !sel_nation) {
647 auto cid = fat_id.get_continent().id.index();
649 continent_max_pop[cid] = std::max(continent_max_pop[cid], total_regs);
651 prov_population[i] = total_regs;
654 uint32_t province_size = state.world.province_size() + 1;
655 uint32_t texture_size = province_size + 256 - province_size % 256;
656 std::vector<uint32_t> prov_color(texture_size * 2);
657 state.world.for_each_province([&](dcon::province_id prov_id) {
658 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
659 if((sel_nation && nation == sel_nation) || !sel_nation) {
661 auto cid = fat_id.get_continent().id.index();
663 if(prov_population[i] == 0.f) {
665 prov_color[i] = color;
666 prov_color[i + texture_size] = color;
668 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
670 prov_color[i] = color;
671 prov_color[i + texture_size] = color;
678 uint32_t province_size = state.world.province_size() + 1;
679 uint32_t texture_size = province_size + 256 - province_size % 256;
680 std::vector<uint32_t> prov_color(texture_size * 2);
681 if(state.map_state.get_selected_province()) {
682 dcon::pop_type_fat_id fat_id =
dcon::fatten(state.world, dcon::pop_type_id{});
684 for(
const auto pt : state.world.in_pop_type) {
685 auto total = state.world.province_get_demographics(state.map_state.get_selected_province(),
demographics::to_key(state, pt));
692 uint32_t full_color = fat_id.get_color();
695 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
696 empty_color = 0x222222;
698 state.world.for_each_province([&](dcon::province_id prov_id) {
700 float total = state.world.province_get_demographics(state.map_state.get_selected_province(),
demographics::total);
701 float value = state.world.province_get_demographics(state.map_state.get_selected_province(),
demographics::to_key(state, fat_id));
702 auto ratio = value / total;
704 prov_color[i] = color;
705 prov_color[i + texture_size] = color;
709 state.world.for_each_province([&](dcon::province_id prov_id) {
712 dcon::pop_type_id primary_id;
713 dcon::pop_type_id secondary_id;
714 float primary_percent = 0.f;
715 float secondary_percent = 0.f;
716 state.world.for_each_pop_type([&](dcon::pop_type_id
id) {
718 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
719 if(pl.get_pop().get_poptype() == id) {
720 volume += pl.get_pop().get_size();
723 float percent = volume / total_pops;
724 if(percent > primary_percent) {
725 secondary_id = primary_id;
726 secondary_percent = primary_percent;
728 primary_percent = percent;
729 }
else if(percent > secondary_percent) {
731 secondary_percent = percent;
735 uint32_t secondary_color = 0xFFAAAAAA;
736 if(
bool(secondary_id)) {
737 secondary_color =
dcon::fatten(state.world, secondary_id).get_color();
739 if(secondary_percent >= primary_percent * 0.75f) {
740 prov_color[id] = primary_color;
741 prov_color[
id + texture_size] = secondary_color;
743 prov_color[id] = primary_color;
744 prov_color[
id + texture_size] = primary_color;
751 uint32_t province_size = state.world.province_size() + 1;
752 uint32_t texture_size = province_size + 256 - province_size % 256;
753 std::vector<uint32_t> prov_color(texture_size * 2);
754 for(
const auto n : state.world.in_nation) {
755 if(n.get_is_player_controlled()) {
756 for(
const auto po : state.world.nation_get_province_ownership_as_nation(n)) {
758 prov_color[id] = n.get_color();
760 for(
const auto po : state.world.nation_get_province_control_as_nation(n)) {
762 prov_color[
id + texture_size] = n.get_color();
772 uint32_t province_size = state.world.province_size();
773 uint32_t texture_size = province_size + 256 - province_size % 256;
774 std::vector<uint32_t> prov_color(texture_size * 2, 0);
776 assert(state.state_selection.has_value());
777 if(state.state_selection) {
778 for(
const auto s : state.state_selection->selectable_states) {
781 for(
const auto m : state.world.state_definition_get_abstract_state_membership_as_state(s)) {
782 auto p = m.get_province();
786 prov_color[i] = color;
787 prov_color[i + texture_size] = ~color;
797 std::vector<uint32_t> prov_color;
820 if(state.ui_state.map_gradient_legend)
821 state.ui_state.map_gradient_legend->set_visible(state,
true);
824 if(state.ui_state.map_gradient_legend)
825 state.ui_state.map_gradient_legend->set_visible(state,
false);
829 if(state.ui_state.map_civ_level_legend)
830 state.ui_state.map_civ_level_legend->set_visible(state,
true);
832 if(state.ui_state.map_civ_level_legend)
833 state.ui_state.map_civ_level_legend->set_visible(state,
false);
836 if(state.ui_state.map_col_legend)
837 state.ui_state.map_col_legend->set_visible(state,
true);
839 if(state.ui_state.map_col_legend)
840 state.ui_state.map_col_legend->set_visible(state,
false);
843 if(state.ui_state.map_dip_legend)
844 state.ui_state.map_dip_legend->set_visible(state,
true);
846 if(state.ui_state.map_dip_legend)
847 state.ui_state.map_dip_legend->set_visible(state,
false);
850 if(state.ui_state.map_rr_legend)
851 state.ui_state.map_rr_legend->set_visible(state,
true);
853 if(state.ui_state.map_rr_legend)
854 state.ui_state.map_rr_legend->set_visible(state,
false);
857 if(state.ui_state.map_nav_legend)
858 state.ui_state.map_nav_legend->set_visible(state,
true);
860 if(state.ui_state.map_nav_legend)
861 state.ui_state.map_nav_legend->set_visible(state,
false);
864 if(state.ui_state.map_rank_legend)
865 state.ui_state.map_rank_legend->set_visible(state,
true);
867 if(state.ui_state.map_rank_legend)
868 state.ui_state.map_rank_legend->set_visible(state,
false);
871 if(state.ui_state.map_rec_legend)
872 state.ui_state.map_rec_legend->set_visible(state,
true);
874 if(state.ui_state.map_rec_legend)
875 state.ui_state.map_rec_legend->set_visible(state,
false);
883 state.map_state.set_terrain_map_mode();
1018 state.map_state.set_province_color(prov_color,
mode);
std::vector< uint32_t > admin_map_from(sys::state &state)
std::vector< uint32_t > civilization_level_map_from(sys::state &state)
std::vector< uint32_t > colonial_map_from(sys::state &state)
std::vector< uint32_t > crisis_map_from(sys::state &state)
#define assert(condition)
std::vector< uint32_t > diplomatic_map_from(sys::state &state)
std::vector< uint32_t > infrastructure_map_from(sys::state &state)
std::vector< uint32_t > growth_map_from(sys::state &state)
std::vector< uint32_t > issue_map_from(sys::state &state)
std::vector< uint32_t > con_map_from(sys::state &state)
std::vector< uint32_t > ctc_map_from(sys::state &state)
std::vector< uint32_t > rally_map_from(sys::state &state)
std::vector< uint32_t > ideology_map_from(sys::state &state)
std::vector< uint32_t > life_needs_map_from(sys::state &state)
std::vector< uint32_t > factory_map_from(sys::state &state)
std::vector< uint32_t > crime_map_from(sys::state &state)
std::vector< uint32_t > income_map_from(sys::state &state)
std::vector< uint32_t > luxury_needs_map_from(sys::state &state)
std::vector< uint32_t > select_states_map_from(sys::state &state)
std::vector< uint32_t > life_rating_map_from(sys::state &state)
std::vector< uint32_t > everyday_needs_map_from(sys::state &state)
std::vector< uint32_t > employment_map_from(sys::state &state)
std::vector< uint32_t > mobilization_map_from(sys::state &state)
std::vector< uint32_t > fort_map_from(sys::state &state)
std::vector< uint32_t > players_map_from(sys::state &state)
std::vector< uint32_t > workforce_map_from(sys::state &state)
std::vector< uint32_t > militancy_map_from(sys::state &state)
std::vector< uint32_t > literacy_map_from(sys::state &state)
std::vector< uint32_t > officers_map_from(sys::state &state)
std::vector< uint32_t > migration_map_from(sys::state &state)
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
constexpr dcon::demographics_key total(0)
dcon::demographics_key to_key(sys::state const &state, dcon::pop_type_id v)
constexpr dcon::demographics_key employable(1)
constexpr dcon::demographics_key consciousness(3)
constexpr dcon::demographics_key employed(2)
float get_monthly_pop_increase(sys::state &state, dcon::pop_id ids)
constexpr dcon::demographics_key literacy(5)
int32_t state_factory_count(sys::state &state, dcon::state_instance_id sid, dcon::nation_id n)
@ clerk_to_craftsmen_ratio
void update_map_mode(sys::state &state)
void set_map_mode(sys::state &state, mode mode)
int32_t regiments_max_possible_from_province(sys::state &state, dcon::province_id p)
uint32_t get_ui_color(sys::state &state, T id)
constexpr uint32_t color_from_hash(uint32_t color)
uint32_t color_gradient(float percent, uint32_t top_color, uint32_t bot_color)
float get_luxury_needs(sys::state const &state, dcon::pop_id p)
dcon::pop_demographics_key to_key(sys::state const &state, dcon::ideology_id v)
float get_life_needs(sys::state const &state, dcon::pop_id p)
float get_everyday_needs(sys::state const &state, dcon::pop_id p)
float get_demo(sys::state const &state, dcon::pop_id p, dcon::pop_demographics_key k)
bool can_build_fort(sys::state &state, dcon::province_id id, dcon::nation_id n)
bool has_fort_being_built(sys::state &state, dcon::province_id id)
float revolt_risk(sys::state &state, dcon::province_id id)
constexpr uint16_t to_map_id(dcon::province_id id)
uint32_t pack_color(float r, float g, float b)
std::vector< uint32_t > national_focus_map_from(sys::state &state)
std::vector< uint32_t > nationality_map_from(sys::state &state)
std::vector< uint32_t > naval_map_from(sys::state &state)
std::vector< uint32_t > party_loyalty_map_from(sys::state &state)
std::vector< uint32_t > political_map_from(sys::state &state)
std::vector< uint32_t > population_map_from(sys::state &state)
std::vector< uint32_t > rank_map_from(sys::state &state)
std::vector< uint32_t > recruitment_map_from(sys::state &state)
std::vector< uint32_t > region_map_from(sys::state &state)
std::vector< uint32_t > relation_map_from(sys::state &state)
std::vector< uint32_t > religion_map_from(sys::state &state)
std::vector< uint32_t > revolt_map_from(sys::state &state)
std::vector< uint32_t > rgo_output_map_from(sys::state &state)
std::vector< uint32_t > sphere_map_from(sys::state &state)
std::vector< uint32_t > supply_map_from(sys::state &state)