10 static char const* key_str[] = {
15 "amsg_siegeover_by_nation",
16 "amsg_siegeover_on_nation",
17 "amsg_colony_finished",
20 "amsg_ruling_party_change",
25 "amsg_peace_accepted_from_nation",
26 "amsg_peace_rejected_from_nation",
27 "amsg_peace_accepted_by_nation",
28 "amsg_peace_rejected_by_nation",
29 "amsg_mobilization_start",
30 "amsg_mobilization_end",
31 "amsg_factory_complete",
34 "amsg_naval_base_complete",
35 "amsg_province_event",
36 "amsg_national_event",
41 "amsg_land_combat_starts_on_nation",
42 "amsg_naval_combat_starts_on_nation",
43 "amsg_land_combat_starts_by_nation",
44 "amsg_naval_combat_starts_by_nation",
45 "amsg_movement_finishes",
47 "amsg_lose_great_power",
48 "amsg_become_great_power",
49 "amsg_war_subsidies_start_by_nation",
50 "amsg_war_subsidies_start_on_nation",
51 "amsg_war_subsidies_end_by_nation",
52 "amsg_war_subsidies_end_on_nation",
53 "amsg_reparations_start_by_nation",
54 "amsg_reparations_start_on_nation",
55 "amsg_reparations_end_by_nation",
56 "amsg_reparations_end_on_nation",
57 "amsg_mil_access_start_by_nation",
58 "amsg_mil_access_start_on_nation",
59 "amsg_mil_access_end_by_nation",
60 "amsg_mil_access_end_on_nation",
61 "amsg_mil_access_declined_by_nation",
62 "amsg_mil_access_declined_on_nation",
63 "amsg_alliance_starts",
65 "amsg_alliance_declined_by_nation",
66 "amsg_alliance_declined_on_nation",
67 "amsg_ally_called_accepted_by_nation",
68 "amsg_ally_called_declined_by_nation",
69 "amsg_discredit_by_nation",
71 "amsg_expell_by_nation",
72 "amsg_discredit_on_nation",
74 "amsg_expell_on_nation",
75 "amsg_increase_opinion",
76 "amsg_decrease_opinion_by_nation",
77 "amsg_decrease_opinion_on_nation",
78 "amsg_rem_sphere_by_nation",
79 "amsg_rem_sphere_on_nation",
80 "amsg_removed_from_sphere",
82 "amsg_added_to_sphere",
83 "amsg_increase_relation_by_nation",
84 "amsg_increase_relation_on_nation",
85 "amsg_decrease_relation_by_nation",
86 "amsg_decrease_relation_on_nation",
87 "amsg_join_war_by_nation",
88 "amsg_join_war_on_nation",
90 "amsg_war_becomes_great",
91 "amsg_cb_detected_on_nation",
92 "amsg_cb_detected_by_nation",
93 "amsg_crisis_join_offer_accepted_by_nation",
94 "amsg_crisis_join_offer_declined_by_nation",
95 "amsg_crisis_join_offer_accepted_from_nation",
96 "amsg_crisis_join_offer_declined_from_nation",
97 "amsg_crisis_resolution_accepted",
98 "amsg_crisis_becomes_war",
99 "amsg_crisis_resolution_declined_from_nation",
100 "amsg_crisis_starts",
101 "amsg_crisis_attacker_backer",
102 "amsg_crisis_defender_backer",
103 "amsg_crisis_fizzle",
106 "amsg_cb_fab_finished",
107 "amsg_cb_fab_cancelled",
108 "amsg_crisis_voluntary_join",
112 "amsg_entered_automatic_alliance",
115 return std::string{key_str[
type]};
120template<
int32_t category>
124 auto base_index = retrieve<int32_t>(
state,
parent);
126 if constexpr(category == 0) {
127 current =
state.user_settings.self_message_settings[base_index];
128 }
else if constexpr(category == 1) {
129 current =
state.user_settings.interesting_message_settings[base_index];
130 }
else if constexpr(category == 2) {
131 current =
state.user_settings.other_message_settings[base_index];
147 auto base_index = retrieve<int32_t>(
state,
parent);
149 if constexpr(category == 0) {
150 current =
state.user_settings.self_message_settings[base_index];
151 }
else if constexpr(category == 1) {
152 current =
state.user_settings.interesting_message_settings[base_index];
153 }
else if constexpr(category == 2) {
154 current =
state.user_settings.other_message_settings[base_index];
169 if constexpr(category == 0) {
170 state.user_settings.self_message_settings[base_index] = current;
171 }
else if constexpr(category == 1) {
172 state.user_settings.interesting_message_settings[base_index] = current;
173 }
else if constexpr(category == 2) {
174 state.user_settings.other_message_settings[base_index] = current;
178 state.game_state_updated.store(
true, std::memory_order::release);
181 auto base_index = retrieve<int32_t>(
state,
parent);
183 if constexpr(category == 0) {
184 current =
state.user_settings.self_message_settings[base_index];
185 }
else if constexpr(category == 1) {
186 current =
state.user_settings.interesting_message_settings[base_index];
187 }
else if constexpr(category == 2) {
188 current =
state.user_settings.other_message_settings[base_index];
203 if constexpr(category == 0) {
204 state.user_settings.self_message_settings[base_index] = current;
205 }
else if constexpr(category == 1) {
206 state.user_settings.interesting_message_settings[base_index] = current;
207 }
else if constexpr(category == 2) {
208 state.user_settings.other_message_settings[base_index] = current;
212 state.game_state_updated.store(
true, std::memory_order::release);
219 auto base_index = retrieve<int32_t>(
state,
parent);
221 if constexpr(category == 0) {
222 current =
state.user_settings.self_message_settings[base_index];
223 }
else if constexpr(category == 1) {
224 current =
state.user_settings.interesting_message_settings[base_index];
225 }
else if constexpr(category == 2) {
226 current =
state.user_settings.other_message_settings[base_index];
246 auto base_index = retrieve<int32_t>(
state,
parent);
254 if(
name ==
"entry_text") {
255 return make_element_by_type<message_type_name>(
state,
id);
256 }
else if(
name ==
"us_button") {
257 return make_element_by_type<message_handling_buton<0>>(
state, id);
258 }
else if(
name ==
"interesting_button") {
259 return make_element_by_type<message_handling_buton<1>>(
state, id);
260 }
else if(
name ==
"other_button") {
261 return make_element_by_type<message_handling_buton<2>>(
state, id);
271 return "alice_message_setting_item";
288 std::memcpy(
state.user_settings.self_message_settings, d.self_message_settings,
sizeof(d.self_message_settings));
289 std::memcpy(
state.user_settings.other_message_settings, d.other_message_settings,
sizeof(d.other_message_settings));
290 std::memcpy(
state.user_settings.interesting_message_settings, d.interesting_message_settings,
sizeof(d.interesting_message_settings));
292 state.game_state_updated.store(
true, std::memory_order::release);
305 state.game_state_updated.store(
true, std::memory_order::release);
312 return state.user_settings.notify_rebels_defeat;
315 state.user_settings.notify_rebels_defeat = !
state.user_settings.notify_rebels_defeat;
331 state.save_user_settings();
336 if(
name ==
"close") {
337 return make_element_by_type<generic_close_button>(
state,
id);
338 }
else if(
name ==
"messagesettings_bg") {
339 return make_element_by_type<opaque_element_base>(
state,
id);
340 }
else if(
name ==
"message_settings_items") {
341 return make_element_by_type<message_settings_listbox>(
state,
id);
342 }
else if(
name ==
"message_reset") {
343 return make_element_by_type<message_preset_reset>(
state,
id);
344 }
else if(
name ==
"message_spectator") {
345 return make_element_by_type<message_preset_ai_only>(
state,
id);
346 }
else if(
name ==
"message_notify_rebels_defeat_checkbox") {
347 return make_element_by_type<message_notify_rebels_defeat>(
state,
id);
375 if(
name ==
"messagelogbutton") {
376 return make_element_by_type<message_log_text>(
state,
id);
407template<message_settings_category Filter>
412 return "messagesettings_all";
414 return "messagesettings_combat";
416 return "messagesettings_diplomacy";
418 return "messagesettings_units";
420 return "messagesettings_provinces";
422 return "messagesettings_events";
424 return "messagesettings_other";
435 return any_cast<bool>(payload);
456 std::vector<bool> cat_filters;
468#undef MSG_SETTING_LIST
virtual void impl_on_update(sys::state &state) noexcept
message_result impl_get(sys::state &state, Cyto::Any &payload) noexcept
void set_visible(sys::state &state, bool vis)
std::vector< int32_t > row_contents
void update(sys::state &state)
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
void on_update(sys::state &state) noexcept override
void button_right_action(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
bool is_reversed() override
std::string_view get_row_element_name() override
void on_update(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
std::vector< notification::message > messages
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
void on_update(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
std::string_view get_row_element_name() override
void on_update(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void on_hide(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
void on_update(sys::state &state) noexcept override
void set_text(sys::state &state, std::string const &new_text)
void on_create(sys::state &state) noexcept override
constexpr uint8_t standard_popup
constexpr uint8_t standard_log
constexpr uint8_t standard_pause
constexpr uint8_t standard_sound
layout_box open_layout_box(layout_base &dest, int32_t indent)
void localised_format_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, text::substitution_map const &sub)
void add_line(sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
void close_layout_box(columnar_layout &dest, layout_box &box)
std::string get_setting_text_key(int32_t type)
void send(sys::state &state, element_base *parent, T value)
message_settings_category
element_base * menubar_window