Skip to content

Commit

Permalink
Enable overlay docking option
Browse files Browse the repository at this point in the history
  • Loading branch information
Deji69 committed Sep 16, 2024
1 parent 31a6d3b commit 814307e
Showing 1 changed file with 58 additions and 11 deletions.
69 changes: 58 additions & 11 deletions src/Stealthometer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,64 @@ auto Stealthometer::DrawSettingsUI(bool focused) -> void {
ImGui::PushFont(SDK()->GetImGuiRegularFont());
auto& cfg = config.Get();

if (ImGui::Button("Overlay")) {
cfg.inGameOverlay = true;
config.Save();
}

ImGui::SameLine(100.0);

auto selectedOverlayDockName = "Undocked";

switch (cfg.overlayDockMode) {
case DockMode::TopLeft:
selectedOverlayDockName = "Top Left";
break;
case DockMode::TopRight:
selectedOverlayDockName = "Top Right";
break;
case DockMode::BottomLeft:
selectedOverlayDockName = "Bottom Left";
break;
case DockMode::BottomRight:
selectedOverlayDockName = "Bottom Right";
break;
}

if (ImGui::BeginCombo("##OverlayDock", selectedOverlayDockName, ImGuiComboFlags_HeightLarge)) {
if (ImGui::Selectable("Undocked", cfg.overlayDockMode == DockMode::None, 0)) {
cfg.overlayDockMode = DockMode::None;
this->config.Save();
}
if (cfg.overlayDockMode == DockMode::None) ImGui::SetItemDefaultFocus();

if (ImGui::Selectable("Top Left", cfg.overlayDockMode == DockMode::TopLeft, 0)) {
cfg.overlayDockMode = DockMode::TopLeft;
this->config.Save();
}
if (cfg.overlayDockMode == DockMode::TopLeft) ImGui::SetItemDefaultFocus();

if (ImGui::Selectable("Top Right", cfg.overlayDockMode == DockMode::TopRight, 0)) {
cfg.overlayDockMode = DockMode::TopRight;
this->config.Save();
}
if (cfg.overlayDockMode == DockMode::TopRight) ImGui::SetItemDefaultFocus();

if (ImGui::Selectable("Bottom Left", cfg.overlayDockMode == DockMode::BottomLeft, 0)) {
cfg.overlayDockMode = DockMode::BottomLeft;
this->config.Save();
}
if (cfg.overlayDockMode == DockMode::BottomLeft) ImGui::SetItemDefaultFocus();

if (ImGui::Selectable("Bottom Right", cfg.overlayDockMode == DockMode::BottomRight, 0)) {
cfg.overlayDockMode = DockMode::BottomRight;
this->config.Save();
}
if (cfg.overlayDockMode == DockMode::BottomRight) ImGui::SetItemDefaultFocus();

ImGui::EndCombo();
}

if (ImGui::Checkbox("External Window", &cfg.externalWindow)) {
if (cfg.externalWindow) this->window.create(hInstance);
else this->window.destroy();
Expand All @@ -276,17 +334,6 @@ auto Stealthometer::DrawSettingsUI(bool focused) -> void {
config.Save();
}

if (ImGui::Button("Overlay")) {
cfg.inGameOverlay = true;
config.Save();
}
ImGui::SameLine();
if (ImGui::Checkbox("Detailed", &cfg.inGameOverlayDetailed)) {
if (cfg.inGameOverlayDetailed) this->window.create(hInstance);
else this->window.destroy();
config.Save();
}

if (ImGui::Button("LiveSplit")) this->liveSplitWindowOpen = true;

if (ImGui::Button("Kill Stats")) this->killsWindowOpen = true;
Expand Down

0 comments on commit 814307e

Please sign in to comment.