4#include "dcon_generated.hpp"
15 auto reform = fatten(
state.world, ref);
22 if(
auto desc = reform.get_desc();
state.key_is_localized(desc)) {
34 float base_cost = float(
state.world.reform_option_get_technology_cost(ref));
36 cost = base_cost * reform_factor;
38 float base_cost = float(
state.world.reform_option_get_technology_cost(ref));
40 cost = base_cost * reform_factor;
46 auto mod_id = reform.get_modifier();
52 auto allow = reform.get_allow();
61 auto ext = reform.get_on_execute_trigger();
67 auto ex = reform.get_on_execute_effect();
76 uint32_t((ref.index() << 2) ^
state.local_player_nation.index()));
89 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
94 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
106 auto content = retrieve<dcon::reform_option_id>(
state,
parent);
115 auto content = retrieve<dcon::reform_option_id>(
state,
parent);
120 auto content = retrieve<dcon::reform_option_id>(
state,
parent);
130 if(
name ==
"reform_name") {
131 return make_element_by_type<generic_name_text<dcon::reform_option_id>>(
state, id);
132 }
else if(
name ==
"selected") {
133 auto ptr = make_element_by_type<image_element_base>(
state,
id);
134 selected_icon = ptr.
get();
136 }
else if(
name ==
"reform_option") {
137 return make_element_by_type<unciv_reforms_reform_button>(
state,
id);
151 return "reform_option_window";
156 if(payload.holds_type<dcon::reform_id>()) {
157 auto reform_id = any_cast<dcon::reform_id>(payload);
160 for(
auto& option : fat_id.get_options()) {
180 auto content = retrieve<dcon::reform_id>(
state,
parent);
193 dcon::reform_id reform_id{};
197 if(
name ==
"reform_name") {
198 return make_element_by_type<reform_name_text>(
state,
id);
215 if(payload.holds_type<dcon::reform_id>()) {
216 payload.emplace<dcon::reform_id>(reform_id);
223 if(payload.holds_type<dcon::reform_id>()) {
224 reform_id = any_cast<dcon::reform_id>(payload);
239 if(
name ==
"civ_progress") {
240 return make_element_by_type<nation_westernization_progress_bar>(
state,
id);
241 }
else if(
name ==
"westernize_button") {
242 return make_element_by_type<unciv_reforms_westernize_button>(
state,
id);
243 }
else if(
name ==
"research_points_val") {
244 return make_element_by_type<nation_research_points_text>(
state,
id);
246 auto ptr = make_element_by_type<unciv_reforms_reform_window>(
state,
id);
248 ptr->impl_set(
state, payload);
250 }
else if(
name ==
"mil_plusminus_icon") {
251 return make_element_by_type<nation_military_reform_multiplier_icon>(
state,
id);
252 }
else if(
name ==
"eco_plusminus_icon") {
253 return make_element_by_type<nation_economic_reform_multiplier_icon>(
state,
id);
254 }
else if(
name ==
"eco_main_icon" ||
name ==
"mil_main_icon") {
255 auto ptr = make_element_by_type<image_element_base>(
state,
id);
void add_child_to_front(std::unique_ptr< element_base > child) noexcept final
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
void set_visible(sys::state &state, bool vis)
std::vector< dcon::reform_option_id > row_contents
void update(sys::state &state)
void on_create(sys::state &state) noexcept override
dcon::reform_option_id content
text::layout internal_layout
void on_create(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
bool can_civilize_nation(sys::state &state, dcon::nation_id source)
bool can_enact_reform(sys::state &state, dcon::nation_id source, dcon::reform_option_id r)
void enact_reform(sys::state &state, dcon::nation_id source, dcon::reform_option_id r)
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
float get_military_reform_multiplier(sys::state &state, dcon::nation_id n)
float get_economic_reform_multiplier(sys::state &state, dcon::nation_id n)
bool reform_is_selected(sys::state &state, dcon::nation_id nation, dcon::reform_option_id reform_option)
dcon::reform_id get_reform_by_name(sys::state &state, std::string_view name)
audio_instance & get_enact_sound(sys::state &state)
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)
void add_line(sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
void add_line_break_to_layout(sys::state &state, columnar_layout &dest)
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 close_layout_box(columnar_layout &dest, layout_box &box)
int32_t to_generic(dcon::province_id v)
void modifier_description(sys::state &state, text::layout_base &layout, dcon::modifier_id mid, int32_t indentation=0)
void reform_description(sys::state &state, text::columnar_layout &contents, dcon::issue_option_id ref)
void make_size_from_graphics(sys::state &state, ui::element_data &dat)
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 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)
void reform_rules_description(sys::state &state, text::columnar_layout &contents, uint32_t rules)
union ui::element_data::internal_data data