9 dcon::commodity_id
cid;
18 auto cid = retrieve<dcon::commodity_id>(
state,
parent);
30 auto content = retrieve<dcon::commodity_id>(
state,
parent);
41 auto cid = retrieve<dcon::commodity_id>(
state,
parent);
44 auto content = any_cast<commodity_filter_query_data>(f_payload);
45 frame = content.filter ? 1 : 0;
55 if(
name ==
"filter_button") {
56 return make_element_by_type<commodity_filter_button>(
state,
id);
57 }
else if(
name ==
"filter_enabled") {
58 return make_element_by_type<commodity_filter_enabled_image>(
state,
id);
59 }
else if(
name ==
"goods_type") {
60 return make_element_by_type<commodity_image>(
state,
id);
67 if(payload.holds_type<dcon::commodity_id>()) {
68 payload.emplace<dcon::commodity_id>(
content);
81 state.world.for_each_commodity([&](dcon::commodity_id cid) {
83 bool can_be_produced =
false;
84 state.world.for_each_factory_type([&](dcon::factory_type_id ftid) {
85 can_be_produced = can_be_produced ||
state.world.factory_type_get_output(ftid) == cid;
91 auto ptr = make_element_by_type<commodity_filter_item>(
state,
"goods_filter_template");
94 int16_t rowlimiter = index - (24 * (index / 24));
96 ptr->base_data.position.x = int16_t(33 * rowlimiter);
98 ptr->base_data.position.x = int16_t((33 * rowlimiter) - (rowlimiter * 2));
100 ptr->base_data.position.y = int16_t(30 * (index / 24));
dcon::text_key get_name() noexcept
void on_update(sys::state &state) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
dcon::commodity_id content
void on_create(sys::state &state) noexcept override
void add_child_to_back(std::unique_ptr< element_base > child) noexcept final
message_result impl_get(sys::state &state, Cyto::Any &payload) noexcept
void on_create(sys::state &state) noexcept override
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
layout_box open_layout_box(layout_base &dest, int32_t indent)
void localised_single_sub_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, variable_type subkey, substitution value)
void close_layout_box(columnar_layout &dest, layout_box &box)