Skip to content

Commit

Permalink
feat: options are now bigger and always correctly positioned
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed May 2, 2024
1 parent 544f132 commit 546a7a6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/engine/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,13 @@ void window::window_loop() {

if (show_choices) {
if (!manager.current_video.options.empty() && !first_frame) {
ImGui::Begin("Options Select", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_AlwaysAutoResize);

ImVec2 WindowPos(window_width/2, window_height - 40);
ImGui::SetNextWindowPos(WindowPos, ImGuiCond_None, ImVec2(0.5f, 0.5f));
// ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoBackground (This is to prevent the window from having any looks)
// ImGuiWindowFlags_NoMove (Prevent moving it)
// ImGuiWindowFlags_AlwaysAutoResize (Auto resize)
ImGui::Begin("Options Select", nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_AlwaysAutoResize);
for (const auto& opt : manager.current_video.options) {

// Pre-cautions
Expand All @@ -449,7 +455,7 @@ void window::window_loop() {
}

std::string option_text(opt.second.name);
if (ImGui::Button(option_text.c_str())) {
if (ImGui::Button(option_text.c_str(), ImVec2(300, 30))) {
first_frame = true;
delete[] frame_data;
frame_data = nullptr;
Expand Down

0 comments on commit 546a7a6

Please sign in to comment.