23 auto sm =
state.world.nation_get_in_sphere_of(n);
26 auto smpc =
state.world.nation_get_primary_culture(sm);
40 auto first_wg =
state.crisis_attacker_wargoals.at(0);
56 auto pc =
state.world.nation_get_primary_culture(n);
62 auto first_names =
state.world.culture_get_first_names(
state.world.nation_get_primary_culture(n));
63 if(first_names.size() > 0) {
64 auto first_name = first_names.at(
rng::reduce(
uint32_t(names_pair.high), first_names.size()));
65 auto last_names =
state.world.culture_get_last_names(
state.world.nation_get_primary_culture(n));
66 if(last_names.size() > 0) {
74 if(
auto plist =
state.world.nation_get_province_ownership(n); plist.begin() != plist.end()) {
75 auto plist_size =
uint32_t(plist.end() - plist.begin());
88 auto id = retrieve<dcon::decision_id>(
state,
parent);
89 auto condition =
state.world.decision_get_allow(
id);
102 auto id = retrieve<dcon::decision_id>(
state,
parent);
104 auto mkey =
state.world.decision_get_ai_will_do(
id);
117 auto id = retrieve<dcon::decision_id>(
state,
parent);
118 auto potential =
state.world.decision_get_potential(
id);
131 auto content = retrieve<dcon::decision_id>(
state,
parent);
136 auto content = retrieve<dcon::decision_id>(
state,
parent);
145 auto id = retrieve<dcon::decision_id>(
state,
parent);
154 auto ef = fat_id.get_effect();
158 uint32_t(
state.local_player_nation.index() << 4 ^
id.index()));
170 auto id = retrieve<dcon::decision_id>(
state,
parent);
171 auto contents =
text::create_endless_layout(
state,
internal_layout,
text::layout_parameters{ 0, 0,
static_cast<int16_t
>(
base_data.
size.
x),
static_cast<int16_t
>(
base_data.
size.
y),
base_data.
data.
text.
font_handle, 0,
text::alignment::left,
text::text_color::white,
true });
184 auto const id = retrieve<dcon::decision_id>(
state,
parent);
185 if(
state.cheat_data.show_province_id_tooltip) {
192 auto const desc =
state.world.decision_get_description(
id);
193 if(
state.key_is_localized(desc)) {
213 auto id = retrieve<dcon::decision_id>(
state,
parent);
225 dcon::text_key description;
241 auto id = retrieve<dcon::decision_id>(
state,
parent);
243 description = fat_id.get_description();
246 base_data.data.text.font_handle, 0, text::alignment::left,
247 text::is_black_from_font_id(base_data.data.text.font_handle) ? text::text_color::black : text::text_color::white,
249 populate_layout(
state, container);
267 auto id = retrieve<dcon::decision_id>(
state,
parent);
269 state.world.decision_set_hide_notification(
id, !
state.world.decision_get_hide_notification(
id));
270 state.game_state_updated.store(
true, std::memory_order_release);
275 auto id = retrieve<dcon::decision_id>(
state,
parent);
276 return !
state.world.decision_get_hide_notification(
id);
295 if(
name ==
"decision_name") {
296 return make_element_by_type<decision_name>(
state,
id);
297 }
else if(
name ==
"decision_image") {
298 return make_element_by_type<decision_image>(
state,
id);
299 }
else if(
name ==
"decision_desc") {
300 return make_element_by_type<decision_desc>(
state,
id);
301 }
else if(
name ==
"requirements") {
304 auto btn1 = make_element_by_type<decision_ai_will_do>(
state,
id);
305 btn1->base_data.position.x -= btn1->base_data.size.x * 2;
308 auto btn2 = make_element_by_type<decision_potential>(
state,
id);
309 btn2->base_data.position.x -= btn2->base_data.size.x;
311 return make_element_by_type<decision_requirements>(
state,
id);
312 }
else if(
name ==
"ignore_checkbox") {
313 return make_element_by_type<ignore_checkbox>(
state,
id);
314 }
else if(
name ==
"make_decision") {
315 return make_element_by_type<make_decision>(
state,
id);
322 if(payload.holds_type<dcon::decision_id>()) {
323 payload.emplace<dcon::decision_id>(
content);
340 return "decision_entry";
344 std::vector<dcon::decision_id>
list;
345 auto n =
state.local_player_nation;
347 dcon::decision_id did{ dcon::decision_id::value_base_t(i) };
348 if(!state.cheat_data.always_potential_decisions) {
349 auto lim = state.world.decision_get_potential(did);
358 std::sort(
list.begin(),
list.end(), [&](dcon::decision_id a, dcon::decision_id b) {
359 auto allow_a = state.world.decision_get_allow(a);
360 auto allow_b = state.world.decision_get_allow(b);
361 auto a_res = !allow_a || trigger::evaluate(state, allow_a, trigger::to_generic(n), trigger::to_generic(n), 0);
362 auto b_res = !allow_b || trigger::evaluate(state, allow_b, trigger::to_generic(n), trigger::to_generic(n), 0);
366 return a.index() < b.index();
390 if(
name ==
"decision_listbox") {
391 return make_element_by_type<decision_listbox>(
state,
id);
void add_child_to_front(std::unique_ptr< element_base > child) noexcept final
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void on_create(sys::state &state) noexcept override
bool get_horizontal_flip(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
std::unique_ptr< ui::element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
void on_update(sys::state &state) noexcept override
std::string_view get_row_element_name() override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
void on_create(sys::state &state) noexcept override
void set_visible(sys::state &state, bool vis)
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
std::vector< dcon::decision_id > row_contents
void update(sys::state &state)
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
dcon::decision_id content
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
sound::audio_instance & get_click_sound(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
text::layout internal_layout
void calibrate_scrollbar(sys::state &state) noexcept
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void on_create(sys::state &state) noexcept override
multiline_text_element_base * delegate
void on_create(sys::state &state) noexcept override
bool can_take_decision(sys::state &state, dcon::nation_id source, dcon::decision_id d)
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
random_pair get_random_pair(sys::state const &state, uint32_t value_in)
uint32_t reduce(uint32_t value_in, uint32_t upper_bound)
audio_instance & get_decision_sound(sys::state &state)
@ crisisdefender_continent
@ crisisattacker_continent
void add_to_layout_box(sys::state &state, layout_base &dest, layout_box &box, embedded_flag ico)
layout_box open_layout_box(layout_base &dest, int32_t indent)
endless_layout create_endless_layout(sys::state &state, layout &dest, layout_parameters const ¶ms)
dcon::text_key get_ruler_title(sys::state &state, dcon::nation_id n)
void add_line(sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
void add_to_substitution_map(substitution_map &mp, variable_type key, substitution value)
dcon::text_key get_adjective(sys::state &state, dcon::nation_id id)
ankerl::unordered_dense::map< uint32_t, substitution > substitution_map
void add_space_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
void close_layout_box(columnar_layout &dest, layout_box &box)
int32_t to_generic(dcon::province_id v)
bool evaluate(sys::state &state, dcon::trigger_key key, int32_t primary, int32_t this_slot, int32_t from_slot)
void multiplicative_value_modifier_description(sys::state &state, text::layout_base &layout, dcon::value_modifier_key modifier, int32_t primary, int32_t this_slot, int32_t from_slot)
void effect_description(sys::state &state, text::layout_base &layout, dcon::effect_key k, int32_t primary_slot, int32_t this_slot, int32_t from_slot, uint32_t r_lo, uint32_t r_hi)
void produce_decision_substitutions(sys::state &state, text::substitution_map &m, dcon::nation_id n)
void trigger_description(sys::state &state, text::layout_base &layout, dcon::trigger_key k, int32_t primary_slot=-1, int32_t this_slot=-1, int32_t from_slot=-1)
Holds important data about the game world, state, and other data regarding windowing,...
union ui::element_data::internal_data data
dcon::gfx_object_id gfx_object