From 1cf5e4ff6a1f05ce47d3b54479cb56dc5cd2eacb Mon Sep 17 00:00:00 2001 From: CatWindow Date: Wed, 19 Aug 2026 19:11:17 +0300 Subject: [PATCH 01/10] optimized 2 --- scripts/Settings_Classes.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/Settings_Classes.rb b/scripts/Settings_Classes.rb index 68c3ba6..0172cf6 100644 --- a/scripts/Settings_Classes.rb +++ b/scripts/Settings_Classes.rb @@ -311,11 +311,6 @@ class Window_Settings @selection_sprite.opacity = value @screen_panel_selection_sprite.opacity = value @switch_panels_hint_right.opacity = @switch_panels_hint_left.opacity = (value * 127) / 255 - @parameters.each do |screen_name, screen_parameters| - screen_parameters.each do |parameter| - parameter.update - end - end end def waiting_for_key=(value) From 9d3b0a146be33e661791dcef5351e97772d2ace7 Mon Sep 17 00:00:00 2001 From: CatWindow Date: Wed, 19 Aug 2026 19:21:37 +0300 Subject: [PATCH 02/10] meow gfslkjgfsjlk --- scripts/Settings_Setters.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/Settings_Setters.rb b/scripts/Settings_Setters.rb index 3c35483..d31df05 100644 --- a/scripts/Settings_Setters.rb +++ b/scripts/Settings_Setters.rb @@ -72,11 +72,7 @@ module Settings end def SDL_HINT_INVALID_PARAM_CHECKS(value) - if value - Sunshine.setSDLHint("SDL_HINT_INVALID_PARAM_CHECKS", "1") - else - Sunshine.setSDLHint("SDL_HINT_INVALID_PARAM_CHECKS", "2") - end + Sunshine.setSDLHint("SDL_HINT_INVALID_PARAM_CHECKS", value ? "1" : "2") end def vsync(value) From 62532c45091fbd53ccc31793d3bbbd43eef02a33 Mon Sep 17 00:00:00 2001 From: CatWindow Date: Wed, 19 Aug 2026 19:41:45 +0300 Subject: [PATCH 03/10] code clean --- binding-mri/sunshine-binding.cpp | 32 +++++------ scripts/Data_Settings.rb | 96 ++++++++++++++++---------------- scripts/Settings_Setters.rb | 48 +++++----------- scripts/Spriteset_Map.rb | 2 +- 4 files changed, 78 insertions(+), 100 deletions(-) diff --git a/binding-mri/sunshine-binding.cpp b/binding-mri/sunshine-binding.cpp index 33fe3f7..7d6b16c 100644 --- a/binding-mri/sunshine-binding.cpp +++ b/binding-mri/sunshine-binding.cpp @@ -14,18 +14,18 @@ #include "meow.h" #include "sharedstate.h" -static VALUE sunshine_set_crash_privacy(VALUE, VALUE v) { +static VALUE sunshineSetCrashPrivacy(VALUE, VALUE v) { is_privacy_crashdump_enabled = RTEST(v); return v; } -static VALUE sunshine_set_wallpaper_mode(VALUE, VALUE v) { +static VALUE sunshineSetWallpaperMode(VALUE, VALUE v) { std::string s(StringValueCStr(v)); shState->config().wallpaperMode = s; return v; } -static VALUE sunshine_set_hint(VALUE, VALUE h, VALUE v) { +static VALUE sunshineSetHint(VALUE, VALUE h, VALUE v) { return SDL_SetHint(StringValueCStr(h), StringValueCStr(v)); } @@ -48,9 +48,8 @@ static VALUE int_times(VALUE self) { if (n <= 0) return self; - for (long i = 0; i < n; ++i) { + for (long i = 0; i < n; ++i) rb_yield(LONG2NUM(i)); - } return self; } @@ -68,19 +67,16 @@ void SunshineBindingInit(){ #else rb_const_set(module, rb_intern("DEVBUILD"), Qfalse); #endif - 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"))) { - rb_define_method(rb_cObject, "class", rb_obj_class, 0); - } - //сразу для всех обьектов - if (!rb_respond_to(rb_cObject, rb_intern("clone"))) { - rb_define_method(rb_cObject, "clone", RUBY_METHOD_FUNC(obj_clone), 0); - } + rb_define_singleton_method(module, "crash_privacy=", RUBY_METHOD_FUNC(sunshineSetCrashPrivacy), 1); + rb_define_singleton_method(module, "wallpaper_mode=", RUBY_METHOD_FUNC(sunshineSetWallpaperMode), 1); + rb_define_singleton_method(module, "set_sdl_hint", RUBY_METHOD_FUNC(sunshineSetHint), 2); + + if (!rb_respond_to(rb_cObject, rb_intern("class"))) + rb_define_method(rb_cObject, "class", rb_obj_class, 0); + + if (!rb_respond_to(rb_cObject, rb_intern("clone"))) + rb_define_method(rb_cObject, "clone", RUBY_METHOD_FUNC(obj_clone), 0); - if (!rb_respond_to(rb_cInteger, rb_intern("times"))) { + if (!rb_respond_to(rb_cInteger, rb_intern("times"))) rb_define_method(rb_cInteger, "times", RUBY_METHOD_FUNC(int_times), 0); - } } diff --git a/scripts/Data_Settings.rb b/scripts/Data_Settings.rb index 0f48236..f232e51 100644 --- a/scripts/Data_Settings.rb +++ b/scripts/Data_Settings.rb @@ -3,60 +3,60 @@ module Settings def reset! @data = { # Audio - :master_volume => 100, - :bgm_volume => 100, - :sfx_volume => 100, - :use_fight_crime_track => false, - :use_old_self_contained_universe_reprise => false, + :master_volume => 100, + :bgm_volume => 100, + :sfx_volume => 100, + :fight_crime_track => false, + :old_reprise_song => false, # Video - :fullscreen => false, - :resolution => 0, - :colorblind => false, - :frameskip => true, - :twm_shader => true, - :light => true, - :scaling_mode => 0, - :vsync => 0, - :max_particle_count_firefly => 30, + :fullscreen => false, + :resolution => 0, + :colorblind => false, + :frameskip => true, + :twm_shader => true, + :light => true, + :scaling_mode => 0, + :vsync => 0, + :max_firefly_count => 30, # UI - :in_game_timer => false, - :language => 0, - :fasttravel_ui => 0, - :mainmenu_background => 0, + :in_game_timer => false, + :language => 0, + :fasttravel_ui => 0, + :mainmenu_background => 0, # Gameplay - :movement => 0, - :skip_text => false, - :en_purple_messagebox => true, - :enforce_april_fools => false, - :true_memory_mode => false, - :oneshot_mode => false, - :twm_shader_footprint => true, - :disable_pizzles_for_fuckin_gayland_users_gayland_devs_fix_your_bullshit_already => false, - :wallpaper_mode => 0, + :movement => 0, + :skip_text => false, + :en_purple_messagebox => true, + :enforce_april_fools => false, + :true_memory_mode => false, + :oneshot_mode => false, + :twm_shader_footprint => true, + :disable_api_puzzles => false, #disable_pizzles_for_fuckin_gayland_users_gayland_devs_fix_your_bullshit_already + :wallpaper_mode => 0, # Advanced - :crashlog_privacy => false, - :streamer_privacy => false, - :SDL_HINT_INVALID_PARAM_CHECKS => false, + :crashlog_privacy => false, + :streamer_privacy => false, + :invalid_param_checks => false, #controls - :gamepad_type => -1, - :gamepad_face_style => 0, - :gamepad_led => true, - :gamepad_deadzone => 5, + :gamepad_type => -1, + :gamepad_face_style => 0, + :gamepad_led => true, + :gamepad_deadzone => 5, # Debug - :debug => false, - :debug_character => false, - :debug_text_scene_title => true, - :debug_text => false, - :debug_picture_names => false, - :debug_lightmap => false, - :SDL_HINT_SHUTDOWN_DBUS_ON_QUIT => false, - :profiler => false, + :debug => false, + :debug_character => false, + :debug_text_scene_title => true, + :debug_text => false, + :debug_picture_names => false, + :debug_lightmap => false, + :shutdown_dbus_on_quit => false, + :profiler => false, } reset_controls! end @@ -182,13 +182,13 @@ class Window_Settings { :type => :bool, :name => "ITS TIME FOR FIGHT CRIME", - :parameter => :use_fight_crime_track + :parameter => :fight_crime_track }, { :type => :bool, :name => "Use Old Self Contained Universe(Reprise) version", :icon => [1, 1], - :parameter => :use_old_self_contained_universe_reprise + :parameter => :old_reprise_song }, ], "Video" => [ @@ -237,7 +237,7 @@ class Window_Settings { :type => :slider, :name => "Density of glen fireflies", - :parameter => :max_particle_count_firefly, + :parameter => :max_firefly_count, :icon => [1, 1], :min => 0, :max => 30 @@ -318,7 +318,7 @@ class Window_Settings { :type => :bool, :name => "Disable System API Dependent Puzzles(For wayland users)", - :parameter => :disable_pizzles_for_fuckin_gayland_users_gayland_devs_fix_your_bullshit_already + :parameter => :disable_api_puzzles }, { :type => :enum, @@ -541,7 +541,7 @@ class Window_Settings :type => :bool, :name => "SDL_HINT_INVALID_PARAM_CHECKS", :icon => [1, 0], - :parameter => :SDL_HINT_INVALID_PARAM_CHECKS + :parameter => :invalid_param_checks }, ], "Debug" => [ @@ -584,7 +584,7 @@ class Window_Settings { :type => :bool, :name => "SDL_HINT_SHUTDOWN_DBUS_ON_QUIT", - :parameter => :SDL_HINT_SHUTDOWN_DBUS_ON_QUIT, + :parameter => :shutdown_dbus_on_quit, :icon => [1, 0], }, { diff --git a/scripts/Settings_Setters.rb b/scripts/Settings_Setters.rb index d31df05..76aa397 100644 --- a/scripts/Settings_Setters.rb +++ b/scripts/Settings_Setters.rb @@ -8,9 +8,9 @@ module Settings # name must be same as the parameter identifier - def crashlog_privacy(value) - Sunshine.crashprivacy=value - end + def crashlog_privacy(value) + Sunshine.crash_privacy = value + end def master_volume(value) Audio.master_volume = value / 100.0 end @@ -36,13 +36,9 @@ module Settings end end - def scaling_mode(value) - if value == 0 - Graphics.smooth = false - else - Graphics.smooth = true - end - end + def scaling_mode(value) + Graphics.smooth = value != 0 + end def colorblind(value) $game_switches[252] = value @@ -71,40 +67,26 @@ module Settings Graphics.frameskip = value end - def SDL_HINT_INVALID_PARAM_CHECKS(value) - Sunshine.setSDLHint("SDL_HINT_INVALID_PARAM_CHECKS", value ? "1" : "2") + def invalid_param_checks(value) + Sunshine.set_sdl_hint("SDL_HINT_INVALID_PARAM_CHECKS", value ? "1" : "2") end + VSYNC_MODES = [1, -1, 0] def vsync(value) - if value == 0 - Graphics.setVsync(1) - elsif value == 1 - Graphics.setVsync(-1) - else - Graphics.setVsync(0) - end + Graphics.setVsync(VSYNC_MODES[value]) end - def SDL_HINT_SHUTDOWN_DBUS_ON_QUIT(value) - if value - Sunshine.setSDLHint("SDL_HINT_SHUTDOWN_DBUS_ON_QUIT", "1") - else - Sunshine.setSDLHint("SDL_HINT_SHUTDOWN_DBUS_ON_QUIT", "0") - end + def shutdown_dbus_on_quit(value) + Sunshine.set_sdl_hint("SDL_HINT_SHUTDOWN_DBUS_ON_QUIT", value ? "1" : "0") end def profiler(value) Profiler.set(value) end - + + WALLPAPER_MODES = ["normal", "fallback", "disbled"] def wallpaper_mode(value) - if value == 0 - Sunshine.wallpapermode="normal" - elsif value == 1 - Sunshine.wallpapermode="fallback" - else - Sunshine.wallpapermode="disabled" - end + Sunshine.wallpaper_mode = WALLPAPER_MODES[value] end end end diff --git a/scripts/Spriteset_Map.rb b/scripts/Spriteset_Map.rb index cbc452c..16b7e7b 100644 --- a/scripts/Spriteset_Map.rb +++ b/scripts/Spriteset_Map.rb @@ -260,7 +260,7 @@ class Spriteset_Map case @particles_type when :fireflies klass = Particle_Firefly - count = Settings[:max_particle_count_firefly] + count = Settings[:max_firefly_count] layer = :front when :shrimp klass = Particle_Shrimp From dcd7c362a5d4ea638f438ea5ee877aaa00709f08 Mon Sep 17 00:00:00 2001 From: CatWindow Date: Wed, 19 Aug 2026 20:01:06 +0300 Subject: [PATCH 04/10] code clean 2 --- scripts/Data_Settings.rb | 136 ++++++++++++++++++------------------ scripts/Settings_Setters.rb | 81 ++++++++++++--------- 2 files changed, 115 insertions(+), 102 deletions(-) diff --git a/scripts/Data_Settings.rb b/scripts/Data_Settings.rb index f232e51..33c397f 100644 --- a/scripts/Data_Settings.rb +++ b/scripts/Data_Settings.rb @@ -2,14 +2,14 @@ module Settings class << self def reset! @data = { - # Audio + # ------------ Audio ------------ :master_volume => 100, :bgm_volume => 100, :sfx_volume => 100, :fight_crime_track => false, :old_reprise_song => false, - # Video + # ------------ Video ------------ :fullscreen => false, :resolution => 0, :colorblind => false, @@ -20,13 +20,13 @@ module Settings :vsync => 0, :max_firefly_count => 30, - # UI + # ------------- UI -------------- :in_game_timer => false, :language => 0, :fasttravel_ui => 0, :mainmenu_background => 0, - # Gameplay + # ---------- Gameplay ----------- :movement => 0, :skip_text => false, :en_purple_messagebox => true, @@ -37,18 +37,18 @@ module Settings :disable_api_puzzles => false, #disable_pizzles_for_fuckin_gayland_users_gayland_devs_fix_your_bullshit_already :wallpaper_mode => 0, - # Advanced + # ---------- Advanced ----------- :crashlog_privacy => false, :streamer_privacy => false, :invalid_param_checks => false, - #controls + # ---------- Сontrols ----------- :gamepad_type => -1, :gamepad_face_style => 0, :gamepad_led => true, :gamepad_deadzone => 5, - # Debug + # ------------ Debug ------------ :debug => false, :debug_character => false, :debug_text_scene_title => true, @@ -63,69 +63,69 @@ module Settings def reset_controls! @data.merge!({ - :controls_walk_down => [ - KeyBind.key(Input::key_from_name("Down")), - KeyBind.caxis(Input::c_axis_from_name("LeftY"), KeyBind::Positive), - KeyBind.cbutton(Input::c_button_from_name("DpDown")) - ], - :controls_walk_left => [ - KeyBind.key(Input::key_from_name("Left")), - KeyBind.caxis(Input::c_axis_from_name("LeftX"), KeyBind::Negative), - KeyBind.cbutton(Input::c_button_from_name("DpLeft")) - ], - :controls_walk_right => [ - KeyBind.key(Input::key_from_name("Right")), - KeyBind.caxis(Input::c_axis_from_name("LeftX"), KeyBind::Positive), - KeyBind.cbutton(Input::c_button_from_name("DpRight")) - ], - :controls_walk_up => [ - KeyBind.key(Input::key_from_name("Up")), - KeyBind.caxis(Input::c_axis_from_name("LeftY"), KeyBind::Negative), - KeyBind.cbutton(Input::c_button_from_name("DpUp")) - ], - :controls_run => [ - KeyBind.key(Input::key_from_name("Left Shift")), - KeyBind.caxis(Input::c_axis_from_name("righttrigger"), KeyBind::Positive), - KeyBind.cbutton(Input::c_button_from_name("x")) - ], + :controls_walk_down => [ + KeyBind.key(Input::key_from_name("Down")), + KeyBind.caxis(Input::c_axis_from_name("LeftY"), KeyBind::Positive), + KeyBind.cbutton(Input::c_button_from_name("DpDown")) + ], + :controls_walk_left => [ + KeyBind.key(Input::key_from_name("Left")), + KeyBind.caxis(Input::c_axis_from_name("LeftX"), KeyBind::Negative), + KeyBind.cbutton(Input::c_button_from_name("DpLeft")) + ], + :controls_walk_right => [ + KeyBind.key(Input::key_from_name("Right")), + KeyBind.caxis(Input::c_axis_from_name("LeftX"), KeyBind::Positive), + KeyBind.cbutton(Input::c_button_from_name("DpRight")) + ], + :controls_walk_up => [ + KeyBind.key(Input::key_from_name("Up")), + KeyBind.caxis(Input::c_axis_from_name("LeftY"), KeyBind::Negative), + KeyBind.cbutton(Input::c_button_from_name("DpUp")) + ], + :controls_run => [ + KeyBind.key(Input::key_from_name("Left Shift")), + KeyBind.caxis(Input::c_axis_from_name("righttrigger"), KeyBind::Positive), + KeyBind.cbutton(Input::c_button_from_name("x")) + ], # ----------------------------------------------------------------------------------------------------------- - :controls_action => [ - KeyBind.key(Input::key_from_name("Z")), - KeyBind.key(Input::key_from_name("Space")), - KeyBind.cbutton(Input::c_button_from_name("a")), - ], - :controls_deactivate => [ - KeyBind.key(Input::key_from_name("Left Shift")), - KeyBind.cbutton(Input::c_button_from_name("back")), - KeyBind.caxis(Input::c_axis_from_name("lefttrigger"), KeyBind::Positive), - ], - :controls_cancel => [ - KeyBind.key(Input::key_from_name("X")), - KeyBind.key(Input::key_from_name("Escape")), - KeyBind.cbutton(Input::c_button_from_name("b")), - ], - :controls_menu => [ - KeyBind.key(Input::key_from_name("A")), - KeyBind.key(Input::key_from_name("Return")), - KeyBind.cbutton(Input::c_button_from_name("start")), - ], - :controls_items => [ - KeyBind.key(Input::key_from_name("S")), - KeyBind.cbutton(Input::c_button_from_name("y")), - ], - :controls_nav_left => [ - KeyBind.key(Input::key_from_name("Q")), - KeyBind.cbutton(Input::c_button_from_name("leftshoulder")), - ], - :controls_nav_right => [ - KeyBind.key(Input::key_from_name("W")), - KeyBind.cbutton(Input::c_button_from_name("rightshoulder")), - ], + :controls_action => [ + KeyBind.key(Input::key_from_name("Z")), + KeyBind.key(Input::key_from_name("Space")), + KeyBind.cbutton(Input::c_button_from_name("a")), + ], + :controls_deactivate => [ + KeyBind.key(Input::key_from_name("Left Shift")), + KeyBind.cbutton(Input::c_button_from_name("back")), + KeyBind.caxis(Input::c_axis_from_name("lefttrigger"), KeyBind::Positive), + ], + :controls_cancel => [ + KeyBind.key(Input::key_from_name("X")), + KeyBind.key(Input::key_from_name("Escape")), + KeyBind.cbutton(Input::c_button_from_name("b")), + ], + :controls_menu => [ + KeyBind.key(Input::key_from_name("A")), + KeyBind.key(Input::key_from_name("Return")), + KeyBind.cbutton(Input::c_button_from_name("start")), + ], + :controls_items => [ + KeyBind.key(Input::key_from_name("S")), + KeyBind.cbutton(Input::c_button_from_name("y")), + ], + :controls_nav_left => [ + KeyBind.key(Input::key_from_name("Q")), + KeyBind.cbutton(Input::c_button_from_name("leftshoulder")), + ], + :controls_nav_right => [ + KeyBind.key(Input::key_from_name("W")), + KeyBind.cbutton(Input::c_button_from_name("rightshoulder")), + ], # ----------------------------------------------------------------------------------------------------------- - :controls_debug => [ - KeyBind.key(Input::key_from_name("Left Ctrl")), - KeyBind.cbutton(Input::c_button_from_name("rightstick")), - ], + :controls_debug => [ + KeyBind.key(Input::key_from_name("Left Ctrl")), + KeyBind.cbutton(Input::c_button_from_name("rightstick")), + ], }) end end diff --git a/scripts/Settings_Setters.rb b/scripts/Settings_Setters.rb index 76aa397..1866e15 100644 --- a/scripts/Settings_Setters.rb +++ b/scripts/Settings_Setters.rb @@ -7,23 +7,25 @@ module Settings # if you do not take the value from settings directly. # name must be same as the parameter identifier - - def crashlog_privacy(value) - Sunshine.crash_privacy = value - end + + # ---------------------------------------------- Audio -------------------------------------------- def master_volume(value) Audio.master_volume = value / 100.0 end + def bgm_volume(value) Audio.bgm_volume = value end + def sfx_volume(value) Audio.sfx_volume = value end + # ---------------------------------------------- Video -------------------------------------------- def fullscreen(value) Graphics.fullscreen = $console = value end + def resolution(value) if (!Graphics::RESOLUTION_OVERRIDDEN) res_data = Graphics::RESOLUTIONS&.[](value) || {:width => 480, :height => 640} @@ -35,47 +37,61 @@ module Settings Graphics.resize_screen(new_width, new_height) end end - - def scaling_mode(value) - Graphics.smooth = value != 0 - end def colorblind(value) $game_switches[252] = value end - # UI - def in_game_timer(value) - $game_temp.igt_timer_visible = value - if $scene.is_a?(Scene_Map) && $scene&.in_game_timer - $scene.in_game_timer.visible = $game_temp.igt_timer_visible - end - end - def language(value) - $persistent.lang = Language::LANGUAGES[value] - $scene&.redraw - end - - def movement(value) - $game_switches[251] = value != 0 - end - def skip_text(value) - $game_switches[253] = value != 0 - end - def frameskip(value) Graphics.frameskip = value end - def invalid_param_checks(value) - Sunshine.set_sdl_hint("SDL_HINT_INVALID_PARAM_CHECKS", value ? "1" : "2") + def scaling_mode(value) + Graphics.smooth = value != 0 end VSYNC_MODES = [1, -1, 0] def vsync(value) Graphics.setVsync(VSYNC_MODES[value]) end - + + # ----------------------------------------------- UI ----------------------------------------------- + def in_game_timer(value) + $game_temp.igt_timer_visible = value + if $scene.is_a?(Scene_Map) && $scene&.in_game_timer + $scene.in_game_timer.visible = $game_temp.igt_timer_visible + end + end + + def language(value) + $persistent.lang = Language::LANGUAGES[value] + $scene&.redraw + end + + # -------------------------------------------- Gameplay -------------------------------------------- + def movement(value) + $game_switches[251] = value != 0 + end + + def skip_text(value) + $game_switches[253] = value != 0 + end + + WALLPAPER_MODES = ["normal", "fallback", "disbled"] + def wallpaper_mode(value) + Sunshine.wallpaper_mode = WALLPAPER_MODES[value] + end + + # -------------------------------------------- Advanced -------------------------------------------- + def crashlog_privacy(value) + Sunshine.crash_privacy = value + end + + def invalid_param_checks(value) + Sunshine.set_sdl_hint("SDL_HINT_INVALID_PARAM_CHECKS", value ? "1" : "2") + end + + # --------------------------------------------- Debug ---------------------------------------------- def shutdown_dbus_on_quit(value) Sunshine.set_sdl_hint("SDL_HINT_SHUTDOWN_DBUS_ON_QUIT", value ? "1" : "0") end @@ -84,10 +100,7 @@ module Settings Profiler.set(value) end - WALLPAPER_MODES = ["normal", "fallback", "disbled"] - def wallpaper_mode(value) - Sunshine.wallpaper_mode = WALLPAPER_MODES[value] - end + # --------------------------------------------- End :3 --------------------------------------------- end end end From 8c0399cc98453a0b6962ece59a8e85be7d21dc89 Mon Sep 17 00:00:00 2001 From: CatWindow Date: Wed, 19 Aug 2026 20:03:25 +0300 Subject: [PATCH 05/10] meow --- binding-mri/graphics-binding.cpp | 2 +- scripts/Settings_Setters.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/binding-mri/graphics-binding.cpp b/binding-mri/graphics-binding.cpp index 7ecf4cd..f30047e 100644 --- a/binding-mri/graphics-binding.cpp +++ b/binding-mri/graphics-binding.cpp @@ -306,7 +306,7 @@ void graphicsBindingInit(){ _rb_define_module_function(module, "freeze", graphicsFreeze); _rb_define_module_function(module, "transition", graphicsTransition); _rb_define_module_function(module, "frame_reset", graphicsFrameReset); - _rb_define_module_function(module, "setVsync", graphicsSetVsync); + _rb_define_module_function(module, "vsync_mode=", graphicsSetVsync); _rb_define_module_function(module, "__reset__", graphicsReset); // Variables diff --git a/scripts/Settings_Setters.rb b/scripts/Settings_Setters.rb index 1866e15..c8c96c5 100644 --- a/scripts/Settings_Setters.rb +++ b/scripts/Settings_Setters.rb @@ -52,7 +52,7 @@ module Settings VSYNC_MODES = [1, -1, 0] def vsync(value) - Graphics.setVsync(VSYNC_MODES[value]) + Graphics.vsync_mode = VSYNC_MODES[value] end # ----------------------------------------------- UI ----------------------------------------------- From ca8ac8bb3b3f631ff4b76f67cc5cc068837c7e58 Mon Sep 17 00:00:00 2001 From: CatWindow Date: Thu, 20 Aug 2026 01:42:44 +0300 Subject: [PATCH 06/10] arts folder --- arts/MeowCat.txt | 20 +++ arts/MeowingCat.txt | 30 +++++ arts/README.md | 3 + arts/WhiteCatWindow.txt | 187 ++++++++++++++++++++++++++++ binding-mri/audioplayback-binding.h | 35 +----- src/sharedstate.h | 27 +--- 6 files changed, 242 insertions(+), 60 deletions(-) create mode 100644 arts/MeowCat.txt create mode 100644 arts/MeowingCat.txt create mode 100644 arts/README.md create mode 100644 arts/WhiteCatWindow.txt diff --git a/arts/MeowCat.txt b/arts/MeowCat.txt new file mode 100644 index 0000000..dfa7f3d --- /dev/null +++ b/arts/MeowCat.txt @@ -0,0 +1,20 @@ + meow meow + meow meow + meow meow meow meow + meow meow meow meow + meow meow meow meow meow meow + meow meow meow meow meow meow + meow meow meow meow meow meow meow meow + meow meow meow meow meow meow meow meow + meow meow meow meow meow meow meow meow + meow meow meow meow meow meow meow meow + meow meow meow meow meow meow + meow meow meow meow meow meow +meow meow meow meow meow meow meow meow meow meow +meow meow meow meow meow meow meow meow meow meow + meow meow meow meow meow meow meow + meow meow meow meow meow meow meow +meow meow meow meow meow meow meow +meow meow meow meow meow meow meow + meow meow meow meow meow meow meow meow + meow meow meow meow meow meow meow meow \ No newline at end of file diff --git a/arts/MeowingCat.txt b/arts/MeowingCat.txt new file mode 100644 index 0000000..60502a1 --- /dev/null +++ b/arts/MeowingCat.txt @@ -0,0 +1,30 @@ +the code is my canvas.. + ██████ ██████ ██ + ████ ██ ████ ██ ████ + ██ ██ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ████████ + ██ ██ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ██ ██ +██ ████ ██ ██ ██ +██ ██ ██ ██ +██ ██ ██ ██ ██ +██ ██ ██ ██ ██ +██ ██ ██ ██ +██ ████ ████ ██ ██ ██ ██ +██ ██ ██ ██ ██ ██ ██ +██ ██ ██ ██ ██ ██ +██ ██ ██ ██ ██ ██ +██ ████ ████ ██ ████████████████ ████████ ██ +██ ██ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ████ ██ + ██ ██████ ████ ██ ██ ██ + ██ ██ ██ ██ ████ ██ ██ + ████ ████ ████ ██████ ██████ + ████████████████████ ██████ ██ ██ + ██ ██████ ████ + ██ + ████ + ██ + ██ \ No newline at end of file diff --git a/arts/README.md b/arts/README.md new file mode 100644 index 0000000..b8ad767 --- /dev/null +++ b/arts/README.md @@ -0,0 +1,3 @@ +# Arts + +Just some random art drawn during a break from coding 🗦(^.ꞈ.^)🗧 \ No newline at end of file diff --git a/arts/WhiteCatWindow.txt b/arts/WhiteCatWindow.txt new file mode 100644 index 0000000..db472b3 --- /dev/null +++ b/arts/WhiteCatWindow.txt @@ -0,0 +1,187 @@ +████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ +████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ +████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ +████████████ ██████████████████████████████████ ██████████████████████████████████████████████████████████ ████████ ██████ +██████████ ████████ ████████████ ████████████████ ██ ████████████████████████████████████████████████████████ ████ ██████ +████████ ████████████████ ██████ ██████████ ██████ ██████████████████████████████████████████████████████████ ████████ +████████ ██████████████ ██ ██ ████████ ████ ██████████████████████████████████████████████████████████████ ██████████ +████████ ██████████████ ██ ████ ████████████████████ ████████████████████████████████████████████████████████████ ██████████ +████████ ██████████████ ██ ████ ████████████████████ ██████████████████████████████████████████████████████████ ████████ +██████████ ████████ ██ ██ ████ ██ ████████ ██ ██ ████████████████████████████████████████████████████████ ████ ██████ +████████████ ██████ ██ ████ ██████████ ████ ██████████████████████████████████████████████████████████ ████████ ██████ +██████████████████████████████████████████████ ████████████████████████████████████████████████████████████████████████████████████████ +████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ +████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ +████ ████ +████ ██████ ████ +████ ████████ ████ +████ ████████ ████ +████ ██████████ ████ +████ ██████████ ████ +████ ████████████ ████ +████ ██████████████ ████ +████ ██████████████ ████ +████ ████████████████ ████ +████ ████████████████ ██████ ████ +████ ██████████████████ ████████ ████ +████ ██████████████████ ████████████ ████ +████ ████████████████████ ████████████████ ████ +████ ██████████████████████ ████████████████████ ████ +████ ██████████████████████ ██████████████████████ ████ +████ ████████████████████████ ██████████████████████████ ████ +████ ████████████████████████ ████████████████████████████ ████ +████ ██████████████████████████ ████████████████████████████████ ████ +████ ████████████████████████ ████████████████████████████████ ████ +████ ██████████████████████████ ████████████████████ ████ +████ ████████████████ ██████████████████████████████████████████████████████ ████ +████ ████████████████ ██████████████████████████████████████████████████████ ████ +████ ████████████████ ██████████████████████████████████████████████████████ ████ +████ ████████████████ ██████████████████████████████████████████████████████ ████ +████ ████████████████ ██████████████████████████████████████████████████████ ████ +████ ████████████████ ██████████████████████████████████████████████████████ ████ +████ ████████████████ ██████████████████████████████████████████████████████ ████ +████ ████████████████ ██████████████████████████████████████████████████████ ████ +████ ████████████████ ██████ ████████████████████████████████████████████ ████ +████ ████████████████ ████████████████████████████████████████████████ ████ +████ ██████████████████████████████████████████████████████████████████████████ ████ +████ ██████████████████████████████████████████████ ██████ ██████ ████ +████ ██████████████████████████████████████████████ ████████ ████████ ████ +████ ██████████████████████████████████████████████ ████████ ████████ ████ +████ ██████████████████████████████████████████████ ████████ ████████ ████ +████ ██████████████████████████████████████████████████████████████████████████ ████ +████ ██████████████████████████████████████████████████████████████████████████ ████ +████ ██████████████████████████████████████████████████████████████████████████ ████ +████ ██████████████████████████████████████████████████ ██████ ██████████ ████ +████ ████████████████████████████████████████████████ ████ ██ ████████ ████ +████ ████████████████████████████████████████████████ ████████ ████ +████ ██████████████████████████████████████████████████ ████ ██████████ ████ +████ ██████████████████████████████████████████████████████████████████████████ ████ +████ ██████████████████████████████████████████████████████████████████████████ ████ +████ ██████████████████████████████████████████████████████████████████████████ ████ +████ ██████████████████████████████████████████████████████████████████████████ ████ +████ ████ ██████████████████████████████████████████████████████████████████ ████ +████ ██████████ ████ +████ ██████████████ ████ +████ ██████████████ ████████████████████████████ ████ +████ ██████████████████ ████████████████████████████████████████████████████ ████ +████ ████████████████████ ████████████████████████████████████████████████████ ████ +████ ████████████████████ ██████████████████████████████████████████████████████ ████ +████ ████████████████████ ██████████████████████████████████████████████████████ ██ ████ +████ ██████████████████████ ████████████████████████████████████████████████████████ ████ ████ +████ ████████████████████ ██████████████████████████████████████████████████████ ██████ ████ +████ ████████████████████ ██████████████████████████████████████████████████████████████████ ██████ ████ +████ ████████████████████ ████████████████████████████████████████████████████████████████████ ████████ ████ +████ ████████████████████ ████████████████████████████████████████████████████████████████████ ██████ ████ +████ ████████████████████ ████████████████████████████████████████████████████████████████████████ ████████ ████ +████ ████████████████████ ████████████████████████████████████████████████████████████████████████ ██████ ████ +████ ████████████████████ ██████████████████████████████████████████████████████████████████████████ ██████ ████ +████ ████████████████████ ██████████████████████████████████████████████████████████████████████████ ██████ ████ +████ ██████████████████ ████████████████████████████████████████████████████████████████████████████ ██████ ████ +████ ██████████████████ ██████████████████████████████████████████████████████████████████████████ ████████ ████ +████ ████████████████████ ████████████████████████████████████████████████████████████████████████ ██████████ ████ +████ ████████████████████ ██████████████████████████████████████████████████████████████████████ ████████████ ████ +████ ████████████████████ ██████████████████████████████████████████████████████████████████████ ████████████████ ████ +████ ██████████████████ ██████████████████████████████████████████████████████████████████ ████████████████ ████ +████ ██████████████████ ████████████████████████████████████████████████████████████████ ████████████████████ ████ +████ ██████████████████ ██████████████████████████████████████████████████████████████ ████████████████████████ ████ +████ ██████████████████ ████████████████████████████████████████████████████████████ ██████████████████████████ ████ +████ ████████████████ ████████████████████████████ ██████████████████████████████ ████████████████████████████ ████ +████ ██████████████████ ████████████████████████████ ██████████████████████████████ ██████████████████ ██████ ████ +████ ██████████████████ ██████████████████████████ ████████████████████████████████ ████████████ ██████ ████ +████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██ ████████ ████ +████ ████████████████ ██████████████████████████ ██████████████████████████████ ████████████████████ ████ +████ ████████████████ ████████████████████████ ██████████████████████████████ ████████████████████████ ████ +████ ████████████████ ████████████████████████ ██████████████████████████████ ████████████████████████ ████ +████ ████████████████ ████████████████████████ ██████████████████████████████ ████████████████████████ ████ +████ ████████████████ ██████████████████████ ██████████████████████████████ ████████████████████████ ████ +████ ████████████████ ██████████████████████ ████████████████████████████████ ██████████████████████ ████ +████ ████████████████ ██████████████████████ ████████████████████████████████ ██████████████████████ ████ +████ ██████████████████ ██████████████████████ ████████████████████████████████ ██████████████████████ ████ +████ ████████████████████ ██████████████████████ ██████████████████████████████ ██████████████████████ ████ +████ ██████████████████ ██████████████████████ ████████████████████████████████ ██████████████████ ████ +████ ██████████████████ ██████████████████████ ████████████████████████████████ ████████████████ ████ +████ ████████████████ ██████████████████████ ██████████████████████████████████ ████████ ████ +████ ████████████████ ████████████████████████ ████████████████████████████████████ ██ ████ +████ ██████████████ ████████████████████████ ██████████████████████████████████ ██████ ████ +████ ████████████ ████████████████████████ ██████████████████████████████████████ ████ ████ +████ ██████████ ████████████████████████ ████████████████████████████████████████ ██ ████ +████ ████████ ██████████████████████ ████████████████████████████████████████ ██ ████ +████ ████████ ████████████████████ ██████████████████████████████████████████ ██████ ████ +████ ██████ ████████████████████ ██████████████████████████████████████████ ██████ ████ +████ ████ ████████████████████ ████████████████████████████████████████ ████████ ████ +████ ██ ████████████████████ ████████████████████████████████████████ ████████ ████ +████ ████████████████████ ████████████████████████████████████████ ██████████ ████ +████ ████████████████████ ██████████████████████████████████████████ ██████████ ████ +████ ████████████████████ ██████████████████████████████████████████ ██████████ ████ +████ ████████████████████ ██████████████████████████████████████████ ██████████ ████ +████ ████████████████████ ████████████████████████████ ██████████████ ██████ ████ +████ ██████████████████ ████████████████████████████ ██████████████ ██████ ████ +████ ██████████████████ ████████████████████████████ ██████████████ ████ ████ +████ ██████████████████ ████████████████████████████ ████████████████ ████ +████ ████████████████ ██████████████████████████████ ██████████████████ ████ +████ ████████████████ ██████████████████████████████ ██████████████████ ████ +████ ████████████████ ██████████████████████████████ ████████████████ ████ +████ ████████████████ ██████████████████████████████ ████████████████ ████ +████ ████████████████ ██████████████████████████████ ████████████████ ████ +████ ████████████████ ██████████████████████████████ ████████████████ ████ +████ ██████████████ ██████████████████████████████ ████████████████ ████ +████ ██████████████ ████████████████████████████ ████████████████ ████ +████ ████████████████ ████████ ████████ ██████████████ ████ +████ ████████████████████ ████ ████ ████ ████ ██████████████ ████ +████ ██████████████████████ ██ ████ ████ ██ ██ ██████████████ ████ +████ ████████████████████████ ██ ██ ██ ██████████████ ████ +████ ██████████████████ ██ ██ ████ ██ ██ ██████████████ ████ +████ ████████████████ ██████ ████ ████ ████ ██████████████ ████ +████ ████████████████ ██████ ██ ██ ████████████ ████ +████ ████████████████ ██████ ████ ████ ████ ██████████ ████ +████ ████████████████ ██████ ██ ██ ████ ██ ██ ██████████ ████ +████ ██████████████████ ██ ████ ██ ██████████ ████ +████ ████████████████████████ ████ ████ ██ ██ ██████████ ████ +████ ██████████████████ ████ ████ ████ ████ ██████████ ████ +████ ██████████ ████████ ██████████ ████ +████ ████████████████████████████████████ ████████ ████ +████ ████████████████████████████████████ ████████ ████ +████ ████████████████████████████████████ ████████ ████ +████ ████████████████████████████████████ ████████ ████ +████ ██████████████████████████████████ ████████ ████ +████ ██████████████████████████████████ ████████ ████ +████ ████████████████████████████████ ████ ████ +████ ████████████████████████████████ ██████ ████ +████ ██████████████████████████████ ██████ ████ +████ ██████████████████████████████ ██████ ████ +████ ████████████████████████████ ██████ ████ +████ ██████████████████████████████ ██████ ████ +████ ██████████████████████████████ ██████ ████ +████ ██████████████████████████████ ████ ████ +████ ██████████████████████████████ ████ ████ +████ ████████████████████████████████ ██████ ████ +████ ████████████████████████████████ ██████ ████ +████ ██████████████████████████████ ██████ ████ +████ ██████████████████████████████ ██████ ████ +████ ████████████████████████████ ██████ ████ +████ ████████████████████████████ ████████ ████ +████ ██████████████████████████ ████████ ████ +████ ████████████████████████ ██████████ ████ +████ ████████████████████████ ████████ ████ +████ ██████████████████████ ██████████ ████ +████ ██████████████████████ ██████████ ████ +████ ████████████████████ ████████████ ████ +████ ████████████████████ ████████████ ████ +████ ██████████████████ ████████████ ████ +████ ████████████████████ ██████████████ ████ +████ ██████████████████ ██████████████ ████ +████ ██████████████████ ████████████████ ████ +████ ████████████████ ██████████████ ████ +████ ████████████████ ██████████████ ████ +████ ██████████████ ████████████ ████ +████ ██████████████ ████████████ ████ +████ ██████████████ ██████████████ ████ +████ ██████████████ ████████████████ ████ +████ ██████████████████ ████████████████████ ████ +████ ████████████████████ ████████████████████████ ████ +████ ██████████████████████████ ██████████████████████ ████ +████ ██████████████████████████████ ██████████████████████ ████ +████ ██████████████████████████████ ████ +████ ████ +████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ +████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ \ No newline at end of file diff --git a/binding-mri/audioplayback-binding.h b/binding-mri/audioplayback-binding.h index d21e0f4..2e93c65 100644 --- a/binding-mri/audioplayback-binding.h +++ b/binding-mri/audioplayback-binding.h @@ -6,37 +6,4 @@ extern void audioplayback_free(void* ptr); extern const rb_data_type_t audioplayback_type; -extern VALUE audioplayback_klass; - -/* -the code is my canvas.. - ██████ ██████ ██ - ████ ██ ████ ██ ████ - ██ ██ ██ ██ ██ ██ - ██ ██ ██ ██ ██ ████████ - ██ ██ ██ ██ ██ ██ - ██ ██ ██ ██ ██ ██ - ██ ██ ██ ██ ██ ██ ██ - ██ ██ ██ ██ ██ ██ ██ -██ ████ ██ ██ ██ -██ ██ ██ ██ -██ ██ ██ ██ ██ -██ ██ ██ ██ ██ -██ ██ ██ ██ -██ ████ ████ ██ ██ ██ ██ -██ ██ ██ ██ ██ ██ ██ -██ ██ ██ ██ ██ ██ -██ ██ ██ ██ ██ ██ -██ ████ ████ ██ ████████████████ ████████ ██ -██ ██ ██ ██ ██ ██ - ██ ██ ██ ██ ██ ████ ██ - ██ ██████ ████ ██ ██ ██ - ██ ██ ██ ██ ████ ██ ██ - ████ ████ ████ ██████ ██████ - ████████████████████ ██████ ██ ██ - ██ ██████ ████ - ██ - ████ - ██ - ██ -*/ \ No newline at end of file +extern VALUE audioplayback_klass; \ No newline at end of file diff --git a/src/sharedstate.h b/src/sharedstate.h index 7213576..0db5dbc 100644 --- a/src/sharedstate.h +++ b/src/sharedstate.h @@ -151,29 +151,4 @@ private: SharedStatePrivate *p; }; -#endif // SHAREDSTATE_H - - - -/* this is not part of mkxp :| - meow meow - meow meow - meow meow meow meow - meow meow meow meow - meow meow meow meow meow meow - meow meow meow meow meow meow - meow meow meow meow meow meow meow meow - meow meow meow meow meow meow meow meow - meow meow meow meow meow meow meow meow - meow meow meow meow meow meow meow meow - meow meow meow meow meow meow - meow meow meow meow meow meow -meow meow meow meow meow meow meow meow meow meow -meow meow meow meow meow meow meow meow meow meow - meow meow meow meow meow meow meow - meow meow meow meow meow meow meow -meow meow meow meow meow meow meow -meow meow meow meow meow meow meow - meow meow meow meow meow meow meow meow - meow meow meow meow meow meow meow meow -*/ +#endif // SHAREDSTATE_H \ No newline at end of file From e318e5ed23946230afdc588d5bbdf408af8a6a1d Mon Sep 17 00:00:00 2001 From: AnmiTaliDev Date: Thu, 20 Aug 2026 09:11:05 +0500 Subject: [PATCH 07/10] Fix XFCE wallpaper not applying (wrong monitor property + broken xfconf array write) --- binding-mri/wallpaper-binding.cpp | 202 +++++++++++++++++++----------- 1 file changed, 128 insertions(+), 74 deletions(-) diff --git a/binding-mri/wallpaper-binding.cpp b/binding-mri/wallpaper-binding.cpp index 8bbddea..4dc2fde 100644 --- a/binding-mri/wallpaper-binding.cpp +++ b/binding-mri/wallpaper-binding.cpp @@ -49,11 +49,15 @@ static bool hasPictureURIDark = false; // XFCE settings static XfconfChannel* bgchannel; - static int defPictureStyle; - static int defColorStyle; - static GValue defColor = G_VALUE_INIT; - static bool defColorExists; - static std::string optionImage, optionColor, optionImageStyle, optionColorStyle; + static std::vector xfceMonitorPrefixes; + static std::map defXfcePictureURI; + static std::map defXfcePictureStyle; + static std::map defXfceColorStyle; + static std::map defXfceColor; + static std::map defXfceColorExists; + static bool xfceHasSingleWorkspaceProps = false; + static bool xfceSingleWorkspaceMode = false; + static int xfceSingleWorkspaceNumber = 0; // KDE settings static std::map defPlugins, defPictures, defColors, defModes; static std::map defBlurs; @@ -191,15 +195,55 @@ GError *xferror = NULL; if (xfconf_init(&xferror)) { bgchannel = xfconf_channel_get("xfce4-desktop"); - std::string optionPrefix = "/backdrop/screen0/monitor0/workspace0/"; - optionImage = optionPrefix + "last-image"; - optionColor = optionPrefix + "color1"; - optionImageStyle = optionPrefix + "image-style"; - optionColorStyle = optionPrefix + "color-style"; - defPictureURI = xfconf_channel_get_string(bgchannel, optionImage.c_str(), ""); - defPictureStyle = xfconf_channel_get_int(bgchannel, optionImageStyle.c_str(), -1); - defColorExists = xfconf_channel_get_property(bgchannel, optionColor.c_str(), &defColor); - defColorStyle = xfconf_channel_get_int(bgchannel, optionColorStyle.c_str(), -1); + + GHashTable *props = xfconf_channel_get_properties(bgchannel, "/backdrop"); + if (props) { + const std::string suffix = "/last-image"; + GHashTableIter iter; + gpointer key, value; + g_hash_table_iter_init(&iter, props); + while (g_hash_table_iter_next(&iter, &key, &value)) { + std::string propPath((const char*)key); + if (propPath.size() > suffix.size() && + propPath.compare(propPath.size() - suffix.size(), suffix.size(), suffix) == 0) { + xfceMonitorPrefixes.push_back(propPath.substr(0, propPath.size() - suffix.size() + 1)); + } + } + g_hash_table_destroy(props); + } + if (xfceMonitorPrefixes.empty()) { + xfceMonitorPrefixes.push_back("/backdrop/screen0/monitor0/workspace0/"); + } + + xfceHasSingleWorkspaceProps = xfconf_channel_has_property(bgchannel, "/backdrop/single-workspace-mode"); + if (xfceHasSingleWorkspaceProps) { + xfceSingleWorkspaceMode = xfconf_channel_get_bool(bgchannel, "/backdrop/single-workspace-mode", true); + xfceSingleWorkspaceNumber = xfconf_channel_get_int(bgchannel, "/backdrop/single-workspace-number", 0); + } + if (xfceHasSingleWorkspaceProps && xfceSingleWorkspaceMode) { + std::vector extraPrefixes; + for (const std::string &prefix : xfceMonitorPrefixes) { + std::size_t workspacePos = prefix.rfind("/workspace"); + if (workspacePos == std::string::npos) + continue; + std::string monitorBase = prefix.substr(0, workspacePos + 1); + std::string activePrefix = monitorBase + "workspace" + std::to_string(xfceSingleWorkspaceNumber) + "/"; + if (std::find(xfceMonitorPrefixes.begin(), xfceMonitorPrefixes.end(), activePrefix) == xfceMonitorPrefixes.end() && + std::find(extraPrefixes.begin(), extraPrefixes.end(), activePrefix) == extraPrefixes.end()) { + extraPrefixes.push_back(activePrefix); + } + } + xfceMonitorPrefixes.insert(xfceMonitorPrefixes.end(), extraPrefixes.begin(), extraPrefixes.end()); + } + + for (const std::string &prefix : xfceMonitorPrefixes) { + defXfcePictureURI[prefix] = xfconf_channel_get_string(bgchannel, (prefix + "last-image").c_str(), ""); + defXfcePictureStyle[prefix] = xfconf_channel_get_int(bgchannel, (prefix + "image-style").c_str(), -1); + defXfceColorStyle[prefix] = xfconf_channel_get_int(bgchannel, (prefix + "color-style").c_str(), -1); + GValue colorVal = G_VALUE_INIT; + defXfceColorExists[prefix] = xfconf_channel_get_property(bgchannel, (prefix + "color1").c_str(), &colorVal); + defXfceColor[prefix] = colorVal; + } } else { // Configuration failed to initialize, we won't set the wallpaper printf("[desktopEnvironmentInit] Configuration failed to initialize, we won't set the wallpaper\n"); @@ -457,49 +501,47 @@ end: unsigned int ub = b * 256 + b; unsigned int alpha = 65535; std::string concatPath(gameDirStr + path); - xfconf_channel_set_string(bgchannel, optionImage.c_str(), concatPath.c_str()); - xfconf_channel_set_int(bgchannel, optionColorStyle.c_str(), 0); - xfconf_channel_set_int(bgchannel, optionImageStyle.c_str(), 4); - GValue colorValue = G_VALUE_INIT; - GPtrArray *colorArr = g_ptr_array_sized_new(4); - GType colorArrType = g_type_from_name("GPtrArray_GValue_"); - //TODO:fix later - //if (!colorArrType) { - std::stringstream colorCommand; - colorCommand << "xfconf-query -c xfce4-desktop -n -p " << optionColor - << " -t uint -t uint -t uint -t uint -s " << ub - << " -s " << ug << " -s " << ub << " -s " << alpha; - Debug() << "xfconf-query -c xfce4-desktop -n -p " << optionColor - << " -t uint -t uint -t uint -t uint -s " << ub - << " -s " << ug << " -s " << ub << " -s " << alpha; - int colorCommandRes = system(colorCommand.str().c_str()); - defColorExists = xfconf_channel_get_property(bgchannel, optionColor.c_str(), &defColor); - colorArrType = g_type_from_name("GPtrArray_GValue_"); - if (!colorArrType) { - // Let's do some debug output here and skip changing the color - Debug() << "[wallpaperSet] WALLPAPER ERROR: xfconf-query call returned" << colorCommandRes; - return Qnil; + for (const std::string &prefix : xfceMonitorPrefixes) { + std::string optionImage = prefix + "last-image"; + std::string optionColor = prefix + "color1"; + std::string optionImageStyle = prefix + "image-style"; + std::string optionColorStyle = prefix + "color-style"; + + xfconf_channel_set_string(bgchannel, optionImage.c_str(), concatPath.c_str()); + xfconf_channel_set_int(bgchannel, optionColorStyle.c_str(), 0); + xfconf_channel_set_int(bgchannel, optionImageStyle.c_str(), 4); + + GPtrArray *colorArr = g_ptr_array_sized_new(4); + GValue *vr = g_new0(GValue, 1); + GValue *vg = g_new0(GValue, 1); + GValue *vb = g_new0(GValue, 1); + GValue *va = g_new0(GValue, 1); + g_value_init(vr, G_TYPE_UINT); + g_value_init(vg, G_TYPE_UINT); + g_value_init(vb, G_TYPE_UINT); + g_value_init(va, G_TYPE_UINT); + g_value_set_uint(vr, ur); + g_value_set_uint(vg, ug); + g_value_set_uint(vb, ub); + g_value_set_uint(va, alpha); + g_ptr_array_add(colorArr, vr); + g_ptr_array_add(colorArr, vg); + g_ptr_array_add(colorArr, vb); + g_ptr_array_add(colorArr, va); + if (!xfconf_channel_set_arrayv(bgchannel, optionColor.c_str(), colorArr)) { + Debug() << "[wallpaperSet] WALLPAPER ERROR: xfconf_channel_set_arrayv failed for" << optionColor; } - //} - g_value_init(&colorValue, colorArrType); - GValue *vr = g_new0(GValue, 1); - GValue *vg = g_new0(GValue, 1); - GValue *vb = g_new0(GValue, 1); - GValue *va = g_new0(GValue, 1); - g_value_init(vr, G_TYPE_UINT); - g_value_init(vg, G_TYPE_UINT); - g_value_init(vb, G_TYPE_UINT); - g_value_init(va, G_TYPE_UINT); - g_value_set_uint(vr, ur); - g_value_set_uint(vg, ug); - g_value_set_uint(vb, ub); - g_value_set_uint(va, alpha); - g_ptr_array_add(colorArr, vr); - g_ptr_array_add(colorArr, vg); - g_ptr_array_add(colorArr, vb); - g_ptr_array_add(colorArr, va); - g_value_set_boxed(&colorValue, colorArr); - xfconf_channel_set_property(bgchannel, optionColor.c_str(), &colorValue); + g_value_unset(vr); + g_value_unset(vg); + g_value_unset(vb); + g_value_unset(va); + g_free(vr); + g_free(vg); + g_free(vb); + g_free(va); + g_ptr_array_free(colorArr, TRUE); + } + system("xfdesktop --reload &"); } else if (desktop == "kde") { std::stringstream command; std::string concatPath(gameDirStr + path); @@ -622,26 +664,38 @@ RB_METHOD(wallpaperReset){ g_settings_set_string(bgsetting, "primary-color", defPrimaryColor.c_str()); g_settings_set_string(bgsetting, "color-shading-type", defColorShading.c_str()); } else if (desktop == "xfce") { - if (defColorExists) { - xfconf_channel_set_property(bgchannel, optionColor.c_str(), &defColor); - } else { - xfconf_channel_reset_property(bgchannel, optionColor.c_str(), false); + for (const std::string &prefix : xfceMonitorPrefixes) { + std::string optionImage = prefix + "last-image"; + std::string optionColor = prefix + "color1"; + std::string optionImageStyle = prefix + "image-style"; + std::string optionColorStyle = prefix + "color-style"; + + if (defXfceColorExists[prefix]) { + xfconf_channel_set_property(bgchannel, optionColor.c_str(), &defXfceColor[prefix]); + } else { + xfconf_channel_reset_property(bgchannel, optionColor.c_str(), false); + } + if (defXfcePictureURI[prefix] == "") { + xfconf_channel_reset_property(bgchannel, optionImage.c_str(), false); + } else { + xfconf_channel_set_string(bgchannel, optionImage.c_str(), defXfcePictureURI[prefix].c_str()); + } + if (defXfcePictureStyle[prefix] == -1) { + xfconf_channel_reset_property(bgchannel, optionImageStyle.c_str(), false); + } else { + xfconf_channel_set_int(bgchannel, optionImageStyle.c_str(), defXfcePictureStyle[prefix]); + } + if (defXfceColorStyle[prefix] == -1) { + xfconf_channel_reset_property(bgchannel, optionColorStyle.c_str(), false); + } else { + xfconf_channel_set_int(bgchannel, optionColorStyle.c_str(), defXfceColorStyle[prefix]); + } } - if (defPictureURI == "") { - xfconf_channel_reset_property(bgchannel, optionImage.c_str(), false); - } else { - xfconf_channel_set_string(bgchannel, optionImage.c_str(), defPictureURI.c_str()); - } - if (defPictureStyle == -1) { - xfconf_channel_reset_property(bgchannel, optionImageStyle.c_str(), false); - } else { - xfconf_channel_set_int(bgchannel, optionImageStyle.c_str(), defPictureStyle); - } - if (defColorStyle == -1) { - xfconf_channel_reset_property(bgchannel, optionColorStyle.c_str(), false); - } else { - xfconf_channel_set_int(bgchannel, optionColorStyle.c_str(), defColorStyle); + if (xfceHasSingleWorkspaceProps && xfceSingleWorkspaceMode) { + xfconf_channel_set_bool(bgchannel, "/backdrop/single-workspace-mode", false); + xfconf_channel_set_bool(bgchannel, "/backdrop/single-workspace-mode", true); } + system("xfdesktop --reload &"); } else if (desktop == "kde") { std::stringstream command; command << "qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'string:" << From eeb4022566d44a4799ab248c406814929be41a75 Mon Sep 17 00:00:00 2001 From: niko Date: Thu, 20 Aug 2026 07:39:05 +0300 Subject: [PATCH 08/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18a9228..a1ad95d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ It is a specialized fork of [mkxp-oneshot](https://github.com/elizagamedev/mkxp- ## Build 1. Install required packages * Cmake - * C/C++ compiler, GCC or MinG or Clang + * C/C++ compiler, GCC or MinGW or Clang * xxd * Ruby 3.4+ * Boost From 85a80a803002a843bc2ce52b6f755c6456ecbef2 Mon Sep 17 00:00:00 2001 From: niko Date: Thu, 20 Aug 2026 08:04:31 +0300 Subject: [PATCH 09/10] Update README.md --- README.md | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/README.md b/README.md index a1ad95d..ab298af 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,6 @@ # SunshineEngine It is a specialized fork of [mkxp-oneshot](https://github.com/elizagamedev/mkxp-oneshot) developed for the OneShot: Sunshine mod, aimed at optimization, running on old and new hardware, support for multiple platforms, and mod download security. -## Build -1. Install required packages - * Cmake - * C/C++ compiler, GCC or MinGW or Clang - * xxd - * Ruby 3.4+ - * Boost - * SDL3 - * pixman - * SDL3_image - * SDL3_ttf - * SDL3_mixer - * SDL3_net - * PhysFS - * sigc++-2.0 - * GTK3(*NIX only!) - * libxfconf(*NIX only!) - * libseccomp(Linux only) - -(*NIX - Linux,FreeBSD and other UNIX and UNIX-like systems.) - -2. build -Use build scripts. -make-oneshot-(OS).sh -DCMAKE_TOOLCHAIN_FILE=toolchain/arch/(x86/arm/ia-64).cmake - # Mirrors [Github](https://github.com/CatWindowTeam/mkxp-sunshine/tree/master) [git.snxrzx.xyz](https://git.snxrzx.xyz/snxrzx/mkxp-sunshine) From 98bfdc57f0b9c4ef0ac07d5dcf09621b664a19d3 Mon Sep 17 00:00:00 2001 From: niko Date: Thu, 20 Aug 2026 08:10:11 +0300 Subject: [PATCH 10/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab298af..dba3e20 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # SunshineEngine -It is a specialized fork of [mkxp-oneshot](https://github.com/elizagamedev/mkxp-oneshot) developed for the OneShot: Sunshine mod, aimed at optimization, running on old and new hardware, support for multiple platforms, and mod download security. +It is a specialized fork of [mkxp-oneshot](https://github.com/elizagamedev/mkxp-oneshot) developed for the OneShot: Sunshine mod, aimed at optimization, running on old and new hardware, support for multiple platforms, secure modloading. # Mirrors [Github](https://github.com/CatWindowTeam/mkxp-sunshine/tree/master)