From d1124b7b354a88ed0c07347ec1551ef0fc1957f3 Mon Sep 17 00:00:00 2001 From: DepressedTWM Date: Sat, 15 Aug 2026 17:16:16 +0400 Subject: [PATCH] ga --- binding-mri/sunshine-binding.cpp | 13 ++++++++----- oneshot.conf | 3 ++- scripts/Data_Settings.rb | 7 +++++++ scripts/Settings_Setters.rb | 9 +++++++++ src/main.cpp | 2 +- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/binding-mri/sunshine-binding.cpp b/binding-mri/sunshine-binding.cpp index eccc259..33fe3f7 100644 --- a/binding-mri/sunshine-binding.cpp +++ b/binding-mri/sunshine-binding.cpp @@ -12,16 +12,19 @@ #include "eventthread.h" #include "sunshine.h" #include "meow.h" - -static VALUE sunshine_get_crash_privacy(VALUE self) { - return is_privacy_crashdump_enabled ? Qtrue : Qfalse; -} +#include "sharedstate.h" static VALUE sunshine_set_crash_privacy(VALUE, VALUE v) { is_privacy_crashdump_enabled = RTEST(v); return v; } +static VALUE sunshine_set_wallpaper_mode(VALUE, VALUE v) { + std::string s(StringValueCStr(v)); + shState->config().wallpaperMode = s; + return v; +} + static VALUE sunshine_set_hint(VALUE, VALUE h, VALUE v) { return SDL_SetHint(StringValueCStr(h), StringValueCStr(v)); } @@ -65,8 +68,8 @@ void SunshineBindingInit(){ #else rb_const_set(module, rb_intern("DEVBUILD"), Qfalse); #endif - rb_define_singleton_method(module, "crashprivacy", RUBY_METHOD_FUNC(sunshine_get_crash_privacy), 0); rb_define_singleton_method(module, "crashprivacy=", RUBY_METHOD_FUNC(sunshine_set_crash_privacy), 1); + rb_define_singleton_method(module, "wallpapermode=", RUBY_METHOD_FUNC(sunshine_set_wallpaper_mode), 1); rb_define_singleton_method(module, "setSDLHint", RUBY_METHOD_FUNC(sunshine_set_hint), 2); //если методы доступны то просто не перезаписываем их if (!rb_respond_to(rb_cObject, rb_intern("class"))) { diff --git a/oneshot.conf b/oneshot.conf index 4423b6c..5508877 100644 --- a/oneshot.conf +++ b/oneshot.conf @@ -140,7 +140,8 @@ pancakes=false # recommended use when you play with mods. SecurityEngine=true -# Controls the change of wallpaper on Linux and *NIX +# Controls the change of wallpaper +# The set value through the in-game settings takes precedence over these. # Available modes: # normal - normal wallpaper changing # fallback - Uses fallback mode, a hint using a file in the user folder. diff --git a/scripts/Data_Settings.rb b/scripts/Data_Settings.rb index 57f6e33..a69a48b 100644 --- a/scripts/Data_Settings.rb +++ b/scripts/Data_Settings.rb @@ -34,6 +34,7 @@ module Settings :oneshot_mode => false, :twm_shader_footprint => true, :disable_pizzles_for_fuckin_gayland_users_gayland_devs_fix_your_bullshit_already => false, + :wallpaper_mode => 0, # Advanced :crashlog_privacy => false, @@ -309,6 +310,12 @@ class Window_Settings :name => "Disable System API Dependent Puzzles(For wayland users)", :parameter => :disable_pizzles_for_fuckin_gayland_users_gayland_devs_fix_your_bullshit_already }, + { + :type => :enum, + :name => "Wallpaper mode", + :parameter => :wallpaper_mode, + :values => ["Normal", "Fallback", "Disabled"] + }, ], "Controls" => [ { :type => :sep, :name => "Gamepad" }, diff --git a/scripts/Settings_Setters.rb b/scripts/Settings_Setters.rb index aa1dc6f..7705f24 100644 --- a/scripts/Settings_Setters.rb +++ b/scripts/Settings_Setters.rb @@ -100,6 +100,15 @@ module Settings def profiller(value) Profiler.set(value) end + def wallpaper_mode(value) + if value == 0 + Sunshine.wallpapermode="normal" + elsif value == 1 + Sunshine.wallpapermode="fallback" + else + Sunshine.wallpapermode="disabled" + end + end end end end diff --git a/src/main.cpp b/src/main.cpp index 70889ba..a4be5e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -265,7 +265,7 @@ int main(int argc, char *argv[]){ freopen("CONOUT$", "w", stderr); } #endif - + if (!conf.gameFolder.empty()){ if (chdir(conf.gameFolder.c_str()) != 0){ WarnMsg("Unable to switch into gameFolder %s", conf.gameFolder.c_str());