Add dark background toggle
parent
2990511cd4
commit
cbdb835dd1
13
as1/as1.cpp
13
as1/as1.cpp
|
|
@ -1,10 +1,12 @@
|
||||||
#include "AudioDevice.hpp"
|
#include "AudioDevice.hpp"
|
||||||
#include "Color.hpp"
|
#include "Color.hpp"
|
||||||
|
#include "raylib.h"
|
||||||
#include <raylib-cpp.hpp>
|
#include <raylib-cpp.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
static std::function<void()> pingButtonHandler;
|
static std::function<void()> pingButtonHandler;
|
||||||
|
static bool darkMode = false;
|
||||||
|
|
||||||
void PingButton() {
|
void PingButton() {
|
||||||
pingButtonHandler();
|
pingButtonHandler();
|
||||||
|
|
@ -43,7 +45,16 @@ int main() {
|
||||||
|
|
||||||
GuiVolumeControl(&guiState);
|
GuiVolumeControl(&guiState);
|
||||||
|
|
||||||
window.ClearBackground(raylib::Color::RayWhite());
|
const char *modeText = darkMode ? "Background: Black" : "Background: White";
|
||||||
|
if (GuiButton((Rectangle){ 24, 328, 256, 24 }, modeText)) {
|
||||||
|
darkMode = !darkMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (darkMode) {
|
||||||
|
window.ClearBackground(raylib::Color::Black());
|
||||||
|
} else {
|
||||||
|
window.ClearBackground(raylib::Color::RayWhite());
|
||||||
|
}
|
||||||
|
|
||||||
ping.SetVolume(guiState.SFXSliderValue / 100.0f);
|
ping.SetVolume(guiState.SFXSliderValue / 100.0f);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue