mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
d530bfcd65
## Link to GitHub Issue, if one exists n/a ## Description of change Change the dark brown colors used in widget backgrounds to dark gray. Decrease the in-game overlay transparency (more opaque): 80% -> 96%. ## Testing Tested cfg and in-game overlay.
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "external/imgui/imgui.h"
|
|
#include "external/imgui/misc/cpp/imgui_stdlib.h"
|
|
#include "overlay.h"
|
|
|
|
namespace overlay {
|
|
|
|
class Window {
|
|
public:
|
|
virtual ~Window();
|
|
|
|
// an opportunity to calculate initial window position and size within the ImGui
|
|
// window context, since it may not be possible in the Window constructor
|
|
virtual void calculate_initial_window() {}
|
|
|
|
virtual void build_content() = 0;
|
|
virtual void update();
|
|
virtual void after_render() {};
|
|
|
|
void build();
|
|
void toggle_active();
|
|
void set_active(bool active);
|
|
bool get_active();
|
|
protected:
|
|
|
|
// state
|
|
SpiceOverlay *overlay;
|
|
bool active = false;
|
|
std::vector<Window*> children;
|
|
|
|
// settings
|
|
bool remove_window_padding = false;
|
|
bool draws_window = true;
|
|
ImGuiSizeCallback resize_callback = nullptr;
|
|
std::string title = "Title";
|
|
ImGuiWindowFlags flags = 0;
|
|
size_t toggle_button = ~0u;
|
|
bool toggle_button_state = false;
|
|
|
|
// init settings
|
|
ImVec2 init_pos = ImVec2(0, 0);
|
|
ImVec2 init_size = ImVec2(0, 0);
|
|
ImVec2 size_min = ImVec2(0, 0);
|
|
ImVec2 size_max = ImVec2(-1, -1);
|
|
float bg_alpha = 0.96f;
|
|
|
|
Window(SpiceOverlay *overlay);
|
|
};
|
|
}
|