From e77c7bce4a4818f5b9c85aa9b76f5de1f9c333ed Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Thu, 3 May 2018 02:07:02 -0700 Subject: [PATCH 1/9] Fix install script --- install.command | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.command b/install.command index bf60cc3..ca9e378 100755 --- a/install.command +++ b/install.command @@ -22,7 +22,8 @@ rm -rf "$ONESHOT_PATH/*.exe" rm -rf "$ONESHOT_PATH/*.dll" echo "-> ${cyan}Install OneShot apps to Steam directory...${color_reset}" -cp -rf "./*" "$ONESHOT_PATH" +cp -rf "." "$ONESHOT_PATH" +rm -f "$ONESHOT_PATH/install.command" ln -sfh "$ONESHOT_PATH/OneShot.app" "$HOME/Applications/OneShot.app" rm -f /tmp/oneshot-pipe # Important for pre-release version cleanup From 77b419d30afe5fffef6efb8de3a63dbcf0b59ed1 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Thu, 3 May 2018 22:10:59 -0700 Subject: [PATCH 2/9] Allow for easy OS detection within Ruby scripts --- binding-mri/oneshot-binding.cpp | 1 + src/oneshot.cpp | 13 +++++++++++++ src/oneshot.h | 1 + 3 files changed, 15 insertions(+) diff --git a/binding-mri/oneshot-binding.cpp b/binding-mri/oneshot-binding.cpp index b933a36..fc253a6 100644 --- a/binding-mri/oneshot-binding.cpp +++ b/binding-mri/oneshot-binding.cpp @@ -107,6 +107,7 @@ void oneshotBindingInit() VALUE msg = rb_define_module_under(module, "Msg"); // Constants + rb_const_set(module, rb_intern("OS"), rb_str_new2(shState->oneshot().os().c_str())); rb_const_set(module, rb_intern("USER_NAME"), rb_str_new2(shState->oneshot().userName().c_str())); rb_const_set(module, rb_intern("SAVE_PATH"), rb_str_new2(shState->oneshot().savePath().c_str())); rb_const_set(module, rb_intern("DOCS_PATH"), rb_str_new2(shState->oneshot().docsPath().c_str())); diff --git a/src/oneshot.cpp b/src/oneshot.cpp index 98c350f..01e56fd 100644 --- a/src/oneshot.cpp +++ b/src/oneshot.cpp @@ -49,6 +49,7 @@ struct OneshotPrivate SDL_Window *window; // String data + std::string os; std::string lang; std::string userName; std::string savePath; @@ -183,6 +184,13 @@ Oneshot::Oneshot(RGSSThreadData &threadData) : p->winPosChanged = false; p->allowExit = true; p->exiting = false; + #ifdef OS_W32 + p->os = "windows"; + #elif defined OS_OSX + p->os = "macos"; + #else + p->os = "linux"; + #endif /******************** * USERNAME/DOCS PATH @@ -373,6 +381,11 @@ void Oneshot::update() } } +const std::string &Oneshot::os() const +{ + return p->os; +} + const std::string &Oneshot::lang() const { return p->lang; diff --git a/src/oneshot.h b/src/oneshot.h index bc40a9a..bb02091 100644 --- a/src/oneshot.h +++ b/src/oneshot.h @@ -49,6 +49,7 @@ public: void update(); //Accessors + const std::string &os() const; const std::string &lang() const; const std::string &userName() const; const std::string &savePath() const; From d9357ef4f360d493b0ee102d9baee46402635154 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Thu, 3 May 2018 22:12:26 -0700 Subject: [PATCH 3/9] Increase fullscreen->window delay on dialogue message boxes Fixes #38 --- scripts/EdText.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/EdText.rb b/scripts/EdText.rb index fb4c87f..1dfd998 100644 --- a/scripts/EdText.rb +++ b/scripts/EdText.rb @@ -22,7 +22,12 @@ module EdText if Graphics.fullscreen Graphics.fullscreen = false $console = false - sleep 0.2 + if Oneshot::OS == "macos" + sleep 0.65 + else + sleep 0.2 + end + Graphics.update end result = nil # so here, we strip unescaped newlines from the untranslated text From beb0d3fb3c8ae0f00273b9572a134174e6e03369 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 4 May 2018 01:20:41 -0700 Subject: [PATCH 4/9] If journal is open, quit journal when quitting game --- scripts/Main.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/Main.rb b/scripts/Main.rb index d2cc5f1..1efbc73 100644 --- a/scripts/Main.rb +++ b/scripts/Main.rb @@ -36,6 +36,11 @@ begin # Fade out Oneshot.exiting true Graphics.transition(20) + + if Journal.active? + Journal.set '' + end + Oneshot.allow_exit true rescue Errno::ENOENT # Supplement Errno::ENOENT exception From 386189e0323bca19ca9a87cf970816a2e83e5c8e Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 4 May 2018 01:31:52 -0700 Subject: [PATCH 5/9] Copy xScripts.rxdata from Steam folder to repo folder This makes for somewhat easier packaging and release. --- make-oneshot-mac.command | 1 + 1 file changed, 1 insertion(+) diff --git a/make-oneshot-mac.command b/make-oneshot-mac.command index 1e3267d..2a4fff9 100755 --- a/make-oneshot-mac.command +++ b/make-oneshot-mac.command @@ -62,6 +62,7 @@ m4 patches/mac/JournalInfo.plist.in -DONESHOTMACVERSION=$mac_version > _______.a # Compile scripts echo "-> ${cyan}Compile xScripts.rxdata...${color_reset}" ruby rpgscript.rb ./scripts "$ONESHOT_PATH" +cp "$ONESHOT_PATH/Data/xScripts.rxdata" . echo "-> ${cyan}Install OneShot apps to Steam directory...${color_reset}" cp -rf "./OneShot.app" "$ONESHOT_PATH" From 69829ad17a1ae3a4638549072f08f3ccb7b45705 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 4 May 2018 01:32:16 -0700 Subject: [PATCH 6/9] Disable close button after switching from default image --- journal/unix/journal.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/journal/unix/journal.py b/journal/unix/journal.py index b54140b..23b994c 100644 --- a/journal/unix/journal.py +++ b/journal/unix/journal.py @@ -88,6 +88,8 @@ class Journal(QWidget): self.close_label.setPixmap(QPixmap(os.path.join(base_path, 'images', 'close.png'))) if not left_close: self.close_label.move(776, 0) # X = 800-24 + self.close_button = True + if "linux" in sys.platform: self.setWindowFlags(Qt.FramelessWindowHint) else: self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint | Qt.NoDropShadowWindowHint) self.setAttribute(Qt.WA_TranslucentBackground) @@ -103,7 +105,7 @@ class Journal(QWidget): self.mousedown = True self.mousedownpos = event.pos() - if ((left_close and self.mousedownpos.x() <= 24) or (not left_close and self.mousedownpos.x() >= 776)) and self.mousedownpos.y() < 24: + if self.close_button and (((left_close and self.mousedownpos.x() <= 24) or (not left_close and self.mousedownpos.x() >= 776)) and self.mousedownpos.y() < 24): self.app.quit() def mouseReleaseEvent(self, event): @@ -122,6 +124,11 @@ class Journal(QWidget): if not "_" in image: return name, lang = image.split('_', 1) + + if name != "default": + self.close_label.hide() + self.close_button = False + if lang == 'en': img = os.path.join(base_path, 'images', '{}.png'.format(name)) else: img = os.path.join(base_path, 'images', lang.upper(), '{}.png'.format(name)) if not os.path.exists(img): return From 0e3abe02e253e85230d073a67bb58d6cfac70218 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 4 May 2018 01:38:04 -0700 Subject: [PATCH 7/9] Bump version number --- make-oneshot-mac.command | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make-oneshot-mac.command b/make-oneshot-mac.command index 2a4fff9..9b40905 100755 --- a/make-oneshot-mac.command +++ b/make-oneshot-mac.command @@ -4,7 +4,7 @@ set -e cd `dirname $0` # User-configurable variables -mac_version="1.0.1" +mac_version="1.0.2" make_threads=8 ONESHOT_PATH=$HOME/Library/Application\ Support/Steam/steamapps/common/OneShot From 8a873cd50320f666cefe93520be7609338645d58 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 4 May 2018 01:39:26 -0700 Subject: [PATCH 8/9] 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 fbea489..6236f43 100644 --- a/scripts/Game_Oneshot.rb +++ b/scripts/Game_Oneshot.rb @@ -32,6 +32,16 @@ end 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 @@ module Wallpaper 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 From e09072c800b24ca1da60cafb2d9c6c0f4259bce2 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Mon, 21 May 2018 16:24:37 -0700 Subject: [PATCH 9/9] Update dependencies list Fixes #48 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6976d00..b46a0d1 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Thanks to [hunternet93](https://github.com/hunternet93) for starting the reimple * Boost.Unordered (headers only) * Boost.Program_options * Boost.CRC +* Vim XXD (vim-common in apt) * libsigc++ 2.0 * PhysFS (latest hg) * OpenAL