Skip to content

Commit

Permalink
Create config dir on first startup, use `"$XDG_DATA_HOME/{NCINE_LINUX…
Browse files Browse the repository at this point in the history
…_PACKAGE}/"` by default
  • Loading branch information
deathkiller committed Nov 29, 2023
1 parent 05a63a1 commit 06c6862
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,16 @@ jobs:
- name: 'Create AppImage'
run: |
if [ ! -f linuxdeploy-x86_64.AppImage ]; then
curl -s -S -O --location 'https://github.com/darealshinji/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt.sh'
curl -s -S -O --location 'https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage'
chmod +x linuxdeploy-x86_64.AppImage
chmod a+x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-checkrt.sh
fi
mv -f ./_appdir/usr/share/jazz2/Content/ ./_appdir/usr/bin/Content/
rm -f -r ./_appdir/usr/share/jazz2/
rm -f -r ./_appdir/usr/share/doc/
LDAI_OUTPUT="./_build/jazz2.AppImage" ARCH=x86_64 ./linuxdeploy-x86_64.AppImage --appdir=./_appdir/ --icon-filename=jazz2 --desktop-file=./_appdir/usr/share/applications/jazz2.desktop --executable=./_appdir/usr/bin/jazz2 --custom-apprun=./Sources/AppRun --output=appimage
LDAI_OUTPUT="./_build/jazz2.AppImage" ARCH=x86_64 ./linuxdeploy-x86_64.AppImage --appdir=./_appdir/ --icon-filename=jazz2 --desktop-file=./_appdir/usr/share/applications/jazz2.desktop --executable=./_appdir/usr/bin/jazz2 --custom-apprun=./Sources/AppRun --output=appimage --plugin checkrt
artifactPath="Jazz2_${{ matrix.Platform }}_${{ matrix.Backend }}.AppImage"
echo "artifactPath=$artifactPath" >> $GITHUB_ENV
Expand Down
Binary file modified Content/Translations/cs.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions Content/Translations/cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ msgid ""
msgstr ""
"Project-Id-Version: jazz2-resurrection\n"
"POT-Creation-Date: 2023-11-26 18:03+0100\n"
"PO-Revision-Date: 2023-11-26 18:03+0100\n"
"PO-Revision-Date: 2023-11-29 19:38+0100\n"
"Last-Translator: \n"
"Language-Team: Překlad do češtiny: Dan R. (http://deat.tk/jazz2/)\n"
"Language-Team: Překlad do češtiny: Dan R. (https://deat.tk/jazz2/)\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
10 changes: 8 additions & 2 deletions Sources/Jazz2/ContentResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,15 @@ namespace Jazz2
// Shared Content exists, try to use standard XDG paths
auto localStorage = fs::GetLocalStorage();
if (!localStorage.empty()) {
// TODO: Change "Jazz² Resurrection" to NCINE_LINUX_PACKAGE
// Use "$XDG_DATA_HOME/Jazz² Resurrection/" if exists (for backward compatibility), otherwise "$XDG_DATA_HOME/{NCINE_LINUX_PACKAGE}/"
_sourcePath = fs::CombinePath(localStorage, "Jazz² Resurrection/Source/"_s);
_cachePath = fs::CombinePath(localStorage, "Jazz² Resurrection/Cache/"_s);
if (fs::DirectoryExists(_sourcePath)) {
_cachePath = fs::CombinePath(localStorage, "Jazz² Resurrection/Cache/"_s);
} else {
auto appData = fs::CombinePath(localStorage, NCINE_LINUX_PACKAGE);
_sourcePath = fs::CombinePath(appData, "Source/"_s);
_cachePath = fs::CombinePath(appData, "Cache/"_s);
}
} else {
_sourcePath = "Source/"_s;
_cachePath = "Cache/"_s;
Expand Down
5 changes: 5 additions & 0 deletions Sources/Jazz2/PreferencesCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ namespace Jazz2
} else {
TryLoadPreferredLanguage();

auto configDir = fs::GetDirectoryName(_configPath);
if (!configDir.empty()) {
fs::CreateDirectories(configDir);
}

#if !defined(DEATH_TARGET_EMSCRIPTEN)
// Create "Source" directory on the first launch
auto& resolver = ContentResolver::Get();
Expand Down
2 changes: 1 addition & 1 deletion Sources/Jazz2/UI/Menu/AboutSection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace Jazz2::UI::Menu
int32_t charOffset = 0;

// TRANSLATORS: Main information in About section
_root->DrawStringShadow(_f("Reimplementation of the game \f[c:0x9e7056]Jazz Jackrabbit 2\f[c] released in 1998. Supports various\nversions of the game (Shareware Demo, Holiday Hare '98, The Secret Files and\nChristmas Chronicles). Also, it partially supports some features of JJ2+ extension.\nFor more information, visit the official website: %s", "\f[c:0x707070]http://deat.tk/jazz2/\f[c]"),
_root->DrawStringShadow(_f("Reimplementation of the game \f[c:0x9e7056]Jazz Jackrabbit 2\f[c] released in 1998. Supports various\nversions of the game (Shareware Demo, Holiday Hare '98, The Secret Files and\nChristmas Chronicles). Also, it partially supports some features of JJ2+ extension.\nFor more information, visit the official website: %s", "\f[c:0x707070]https://deat.tk/jazz2/\f[c]"),
charOffset, viewSize.X * 0.5f, pos.Y - 22.0f, IMenuContainer::FontLayer,
Alignment::Center, Font::DefaultColor, 0.7f, 0.4f, 0.6f, 0.6f, 0.6f, 0.9f, 1.2f);

Expand Down

0 comments on commit 06c6862

Please sign in to comment.