mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
100caa0f5c
## 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
27 lines
602 B
C++
27 lines
602 B
C++
#pragma once
|
|
|
|
#include <chrono>
|
|
#include "overlay/window.h"
|
|
|
|
namespace overlay::windows {
|
|
|
|
enum class NextItem {
|
|
NEW_LINE,
|
|
SAME_LINE
|
|
};
|
|
|
|
class ExitPrompt : public Window {
|
|
public:
|
|
ExitPrompt(SpiceOverlay *overlay);
|
|
void build_content() override;
|
|
void update() override;
|
|
|
|
private:
|
|
void build_button(Window *window, std::string label, const ImVec2 &size, NextItem next);
|
|
|
|
// latch so the popup is opened once per activation; reset in update()
|
|
// whenever the menu is inactive
|
|
bool popup_opened = false;
|
|
};
|
|
}
|