| 73 | |
| 74 | auto Sorcery::Menu::regenerate() -> void { |
| 75 | |
| 76 | _ctx.menubuilder->build(_name, _width, _items, _data, _reorder); |
| 77 | } |
| 78 | |
| 79 | auto Sorcery::Menu::draw() -> void { |
| 80 | |
| 81 | with_Window(WINDOW_LAYER_MENUS, nullptr, |
| 82 | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoTitleBar) { |
| 83 | |
| 84 | const auto col{_ctx.ui->get_hl_colour(_ctx.animation->lerp)}; |
| 85 | set_Font( |
| 86 | _ctx.ui->fontstore->get_current_font(Enums::Layout::Font::MONOSPACE) |
| 87 | .value(), |
| 88 | _ctx.ui->font_sz()); |
| 89 | const auto sz{ |
| 90 | ImVec2{static_cast<float>(_width * _ctx.ui->font_sz()), |
| 91 | static_cast<float>( |
| 92 | (_height * ImGui::GetTextLineHeightWithSpacing()) + 2)}}; |
| 93 | |
| 94 | // Note that _pos is in grid units whereas sz is in pixels! |
| 95 | _ctx.ui->draw_menu(_name, col, _pos, sz, _font, _items, _data, _reorder, |
| 96 | _across, _numeric_input); |
| 97 | |
| 98 | // Handle SpecialEvents such as Reordering Party Menu |
| 99 | if (_ctx.controller->has_flag("party_order_changed")) { |
| 100 | |
| 101 | _game->state->reorder_party(_ctx.controller->get_candidate_party()); |
| 102 | regenerate(); |
| 103 | _ctx.controller->clear_candidate_party(); |
| 104 | _ctx.controller->unset_flag("party_order_changed"); |
| 105 | } |
nothing calls this directly
no test coverage detected