diff --git a/.gitignore b/.gitignore index 7137b9b..04acf7b 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ oneshot_JA_2_ver3_checked.pot oneshot_JA_Mariko1_WIP.pot *.pot xScripts.rxdata +OneShot .qmake.stash CMakeCache.txt diff --git a/binding-mri/wallpaper-binding.cpp b/binding-mri/wallpaper-binding.cpp index ea6490a..1e170d8 100644 --- a/binding-mri/wallpaper-binding.cpp +++ b/binding-mri/wallpaper-binding.cpp @@ -20,7 +20,13 @@ static bool isCached = false; #ifdef __APPLE__ #include "mac-desktop.h" #else - // XXX Implement me! + #include + #include + #include + Glib::RefPtr bgsetting = Gio::Settings::create("org.gnome.desktop.background"); + std::string defPictureURI = bgsetting->get_string("picture-uri"); + std::string defPictureOptions = bgsetting->get_string("picture-options"); + std::string defPrimaryColor = bgsetting->get_string("primary-color"); #endif #endif @@ -110,7 +116,17 @@ end: } MacDesktop::ChangeBackground(imgname, ((color >> 16) & 0xFF) / 255.0, ((color >> 8) & 0xFF) / 255.0, ((color) & 0xFF) / 255.0); #else - // XXX Implement me! + char gameDir[1024]; + if (getcwd(gameDir, sizeof(gameDir)) != NULL) { + std::string gameDirStr(gameDir); + std::stringstream hexColor; + hexColor << "#" << std::hex << color; + bgsetting->set_string("picture-uri", "file://" + gameDirStr + "/Wallpaper/" + imageName + ".png"); + bgsetting->set_string("picture-options", "scaled"); + bgsetting->set_string("primary-color", hexColor.str()); + } else { + // Error handling? + } #endif #endif return Qnil; @@ -148,7 +164,9 @@ RB_METHOD(wallpaperReset) #ifdef __APPLE__ MacDesktop::ResetBackground(); #else - // XXX Implement me! + bgsetting->set_string("picture-uri", defPictureURI); + bgsetting->set_string("picture-options", defPictureOptions); + bgsetting->set_string("primary-color", defPrimaryColor); #endif #endif return Qnil; @@ -156,9 +174,9 @@ RB_METHOD(wallpaperReset) void wallpaperBindingInit() { - VALUE module = rb_define_module("Wallpaper"); + VALUE module = rb_define_module("Wallpaper"); - //Functions - _rb_define_module_function(module, "set", wallpaperSet); - _rb_define_module_function(module, "reset", wallpaperReset); + // Functions + _rb_define_module_function(module, "set", wallpaperSet); + _rb_define_module_function(module, "reset", wallpaperReset); } diff --git a/cleanup.sh b/cleanup.sh index 7843fac..9aed42f 100755 --- a/cleanup.sh +++ b/cleanup.sh @@ -5,4 +5,5 @@ rm -rf build rm -rf dist rm -rf _______.app rm -rf OneShot.app +rm -rf OneShot make distclean \ No newline at end of file diff --git a/make-oneshot-linux.sh b/make-oneshot-linux.sh new file mode 100755 index 0000000..be52f18 --- /dev/null +++ b/make-oneshot-linux.sh @@ -0,0 +1,45 @@ +#!/bin/sh +set -e + +cd `dirname $0` + +# User-configurable variables +linux_version="0.1.0" +make_threads=8 +ONESHOT_PATH=$HOME/.steam/steam/steamapps/common/OneShot + +# Colors +white="\033[0;37m" # White - Regular +bold="\033[1;37m" # White - Bold +cyan="\033[1;36m" # Cyan - Bold +green="\033[1;32m" # Green - Bold +color_reset="\033[0m" # Reset Colors + +echo "${white}Compiling ${bold}SyngleChance v${linux_version} ${white}engine for Linux...${color_reset}\n" + +# Generate makefile and build main + journal +echo "-> ${cyan}Generate makefile...${color_reset}" +qmake MRIVERSION=2.3 +echo "-> ${cyan}Compile engine...${color_reset}" +make -j${make_threads} +echo "-> ${cyan}Compile journal...${color_reset}" +pyinstaller journal/unix/journal.spec --onefile --windowed + +# Set version number +echo "-> ${cyan}Set version number...${color_reset}" + +# Compile scripts +echo "-> ${cyan}Compile xScripts.rxdata...${color_reset}" +ruby rpgscript.rb ./scripts "$ONESHOT_PATH" + +echo "-> ${cyan}Install OneShot apps to Steam directory...${color_reset}" +cp -rf "./OneShot" "$ONESHOT_PATH" +cp -rf "./dist/_______" "$ONESHOT_PATH" + +# Cleanup +echo "-> ${cyan}Cleanup files...${color_reset}" +rm -rf journal/unix/__pycache__ +rm -rf build +rm -rf dist + +echo "\n${green}Complete! ${white}Please report any issues to https://github.com/vinyldarkscratch/synglechance/issues${color_reset}" diff --git a/mkxp.pro b/mkxp.pro index 6791250..2bac4bf 100644 --- a/mkxp.pro +++ b/mkxp.pro @@ -47,7 +47,7 @@ unix { SOURCES += src/mac-desktop.mm } !macx: { - # PKGCONFIG += openal zlib + PKGCONFIG += giomm-2.4 INCLUDEPATH += /usr/include/AL /usr/local/include/AL SOURCES += src/xdg-user-dir-lookup.c LIBS += -lX11