Working to save and select classes
This commit is contained in:
parent
8e6f0ccc1f
commit
acc2f0ca9d
6 changed files with 54 additions and 1 deletions
|
@ -42,6 +42,20 @@ void Controller::control_menu() const noexcept {
|
|||
void Controller::control_sheet() const noexcept {
|
||||
if (menu_data.is_edit_mode()) {
|
||||
// TODO
|
||||
switch (sheet.get_current_class()) {
|
||||
case character::classe::Prudent:
|
||||
// TODO
|
||||
break;
|
||||
case character::classe::Guerrier:
|
||||
// TODO
|
||||
break;
|
||||
case character::classe::Paysan:
|
||||
// TODO
|
||||
break;
|
||||
case character::classe::Debrouillard:
|
||||
// TODO
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// TODO
|
||||
}
|
||||
|
|
|
@ -47,6 +47,20 @@ void gui::Gui::render_gui(const Controller &controller) {
|
|||
(void) ImGui::Begin("Billy", nullptr, flags);
|
||||
menu.gui();
|
||||
|
||||
if (ImGui::BeginCombo("Classe",
|
||||
GuiData::classes[static_cast<std::uint32_t>(data.billy.get_current_class())].data(),
|
||||
ImGuiComboFlags_PopupAlignLeft)) {
|
||||
for (std::size_t i = 0; i < GuiData::classes.size(); ++i) {
|
||||
const bool is_selected = (data.billy.get_current_class() == static_cast<character::classe>(i));
|
||||
if (ImGui::Selectable(GuiData::classes[i].data(), is_selected))
|
||||
data.billy.current_class = static_cast<character::classe>(i);
|
||||
|
||||
if (is_selected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
{
|
||||
ImGui::BeginChild("carac", ImVec2(0, ImGui::GetWindowHeight() * 0.2f), true);
|
||||
ImGui::Text("Caractère");
|
||||
|
|
|
@ -21,7 +21,7 @@ int main() {
|
|||
|
||||
while (!window.should_close()) {
|
||||
glfwPollEvents();
|
||||
// controller.control();
|
||||
controller.control_sheet();
|
||||
|
||||
gui.render_gui(controller);
|
||||
gui.render_gpu();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue