overlay: refactor overlay layering (#739)

## Link to GitHub Issue or related Pull Request, if one exists
n/a

## Description of change

Create three distinct layers for the overlay:

1. Bottommost persistent layer - non-interactable layer that is always
on. This was only for notifications, but now the FPS widget lives here
as well.
2. Overlay windows layer - most interactable windows go here.
3. Topmost main menu - this is reserved for the main menu (escape key)
and this is a modal dialog that occludes the layers below.

Why? 

- `toggle overlay` behavior with FPS widget *also* toggling on/off was a
bit confusing (now they're two separate keys)
- FPS widget is popular, but it caused the entire overlay to be active,
which affects how input is handled
- the main menu being a standalone window was a little awkward (now it's
a modal)

## Testing
This commit is contained in:
bicarus
2026-06-07 17:23:08 -07:00
committed by GitHub
parent bb87aa2944
commit 100caa0f5c
16 changed files with 348 additions and 102 deletions
+11 -17
View File
@@ -324,20 +324,12 @@ namespace overlay::windows {
}
if (ImGui::BeginTabItem("Overlay")) {
tab_selected_new = ConfigTab::CONFIG_TAB_OVERLAY;
const auto offset = cfg::CONFIGURATOR_STANDALONE ? page_offset : page_offset2;
ImGui::BeginChild("Overlay", ImVec2(
0, ImGui::GetWindowContentRegionMax().y - offset), false);
0, ImGui::GetWindowContentRegionMax().y - page_offset2), false);
// overlay buttons
this->build_buttons("Overlay", games::get_buttons_overlay(this->games_selected_name));
ImGui::EndChild();
// standalone configurator extras
if (cfg::CONFIGURATOR_STANDALONE) {
ImGui::Checkbox("Enable Overlay in Config", &OVERLAY->hotkeys_enable);
}
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Lights")) {
@@ -4316,7 +4308,7 @@ namespace overlay::windows {
ImGui::Spacing();
ImGui::Separator();
ImGui::Spacing();
ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "NFC card reader status");
ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "NFC / API card reader status");
ImGui::Spacing();
if (cfg::CONFIGURATOR_STANDALONE) {
@@ -4379,14 +4371,16 @@ namespace overlay::windows {
ImGui::Spacing();
ImGui::Separator();
ImGui::Spacing();
ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "More tips");
ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "Card Manager");
ImGui::Spacing();
ImGui::BeginDisabled();
ImGui::TextWrapped("To debug card reader issues, run spice.exe -cfg in command line and check the log.");
ImGui::TextWrapped(
"If you have multiple players, try opening Card Manager window in the game. "
"Check the key bind in Overlay tab for Toggle Card Manager.");
ImGui::EndDisabled();
if (ImGui::Button("Open Card Manager")) {
if (this->overlay->window_cards != nullptr) {
this->overlay->window_cards->set_active(true);
this->overlay->window_cards->bring_to_front();
}
}
ImGui::TextUnformatted("");
ImGui::TextUnformatted("");
}
bool Config::validate_ea_card(char card_number[16]) {