Settings tabs can be on the stack
This commit is contained in:
@@ -7,20 +7,20 @@
|
||||
|
||||
class SettingsWindow final {
|
||||
gui::NativeWindow& window;
|
||||
GeneralSettings* generalSettings;
|
||||
CPUSettings* cpuSettings = new CPUSettings;
|
||||
AudioSettings* audioSettings = new AudioSettings;
|
||||
GeneralSettings generalSettings;
|
||||
CPUSettings cpuSettings;
|
||||
AudioSettings audioSettings;
|
||||
bool applyEnabled = false;
|
||||
|
||||
std::vector<std::pair<std::string, SettingsTab*>> tabs = {
|
||||
{ "General", generalSettings },
|
||||
{ "CPU", cpuSettings },
|
||||
{ "Audio", audioSettings },
|
||||
{ "General", &generalSettings },
|
||||
{ "CPU", &cpuSettings },
|
||||
{ "Audio", &audioSettings },
|
||||
};
|
||||
public:
|
||||
bool isOpen = false;
|
||||
bool render();
|
||||
explicit SettingsWindow(gui::NativeWindow& window) : window(window), generalSettings(new GeneralSettings(window)) {}
|
||||
[[nodiscard]] float getVolumeL() const { return audioSettings->volumeL / 100.f; }
|
||||
[[nodiscard]] float getVolumeR() const { return audioSettings->volumeR / 100.f; }
|
||||
explicit SettingsWindow(gui::NativeWindow& window) : window(window), generalSettings(window) {}
|
||||
[[nodiscard]] float getVolumeL() const { return audioSettings.volumeL / 100.f; }
|
||||
[[nodiscard]] float getVolumeR() const { return audioSettings.volumeR / 100.f; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user