From 8d4da1c2a0d22f941b0818a46710b7f347b5cd01 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Thu, 25 Feb 2016 15:55:06 +0300
Subject: Add into paths.xml chars for gm command and char gm command.

---
 src/client.cpp         | 8 ++++++++
 src/client.h           | 2 ++
 src/defaults.cpp       | 2 ++
 src/dyetool/client.cpp | 6 ++++++
 src/dyetool/client.h   | 2 ++
 src/settings.h         | 4 ++++
 6 files changed, 24 insertions(+)

(limited to 'src')

diff --git a/src/client.cpp b/src/client.cpp
index b0e133ca1..e9869e804 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -277,6 +277,7 @@ void Client::gameInit()
     Net::loadIgnorePackets();
     paths.setDefaultValues(getPathsDefaults());
     initFeatures();
+    initPaths();
     logger->log("init 4");
     logger->setDebugLog(config.getBoolValue("debugLog"));
     logger->setReportUnimplimented(config.getBoolValue("unimplimentedLog"));
@@ -1249,6 +1250,7 @@ int Client::gameExec()
                     logger->log("Init paths");
                     paths.init("paths.xml", UseResman_true);
                     paths.setDefaultValues(getPathsDefaults());
+                    initPaths();
                     if (!SpriteReference::Empty)
                     {
                         SpriteReference::Empty = new SpriteReference(
@@ -1792,6 +1794,12 @@ void Client::initFeatures()
     settings.fixDeadAnimation = features.getBoolValue("fixDeadAnimation");
 }
 
+void Client::initPaths()
+{
+    settings.gmCommandSymbol = paths.getStringValue("gmCommandSymbol");
+    settings.gmCharCommandSymbol = paths.getStringValue("gmCharCommandSymbol");
+}
+
 void Client::initTradeFilter()
 {
     const std::string tradeListName =
diff --git a/src/client.h b/src/client.h
index 98488aace..ab168140c 100644
--- a/src/client.h
+++ b/src/client.h
@@ -111,6 +111,8 @@ class Client final : public ConfigListener,
 
         static void initFeatures();
 
+        static void initPaths();
+
         void gameClear();
 
         void testsClear();
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 6e985e2d2..823265ea0 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -630,6 +630,8 @@ DefaultsData* getPathsDefaults()
     AddDEF("inactivebadge", "inactive.xml");
     AddDEF("awaybadge", "away.xml");
     AddDEF("cutInsDir", "graphics/cutins");
+    AddDEF("gmCommandSymbol", "@");
+    AddDEF("gmCharCommandSymbol", "#");
 
     AddDEF("palettesDir", "");
     AddDEF("defaultPaletteFile", "palette.gpl");
diff --git a/src/dyetool/client.cpp b/src/dyetool/client.cpp
index 727bfecc4..939239d72 100644
--- a/src/dyetool/client.cpp
+++ b/src/dyetool/client.cpp
@@ -157,6 +157,7 @@ void Client::gameInit()
     ConfigManager::backupConfig("config.xml");
     ConfigManager::initConfiguration();
     paths.setDefaultValues(getPathsDefaults());
+    initPaths();
     logger->log("init 4");
     logger->setDebugLog(config.getBoolValue("debugLog"));
     logger->setReportUnimplimented(config.getBoolValue("unimplimentedLog"));
@@ -622,6 +623,7 @@ int Client::gameExec()
                     logger->log("Init paths");
                     paths.init("paths.xml", UseResman_true);
                     paths.setDefaultValues(getPathsDefaults());
+                    initPaths();
                     TranslationManager::loadCurrentLang();
 
                     if (desktop)
@@ -750,3 +752,7 @@ bool Client::isTmw()
     }
     return false;
 }
+
+void Client::initPaths()
+{
+}
diff --git a/src/dyetool/client.h b/src/dyetool/client.h
index 9ca3c8d0c..4a79a303e 100644
--- a/src/dyetool/client.h
+++ b/src/dyetool/client.h
@@ -91,6 +91,8 @@ class Client final : public ActionListener
 
         static void initGraphics();
 
+        static void initPaths();
+
         void gameClear();
 
         void testsClear();
diff --git a/src/settings.h b/src/settings.h
index 96e77e06f..21b5f2e1d 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -50,6 +50,8 @@ class Settings final
             logFileName(),
             rootDir(),
             windowCaption(),
+            gmCommandSymbol("@"),
+            gmCharCommandSymbol("#"),
             updateMirrors(),
             options(),
             guiAlpha(1.0F),
@@ -97,6 +99,8 @@ class Settings final
         std::string logFileName;
         std::string rootDir;
         std::string windowCaption;
+        std::string gmCommandSymbol;
+        std::string gmCharCommandSymbol;
         std::vector<std::string> updateMirrors;
         Options options;
         float guiAlpha;
-- 
cgit v1.2.3-70-g09d2