33 state.stored_map_mode =
state.map_state.active_map_mode;
35 state.map_state.set_selected_province(dcon::province_id{});
41 state.state_selection.reset();
78 state.game_state_updated.store(
true, std::memory_order_release);
83 dcon::province_id target,
89 while(checked_element !=
nullptr) {
90 if(checked_element ==
state.ui_state.units_root.get())
92 if(checked_element ==
state.ui_state.unit_details_box.get())
94 checked_element = checked_element->
parent;
111 return state.user_settings.effects_volume *
state.user_settings.master_volume;
117 dcon::province_id target,
121 bool army_play =
false;
126 for(
auto a :
state.selected_armies) {
134 for(
auto a :
state.selected_navies) {
156 dcon::province_id target,
159 auto owner =
state.world.province_get_nation_from_province_ownership(target);
161 state.open_diplomacy(owner);
168 auto owner =
state.world.province_get_nation_from_province_ownership(
state.map_state.selected_province);
176 state.world.nation_set_is_player_controlled(
state.local_player_nation,
false);
177 state.local_player_nation = owner;
178 state.world.nation_set_is_player_controlled(
state.local_player_nation,
true);
179 if(
state.ui_state.nation_picker) {
180 state.ui_state.nation_picker->impl_on_update(
state);
189 auto prov =
state.map_state.selected_province;
190 auto sdef =
state.world.province_get_state_from_abstract_state_membership(prov);
191 state.state_select(sdef);
195 if(
state.ui_state.province_window) {
201 state.x_drag_start = x;
202 state.y_drag_start = y;
203 state.drag_selecting =
true;
208 state.is_dragging =
false;
209 if(
state.ui_state.drag_target) {
210 state.on_drag_finished(x, y, mod);
219 state.ui_state.under_mouse->impl_on_rbutton_down(
221 state.ui_state.relative_mouse_location.x,
222 state.ui_state.relative_mouse_location.y,
227 state.ui_state.under_mouse->impl_on_lbutton_down(
229 state.ui_state.relative_mouse_location.x,
230 state.ui_state.relative_mouse_location.y,
233 state.ui_state.left_mouse_hold_target =
state.ui_state.under_mouse;
250 auto mouse_pos = glm::vec2(x, y);
251 auto screen_size = glm::vec2(
state.x_size,
state.y_size);
253 if(!
state.map_state.screen_to_map(mouse_pos, screen_size, current_view, map_pos)) {
256 map_pos *= glm::vec2(
float(
state.map_state.map_data.size_x),
float(
state.map_state.map_data.size_y));
257 auto idx = int32_t(
state.map_state.map_data.size_y - map_pos.y) * int32_t(
state.map_state.map_data.size_x) + int32_t(map_pos.x);
259 if(0 <= idx &&
size_t(idx) <
state.map_state.map_data.province_id_map.size()) {
263 if(
state.selected_armies.size() > 0 ||
state.selected_navies.size() > 0) {
264 state.current_scene.rbutton_selected_units(
state,
state.local_player_nation,
id, mod);
266 state.current_scene.rbutton_province(
state,
state.local_player_nation,
id, mod);
275 state.current_scene.on_drag_start(
state, x, y, mod);
280 state.ui_state.edit_target =
nullptr;
282 if(
state.iui_state.over_ui) {
289 if(
state.ui_state.under_mouse !=
nullptr && !under_mouse_belongs_on_map) {
299 state.ui_state.edit_target =
nullptr;
301 if(
state.iui_state.over_ui) {
305 if(
state.ui_state.under_mouse !=
nullptr) {
314 auto rel_x =
state.ui_state.relative_mouse_location.x;
315 auto rel_y =
state.ui_state.relative_mouse_location.y;
317 bool mouse_over_target =
state.ui_state.under_mouse ==
state.ui_state.left_mouse_hold_target;
319 if(!
state.current_scene.allow_drag_selection) {
320 if(mouse_over_target) {
321 state.ui_state.under_mouse->impl_on_lbutton_up(
state, rel_x, rel_y, mod,
true);
323 state.ui_state.left_mouse_hold_target->impl_on_lbutton_up(
state, rel_x, rel_y, mod,
false);
326 if(mouse_over_target) {
327 state.ui_state.left_mouse_hold_target =
nullptr;
328 state.ui_state.under_mouse->impl_on_lbutton_up(
state, rel_x, rel_y, mod,
true);
329 }
else if(!mouse_over_target && !
state.drag_selecting) {
330 state.ui_state.left_mouse_hold_target->impl_on_lbutton_up(
state, rel_x, rel_y, mod,
false);
332 state.ui_state.left_mouse_hold_target =
nullptr;
333 if(
state.ui_state.scrollbar_continuous_movement) {
336 state.ui_state.scrollbar_continuous_movement =
false;
343 state.selected_armies.clear();
344 state.selected_navies.clear();
348 auto mid_point =
state.world.province_get_mid_point(
province);
349 auto map_pos =
state.map_state.normalize_map_coord(mid_point);
350 auto screen_size = glm::vec2{ float(
state.x_size), float(
state.y_size) };
351 glm::vec2 screen_pos;
352 if(
state.map_state.map_to_screen(
state, map_pos, screen_size, screen_pos)) {
353 if(
state.x_drag_start <= int32_t(screen_pos.x) && int32_t(screen_pos.x) <= x
354 &&
state.y_drag_start <= int32_t(screen_pos.y) && int32_t(screen_pos.y) <= y) {
363 auto adj =
state.world.get_province_adjacency_by_province_pair(
province, port_to);
365 auto id = adj.index();
366 auto& border =
state.map_state.map_data.borders[id];
367 auto& vertex =
state.map_state.map_data.border_vertices[border.start_index + border.count / 2];
369 auto map_x = vertex.position.x;
370 auto map_y = vertex.position.y;
372 glm::vec2 map_pos(map_x, 1.0f - map_y);
373 auto screen_size = glm::vec2{ float(
state.x_size), float(
state.y_size) };
374 glm::vec2 screen_pos;
375 if(
state.map_state.map_to_screen(
state, map_pos, screen_size, screen_pos)) {
376 if(
state.x_drag_start <= int32_t(screen_pos.x)
377 && int32_t(screen_pos.x) <= x
378 &&
state.y_drag_start <= int32_t(screen_pos.y)
379 && int32_t(screen_pos.y) <= y
389 auto province =
state.world.army_get_location_from_army_location(a);
394 auto loc =
state.world.navy_get_location_from_navy_location(n);
395 if(loc.index() >=
state.province_definitions.first_sea_province.index()) {
412 for(
auto a :
state.world.nation_get_army_control(
state.local_player_nation)) {
413 if(!a.get_army().get_navy_from_army_transport() && !a.get_army().get_battle_from_army_battle_participation() && !a.get_army().get_is_retreating()) {
415 state.select(a.get_army());
420 for(
auto a :
state.world.nation_get_navy_control(
state.local_player_nation)) {
421 if(!a.get_navy().get_battle_from_navy_battle_participation() && !a.get_navy().get_is_retreating()) {
423 state.select(a.get_navy());
427 if(!
state.selected_armies.empty() && !
state.selected_navies.empty()) {
428 state.selected_navies.clear();
431 if(!
state.selected_armies.empty() || !
state.selected_navies.empty()) {
432 if(
state.ui_state.province_window) {
433 state.ui_state.province_window->set_visible(
state,
false);
434 state.map_state.set_selected_province(dcon::province_id{});
437 if(!
state.selected_armies.empty()) {
443 state.game_state_updated.store(
true, std::memory_order_release);
447 bool insignificant_movement =
448 std::abs(x -
state.x_drag_start) <= int32_t(std::ceil(
state.x_size * 0.0025))
449 && std::abs(y -
state.y_drag_start) <= int32_t(std::ceil(
state.x_size * 0.0025));
451 state.ui_state.scrollbar_timer = 0;
452 if(
state.ui_state.under_mouse !=
nullptr || !
state.drag_selecting) {
453 state.drag_selecting =
false;
455 }
else if(insignificant_movement) {
457 state.drag_selecting =
false;
461 state.game_state_updated.store(
true, std::memory_order_release);
464 state.drag_selecting =
false;
466 if(x <
state.x_drag_start)
468 if(y <
state.y_drag_start)
471 state.current_scene.drag_selection(
state, x, y, mod);
477 if(
state.user_settings.left_mouse_click_hold_and_release &&
state.ui_state.left_mouse_hold_target) {
483 if(!
state.ui_state.under_mouse && !
state.iui_state.over_ui) {
488 if(
state.user_settings.left_mouse_click_hold_and_release
489 &&
state.ui_state.left_mouse_hold_target
490 && !
state.current_scene.allow_drag_selection
495 state.ui_state.scrollbar_timer = 0;
501 if(!
state.ui_state.edit_target &&
state.user_settings.wasd_for_map_movement) {
524 return state.current_scene.keycode_mapping(
state, keycode, mod);
535 state.map_state.on_key_down(keycode, mod);
541 state.map_state.on_key_down(keycode, mod);
551 auto selected_group =
state.selected_army_group;
552 auto selected_province =
state.map_state.selected_province;
554 switch(
state.selected_army_group_order) {
558 state.toggle_designated_port(selected_group, selected_province);
561 state.toggle_enforce_control_position(selected_group, selected_province);
564 state.toggle_defensive_position(selected_group, selected_province);
572 auto selected_group =
state.selected_army_group;
573 auto selected_province =
state.map_state.selected_province;
580 if(!selected_group) {
583 state.deselect_army_group();
587 }
if(
state.map_state.selected_province) {
590 if(!selected_group) {
591 state.new_army_group(
state.map_state.selected_province);
593 }
else if(selected_group) {
595 state.toggle_designated_port(selected_group, selected_province);
597 state.toggle_defensive_position(selected_group, selected_province);
607 state.map_state.on_key_down(keycode, mod);
609 state.iui_state.over_ui =
false;
617 if(
state.ui_state.console_window->is_visible()) {
619 }
else if(!
state.selected_armies.empty() || !
state.selected_navies.empty()) {
621 state.game_state_updated.store(
true, std::memory_order::release);
628 if(
auto cap =
state.world.nation_get_capital(
nation); cap) {
631 state.map_state.center_map_on_province(
state, cap);
669 if(ctrl_group != 0) {
671 for(
const auto a :
state.selected_armies) {
672 auto& v =
state.ctrl_armies[ctrl_group];
673 auto it = std::find(v.begin(), v.end(), a);
681 for(
const auto n :
state.selected_navies) {
682 auto& v =
state.ctrl_navies[ctrl_group];
683 auto it = std::find(v.begin(), v.end(), n);
691 state.game_state_updated.store(
true, std::memory_order_release);
693 for(
const auto a :
state.ctrl_armies[ctrl_group]) {
696 for(
const auto n :
state.ctrl_navies[ctrl_group]) {
699 state.game_state_updated.store(
true, std::memory_order_release);
703 if(!
state.ui_state.topbar_subwindow->is_visible()) {
704 state.map_state.on_key_down(keycode, mod);
708 if(
state.ui_state.mouse_sensitive_target) {
709 state.ui_state.mouse_sensitive_target->set_visible(
state,
false);
710 state.ui_state.mouse_sensitive_target =
nullptr;
723 if(
state.ui_state.edit_target) {
724 state.ui_state.edit_target->impl_on_key_down(
state, keycode, mod);
726 state.current_scene.handle_hotkeys(
state, keycode, mod);
731 auto msg = std::string(message);
732 msg =
"{" + std::string(
state.network_state.nickname.to_string_view()) +
"} " + msg;
734 OutputDebugStringA(msg.c_str());
735 OutputDebugStringA(
"\n");
744 NATIVE(
"console_log.txt"),
760 if(
state.ui_state.units_root) {
761 state.ui_state.units_root->impl_render(
state, 0, 0);
766 if(
state.ui_state.unit_details_box &&
state.ui_state.unit_details_box->is_visible()) {
767 state.ui_state.unit_details_box->impl_render(
state,
state.ui_state.unit_details_box->base_data.position.x,
state.ui_state.unit_details_box->base_data.position.y);
781 if(
state.ui_state.tl_chat_list) {
782 state.ui_state.root->move_child_to_front(
state.ui_state.tl_chat_list);
785 if(!
state.ui_state.ctrl_held_down) {
786 if(
state.ui_state.rgos_root
790 state.ui_state.rgos_root->impl_render(
state, 0, 0);
796 state.ui_state.province_details_root->impl_render(
state, 0, 0);
806 float scaled_mouse_x =
state.mouse_x_position /
state.user_settings.ui_scale;
807 float scaled_mouse_y =
state.mouse_y_position /
state.user_settings.ui_scale;
808 float pos_x =
state.ui_state.unit_details_box->base_data.position.x;
809 float pos_y =
state.ui_state.unit_details_box->base_data.position.y;
811 return state.ui_state.unit_details_box->impl_probe_mouse(
813 int32_t(scaled_mouse_x - pos_x),
814 int32_t(scaled_mouse_y - pos_y),
820 float scaled_mouse_x =
state.mouse_x_position /
state.user_settings.ui_scale;
821 float scaled_mouse_y =
state.mouse_y_position /
state.user_settings.ui_scale;
823 return state.ui_state.units_root->impl_probe_mouse(
825 int32_t(scaled_mouse_x),
826 int32_t(scaled_mouse_y),
832 if(
state.ui_state.unit_details_box &&
state.ui_state.unit_details_box->is_visible()) {
844 if(!
state.ui_state.units_root ||
state.ui_state.ctrl_held_down) {
857 if(!
state.ui_state.military_root) {
861 float scaled_mouse_x =
state.mouse_x_position /
state.user_settings.ui_scale;
862 float scaled_mouse_y =
state.mouse_y_position /
state.user_settings.ui_scale;
864 return state.ui_state.military_root->impl_probe_mouse(
866 int32_t(scaled_mouse_x),
867 int32_t(scaled_mouse_y),
873 float scaled_mouse_x =
state.mouse_x_position /
state.user_settings.ui_scale;
874 float scaled_mouse_y =
state.mouse_y_position /
state.user_settings.ui_scale;
876 if(
state.ui_state.unit_details_box &&
state.ui_state.unit_details_box->is_visible()) {
877 float pos_x =
state.ui_state.unit_details_box->base_data.position.x;
878 float pos_y =
state.ui_state.unit_details_box->base_data.position.y;
880 tooltip_probe =
state.ui_state.unit_details_box->impl_probe_mouse(
state,
881 int32_t(scaled_mouse_x - pos_x),
882 int32_t(scaled_mouse_y - pos_y),
886 tooltip_probe =
state.ui_state.units_root->impl_probe_mouse(
888 int32_t(scaled_mouse_x),
889 int32_t(scaled_mouse_y),
893 return tooltip_probe;
897 if(!
state.ui_state.units_root ||
state.ui_state.ctrl_held_down) {
898 return tooltip_probe;
904 return tooltip_probe;
907 return tooltip_probe;
914 if(
state.selected_armies.size() == 1) {
915 if(!
state.world.army_is_valid(
state.selected_armies[0])) {
916 state.selected_armies.clear();
918 }
else if(
state.selected_navies.size() == 1) {
919 if(!
state.world.navy_is_valid(
state.selected_navies[0])) {
920 state.selected_navies.clear();
923 for(
auto i =
state.selected_armies.size(); i-- > 0; ) {
924 if(!
state.world.army_is_valid(
state.selected_armies[i]) ||
state.world.army_get_controller_from_army_control(
state.selected_armies[i]) !=
state.local_player_nation) {
925 state.selected_armies[i] =
state.selected_armies.back();
926 state.selected_armies.pop_back();
929 for(
auto i =
state.selected_navies.size(); i-- > 0; ) {
930 if(!
state.world.navy_is_valid(
state.selected_navies[i]) ||
state.world.navy_get_controller_from_navy_control(
state.selected_navies[i]) !=
state.local_player_nation) {
931 state.selected_navies[i] =
state.selected_navies.back();
932 state.selected_navies.pop_back();
939 if(
state.ui_state.change_leader_window &&
state.ui_state.change_leader_window->is_visible()) {
941 if(
state.ui_state.military_subwindow->is_visible() ==
false
942 && std::find(
state.selected_armies.begin(),
state.selected_armies.end(), win->
a) ==
state.selected_armies.end()
943 && std::find(
state.selected_navies.begin(),
state.selected_navies.end(), win->
v) ==
state.selected_navies.end()
945 state.ui_state.change_leader_window->set_visible(
state,
false);
950 for(
auto& v :
state.ctrl_armies) {
951 for(
auto i = v.size(); i-- > 0; ) {
952 if(!
state.world.army_is_valid(v[i]) ||
state.world.army_get_controller_from_army_control(v[i]) !=
state.local_player_nation) {
958 for(
auto& v :
state.ctrl_navies) {
959 for(
auto i = v.size(); i-- > 0; ) {
960 if(!
state.world.navy_is_valid(v[i]) ||
state.world.navy_get_controller_from_navy_control(v[i]) !=
state.local_player_nation) {
969 state.ui_state.army_group_window_land->set_visible(
state,
bool(
state.selected_army_group));
973 if(
state.selected_armies.size() +
state.selected_navies.size() > 1) {
974 state.ui_state.multi_unit_selection_window->set_visible(
state,
true);
975 state.ui_state.army_status_window->set_visible(
state,
false);
976 state.ui_state.navy_status_window->set_visible(
state,
false);
977 }
else if(
state.selected_armies.size() == 1) {
978 state.ui_state.multi_unit_selection_window->set_visible(
state,
false);
979 if(
state.ui_state.army_status_window->is_visible() &&
state.ui_state.army_status_window->unit_id !=
state.selected_armies[0]) {
980 state.ui_state.army_status_window->unit_id =
state.selected_armies[0];
981 state.ui_state.army_status_window->impl_on_update(
state);
983 state.ui_state.army_status_window->unit_id =
state.selected_armies[0];
984 state.ui_state.army_status_window->set_visible(
state,
true);
986 state.ui_state.navy_status_window->set_visible(
state,
false);
987 }
else if(
state.selected_navies.size() == 1) {
988 state.ui_state.multi_unit_selection_window->set_visible(
state,
false);
989 state.ui_state.army_status_window->set_visible(
state,
false);
990 if(
state.ui_state.navy_status_window->is_visible() &&
state.ui_state.navy_status_window->unit_id !=
state.selected_navies[0]) {
991 state.ui_state.navy_status_window->unit_id =
state.selected_navies[0];
992 state.ui_state.navy_status_window->impl_on_update(
state);
994 state.ui_state.navy_status_window->unit_id =
state.selected_navies[0];
995 state.ui_state.navy_status_window->set_visible(
state,
true);
998 state.ui_state.multi_unit_selection_window->set_visible(
state,
false);
999 state.ui_state.army_status_window->set_visible(
state,
false);
1000 state.ui_state.navy_status_window->set_visible(
state,
false);
1005 if(
state.ui_state.unit_details_box &&
state.ui_state.unit_details_box->is_visible()) {
1006 state.ui_state.unit_details_box->impl_on_update(
state);
1008 if(
state.ui_state.units_root) {
1009 state.ui_state.units_root->impl_on_update(
state);
1016 if(
state.ui_state.rgos_root) {
1017 state.ui_state.rgos_root->impl_on_update(
state);
1022 state.ui_state.province_details_root->impl_on_update(
state);
1027 if(
state.ui_state.army_combat_window &&
state.ui_state.army_combat_window->is_visible()) {
1030 state.ui_state.army_combat_window->set_visible(
state,
false);
1034 state.map_state.map_data.update_borders(
state);
1039 state.map_state.map_data.update_borders(
state);
1044 state.map_state.map_data.update_borders(
state);
1048 state.map_state.map_data.update_borders(
state);
1063 for(
const auto pc :
state.world.nation_get_province_ownership_as_nation(
state.local_player_nation)) {
1069 if(selected_province) {
1075 if(
state.selected_army_group) {
1077 for(
auto position :
state.world.automated_army_group_get_provinces_defend(
state.selected_army_group)) {
1081 for(
auto position :
state.world.automated_army_group_get_provinces_ferry_origin(
state.selected_army_group)) {
1085 for(
auto position :
state.world.automated_army_group_get_provinces_enforce_control(
state.selected_army_group)) {
1092 return state.ui_state.end_screen.get();
1096 return state.ui_state.nation_picker.get();
1100 return state.ui_state.root.get();
1104 return state.ui_state.military_root.get();
1108 return state.ui_state.army_group_selector_root.get();
1112 return state.ui_state.army_group_selector_root.get();
1116 return state.ui_state.economy_viewer_root.get();
1120 return state.ui_state.select_states_legend.get();
static void show_toggle(sys::state &state)
virtual message_result impl_set(sys::state &state, Cyto::Any &payload) noexcept
dcon::land_battle_id battle
#define assert(condition)
@ notify_player_picks_nation
std::vector< dcon::province_id > can_move_navy(sys::state &state, dcon::nation_id source, dcon::navy_id n, dcon::province_id dest)
bool can_notify_player_picks_nation(sys::state &state, dcon::nation_id source, dcon::nation_id target)
std::vector< dcon::province_id > can_move_army(sys::state &state, dcon::nation_id source, dcon::army_id a, dcon::province_id dest)
void update(sys::state &state)
bool navy_is_in_selection(sys::state &state, int32_t x, int32_t y, dcon::navy_id n)
void update_military_game_scene(sys::state &state)
void render_map_generic(sys::state &state)
void in_game_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
scene_properties nation_picker()
void select_wargoal_state_from_selected_province(sys::state &state)
bool belongs_on_map(sys::state &state, ui::element_base *checked_element)
void on_lbutton_up(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
void highlight_given_province(sys::state &state, std::vector< uint32_t > &data, dcon::province_id selected_province)
void handle_lbutton_down_map_interaction(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
ui::mouse_probe recalculate_mouse_probe_military(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
void switch_scene(sys::state &state, scene_id ui_scene)
void military_screen_on_lbutton_up(sys::state &state)
void on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
void update_ui_state_basic(sys::state &state)
void select_player_nation_from_selected_province(sys::state &state)
@ in_game_military_selector
void render_ui_ingame(sys::state &state)
void render_ui_military(sys::state &state)
void update_ui_unit_details(sys::state &state)
void handle_escape_basic(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
ui::element_base * root_game_economy_viewer(sys::state &state)
void highlight_defensive_positions(sys::state &state, std::vector< uint32_t > &data, dcon::province_id selected_province)
void do_nothing_screen(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
scene_properties basic_game()
ui::mouse_probe recalculate_mouse_probe_units(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
ui::element_base * root_end_screen(sys::state &state)
void highlight_player_nation(sys::state &state, std::vector< uint32_t > &data, dcon::province_id selected_province)
void on_rbutton_down_map(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
void console_log_other(sys::state &state, std::string_view message)
ui::element_base * root_game_basic(sys::state &state)
scene_properties state_wargoal_selector()
void open_chat_before_game(sys::state &state)
ui::element_base * root_game_wargoal_state_selection(sys::state &state)
void do_nothing_province_target(sys::state &state, dcon::nation_id nation, dcon::province_id target, sys::key_modifiers mod)
void stop_dragging(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
void render_units_info_box(sys::state &state)
void on_lbutton_up_ui_click_hold_and_release(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
void open_diplomacy(sys::state &state, dcon::nation_id nation, dcon::province_id target, sys::key_modifiers mod)
void generic_map_scene_update(sys::state &state)
void deselect_units(sys::state &state)
void update_add_units_game_scene(sys::state &state)
void clean_up_basic_game_scene(sys::state &state)
void clean_up_selected_armies_and_navies(sys::state &state)
scene_properties battleplan_editor_add_army()
void render_units(sys::state &state)
ui::mouse_probe recalculate_mouse_probe_identity(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
ui::mouse_probe recalculate_mouse_probe_units_details(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
void state_selector_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
void on_key_down(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
sys::virtual_key replace_keycodes_map_movement(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
sys::virtual_key replace_keycodes(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
void military_screen_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
void ui_lbutton(sys::state &state, sys::key_modifiers mod)
void handle_rbutton_down_map_interaction(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
void nation_picker_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
void render_ui_selection_screen(sys::state &state)
map::map_view get_view(sys::state &state)
bool province_port_is_in_selection(sys::state &state, int32_t x, int32_t y, dcon::province_id province)
bool army_is_in_selection(sys::state &state, int32_t x, int32_t y, dcon::army_id a)
void do_nothing(sys::state &state)
void do_nothing_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
void update_army_group_selection_ui(sys::state &state)
void start_dragging(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
scene_properties battleplan_editor()
void on_lbutton_down_map(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
void update_unit_selection_ui(sys::state &state)
ui::element_base * root_game_battleplanner(sys::state &state)
void center_on_capital(sys::state &state, dcon::nation_id nation)
ui::mouse_probe recalculate_mouse_probe_basic(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
void select_units(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
ui::element_base * root_game_battleplanner_add_army(sys::state &state)
ui::element_base * root_pick_nation(sys::state &state)
void on_lbutton_up_map(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
bool province_mid_point_is_in_selection(sys::state &state, int32_t x, int32_t y, dcon::province_id province)
float get_effects_volume(sys::state &state)
void open_chat_during_game(sys::state &state)
scene_properties end_screen()
void send_selected_province_to_province_window(sys::state &state)
ui::mouse_probe recalculate_mouse_probe_units_and_details(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
void handle_drag_stop(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
void economy_scene_update(sys::state &state)
void ui_rbutton(sys::state &state, sys::key_modifiers mod)
void update_basic_game_scene(sys::state &state)
ui::mouse_probe recalculate_tooltip_probe_basic(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
scene_properties economy_viewer_scene()
void selected_units_control(sys::state &state, dcon::nation_id nation, dcon::province_id target, sys::key_modifiers mod)
ui::mouse_probe recalculate_tooltip_probe_units_and_details(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
sys::virtual_key replace_keycodes_identity(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
ui::element_base * root_game_battleplanner_unit_selection(sys::state &state)
void economy_screen_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
void on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
void update_map_mode(sys::state &state)
void set_map_mode(sys::state &state, mode mode)
constexpr float zoom_close
constexpr float zoom_very_close
constexpr dcon::province_id from_map_id(uint16_t id)
constexpr uint16_t to_map_id(dcon::province_id id)
directory get_or_create_data_dumps_directory()
void append_file(directory const &dir, native_string_view file_name, char const *file_data, uint32_t file_size)
audio_instance & get_random_province_select_sound(sys::state &state)
audio_instance & get_navy_move_sound(sys::state &state)
void play_effect(sys::state &state, audio_instance &s, float volume)
audio_instance & get_navy_select_sound(sys::state &state)
audio_instance & get_army_select_sound(sys::state &state)
void play_interface_sound(sys::state &state, audio_instance &s, float volume)
audio_instance & get_error_sound(sys::state &state)
audio_instance & get_army_move_sound(sys::state &state)
NLOHMANN_BASIC_JSON_TPL_DECLARATION void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL &j1, nlohmann::NLOHMANN_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression, cppcoreguidelines-noexcept-swap, performance-noexcept-swap) is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
void open_chat_during_game(sys::state &state)
void open_chat_before_game(sys::state &state)
void close_expired_event_windows(sys::state &state)
constexpr float big_counter_cutoff
void show_main_menu_nation_picker(sys::state &state)
void show_main_menu_nation_basic(sys::state &state)
void open_chat_window(sys::state &state)
void change_cursor(sys::state &state, cursor_type type)
Holds important data about the game world, state, and other data regarding windowing,...
element_base * under_mouse