Project Alice
Loading...
Searching...
No Matches
game_scene.cpp
Go to the documentation of this file.
2#include "gui_unit_panel.hpp"
4#include "gui_land_combat.hpp"
5#include "gui_console.hpp"
6#include "gui_chat_window.hpp"
7#include "gui_event.hpp"
8#include "gui_map_icons.hpp"
9
10
11namespace game_scene {
12
14 /*
15 if (state.ui_state.end_screen)
16 state.ui_state.end_screen->set_visible(state, false);
17 if(state.ui_state.nation_picker)
18 state.ui_state.nation_picker->set_visible(state, false);
19 if(state.ui_state.root)
20 state.ui_state.root->set_visible(state, false);
21 if(state.ui_state.select_states_legend)
22 state.ui_state.select_states_legend->set_visible(state, false);
23 if(state.ui_state.military_root)
24 state.ui_state.military_root->set_visible(state, false);
25
26 state.get_root_element()->set_visible(state, true);
27 */
28
29 switch(ui_scene) {
31 state.current_scene = state_wargoal_selector();
32
33 state.stored_map_mode = state.map_state.active_map_mode;
35 state.map_state.set_selected_province(dcon::province_id{});
36
37 return;
38
40 if(state.current_scene.id == scene_id::in_game_state_selector) {
41 state.state_selection.reset();
42 map_mode::set_map_mode(state, state.stored_map_mode);
43 }
44
45 state.current_scene = basic_game();
46
47 return;
48
50 state.current_scene = battleplan_editor();
51
52 return;
53
55 state.current_scene = end_screen();
56
57 return;
58
60 state.current_scene = nation_picker();
61
62 return;
63
65 state.current_scene = battleplan_editor_add_army();
66
67 return;
68 case scene_id::count: // this should never happen
69 assert(false);
70 return;
71 }
72
73 state.game_state_updated.store(true, std::memory_order_release);
74}
75
77 dcon::nation_id nation,
78 dcon::province_id target,
79 sys::key_modifiers mod) { }
81void do_nothing_screen(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) { }
82
84 while(checked_element != nullptr) {
85 if(checked_element == state.ui_state.units_root.get())
86 return true;
87 if(checked_element == state.ui_state.unit_details_box.get())
88 return true;
89 checked_element = checked_element->parent;
90 }
91 return false;
92}
93
95 auto current_view = map::map_view::globe;
96 if(state.user_settings.map_is_globe == sys::projection_mode::flat) {
97 current_view = map::map_view::flat;
98 } else if(state.user_settings.map_is_globe == sys::projection_mode::globe_perpect) {
99 current_view = map::map_view::globe_perspect;
100 }
101
102 return current_view;
103}
104
106 return state.user_settings.effects_volume * state.user_settings.master_volume;
107}
108
111 dcon::nation_id nation,
112 dcon::province_id target,
114) {
115 bool fail = false;
116 bool army_play = false;
117 //as opposed to queueing
118 bool reset_orders = (uint8_t(mod) & uint8_t(sys::key_modifiers::modifiers_shift)) == 0;
119 float volume = get_effects_volume(state);
120
121 for(auto a : state.selected_armies) {
122 if(command::can_move_army(state, nation, a, target).empty()) {
123 fail = true;
124 } else {
125 command::move_army(state, nation, a, target, reset_orders);
126 army_play = true;
127 }
128 }
129 for(auto a : state.selected_navies) {
130 if(command::can_move_navy(state, nation, a, target).empty()) {
131 fail = true;
132 } else {
133 command::move_navy(state, nation, a, target, reset_orders);
134 }
135 }
136
137 if(!fail) {
138 if(army_play) {
140 } else {
142 }
143 } else {
145 }
146}
147
150 dcon::nation_id nation,
151 dcon::province_id target,
153) {
154 auto owner = state.world.province_get_nation_from_province_ownership(target);
155 if(owner) {
156 state.open_diplomacy(owner);
157 } else {
158 state.open_diplomacy(nation);
159 }
160}
161
163 auto owner = state.world.province_get_nation_from_province_ownership(state.map_state.selected_province);
164 if(owner) {
165 // On single player we simply set the local player nation
166 // on multiplayer we wait until we get a confirmation that we are
167 // allowed to pick the specified nation as no two players can get on
168 // a nation, at the moment
169 // TODO: Allow Co-op
170 if(state.network_mode == sys::network_mode_type::single_player) {
171 state.world.nation_set_is_player_controlled(state.local_player_nation, false);
172 state.local_player_nation = owner;
173 state.world.nation_set_is_player_controlled(state.local_player_nation, true);
174 if(state.ui_state.nation_picker) {
175 state.ui_state.nation_picker->impl_on_update(state);
176 }
177 } else if(command::can_notify_player_picks_nation(state, state.local_player_nation, owner)) {
178 command::notify_player_picks_nation(state, state.local_player_nation, owner);
179 }
180 }
181}
182
184 auto prov = state.map_state.selected_province;
185 auto sdef = state.world.province_get_state_from_abstract_state_membership(prov);
186 state.state_select(sdef);
187}
188
190 if(state.ui_state.province_window) {
191 static_cast<ui::province_view_window*>(state.ui_state.province_window)->set_active_province(state, state.map_state.selected_province);
192 }
193}
194
195void start_dragging(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
196 state.x_drag_start = x;
197 state.y_drag_start = y;
198 state.drag_selecting = true;
200}
201
202void stop_dragging(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
203 state.is_dragging = false;
204 if(state.ui_state.drag_target) {
205 state.on_drag_finished(x, y, mod);
206 }
207}
208
210 state.map_state.render(state, state.x_size, state.y_size);
211}
212
214 state.ui_state.under_mouse->impl_on_rbutton_down(
215 state,
216 state.ui_state.relative_mouse_location.x,
217 state.ui_state.relative_mouse_location.y,
218 mod
219 );
220}
222 state.ui_state.under_mouse->impl_on_lbutton_down(
223 state,
224 state.ui_state.relative_mouse_location.x,
225 state.ui_state.relative_mouse_location.y,
226 mod
227 );
228 state.ui_state.left_mouse_hold_target = state.ui_state.under_mouse;
229}
230
231void on_rbutton_down_map(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
232 state.map_state.on_rbutton_down(state, x, y, state.x_size, state.y_size, mod);
233}
234
235void on_lbutton_down_map(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
236 state.map_state.on_lbutton_down(state, x, y, state.x_size, state.y_size, mod);
237}
238
239void on_lbutton_up_map(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
240 state.map_state.on_lbutton_up(state, x, y, state.x_size, state.y_size, mod);
241}
242
244 auto current_view = get_view(state);
245 auto mouse_pos = glm::vec2(x, y);
246 auto screen_size = glm::vec2(state.x_size, state.y_size);
247 glm::vec2 map_pos;
248 if(!state.map_state.screen_to_map(mouse_pos, screen_size, current_view, map_pos)) {
249 return;
250 }
251 map_pos *= glm::vec2(float(state.map_state.map_data.size_x), float(state.map_state.map_data.size_y));
252 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);
253
254 if(0 <= idx && size_t(idx) < state.map_state.map_data.province_id_map.size()) {
256 auto id = province::from_map_id(state.map_state.map_data.province_id_map[idx]);
257
258 if(state.selected_armies.size() > 0 || state.selected_navies.size() > 0) {
259 state.current_scene.rbutton_selected_units(state, state.local_player_nation, id, mod);
260 } else {
261 state.current_scene.rbutton_province(state, state.local_player_nation, id, mod);
262 }
263 }
264
265 on_rbutton_down_map(state, x, y, mod);
266}
267
269 on_lbutton_down_map(state, x, y, mod);
270 state.current_scene.on_drag_start(state, x, y, mod);
271}
272
273void on_rbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
274 // Lose focus on text
275 state.ui_state.edit_target = nullptr;
276
277 bool under_mouse_belongs_on_map = belongs_on_map(state, state.ui_state.under_mouse);
278
279 //if we clicked on UI element, handle it
280 if(state.ui_state.under_mouse != nullptr && !under_mouse_belongs_on_map) {
281 ui_rbutton(state, mod);
282 return;
283 }
284 // otherwise, we clicked on the map and need to handle map clicking logic;
286}
287
288void on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
289 // Lose focus on text
290 state.ui_state.edit_target = nullptr;
291
292 if(state.ui_state.under_mouse != nullptr) {
293 ui_lbutton(state, mod);
294 return;
295 }
296
298}
299
301 auto rel_x = state.ui_state.relative_mouse_location.x;
302 auto rel_y = state.ui_state.relative_mouse_location.y;
303
304 bool mouse_over_target = state.ui_state.under_mouse == state.ui_state.left_mouse_hold_target;
305
306 if(!state.current_scene.allow_drag_selection) {
307 if(mouse_over_target) {
308 state.ui_state.under_mouse->impl_on_lbutton_up(state, rel_x, rel_y, mod, true);
309 } else {
310 state.ui_state.left_mouse_hold_target->impl_on_lbutton_up(state, rel_x, rel_y, mod, false);
311 }
312 } else {
313 if(mouse_over_target) {
314 state.ui_state.left_mouse_hold_target = nullptr;
315 state.ui_state.under_mouse->impl_on_lbutton_up(state, rel_x, rel_y, mod, true);
316 } else if(!mouse_over_target && !state.drag_selecting) {
317 state.ui_state.left_mouse_hold_target->impl_on_lbutton_up(state, rel_x, rel_y, mod, false);
318 ui::element_base* temp_hold_target = state.ui_state.left_mouse_hold_target;
319 state.ui_state.left_mouse_hold_target = nullptr;
320 if(state.ui_state.scrollbar_continuous_movement) {
322 temp_hold_target->impl_set(state, payload);
323 state.ui_state.scrollbar_continuous_movement = false;
324 }
325 }
326 }
327}
328
330 state.selected_armies.clear();
331 state.selected_navies.clear();
332}
333
334bool province_mid_point_is_in_selection(sys::state& state, int32_t x, int32_t y, dcon::province_id province) {
335 auto mid_point = state.world.province_get_mid_point(province);
336 auto map_pos = state.map_state.normalize_map_coord(mid_point);
337 auto screen_size = glm::vec2{ float(state.x_size), float(state.y_size) };
338 glm::vec2 screen_pos;
339 if(state.map_state.map_to_screen(state, map_pos, screen_size, screen_pos)) {
340 if(state.x_drag_start <= int32_t(screen_pos.x) && int32_t(screen_pos.x) <= x
341 && state.y_drag_start <= int32_t(screen_pos.y) && int32_t(screen_pos.y) <= y) {
342 return true;
343 }
344 }
345 return false;
346}
347
348bool province_port_is_in_selection(sys::state& state, int32_t x, int32_t y, dcon::province_id province) {
349 auto port_to = state.world.province_get_port_to(province);
350 auto adj = state.world.get_province_adjacency_by_province_pair(province, port_to);
351 if(adj) {
352 auto id = adj.index();
353 auto& border = state.map_state.map_data.borders[id];
354 auto& vertex = state.map_state.map_data.border_vertices[border.start_index + border.count / 2];
355
356 auto map_x = vertex.position.x;
357 auto map_y = vertex.position.y;
358
359 glm::vec2 map_pos(map_x, 1.0f - map_y);
360 auto screen_size = glm::vec2{ float(state.x_size), float(state.y_size) };
361 glm::vec2 screen_pos;
362 if(state.map_state.map_to_screen(state, map_pos, screen_size, screen_pos)) {
363 if(state.x_drag_start <= int32_t(screen_pos.x)
364 && int32_t(screen_pos.x) <= x
365 && state.y_drag_start <= int32_t(screen_pos.y)
366 && int32_t(screen_pos.y) <= y
367 ) {
368 return true;
369 }
370 }
371 }
372 return false;
373}
374
375bool army_is_in_selection(sys::state& state, int32_t x, int32_t y, dcon::army_id a) {
376 auto province = state.world.army_get_location_from_army_location(a);
378}
379
380bool navy_is_in_selection(sys::state& state, int32_t x, int32_t y, dcon::navy_id n) {
381 auto loc = state.world.navy_get_location_from_navy_location(n);
382 if(loc.index() >= state.province_definitions.first_sea_province.index()) {
384 return true;
385 }
386 } else {
387 if(province_port_is_in_selection(state, x, y, loc)) {
388 return true;
389 }
390 }
391 return false;
392}
393
394void select_units(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
395 if((int32_t(sys::key_modifiers::modifiers_shift) & int32_t(mod)) == 0) {
397 }
398 if((int32_t(sys::key_modifiers::modifiers_ctrl) & int32_t(mod)) == 0) {
399 for(auto a : state.world.nation_get_army_control(state.local_player_nation)) {
400 if(!a.get_army().get_navy_from_army_transport() && !a.get_army().get_battle_from_army_battle_participation() && !a.get_army().get_is_retreating()) {
401 if(army_is_in_selection(state, x, y, a.get_army())) {
402 state.select(a.get_army());
403 }
404 }
405 }
406 }
407 for(auto a : state.world.nation_get_navy_control(state.local_player_nation)) {
408 if(!a.get_navy().get_battle_from_navy_battle_participation() && !a.get_navy().get_is_retreating()) {
409 if(navy_is_in_selection(state, x, y, a.get_navy())) {
410 state.select(a.get_navy());
411 }
412 }
413 }
414 if(!state.selected_armies.empty() && !state.selected_navies.empty()) {
415 state.selected_navies.clear();
416 }
417 // Hide province upon selecting multiple armies / navies :)
418 if(!state.selected_armies.empty() || !state.selected_navies.empty()) {
419 if(state.ui_state.province_window) {
420 state.ui_state.province_window->set_visible(state, false);
421 state.map_state.set_selected_province(dcon::province_id{}); //ensure we deselect from map too
422 }
423 // Play selection sound effect
424 if(!state.selected_armies.empty()) {
426 } else {
428 }
429 }
430 state.game_state_updated.store(true, std::memory_order_release);
431}
432
433void handle_drag_stop(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
434 bool insignificant_movement =
435 std::abs(x - state.x_drag_start) <= int32_t(std::ceil(state.x_size * 0.0025))
436 && std::abs(y - state.y_drag_start) <= int32_t(std::ceil(state.x_size * 0.0025));
437
438 state.ui_state.scrollbar_timer = 0;
439 if(state.ui_state.under_mouse != nullptr || !state.drag_selecting) {
440 state.drag_selecting = false;
442 } else if(insignificant_movement) {
443 // we assume that user wanted to click
444 state.drag_selecting = false;
448 state.game_state_updated.store(true, std::memory_order_release);
449 } else {
450 // stop dragging and select units
451 state.drag_selecting = false;
453 if(x < state.x_drag_start)
454 std::swap(x, state.x_drag_start);
455 if(y < state.y_drag_start)
456 std::swap(y, state.y_drag_start);
457
458 state.current_scene.drag_selection(state, x, y, mod);
459 }
460}
461
462void on_lbutton_up(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mod) {
463 stop_dragging(state, x, y, mod);
464 if(state.user_settings.left_mouse_click_hold_and_release && state.ui_state.left_mouse_hold_target) {
466 }
467
468 on_lbutton_up_map(state, x, y, mod);
469
470 if(!state.ui_state.under_mouse) {
471 state.current_scene.lbutton_up(state);
472 }
473
474 // if we were holding some "button" and this scene doesn't allow drag selection, then we can safely return
475 if(state.user_settings.left_mouse_click_hold_and_release
476 && state.ui_state.left_mouse_hold_target
477 && !state.current_scene.allow_drag_selection
478 ) {
479 return;
480 }
481
482 state.ui_state.scrollbar_timer = 0;
483 handle_drag_stop(state, x, y, mod);
484}
485
487 //Emulating autohotkey
488 if(!state.ui_state.edit_target && state.user_settings.wasd_for_map_movement) {
489 if(keycode == sys::virtual_key::W)
491 else if(keycode == sys::virtual_key::A)
493 else if(keycode == sys::virtual_key::S)
495 else if(keycode == sys::virtual_key::D)
497 }
498 return keycode;
499}
500
502 return keycode;
503}
504
506 if(keycode == sys::virtual_key::MINUS)
508 else if(keycode == sys::virtual_key::PLUS)
510
511 return state.current_scene.keycode_mapping(state, keycode, mod);
512}
513
514
516 if(state.ui_state.nation_picker->impl_on_key_down(state, keycode, mod) != ui::message_result::consumed) {
517 if(keycode == sys::virtual_key::ESCAPE) {
519 } else if(keycode == sys::virtual_key::TAB) {
521 }
522 state.map_state.on_key_down(keycode, mod);
523 }
524}
525
527 if(state.ui_state.select_states_legend->impl_on_key_down(state, keycode, mod) != ui::message_result::consumed) {
528 state.map_state.on_key_down(keycode, mod);
529 if(keycode == sys::virtual_key::ESCAPE) {
530 state.state_selection->on_cancel(state);
532 state.ui_state.root->impl_on_update(state);
533 }
534 }
535}
536
538 auto selected_group = state.selected_army_group;
539 auto selected_province = state.map_state.selected_province;
540
541 switch(state.selected_army_group_order) {
543 return;
545 state.toggle_designated_port(selected_group, selected_province);
546 return;
548 state.toggle_enforce_control_position(selected_group, selected_province);
549 return;
551 state.toggle_defensive_position(selected_group, selected_province);
552 return;
553 default:
554 break;
555 }
556}
557
559 auto selected_group = state.selected_army_group;
560 auto selected_province = state.map_state.selected_province;
561
562 if(state.ui_state.root->impl_on_key_down(state, keycode, mod) != ui::message_result::consumed) {
563 if(keycode == sys::virtual_key::ESCAPE) {
564 if(state.selected_army_group_order != sys::army_group_order::none) {
565 state.selected_army_group_order = sys::army_group_order::none;
566 } else {
567 if(!selected_group) {
569 } else {
570 state.deselect_army_group();
571 }
572 }
573 }
574 } if(state.map_state.selected_province) {
575 if(keycode == sys::virtual_key::Z) {
576 //create HQ
577 if(!selected_group) {
578 state.new_army_group(state.map_state.selected_province);
579 }
580 } else if(selected_group) {
581 if(keycode == sys::virtual_key::X) {
582 state.toggle_designated_port(selected_group, selected_province);
583 } else if(keycode == sys::virtual_key::V) {
584 state.toggle_defensive_position(selected_group, selected_province);
585 } else if(keycode == sys::virtual_key::N) {
587 }
588 }
589 }
590}
591
593 if(state.ui_state.console_window->is_visible()) {
595 } else if(!state.selected_armies.empty() || !state.selected_navies.empty()) {
597 state.game_state_updated.store(true, std::memory_order::release);
598 } else {
600 }
601}
602
603void center_on_capital(sys::state& state, dcon::nation_id nation) {
604 if(auto cap = state.world.nation_get_capital(nation); cap) {
605 if(state.map_state.get_zoom() < map::zoom_very_close)
606 state.map_state.zoom = map::zoom_very_close;
607 state.map_state.center_map_on_province(state, cap);
608 }
609}
610
612 if(state.ui_state.root->impl_on_key_down(state, keycode, mod) != ui::message_result::consumed) {
613 uint32_t ctrl_group = 0;
614 if(keycode == sys::virtual_key::ESCAPE) {
615 handle_escape_basic(state, keycode, mod);
616 } else if(keycode == sys::virtual_key::TILDA || keycode == sys::virtual_key::BACK_SLASH) {
618 } else if(keycode == sys::virtual_key::HOME) {
619 center_on_capital(state, state.local_player_nation);
620 } else if(keycode == sys::virtual_key::TAB) {
622 } else if(keycode == sys::virtual_key::Z && state.ui_state.ctrl_held_down) {
624 } else if(keycode == sys::virtual_key::NUMPAD1 || keycode == sys::virtual_key::NUM_1) {
625 ctrl_group = 1;
626 } else if(keycode == sys::virtual_key::NUMPAD2 || keycode == sys::virtual_key::NUM_2) {
627 ctrl_group = 2;
628 } else if(keycode == sys::virtual_key::NUMPAD3 || keycode == sys::virtual_key::NUM_3) {
629 ctrl_group = 3;
630 } else if(keycode == sys::virtual_key::NUMPAD4 || keycode == sys::virtual_key::NUM_4) {
631 ctrl_group = 4;
632 } else if(keycode == sys::virtual_key::NUMPAD5 || keycode == sys::virtual_key::NUM_5) {
633 ctrl_group = 5;
634 } else if(keycode == sys::virtual_key::NUMPAD6 || keycode == sys::virtual_key::NUM_6) {
635 ctrl_group = 6;
636 } else if(keycode == sys::virtual_key::NUMPAD7 || keycode == sys::virtual_key::NUM_7) {
637 ctrl_group = 7;
638 } else if(keycode == sys::virtual_key::NUMPAD8 || keycode == sys::virtual_key::NUM_8) {
639 ctrl_group = 8;
640 } else if(keycode == sys::virtual_key::NUMPAD9 || keycode == sys::virtual_key::NUM_9) {
641 ctrl_group = 9;
642 }
643 if(ctrl_group != 0) {
645 for(const auto a : state.selected_armies) {
646 auto& v = state.ctrl_armies[ctrl_group];
647 auto it = std::find(v.begin(), v.end(), a);
648 if(it != v.end()) {
649 *it = v.back();
650 v.pop_back();
651 } else {
652 v.push_back(a);
653 }
654 }
655 for(const auto n : state.selected_navies) {
656 auto& v = state.ctrl_navies[ctrl_group];
657 auto it = std::find(v.begin(), v.end(), n);
658 if(it != v.end()) {
659 *it = v.back();
660 v.pop_back();
661 } else {
662 v.push_back(n);
663 }
664 }
665 state.game_state_updated.store(true, std::memory_order_release);
666 } else { //shift to append
667 for(const auto a : state.ctrl_armies[ctrl_group]) {
668 state.select(a);
669 }
670 for(const auto n : state.ctrl_navies[ctrl_group]) {
671 state.select(n);
672 }
673 state.game_state_updated.store(true, std::memory_order_release);
674 }
675 }
676
677 if(!state.ui_state.topbar_subwindow->is_visible()) {
678 state.map_state.on_key_down(keycode, mod);
679 }
680
681 if(keycode == sys::virtual_key::LEFT || keycode == sys::virtual_key::RIGHT || keycode == sys::virtual_key::UP || keycode == sys::virtual_key::DOWN) {
682 if(state.ui_state.mouse_sensitive_target) {
683 state.ui_state.mouse_sensitive_target->set_visible(state, false);
684 state.ui_state.mouse_sensitive_target = nullptr;
685 }
686 }
687 }
688}
689
691 return;
692}
693
694
696 keycode = replace_keycodes(state, keycode, mod);
697 if(state.ui_state.edit_target) {
698 state.ui_state.edit_target->impl_on_key_down(state, keycode, mod);
699 } else {
700 state.current_scene.handle_hotkeys(state, keycode, mod);
701 }
702}
703
704void console_log_pick_nation(sys::state& state, std::string_view message) {
705 if(state.ui_state.console_window_r != nullptr) {
706 Cyto::Any payload = std::string(message);
707 state.ui_state.console_window_r->impl_get(state, payload);
708 if(true && !(state.ui_state.console_window_r->is_visible())) {
709 state.ui_state.nation_picker->move_child_to_front(state.ui_state.console_window_r);
710 state.ui_state.console_window_r->set_visible(state, true);
711 }
712 }
713}
714
715void console_log_other(sys::state& state, std::string_view message) {
716 if(state.ui_state.console_window != nullptr) {
717 Cyto::Any payload = std::string(message);
718 state.ui_state.console_window->impl_get(state, payload);
719 if(true && !(state.ui_state.console_window->is_visible())) {
720 state.ui_state.root->move_child_to_front(state.ui_state.console_window);
721 state.ui_state.console_window->set_visible(state, true);
722 }
723 }
724}
725
726
728 if(state.ui_state.units_root) {
729 state.ui_state.units_root->impl_render(state, 0, 0);
730 }
731}
732
734 if(state.ui_state.unit_details_box && state.ui_state.unit_details_box->is_visible()) {
735 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);
736 }
737}
738
741}
742
746}
747
749 if(state.ui_state.tl_chat_list) {
750 state.ui_state.root->move_child_to_front(state.ui_state.tl_chat_list);
751 }
752 if(state.map_state.get_zoom() > map::zoom_close) {
753 if(!state.ui_state.ctrl_held_down) {
754 if(state.ui_state.rgos_root
755 && (state.map_state.active_map_mode == map_mode::mode::rgo_output
756 || state.map_state.active_map_mode == map_mode::mode::infrastructure
757 || state.map_state.active_map_mode == map_mode::mode::naval)) {
758 state.ui_state.rgos_root->impl_render(state, 0, 0);
759 } else {
762 }
763 } else if(state.map_state.get_zoom() >= ui::big_counter_cutoff && state.ui_state.province_details_root) {
764 state.ui_state.province_details_root->impl_render(state, 0, 0);
765 }
766 }
767}
768
770 return mouse_probe;
771}
772
774 float scaled_mouse_x = state.mouse_x_position / state.user_settings.ui_scale;
775 float scaled_mouse_y = state.mouse_y_position / state.user_settings.ui_scale;
776 float pos_x = state.ui_state.unit_details_box->base_data.position.x;
777 float pos_y = state.ui_state.unit_details_box->base_data.position.y;
778
779 return state.ui_state.unit_details_box->impl_probe_mouse(
780 state,
781 int32_t(scaled_mouse_x - pos_x),
782 int32_t(scaled_mouse_y - pos_y),
784 );
785}
786
788 float scaled_mouse_x = state.mouse_x_position / state.user_settings.ui_scale;
789 float scaled_mouse_y = state.mouse_y_position / state.user_settings.ui_scale;
790
791 return state.ui_state.units_root->impl_probe_mouse(
792 state,
793 int32_t(scaled_mouse_x),
794 int32_t(scaled_mouse_y),
796 );
797}
798
800 if(state.ui_state.unit_details_box && state.ui_state.unit_details_box->is_visible()) {
801 mouse_probe = recalculate_mouse_probe_units_details(state, mouse_probe, tooltip_probe);
802 }
803 if(!mouse_probe.under_mouse) {
804 mouse_probe = recalculate_mouse_probe_units(state, mouse_probe, tooltip_probe);
805 }
806
807 return mouse_probe;
808}
809
810
812 if(!state.ui_state.units_root || state.ui_state.ctrl_held_down) {
813 return mouse_probe;
814 }
815 if(state.map_state.active_map_mode == map_mode::mode::rgo_output
816 || state.map_state.active_map_mode == map_mode::mode::infrastructure
817 || state.map_state.active_map_mode == map_mode::mode::naval) {
818 // RGO doesn't need clicks... yet
819 return mouse_probe;
820 }
821 return recalculate_mouse_probe_units_and_details(state, mouse_probe, tooltip_probe);
822}
823
825 if(!state.ui_state.military_root) {
826 return mouse_probe;
827 }
828
829 float scaled_mouse_x = state.mouse_x_position / state.user_settings.ui_scale;
830 float scaled_mouse_y = state.mouse_y_position / state.user_settings.ui_scale;
831
832 return state.ui_state.military_root->impl_probe_mouse(
833 state,
834 int32_t(scaled_mouse_x),
835 int32_t(scaled_mouse_y),
837 );
838}
839
841 float scaled_mouse_x = state.mouse_x_position / state.user_settings.ui_scale;
842 float scaled_mouse_y = state.mouse_y_position / state.user_settings.ui_scale;
843 float pos_x = state.ui_state.unit_details_box->base_data.position.x;
844 float pos_y = state.ui_state.unit_details_box->base_data.position.y;
845
846 if(state.ui_state.unit_details_box && state.ui_state.unit_details_box->is_visible()) {
847 tooltip_probe = state.ui_state.unit_details_box->impl_probe_mouse(state,
848 int32_t(scaled_mouse_x - pos_x),
849 int32_t(scaled_mouse_y - pos_y),
851 }
852 if(!tooltip_probe.under_mouse) {
853 tooltip_probe = state.ui_state.units_root->impl_probe_mouse(
854 state,
855 int32_t(scaled_mouse_x),
856 int32_t(scaled_mouse_y),
858 }
859
860 return tooltip_probe;
861}
862
864 if(!state.ui_state.units_root || state.ui_state.ctrl_held_down) {
865 return tooltip_probe;
866 }
867 if(state.map_state.active_map_mode == map_mode::mode::rgo_output
868 || state.map_state.active_map_mode == map_mode::mode::infrastructure
869 || state.map_state.active_map_mode == map_mode::mode::naval) {
870 // RGO doesn't need clicks... yet
871 return tooltip_probe;
872 }
873 if(tooltip_probe.under_mouse) {
874 return tooltip_probe;
875 }
876 return recalculate_tooltip_probe_units_and_details(state, mouse_probe, tooltip_probe);
877}
878
880 // Allow player to select single enemy army or enemy navy to view them
881 if(state.selected_armies.size() == 1) {
882 if(!state.world.army_is_valid(state.selected_armies[0])) {
883 state.selected_armies.clear();
884 }
885 } else if(state.selected_navies.size() == 1) {
886 if(!state.world.navy_is_valid(state.selected_navies[0])) {
887 state.selected_navies.clear();
888 }
889 } else {
890 for(auto i = state.selected_armies.size(); i-- > 0; ) {
891 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) {
892 state.selected_armies[i] = state.selected_armies.back();
893 state.selected_armies.pop_back();
894 }
895 }
896 for(auto i = state.selected_navies.size(); i-- > 0; ) {
897 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) {
898 state.selected_navies[i] = state.selected_navies.back();
899 state.selected_navies.pop_back();
900 }
901 }
902 }
903}
904
906 if(state.ui_state.change_leader_window && state.ui_state.change_leader_window->is_visible()) {
907 ui::leader_selection_window* win = static_cast<ui::leader_selection_window*>(state.ui_state.change_leader_window);
908 if(state.ui_state.military_subwindow->is_visible() == false
909 && std::find(state.selected_armies.begin(), state.selected_armies.end(), win->a) == state.selected_armies.end()
910 && std::find(state.selected_navies.begin(), state.selected_navies.end(), win->v) == state.selected_navies.end()
911 ) {
912 state.ui_state.change_leader_window->set_visible(state, false);
913 }
914 }
916 // clear up control groups too
917 for(auto& v : state.ctrl_armies) {
918 for(auto i = v.size(); i-- > 0; ) {
919 if(!state.world.army_is_valid(v[i]) || state.world.army_get_controller_from_army_control(v[i]) != state.local_player_nation) {
920 v[i] = v.back();
921 v.pop_back();
922 }
923 }
924 }
925 for(auto& v : state.ctrl_navies) {
926 for(auto i = v.size(); i-- > 0; ) {
927 if(!state.world.navy_is_valid(v[i]) || state.world.navy_get_controller_from_navy_control(v[i]) != state.local_player_nation) {
928 v[i] = v.back();
929 v.pop_back();
930 }
931 }
932 }
933}
934
936 state.ui_state.army_group_window_land->set_visible(state, bool(state.selected_army_group));
937}
938
940 if(state.selected_armies.size() + state.selected_navies.size() > 1) {
941 state.ui_state.multi_unit_selection_window->set_visible(state, true);
942 state.ui_state.army_status_window->set_visible(state, false);
943 state.ui_state.navy_status_window->set_visible(state, false);
944 } else if(state.selected_armies.size() == 1) {
945 state.ui_state.multi_unit_selection_window->set_visible(state, false);
946 if(state.ui_state.army_status_window->is_visible() && state.ui_state.army_status_window->unit_id != state.selected_armies[0]) {
947 state.ui_state.army_status_window->unit_id = state.selected_armies[0];
948 state.ui_state.army_status_window->impl_on_update(state);
949 } else {
950 state.ui_state.army_status_window->unit_id = state.selected_armies[0];
951 state.ui_state.army_status_window->set_visible(state, true);
952 }
953 state.ui_state.navy_status_window->set_visible(state, false);
954 } else if(state.selected_navies.size() == 1) {
955 state.ui_state.multi_unit_selection_window->set_visible(state, false);
956 state.ui_state.army_status_window->set_visible(state, false);
957 if(state.ui_state.navy_status_window->is_visible() && state.ui_state.navy_status_window->unit_id != state.selected_navies[0]) {
958 state.ui_state.navy_status_window->unit_id = state.selected_navies[0];
959 state.ui_state.navy_status_window->impl_on_update(state);
960 } else {
961 state.ui_state.navy_status_window->unit_id = state.selected_navies[0];
962 state.ui_state.navy_status_window->set_visible(state, true);
963 }
964 } else {
965 state.ui_state.multi_unit_selection_window->set_visible(state, false);
966 state.ui_state.army_status_window->set_visible(state, false);
967 state.ui_state.navy_status_window->set_visible(state, false);
968 }
969}
970
972 if(state.ui_state.unit_details_box && state.ui_state.unit_details_box->is_visible()) {
973 state.ui_state.unit_details_box->impl_on_update(state);
974 }
975 if(state.ui_state.units_root) {
976 state.ui_state.units_root->impl_on_update(state);
977 }
978}
979
983 if(state.ui_state.rgos_root) {
984 state.ui_state.rgos_root->impl_on_update(state);
985 }
987
988 if(state.ui_state.ctrl_held_down && state.map_state.get_zoom() >= ui::big_counter_cutoff && state.ui_state.province_details_root) {
989 state.ui_state.province_details_root->impl_on_update(state);
990 }
991}
992
994 if(state.ui_state.army_combat_window && state.ui_state.army_combat_window->is_visible()) {
995 ui::land_combat_window* win = static_cast<ui::land_combat_window*>(state.ui_state.army_combat_window);
996 if(win->battle && !state.world.land_battle_is_valid(win->battle)) {
997 state.ui_state.army_combat_window->set_visible(state, false);
998 }
999 }
1001 state.map_state.map_data.update_borders(state);
1002}
1003
1006 state.map_state.map_data.update_borders(state);
1007}
1008
1011 state.map_state.map_data.update_borders(state);
1012}
1013
1015 state.map_state.map_data.update_borders(state);
1016}
1017
1020}
1023}
1024
1025void highlight_player_nation(sys::state& state, std::vector<uint32_t>& data, dcon::province_id selected_province) {
1026 for(const auto pc : state.world.nation_get_province_ownership_as_nation(state.local_player_nation)) {
1027 data[province::to_map_id(pc.get_province())] = 0x2B2B2B2B;
1028 }
1029}
1030
1031void highlight_given_province(sys::state& state, std::vector<uint32_t>& data, dcon::province_id selected_province) {
1032 if(selected_province) {
1033 data[province::to_map_id(selected_province)] = 0x2B2B2B2B;
1034 }
1035}
1036
1037void highlight_defensive_positions(sys::state& state, std::vector<uint32_t>& data, dcon::province_id selected_province) {
1038 if(state.selected_army_group) {
1039
1040 for(auto position : state.world.automated_army_group_get_provinces_defend(state.selected_army_group)) {
1041 data[province::to_map_id(position)] = 0x2B2B2B2B;
1042 }
1043
1044 for(auto position : state.world.automated_army_group_get_provinces_ferry_origin(state.selected_army_group)) {
1045 data[province::to_map_id(position)] = 0x2B2B2B2B;
1046 }
1047
1048 for(auto position : state.world.automated_army_group_get_provinces_enforce_control(state.selected_army_group)) {
1049 data[province::to_map_id(position)] = 0x2B2B2B2B;
1050 }
1051 }
1052}
1053
1055 return state.ui_state.end_screen.get();
1056}
1057
1059 return state.ui_state.nation_picker.get();
1060}
1061
1063 return state.ui_state.root.get();
1064}
1065
1067 return state.ui_state.military_root.get();
1068}
1069
1071 return state.ui_state.army_group_selector_root.get();
1072}
1073
1075 return state.ui_state.army_group_selector_root.get();
1076}
1077
1079 return state.ui_state.select_states_legend.get();
1080}
1081
1082}
static void show_toggle(sys::state &state)
virtual message_result impl_set(sys::state &state, Cyto::Any &payload) noexcept
element_base * parent
dcon::land_battle_id battle
#define assert(condition)
Definition: debug.h:74
std::vector< dcon::province_id > can_move_navy(sys::state &state, dcon::nation_id source, dcon::navy_id n, dcon::province_id dest)
Definition: commands.cpp:3398
bool can_notify_player_picks_nation(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:4630
std::vector< dcon::province_id > can_move_army(sys::state &state, dcon::nation_id source, dcon::army_id a, dcon::province_id dest)
Definition: commands.cpp:3166
bool navy_is_in_selection(sys::state &state, int32_t x, int32_t y, dcon::navy_id n)
Definition: game_scene.cpp:380
void update_military_game_scene(sys::state &state)
void render_map_generic(sys::state &state)
Definition: game_scene.cpp:209
void in_game_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:611
scene_properties nation_picker()
Definition: game_scene.hpp:181
void select_wargoal_state_from_selected_province(sys::state &state)
Definition: game_scene.cpp:183
bool belongs_on_map(sys::state &state, ui::element_base *checked_element)
Definition: game_scene.cpp:83
void on_lbutton_up(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:462
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)
Definition: game_scene.cpp:268
ui::mouse_probe recalculate_mouse_probe_military(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
Definition: game_scene.cpp:824
void switch_scene(sys::state &state, scene_id ui_scene)
Definition: game_scene.cpp:13
void military_screen_on_lbutton_up(sys::state &state)
Definition: game_scene.cpp:537
void on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:273
void update_ui_state_basic(sys::state &state)
Definition: game_scene.cpp:980
void select_player_nation_from_selected_province(sys::state &state)
Definition: game_scene.cpp:162
void render_ui_ingame(sys::state &state)
Definition: game_scene.cpp:748
void render_ui_military(sys::state &state)
Definition: game_scene.cpp:739
void update_ui_unit_details(sys::state &state)
Definition: game_scene.cpp:971
void handle_escape_basic(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:592
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)
Definition: game_scene.cpp:81
scene_properties basic_game()
Definition: game_scene.hpp:207
ui::mouse_probe recalculate_mouse_probe_units(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
Definition: game_scene.cpp:787
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)
Definition: game_scene.cpp:231
void console_log_other(sys::state &state, std::string_view message)
Definition: game_scene.cpp:715
ui::element_base * root_game_basic(sys::state &state)
scene_properties state_wargoal_selector()
Definition: game_scene.hpp:287
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)
Definition: game_scene.cpp:76
void stop_dragging(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:202
void render_units_info_box(sys::state &state)
Definition: game_scene.cpp:733
void on_lbutton_up_ui_click_hold_and_release(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:300
void open_diplomacy(sys::state &state, dcon::nation_id nation, dcon::province_id target, sys::key_modifiers mod)
Definition: game_scene.cpp:148
void generic_map_scene_update(sys::state &state)
void deselect_units(sys::state &state)
Definition: game_scene.cpp:329
void update_add_units_game_scene(sys::state &state)
void clean_up_basic_game_scene(sys::state &state)
Definition: game_scene.cpp:905
void clean_up_selected_armies_and_navies(sys::state &state)
Definition: game_scene.cpp:879
scene_properties battleplan_editor_add_army()
Definition: game_scene.hpp:260
void render_units(sys::state &state)
Definition: game_scene.cpp:727
ui::mouse_probe recalculate_mouse_probe_identity(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
Definition: game_scene.cpp:769
ui::mouse_probe recalculate_mouse_probe_units_details(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
Definition: game_scene.cpp:773
void state_selector_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:526
void on_key_down(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:695
sys::virtual_key replace_keycodes_map_movement(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:486
sys::virtual_key replace_keycodes(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:505
void military_screen_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:558
void console_log_pick_nation(sys::state &state, std::string_view message)
Definition: game_scene.cpp:704
void ui_lbutton(sys::state &state, sys::key_modifiers mod)
Definition: game_scene.cpp:221
void handle_rbutton_down_map_interaction(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:243
void nation_picker_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:515
void render_ui_selection_screen(sys::state &state)
Definition: game_scene.cpp:743
map::map_view get_view(sys::state &state)
Definition: game_scene.cpp:94
bool province_port_is_in_selection(sys::state &state, int32_t x, int32_t y, dcon::province_id province)
Definition: game_scene.cpp:348
bool army_is_in_selection(sys::state &state, int32_t x, int32_t y, dcon::army_id a)
Definition: game_scene.cpp:375
void do_nothing(sys::state &state)
Definition: game_scene.cpp:80
void do_nothing_hotkeys(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:690
void update_army_group_selection_ui(sys::state &state)
Definition: game_scene.cpp:935
void start_dragging(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:195
scene_properties battleplan_editor()
Definition: game_scene.hpp:236
void on_lbutton_down_map(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:235
void update_unit_selection_ui(sys::state &state)
Definition: game_scene.cpp:939
ui::element_base * root_game_battleplanner(sys::state &state)
void center_on_capital(sys::state &state, dcon::nation_id nation)
Definition: game_scene.cpp:603
ui::mouse_probe recalculate_mouse_probe_basic(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
Definition: game_scene.cpp:811
void select_units(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:394
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)
Definition: game_scene.cpp:239
bool province_mid_point_is_in_selection(sys::state &state, int32_t x, int32_t y, dcon::province_id province)
Definition: game_scene.cpp:334
float get_effects_volume(sys::state &state)
Definition: game_scene.cpp:105
void open_chat_during_game(sys::state &state)
scene_properties end_screen()
Definition: game_scene.hpp:307
void send_selected_province_to_province_window(sys::state &state)
Definition: game_scene.cpp:189
ui::mouse_probe recalculate_mouse_probe_units_and_details(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
Definition: game_scene.cpp:799
void handle_drag_stop(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:433
void ui_rbutton(sys::state &state, sys::key_modifiers mod)
Definition: game_scene.cpp:213
void update_basic_game_scene(sys::state &state)
Definition: game_scene.cpp:993
ui::mouse_probe recalculate_tooltip_probe_basic(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
Definition: game_scene.cpp:863
void selected_units_control(sys::state &state, dcon::nation_id nation, dcon::province_id target, sys::key_modifiers mod)
Definition: game_scene.cpp:109
ui::mouse_probe recalculate_tooltip_probe_units_and_details(sys::state &state, ui::mouse_probe mouse_probe, ui::mouse_probe tooltip_probe)
Definition: game_scene.cpp:840
sys::virtual_key replace_keycodes_identity(sys::state &state, sys::virtual_key keycode, sys::key_modifiers mod)
Definition: game_scene.cpp:501
ui::element_base * root_game_battleplanner_unit_selection(sys::state &state)
void on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mod)
Definition: game_scene.cpp:288
void update_map_mode(sys::state &state)
Definition: map_modes.cpp:1021
void set_map_mode(sys::state &state, mode mode)
Definition: map_modes.cpp:796
constexpr float zoom_close
Definition: constants.hpp:605
map_view
Definition: map_state.hpp:17
constexpr float zoom_very_close
Definition: constants.hpp:606
constexpr dcon::province_id from_map_id(uint16_t id)
Definition: province.hpp:13
constexpr uint16_t to_map_id(dcon::province_id id)
Definition: province.hpp:10
audio_instance & get_random_province_select_sound(sys::state &state)
Definition: sound_nix.cpp:403
audio_instance & get_navy_move_sound(sys::state &state)
Definition: sound_nix.cpp:320
void play_effect(sys::state &state, audio_instance &s, float volume)
Definition: sound_nix.cpp:198
audio_instance & get_navy_select_sound(sys::state &state)
Definition: sound_nix.cpp:317
audio_instance & get_army_select_sound(sys::state &state)
Definition: sound_nix.cpp:311
void play_interface_sound(sys::state &state, audio_instance &s, float volume)
Definition: sound_nix.cpp:203
audio_instance & get_error_sound(sys::state &state)
Definition: sound_nix.cpp:323
audio_instance & get_army_move_sound(sys::state &state)
Definition: sound_nix.cpp:314
virtual_key
Definition: constants.hpp:5
key_modifiers
Definition: constants.hpp:156
void open_chat_during_game(sys::state &state)
void open_chat_before_game(sys::state &state)
void close_expired_event_windows(sys::state &state)
Definition: gui_event.cpp:1146
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)
Definition: window_nix.cpp:351
uint uint32_t
uchar uint8_t
element_base * under_mouse