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);
239 prov_color[i] = color;
240 prov_color[i + texture_size] = color;
247 uint32_t province_size = state.world.province_size();
248 uint32_t texture_size = province_size + 256 - province_size % 256;
249 std::vector<uint32_t> prov_color(texture_size * 2);
250 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
251 state.world.for_each_province([&](dcon::province_id prov_id) {
252 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
253 if((sel_nation && nation == sel_nation) || !sel_nation) {
254 auto scale = 1.f / 10.f;
258 prov_color[i] = color;
259 prov_color[i + texture_size] = color;
266 uint32_t province_size = state.world.province_size();
267 uint32_t texture_size = province_size + 256 - province_size % 256;
268 std::vector<uint32_t> prov_color(texture_size * 2);
269 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
270 state.world.for_each_province([&](dcon::province_id prov_id) {
271 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
272 if((sel_nation && nation == sel_nation) || !sel_nation) {
276 prov_color[i] = color;
277 prov_color[i + texture_size] = color;
283 std::vector<float> prov_population_change(state.world.province_size() + 1);
284 std::unordered_map<int32_t, float> continent_max_growth = {};
285 std::unordered_map<int32_t, float> continent_min_growth = {};
286 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
287 state.world.for_each_province([&](dcon::province_id prov_id) {
288 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
289 if((sel_nation && nation == sel_nation) || !sel_nation) {
292 auto cid = fat_id.get_continent().id.index();
293 continent_max_growth[cid] = std::max(continent_max_growth[cid], population_change);
294 continent_min_growth[cid] = std::min(continent_min_growth[cid], population_change);
296 prov_population_change[i] = population_change;
299 uint32_t province_size = state.world.province_size() + 1;
300 uint32_t texture_size = province_size + 256 - province_size % 256;
301 std::vector<uint32_t> prov_color(texture_size * 2);
302 state.world.for_each_province([&](dcon::province_id prov_id) {
303 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
304 if((sel_nation && nation == sel_nation) || !sel_nation) {
306 auto cid = fat_id.get_continent().id.index();
309 if(prov_population_change[i] > 0.f) {
310 float gradient_index = (continent_max_growth[cid] == 0.f ? 0.f : (prov_population_change[i] / continent_max_growth[cid]));
315 }
else if(prov_population_change[i] < 0.f) {
316 float gradient_index = (continent_min_growth[cid] == 0.f ? 0.f : (prov_population_change[i] / continent_min_growth[cid]));
322 prov_color[i] = color;
323 prov_color[i + texture_size] = color;
329 std::vector<float> prov_population(state.world.province_size() + 1);
330 std::unordered_map<int32_t, float> continent_max_pop = {};
331 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
332 state.world.for_each_province([&](dcon::province_id prov_id) {
333 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
334 if((sel_nation && nation == sel_nation) || !sel_nation) {
336 float population = 0.f;
337 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id))
338 population += pl.get_pop().get_savings();
339 auto cid = fat_id.get_continent().id.index();
340 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
342 prov_population[i] = population;
345 uint32_t province_size = state.world.province_size() + 1;
346 uint32_t texture_size = province_size + 256 - province_size % 256;
347 std::vector<uint32_t> prov_color(texture_size * 2);
348 state.world.for_each_province([&](dcon::province_id prov_id) {
349 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
350 if((sel_nation && nation == sel_nation) || !sel_nation) {
352 auto cid = fat_id.get_continent().id.index();
354 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
356 prov_color[i] = color;
357 prov_color[i + texture_size] = color;
363 uint32_t province_size = state.world.province_size();
364 uint32_t texture_size = province_size + 256 - province_size % 256;
365 std::vector<uint32_t> prov_color(texture_size * 2);
366 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
367 state.world.for_each_province([&](dcon::province_id prov_id) {
368 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
369 if((sel_nation && nation == sel_nation) || !sel_nation) {
376 prov_color[i] = color;
377 prov_color[i + texture_size] = color;
384 uint32_t province_size = state.world.province_size();
385 uint32_t texture_size = province_size + 256 - province_size % 256;
387 std::vector<uint32_t> prov_color(texture_size * 2);
388 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
389 state.world.for_each_province([&](dcon::province_id prov_id) {
391 auto nation = fat_id.get_nation_from_province_ownership();
392 if((sel_nation && nation == sel_nation) || !sel_nation) {
396 prov_color[i] = color;
397 prov_color[i + texture_size] = color;
407 std::vector<float> prov_satisfaction(state.world.province_size() + 1);
408 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
409 state.world.for_each_province([&](dcon::province_id prov_id) {
410 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
411 if((sel_nation && nation == sel_nation) || !sel_nation) {
413 float population = 0.f;
414 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id))
416 auto cid = fat_id.get_continent().id.index();
418 prov_satisfaction[i] = population / state.world.province_get_demographics(prov_id,
demographics::total);
421 uint32_t province_size = state.world.province_size() + 1;
422 uint32_t texture_size = province_size + 256 - province_size % 256;
423 std::vector<uint32_t> prov_color(texture_size * 2);
424 state.world.for_each_province([&](dcon::province_id prov_id) {
425 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
426 if((sel_nation && nation == sel_nation) || !sel_nation) {
428 auto cid = fat_id.get_continent().id.index();
431 prov_color[i] = color;
432 prov_color[i + texture_size] = color;
438 std::vector<float> prov_satisfaction(state.world.province_size() + 1);
439 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
440 state.world.for_each_province([&](dcon::province_id prov_id) {
441 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
442 if((sel_nation && nation == sel_nation) || !sel_nation) {
444 float population = 0.f;
445 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id))
447 auto cid = fat_id.get_continent().id.index();
449 prov_satisfaction[i] = population / state.world.province_get_demographics(prov_id,
demographics::total);
452 uint32_t province_size = state.world.province_size() + 1;
453 uint32_t texture_size = province_size + 256 - province_size % 256;
454 std::vector<uint32_t> prov_color(texture_size * 2);
455 state.world.for_each_province([&](dcon::province_id prov_id) {
456 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
457 if((sel_nation && nation == sel_nation) || !sel_nation) {
459 auto cid = fat_id.get_continent().id.index();
461 float gradient_index = prov_satisfaction[i];
463 prov_color[i] = color;
464 prov_color[i + texture_size] = color;
470 std::vector<float> prov_satisfaction(state.world.province_size() + 1);
471 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
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 float population = 0.f;
477 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id))
479 auto cid = fat_id.get_continent().id.index();
481 prov_satisfaction[i] = population / state.world.province_get_demographics(prov_id,
demographics::total);
484 uint32_t province_size = state.world.province_size() + 1;
485 uint32_t texture_size = province_size + 256 - province_size % 256;
486 std::vector<uint32_t> prov_color(texture_size * 2);
487 state.world.for_each_province([&](dcon::province_id prov_id) {
488 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
489 if((sel_nation && nation == sel_nation) || !sel_nation) {
491 auto cid = fat_id.get_continent().id.index();
494 prov_color[i] = color;
495 prov_color[i + texture_size] = color;
501 std::vector<float> prov_population(state.world.province_size() + 1);
502 std::unordered_map<int32_t, float> continent_max_pop = {};
503 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
504 state.world.for_each_province([&](dcon::province_id prov_id) {
505 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
506 if((sel_nation && nation == sel_nation) || !sel_nation) {
508 auto cid = fat_id.get_continent().id.index();
509 continent_max_pop[cid] = std::max(continent_max_pop[cid],
float(fat_id.get_life_rating()));
511 prov_population[i] = float(fat_id.get_life_rating());
514 uint32_t province_size = state.world.province_size() + 1;
515 uint32_t texture_size = province_size + 256 - province_size % 256;
516 std::vector<uint32_t> prov_color(texture_size * 2);
517 state.world.for_each_province([&](dcon::province_id prov_id) {
518 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
519 if((sel_nation && nation == sel_nation) || !sel_nation) {
521 auto cid = fat_id.get_continent().id.index();
523 float gradient_index = prov_population[i] / continent_max_pop[cid];
525 prov_color[i] = color;
526 prov_color[i + texture_size] = color;
532 std::vector<float> prov_population(state.world.province_size() + 1);
533 std::unordered_map<int32_t, float> continent_max_pop = {};
534 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
535 state.world.for_each_province([&](dcon::province_id prov_id) {
536 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
537 if((sel_nation && nation == sel_nation) || !sel_nation) {
539 auto cid = fat_id.get_continent().id.index();
540 float total_officers = fat_id.get_demographics(
demographics::to_key(state, state.culture_definitions.officers));
541 continent_max_pop[cid] = std::max(continent_max_pop[cid], total_officers);
543 prov_population[i] = total_officers;
546 uint32_t province_size = state.world.province_size() + 1;
547 uint32_t texture_size = province_size + 256 - province_size % 256;
548 std::vector<uint32_t> prov_color(texture_size * 2);
549 state.world.for_each_province([&](dcon::province_id prov_id) {
550 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
551 if((sel_nation && nation == sel_nation) || !sel_nation) {
553 auto cid = fat_id.get_continent().id.index();
555 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
557 prov_color[i] = color;
558 prov_color[i + texture_size] = color;
564 uint32_t province_size = state.world.province_size();
565 uint32_t texture_size = province_size + 256 - province_size % 256;
566 std::vector<uint32_t> prov_color(texture_size * 2);
567 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
568 state.world.for_each_province([&](dcon::province_id prov_id) {
569 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
570 if((sel_nation && nation == sel_nation) || !sel_nation) {
571 auto total_pw = state.world.province_get_demographics(prov_id,
demographics::to_key(state, state.culture_definitions.primary_factory_worker));
572 auto total_sw = state.world.province_get_demographics(prov_id,
demographics::to_key(state, state.culture_definitions.secondary_factory_worker));
573 auto total = total_pw + total_sw;
574 auto value = (total_pw == 0.f || total_sw == 0.f) ? 0.f : total_pw / (total_pw + total_sw);
575 value = 1.f - (state.economy_definitions.craftsmen_fraction - value);
581 prov_color[i] = color;
582 prov_color[i + texture_size] = color;
588 uint32_t province_size = state.world.province_size();
589 uint32_t texture_size = province_size + 256 - province_size % 256;
590 std::vector<uint32_t> prov_color(texture_size * 2);
591 state.world.for_each_province([&](dcon::province_id prov_id) {
592 dcon::crime_id cmp_crime;
593 if(state.map_state.get_selected_province()) {
594 cmp_crime = state.world.province_get_crime(state.map_state.get_selected_province());
597 if(
auto crime = state.world.province_get_crime(prov_id); crime && (!cmp_crime || crime == cmp_crime)) {
598 prov_color[i] = ogl::get_ui_color(state, crime);
599 prov_color[i + texture_size] = ogl::get_ui_color(state, crime);
602 prov_color[i + texture_size] = 0;
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 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
614 prov_color[i] = state.world.province_get_land_rally_point(prov_id) ?
sys::pack_color(46, 247, 15) : 0;
615 prov_color[i + texture_size] = state.world.province_get_naval_rally_point(prov_id) ?
sys::pack_color(46, 15, 247) : 0;
620 std::vector<float> prov_population(state.world.province_size() + 1);
621 std::unordered_map<int32_t, float> continent_max_pop = {};
622 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
623 state.world.for_each_province([&](dcon::province_id prov_id) {
624 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
625 if((sel_nation && nation == sel_nation) || !sel_nation) {
627 auto cid = fat_id.get_continent().id.index();
629 continent_max_pop[cid] = std::max(continent_max_pop[cid], total_regs);
631 prov_population[i] = total_regs;
634 uint32_t province_size = state.world.province_size() + 1;
635 uint32_t texture_size = province_size + 256 - province_size % 256;
636 std::vector<uint32_t> prov_color(texture_size * 2);
637 state.world.for_each_province([&](dcon::province_id prov_id) {
638 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
639 if((sel_nation && nation == sel_nation) || !sel_nation) {
641 auto cid = fat_id.get_continent().id.index();
643 if(prov_population[i] == 0.f) {
645 prov_color[i] = color;
646 prov_color[i + texture_size] = color;
648 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
650 prov_color[i] = color;
651 prov_color[i + texture_size] = color;
658 uint32_t province_size = state.world.province_size() + 1;
659 uint32_t texture_size = province_size + 256 - province_size % 256;
660 std::vector<uint32_t> prov_color(texture_size * 2);
661 if(state.map_state.get_selected_province()) {
662 dcon::pop_type_fat_id fat_id =
dcon::fatten(state.world, dcon::pop_type_id{});
664 for(
const auto pt : state.world.in_pop_type) {
665 auto total = state.world.province_get_demographics(state.map_state.get_selected_province(),
demographics::to_key(state, pt));
672 uint32_t full_color = fat_id.get_color();
675 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
676 empty_color = 0x222222;
678 state.world.for_each_province([&](dcon::province_id prov_id) {
680 float total = state.world.province_get_demographics(state.map_state.get_selected_province(),
demographics::total);
681 float value = state.world.province_get_demographics(state.map_state.get_selected_province(),
demographics::to_key(state, fat_id));
682 auto ratio = value / total;
684 prov_color[i] = color;
685 prov_color[i + texture_size] = color;
689 state.world.for_each_province([&](dcon::province_id prov_id) {
692 dcon::pop_type_id primary_id;
693 dcon::pop_type_id secondary_id;
694 float primary_percent = 0.f;
695 float secondary_percent = 0.f;
696 state.world.for_each_pop_type([&](dcon::pop_type_id
id) {
698 for(
const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
699 if(pl.get_pop().get_poptype() == id) {
700 volume += pl.get_pop().get_size();
703 float percent = volume / total_pops;
704 if(percent > primary_percent) {
705 secondary_id = primary_id;
706 secondary_percent = primary_percent;
708 primary_percent = percent;
709 }
else if(percent > secondary_percent) {
711 secondary_percent = percent;
715 uint32_t secondary_color = 0xFFAAAAAA;
716 if(
bool(secondary_id)) {
717 secondary_color =
dcon::fatten(state.world, secondary_id).get_color();
719 if(secondary_percent >= primary_percent * 0.75f) {
720 prov_color[id] = primary_color;
721 prov_color[
id + texture_size] = secondary_color;
723 prov_color[id] = primary_color;
724 prov_color[
id + texture_size] = primary_color;
731 uint32_t province_size = state.world.province_size() + 1;
732 uint32_t texture_size = province_size + 256 - province_size % 256;
733 std::vector<uint32_t> prov_color(texture_size * 2);
734 for(
const auto n : state.world.in_nation) {
735 if(n.get_is_player_controlled()) {
736 for(
const auto po : state.world.nation_get_province_ownership_as_nation(n)) {
738 prov_color[id] = n.get_color();
740 for(
const auto po : state.world.nation_get_province_control_as_nation(n)) {
742 prov_color[
id + texture_size] = n.get_color();
752 uint32_t province_size = state.world.province_size();
753 uint32_t texture_size = province_size + 256 - province_size % 256;
754 std::vector<uint32_t> prov_color(texture_size * 2, 0);
756 assert(state.state_selection.has_value());
757 if(state.state_selection) {
758 for(
const auto s : state.state_selection->selectable_states) {
761 for(
const auto m : state.world.state_definition_get_abstract_state_membership_as_state(s)) {
762 auto p = m.get_province();
766 prov_color[i] = color;
767 prov_color[i + texture_size] = ~color;
777 std::vector<uint32_t> prov_color;
800 if(state.ui_state.map_gradient_legend)
801 state.ui_state.map_gradient_legend->set_visible(state,
true);
804 if(state.ui_state.map_gradient_legend)
805 state.ui_state.map_gradient_legend->set_visible(state,
false);
809 if(state.ui_state.map_civ_level_legend)
810 state.ui_state.map_civ_level_legend->set_visible(state,
true);
812 if(state.ui_state.map_civ_level_legend)
813 state.ui_state.map_civ_level_legend->set_visible(state,
false);
816 if(state.ui_state.map_col_legend)
817 state.ui_state.map_col_legend->set_visible(state,
true);
819 if(state.ui_state.map_col_legend)
820 state.ui_state.map_col_legend->set_visible(state,
false);
823 if(state.ui_state.map_dip_legend)
824 state.ui_state.map_dip_legend->set_visible(state,
true);
826 if(state.ui_state.map_dip_legend)
827 state.ui_state.map_dip_legend->set_visible(state,
false);
830 if(state.ui_state.map_rr_legend)
831 state.ui_state.map_rr_legend->set_visible(state,
true);
833 if(state.ui_state.map_rr_legend)
834 state.ui_state.map_rr_legend->set_visible(state,
false);
837 if(state.ui_state.map_nav_legend)
838 state.ui_state.map_nav_legend->set_visible(state,
true);
840 if(state.ui_state.map_nav_legend)
841 state.ui_state.map_nav_legend->set_visible(state,
false);
844 if(state.ui_state.map_rank_legend)
845 state.ui_state.map_rank_legend->set_visible(state,
true);
847 if(state.ui_state.map_rank_legend)
848 state.ui_state.map_rank_legend->set_visible(state,
false);
851 if(state.ui_state.map_rec_legend)
852 state.ui_state.map_rec_legend->set_visible(state,
true);
854 if(state.ui_state.map_rec_legend)
855 state.ui_state.map_rec_legend->set_visible(state,
false);
863 state.map_state.set_terrain_map_mode();
998 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 color_gradient_magma(float percent)
uint32_t get_ui_color(sys::state &state, T id)
constexpr uint32_t color_from_hash(uint32_t color)
uint32_t color_gradient_viridis(float percent)
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)
Holds important data about the game world, state, and other data regarding windowing,...
std::vector< uint32_t > supply_map_from(sys::state &state)