Project Alice
Loading...
Searching...
No Matches
gui_leader_select.cpp
Go to the documentation of this file.
2
3namespace ui {
4void open_leader_selection(sys::state& state, dcon::army_id a, dcon::navy_id v, int32_t x, int32_t y) {
6 win->a = a;
7 win->v = v;
8 win->set_visible(state, !win->is_visible());
9 win->base_data.position.x = int16_t(x);
10 if(int32_t(win->base_data.position.x + win->base_data.size.x) >= state.x_size) {
11 win->base_data.position.x -= win->base_data.size.x;
12 }
13 win->base_data.position.y = int16_t(std::clamp(y, 64, int32_t(state.ui_state.root->base_data.size.y - state.ui_state.change_leader_window->base_data.size.y)));
14 state.ui_state.root->move_child_to_front(win);
15}
16} // namespace ui
bool is_visible() const
element_data base_data
void set_visible(sys::state &state, bool vis)
void open_leader_selection(sys::state &state, dcon::army_id a, dcon::navy_id v, int32_t x, int32_t y)
element_base * change_leader_window
std::unique_ptr< element_base > root