This commit is contained in:
DepressedTWM 2026-08-15 17:16:16 +04:00
parent bf160b79e7
commit d1124b7b35
5 changed files with 27 additions and 7 deletions

View file

@ -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"))) {

View file

@ -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.

View file

@ -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" },

View file

@ -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