From 4cb11db37aeb8052e1fef94965bc48bbc949e7f9 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Wed, 24 Feb 2010 21:51:48 +0100 Subject: Added the possibility to pass a branding file by command line. Reviewed-by: Thorbjørn Lindeijer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/branding.xml | 22 ---------------------- docs/example.mana | 21 +++++++++++++++++++++ src/client.cpp | 5 ++++- src/client.h | 1 + src/main.cpp | 11 ++++++++++- 5 files changed, 36 insertions(+), 24 deletions(-) delete mode 100644 data/branding.xml create mode 100644 docs/example.mana diff --git a/data/branding.xml b/data/branding.xml deleted file mode 100644 index 38f74e40..00000000 --- a/data/branding.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - diff --git a/docs/example.mana b/docs/example.mana new file mode 100644 index 00000000..795d8d40 --- /dev/null +++ b/docs/example.mana @@ -0,0 +1,21 @@ + + + + + + diff --git a/src/client.cpp b/src/client.cpp index cf1a6496..5651f968 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -205,7 +205,10 @@ Client::Client(const Options &options): mInstance = this; // Load branding information - branding.init("data/branding.xml"); + if (!options.brandingPath.empty()) + { + branding.init(options.brandingPath); + } initHomeDir(options); initScreenshotDir(options.screenshotDir); diff --git a/src/client.h b/src/client.h index 47328c4d..32b921dc 100644 --- a/src/client.h +++ b/src/client.h @@ -139,6 +139,7 @@ public: std::string password; std::string character; std::string configPath; + std::string brandingPath; std::string updateHost; std::string dataPath; std::string homeDir; diff --git a/src/main.cpp b/src/main.cpp index 2fb9c112..aaa826cb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,7 +40,7 @@ static void printHelp() using std::endl; std::cout - << _("mana") << endl << endl + << _("mana [mana-file]") << endl << endl << _("Options:") << endl << _(" -C --config-file : Configuration file to use") << endl << _(" -d --data : Directory to load game data from") << endl @@ -147,6 +147,15 @@ static void parseOptions(int argc, char *argv[], Client::Options &options) break; } } + + // when there are still options left use the last + // one as branding file + if (optind < argc) + { + options.brandingPath = argv[optind]; + } + + } #ifdef WIN32 -- cgit v1.2.3-70-g09d2