mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-26 11:22:17 -05:00
Fixed ImGui developer menu (#298)
Fixes the Auto Windows Opening that could cancel the menu by itself
This commit is contained in:
parent
0adad641a6
commit
e2c801a2ac
@ -106,7 +106,7 @@ void Console::Draw() {
|
||||
if (!this->opened) return;
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver);
|
||||
ImGui::Begin("Console", nullptr);
|
||||
ImGui::Begin("Console", nullptr, ImGuiWindowFlags_NoFocusOnAppearing);
|
||||
const ImVec2 pos = ImGui::GetWindowPos();
|
||||
const ImVec2 size = ImGui::GetWindowSize();
|
||||
|
||||
|
@ -417,6 +417,15 @@ namespace SohImGui {
|
||||
}
|
||||
}
|
||||
|
||||
void EnhancementButton(std::string text, std::string cvarName)
|
||||
{
|
||||
bool val = (bool)CVar_GetS32(cvarName.c_str(), 0);
|
||||
if (ImGui::Button(text.c_str())) {
|
||||
CVar_SetS32(cvarName.c_str(), !val);
|
||||
needs_save = true;
|
||||
}
|
||||
}
|
||||
|
||||
void EnhancementSliderInt(std::string text, std::string id, std::string cvarName, int min, int max, std::string format)
|
||||
{
|
||||
int val = CVar_GetS32(cvarName.c_str(), 0);
|
||||
@ -725,10 +734,11 @@ namespace SohImGui {
|
||||
|
||||
if (ImGui::BeginMenu("Developer Tools"))
|
||||
{
|
||||
EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled");
|
||||
ImGui::Separator();
|
||||
EnhancementCheckbox("Stats", "gStatsEnabled");
|
||||
EnhancementCheckbox("Console", "gConsoleEnabled");
|
||||
console->opened = CVar_GetS32("gConsoleEnabled", 0);
|
||||
EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled");
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
@ -745,6 +755,7 @@ namespace SohImGui {
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ImGui::EndMenuBar();
|
||||
@ -755,7 +766,7 @@ namespace SohImGui {
|
||||
if (CVar_GetS32("gStatsEnabled", 0)) {
|
||||
const float framerate = ImGui::GetIO().Framerate;
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
|
||||
ImGui::Begin("Debug Stats", nullptr, ImGuiWindowFlags_None);
|
||||
ImGui::Begin("Debug Stats", nullptr, ImGuiWindowFlags_NoFocusOnAppearing);
|
||||
|
||||
#ifdef _WIN32
|
||||
ImGui::Text("Platform: Windows");
|
||||
|
@ -97,7 +97,7 @@ void DrawColViewerWindow(bool& open) {
|
||||
}
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver);
|
||||
if (!ImGui::Begin("Collision Viewer", &open)) {
|
||||
if (!ImGui::Begin("Collision Viewer", &open, ImGuiWindowFlags_NoFocusOnAppearing)) {
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
|
@ -1540,7 +1540,7 @@ void DrawSaveEditor(bool& open) {
|
||||
}
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver);
|
||||
if (!ImGui::Begin("Save Editor", &open)) {
|
||||
if (!ImGui::Begin("Save Editor", &open, ImGuiWindowFlags_NoFocusOnAppearing)) {
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user