58 state.user_settings.interface_volume *
state.user_settings.master_volume);
290 bool setting_changed =
false;
291 std::unique_ptr<element_base> make_child(
sys::state&
state, std::string_view
name, dcon::gui_def_id
id)
noexcept override {
292 if(
name ==
"close_button") {
293 return make_element_by_type<generic_close_button>(
state,
id);
294 }
else if(
name ==
"background") {
295 return make_element_by_type<draggable_target>(
state,
id);
296 }
else if(
name ==
"auto_save_value") {
297 return make_element_by_type<autosave_display>(
state,
id);
298 }
else if(
name ==
"auto_save_left") {
299 return make_element_by_type<autosave_left>(
state,
id);
300 }
else if(
name ==
"auto_save_right") {
301 return make_element_by_type<autosave_right>(
state,
id);
302 }
else if(
name ==
"language_value") {
303 return make_element_by_type<language_display>(
state,
id);
304 }
else if(
name ==
"language_left") {
305 return make_element_by_type<language_left>(
state,
id);
306 }
else if(
name ==
"language_right") {
307 return make_element_by_type<language_right>(
state,
id);
308 }
else if(
name ==
"zoom_mode_value") {
309 return make_element_by_type<map_zoom_mode_display>(
state,
id);
310 }
else if(
name ==
"zoom_mode_left") {
311 return make_element_by_type<map_zoom_mode_left>(
state,
id);
312 }
else if(
name ==
"zoom_mode_right") {
313 return make_element_by_type<map_zoom_mode_right>(
state,
id);
314 }
else if(
name ==
"tooltip_mode_checkbox") {
315 return make_element_by_type<tooltip_mode_checkbox>(
state,
id);
316 }
else if(
name ==
"spoilers_checkbox") {
317 return make_element_by_type<spoilers_checkbox>(
state,
id);
318 }
else if(
name ==
"dm_popup_checkbox") {
319 return make_element_by_type<dm_popup_checkbox>(
state,
id);
320 }
else if(
name ==
"zoom_speed_scrollbar") {
321 return make_element_by_type<zoom_speed_scrollbar>(
state,
id);
322 }
else if(
name ==
"mouse_edge_scrolling_checkbox") {
323 return make_element_by_type<map_mouse_edge_scrolling>(
state,
id);
324 }
else if(
name ==
"wasd_for_map_movement_checkbox") {
325 return make_element_by_type<wasd_for_map_movement_checkbox>(
state,
id);
326 }
else if(
name ==
"close_button") {
327 return make_element_by_type<generic_close_button>(
state,
id);
328 }
else if(
name ==
"background") {
329 return make_element_by_type<draggable_target>(
state,
id);
330 }
else if(
name ==
"ui_scale_value") {
331 return make_element_by_type<ui_scale_display>(
state,
id);
332 }
else if(
name ==
"ui_scale_left") {
333 return make_element_by_type<ui_scale_left>(
state,
id);
334 }
else if(
name ==
"ui_scale_right") {
335 return make_element_by_type<ui_scale_right>(
state,
id);
336 }
else if(
name ==
"window_mode_checkbox") {
337 return make_element_by_type<window_mode_checkbox>(
state,
id);
338 }
else if(
name ==
"projection_left") {
339 return make_element_by_type<projection_mode_left>(
state,
id);
340 }
else if(
name ==
"projection_right") {
341 return make_element_by_type<projection_mode_right>(
state,
id);
342 }
else if(
name ==
"projection_value") {
343 return make_element_by_type<projection_mode_display>(
state,
id);
344 }
else if(
name ==
"fonts_checkbox") {
345 return make_element_by_type<fonts_mode_checkbox>(
state,
id);
346 }
else if(
name ==
"mouse_left_click_mode_checkbox") {
347 return make_element_by_type<left_mouse_click_mode_checkbox>(
state,
id);
348 }
else if(
name ==
"fow_checkbox") {
349 return make_element_by_type<fow_checkbox>(
state,
id);
350 }
else if(
name ==
"render_models_checkbox") {
351 return make_element_by_type<render_models_checkbox>(
state,
id);
352 }
else if(
name ==
"black_map_font_checkbox") {
353 return make_element_by_type<black_map_font_checkbox>(
state,
id);
354 }
else if(
name ==
"railroad_checkbox") {
355 return make_element_by_type<railroad_checkbox>(
state,
id);
356 }
else if(
name ==
"river_checkbox") {
357 return make_element_by_type<river_checkbox>(
state,
id);
358 }
else if(
name ==
"map_label_value") {
359 return make_element_by_type<map_label_display>(
state,
id);
360 }
else if(
name ==
"map_label_left") {
361 return make_element_by_type<map_label_left>(
state,
id);
362 }
else if(
name ==
"map_label_right") {
363 return make_element_by_type<map_label_right>(
state,
id);
364 }
else if(
name ==
"antialiasing_value") {
365 return make_element_by_type<antialiasing_display>(
state,
id);
366 }
else if(
name ==
"antialiasing_left") {
367 return make_element_by_type<antialiasing_left>(
state,
id);
368 }
else if(
name ==
"antialiasing_right") {
369 return make_element_by_type<antialiasing_right>(
state,
id);
370 }
else if(
name ==
"gaussianblur_value") {
371 return make_element_by_type<gaussianblur_display>(
state,
id);
372 }
else if(
name ==
"gaussianblur_left") {
373 return make_element_by_type<gaussianblur_left>(
state,
id);
374 }
else if(
name ==
"gaussianblur_right") {
375 return make_element_by_type<gaussianblur_right>(
state,
id);
376 }
else if(
name ==
"gamma_value") {
377 return make_element_by_type<gamma_display>(
state,
id);
378 }
else if(
name ==
"gamma_left") {
379 return make_element_by_type<gamma_left>(
state,
id);
380 }
else if(
name ==
"gamma_right") {
381 return make_element_by_type<gamma_right>(
state,
id);
382 }
else if(
name ==
"vassal_color_value") {
383 return make_element_by_type<vassal_color_display>(
state,
id);
384 }
else if(
name ==
"vassal_color_left") {
385 return make_element_by_type<vassal_color_left>(
state,
id);
386 }
else if(
name ==
"vassal_color_right") {
387 return make_element_by_type<vassal_color_right>(
state,
id);
388 }
else if(
name ==
"color_blind_value") {
389 return make_element_by_type<color_blind_display>(
state,
id);
390 }
else if(
name ==
"color_blind_left") {
391 return make_element_by_type<color_blind_left>(
state,
id);
392 }
else if(
name ==
"color_blind_right") {
393 return make_element_by_type<color_blind_right>(
state,
id);
394 }
else if(
name ==
"close_button") {
395 return make_element_by_type<generic_close_button>(
state,
id);
396 }
else if(
name ==
"background") {
397 return make_element_by_type<draggable_target>(
state,
id);
398 }
else if(
name ==
"master_volume_scroll_bar") {
399 return make_element_by_type<master_volume>(
state,
id);
400 }
else if(
name ==
"music_volume_scroll_bar") {
401 return make_element_by_type<music_volume>(
state,
id);
402 }
else if(
name ==
"interface_volume_scroll_bar") {
403 return make_element_by_type<interface_volume>(
state,
id);
404 }
else if(
name ==
"effect_volume_scroll_bar") {
405 return make_element_by_type<effects_volume>(
state,
id);
406 }
else if(
name ==
"music_player_value") {
407 return make_element_by_type<music_player_display>(
state,
id);
408 }
else if(
name ==
"music_player_left") {
409 return make_element_by_type<music_player_left>(
state,
id);
410 }
else if(
name ==
"music_player_right") {
411 return make_element_by_type<music_player_right>(
state,
id);
412 }
else if(
name ==
"mute_on_focus_lost_checkbox") {
413 return make_element_by_type<mute_on_focus_lost_checkbox>(
state,
id);
420 state.save_user_settings();
424 setting_changed =
true;
471 if(
name ==
"close_button") {
472 return make_element_by_type<generic_close_button>(
state,
id);
473 }
else if(
name ==
"graphics") {
474 auto ptr = make_element_by_type<generic_tab_button<main_menu_sub_window>>(
state, id);
477 }
else if(
name ==
"sound") {
478 auto ptr = make_element_by_type<generic_tab_button<main_menu_sub_window>>(
state, id);
481 }
else if(
name ==
"controls") {
482 auto ptr = make_element_by_type<generic_tab_button<main_menu_sub_window>>(
state, id);
485 }
else if(
name ==
"message_settings") {
486 return make_element_by_type<mm_disabled_button>(
state,
id);
487 }
else if(
name ==
"save") {
488 return make_element_by_type<mm_disabled_button>(
state,
id);
489 }
else if(
name ==
"save_and_exit") {
490 return make_element_by_type<mm_disabled_button>(
state,
id);
491 }
else if(
name ==
"background") {
492 return make_element_by_type<draggable_target>(
state,
id);
493 }
else if(
name ==
"exit") {
494 return make_element_by_type<close_application_button>(
state,
id);
495 }
else if(
name ==
"alice_graphics_menu") {
496 auto ptr = make_element_by_type<options_menu_window>(
state,
id);
497 graphics_menu = ptr.get();
498 ptr->set_visible(
state,
false);
500 }
else if(
name ==
"alice_controls_menu") {
501 auto ptr = make_element_by_type<options_menu_window>(
state,
id);
502 controls_menu = ptr.get();
503 ptr->set_visible(
state,
false);
505 }
else if(
name ==
"alice_audio_menu") {
506 auto ptr = make_element_by_type<options_menu_window>(
state,
id);
507 audio_menu = ptr.get();
508 ptr->set_visible(
state,
false);
526 auto enum_val = any_cast<main_menu_sub_window>(payload);
557 auto m = make_element_by_type<message_settings_window>(
state,
"alice_message_settings");
558 message_settings_menu = m.get();
559 m->set_visible(
state,
false);
560 state.ui_state.
root->add_child_to_front(std::move(m));
564 if(
name ==
"close_button") {
565 return make_element_by_type<generic_close_button>(
state,
id);
566 }
else if(
name ==
"graphics") {
567 auto ptr = make_element_by_type<generic_tab_button<main_menu_sub_window>>(
state, id);
570 }
else if(
name ==
"sound") {
571 auto ptr = make_element_by_type<generic_tab_button<main_menu_sub_window>>(
state, id);
574 }
else if(
name ==
"controls") {
575 auto ptr = make_element_by_type<generic_tab_button<main_menu_sub_window>>(
state, id);
578 }
else if(
name ==
"message_settings") {
579 auto ptr = make_element_by_type<generic_tab_button<main_menu_sub_window>>(
state, id);
582 }
else if(
name ==
"background") {
583 return make_element_by_type<draggable_target>(
state,
id);
584 }
else if(
name ==
"exit") {
585 return make_element_by_type<close_application_button>(
state,
id);
586 }
else if(
name ==
"save") {
587 return make_element_by_type<save_button>(
state,
id);
588 }
else if(
name ==
"save_and_exit") {
589 return make_element_by_type<save_and_quit_button>(
state,
id);
590 }
else if(
name ==
"alice_graphics_menu") {
591 auto ptr = make_element_by_type<options_menu_window>(
state,
id);
592 graphics_menu = ptr.get();
593 ptr->set_visible(
state,
false);
595 }
else if(
name ==
"alice_controls_menu") {
596 auto ptr = make_element_by_type<options_menu_window>(
state,
id);
597 controls_menu = ptr.get();
598 ptr->set_visible(
state,
false);
600 }
else if(
name ==
"alice_audio_menu") {
601 auto ptr = make_element_by_type<options_menu_window>(
state,
id);
602 audio_menu = ptr.get();
603 ptr->set_visible(
state,
false);
617 if(message_settings_menu)
623 auto enum_val = any_cast<main_menu_sub_window>(payload);
637 state.ui_state.
root->move_child_to_front(message_settings_menu);
ANY_ALWAYS_INLINE bool holds_type() const noexcept
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void impl_on_update(sys::state &state) noexcept override
void set_visible(sys::state &state, bool vis)
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept override
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
void button_action(sys::state &state) noexcept override
message_result on_lbutton_up(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods, bool under_mouse) noexcept override
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_create(sys::state &state) noexcept override
void hide_subwindows(sys::state &state)
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(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 on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
bool is_active(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 hide_subwindows(sys::state &state)
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
bool is_active(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
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void play_interface_sound(sys::state &state, audio_instance &s, float volume)
audio_instance & get_click_sound(sys::state &state)
void close_window(sys::state &game_state)
std::unique_ptr< element_base > root