Merge branch 'master' into linux

This commit is contained in:
Vinyl Darkscratch 2018-05-21 16:24:53 -07:00
commit 9653a59bcc
10 changed files with 60 additions and 4 deletions

View file

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

View file

@ -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()));

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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