multiple intricate implementations

This commit is contained in:
Geoffray Levasseur committed 2026-11-04 11:41:01 +01:00
1 parent 7aa4ea4425
commit 77690cbd96
109 files changed
+2045 -56

No files matched your search

+25 -10
View File
@@ -31,6 +31,7 @@
#include "Cevo/CevoStringTables.h"
#include <QString>
#include <QStringList>
namespace Cevo {
@@ -57,21 +58,33 @@ extern bool fullScreen;
// neither ported in full - toggle background music playback on/off).
extern bool musicEnabled;
// Minimal equivalent of Directories.pas's GetGraphicsDir() (that whole unit
// isn't ported - this is just the one helper needed so far). Resolves to
// CEVO_RESOURCE_DIR/Graphics (see the top-level CMakeLists.txt).
// Directories.pas's GetGraphicsDir()/GetMusicDir() (under the resource directory).
QString getGraphicsDir();
// Same minimal-port rationale as getGraphicsDir(), for Directories.pas's
// GetMusicDir().
QString getMusicDir();
// Minimal equivalent of Directories.pas's LocalizedFilePath(): always
// resolves to CEVO_RESOURCE_DIR/path, since localization (StringTables.pas
// and LocaleCode handling) isn't ported - this is the non-localized ("en")
// fallback branch the original always takes once no localized file exists.
// Directories.pas's GetAppSharePath(): a path inside the resource (shared,
// read-only) directory.
QString getAppSharePath(const QString &path);
// Directories.pas's `LocaleCode`: the interface language chosen by the
// user ("" for automatic, otherwise e.g. "fr", "zh-Hans").
extern QString localeCode;
// Language to use when localeCode is "" (from the system locale).
QString localeCodeAuto();
// Directories.pas's LocalizedFilePath(): the file under the localization
// directory of the current language if it exists there, else the shared one.
QString localizedFilePath(const QString &path);
// Directories.pas's UnitInit() part for the data directory: user data
// (saved games, maps) goes to the application data location unless
// overridden with -d/--data-dir in args.
void initDirectories(const QStringList &args);
// Directories.pas's GetSavedDir()/GetMapsDir(): the user's (or, with share,
// the shared read-only) directory of saved games / maps.
QString getSavedDir(bool share = false);
QString getMapsDir(bool share = false);
// ScreenTools.pas's `Phrases`/`Phrases2` string tables (Language.txt /
// Language2.txt) and `Phrases2FallenBackToEnglish`; filled by loadPhrases().
extern StringTable phrases;
@@ -82,6 +95,8 @@ void loadPhrases();
// Converts a Language.txt Pascal Format() string (%d/%s/%%) to QString::arg()
// style numbered placeholders (%1, %2, ...) in order of appearance.
QString phraseToQtFormat(const QString &text);
// Phrases[key] with its %d/%s placeholders filled in order from args.
QString formatPhrase(const QString &key, const QStringList &args = QStringList());
// ScreenTools.pas's UnitInit()/LoadAssets(): points the widget layer at the
// graphics directory and loads the phrases, fonts, system graphic sets,