mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-21 14:29:55 +00:00
Merge branch 'linux'
This commit is contained in:
commit
79e3449dd3
5 changed files with 73 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -29,6 +29,7 @@ oneshot_JA_2_ver3_checked.pot
|
||||||
oneshot_JA_Mariko1_WIP.pot
|
oneshot_JA_Mariko1_WIP.pot
|
||||||
*.pot
|
*.pot
|
||||||
xScripts.rxdata
|
xScripts.rxdata
|
||||||
|
OneShot
|
||||||
|
|
||||||
.qmake.stash
|
.qmake.stash
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,13 @@ static bool isCached = false;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include "mac-desktop.h"
|
#include "mac-desktop.h"
|
||||||
#else
|
#else
|
||||||
// XXX Implement me!
|
#include <giomm/settings.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sstream>
|
||||||
|
Glib::RefPtr<Gio::Settings> 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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -110,7 +116,17 @@ end:
|
||||||
}
|
}
|
||||||
MacDesktop::ChangeBackground(imgname, ((color >> 16) & 0xFF) / 255.0, ((color >> 8) & 0xFF) / 255.0, ((color) & 0xFF) / 255.0);
|
MacDesktop::ChangeBackground(imgname, ((color >> 16) & 0xFF) / 255.0, ((color >> 8) & 0xFF) / 255.0, ((color) & 0xFF) / 255.0);
|
||||||
#else
|
#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
|
||||||
#endif
|
#endif
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
|
@ -148,7 +164,9 @@ RB_METHOD(wallpaperReset)
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
MacDesktop::ResetBackground();
|
MacDesktop::ResetBackground();
|
||||||
#else
|
#else
|
||||||
// XXX Implement me!
|
bgsetting->set_string("picture-uri", defPictureURI);
|
||||||
|
bgsetting->set_string("picture-options", defPictureOptions);
|
||||||
|
bgsetting->set_string("primary-color", defPrimaryColor);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
|
@ -156,9 +174,9 @@ RB_METHOD(wallpaperReset)
|
||||||
|
|
||||||
void wallpaperBindingInit()
|
void wallpaperBindingInit()
|
||||||
{
|
{
|
||||||
VALUE module = rb_define_module("Wallpaper");
|
VALUE module = rb_define_module("Wallpaper");
|
||||||
|
|
||||||
//Functions
|
// Functions
|
||||||
_rb_define_module_function(module, "set", wallpaperSet);
|
_rb_define_module_function(module, "set", wallpaperSet);
|
||||||
_rb_define_module_function(module, "reset", wallpaperReset);
|
_rb_define_module_function(module, "reset", wallpaperReset);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,5 @@ rm -rf build
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
rm -rf _______.app
|
rm -rf _______.app
|
||||||
rm -rf OneShot.app
|
rm -rf OneShot.app
|
||||||
|
rm -rf OneShot
|
||||||
make distclean
|
make distclean
|
||||||
45
make-oneshot-linux.sh
Executable file
45
make-oneshot-linux.sh
Executable file
|
|
@ -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}"
|
||||||
2
mkxp.pro
2
mkxp.pro
|
|
@ -47,7 +47,7 @@ unix {
|
||||||
SOURCES += src/mac-desktop.mm
|
SOURCES += src/mac-desktop.mm
|
||||||
}
|
}
|
||||||
!macx: {
|
!macx: {
|
||||||
# PKGCONFIG += openal zlib
|
PKGCONFIG += giomm-2.4
|
||||||
INCLUDEPATH += /usr/include/AL /usr/local/include/AL
|
INCLUDEPATH += /usr/include/AL /usr/local/include/AL
|
||||||
SOURCES += src/xdg-user-dir-lookup.c
|
SOURCES += src/xdg-user-dir-lookup.c
|
||||||
LIBS += -lX11
|
LIBS += -lX11
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue