From 8a873cd50320f666cefe93520be7609338645d58 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 4 May 2018 01:39:26 -0700 Subject: [PATCH] Switch to windowed mode when changing wallpaper This fixes a bug on macOS where fullscreen applications are treated like separate desktops. Also makes the wallpaper easier to see. --- scripts/Game_Oneshot.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/Game_Oneshot.rb b/scripts/Game_Oneshot.rb index fbea4897..6236f438 100644 --- a/scripts/Game_Oneshot.rb +++ b/scripts/Game_Oneshot.rb @@ -32,6 +32,16 @@ def self.get_user_name module Wallpaper def self.set_persistent(name, color) + if Graphics.fullscreen + Graphics.fullscreen = false + $console = false + if Oneshot::OS == "macos" + sleep 0.65 + else + sleep 0.2 + end + Graphics.update + end if (name == 'save_w32') case $persistent.langcode @@ -55,6 +65,17 @@ def self.set_persistent(name, color) end def self.reset_persistent + if Graphics.fullscreen + Graphics.fullscreen = false + $console = false + if Oneshot::OS == "macos" + sleep 0.65 + else + sleep 0.2 + end + Graphics.update + end + $game_oneshot.wallpaper = nil $game_oneshot.wallpaper_color = nil Wallpaper.reset