summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-24 17:19:40 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-24 17:19:40 +0300
commit142cdd218fe10efbea5ceb78cb7947812c35e19e (patch)
tree38a40bddc3b8c9d719ad3f370aecd4ceb191f728
parent66c5eb00b62cba0244446a8306dde1ae138d2e06 (diff)
downloadplus-142cdd218fe10efbea5ceb78cb7947812c35e19e.tar.gz
plus-142cdd218fe10efbea5ceb78cb7947812c35e19e.tar.bz2
plus-142cdd218fe10efbea5ceb78cb7947812c35e19e.tar.xz
plus-142cdd218fe10efbea5ceb78cb7947812c35e19e.zip
Add chat command /gmcharcommands. Also add show char commands to player context menu.
-rw-r--r--src/actions/commands.cpp6
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/dyetool/actions/commands.cpp1
-rw-r--r--src/enums/input/inputaction.h1
-rw-r--r--src/gui/popups/popupmenu.cpp5
-rw-r--r--src/input/inputactionmap.h6
-rw-r--r--src/net/adminhandler.h2
-rw-r--r--src/net/eathena/adminhandler.cpp8
-rw-r--r--src/net/eathena/adminhandler.h3
-rw-r--r--src/net/tmwa/adminhandler.cpp4
-rw-r--r--src/net/tmwa/adminhandler.h3
11 files changed, 39 insertions, 1 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 8bccbc9cd..6cd543707 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -1269,4 +1269,10 @@ impHandler(playerGmCommands)
return true;
}
+impHandler(playerCharGmCommands)
+{
+ adminHandler->playerCharGmCommands(event.args);
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index ffcdde479..a950b4d50 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -103,6 +103,7 @@ namespace Actions
decHandler(mobSearch);
decHandler(mobSpawnSearch);
decHandler(playerGmCommands);
+ decHandler(playerCharGmCommands);
} // namespace Actions
#undef decHandler
diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp
index afdf1c8a3..4578c4f2c 100644
--- a/src/dyetool/actions/commands.cpp
+++ b/src/dyetool/actions/commands.cpp
@@ -103,5 +103,6 @@ impHandlerVoid(whoDrops)
impHandlerVoid(mobSearch)
impHandlerVoid(mobSpawnSearch)
impHandlerVoid(playerGmCommands)
+impHandlerVoid(playerCharGmCommands)
} // namespace Actions
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index d8a689063..478665844 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -632,6 +632,7 @@ enumStart(InputAction)
MOB_SEARCH,
MOB_SPAWN_SEARCH,
PLAYER_GM_COMMANDS,
+ PLAYER_CHAR_GM_COMMANDS,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index a5747de37..49eb9761f 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -2664,9 +2664,12 @@ void PopupMenu::showPlayerGMCommands()
// TRANSLATORS: check player ip
mBrowserBox->addRow("ipcheck", _("Check ip"));
// TRANSLATORS: popup menu item
- // TRANSLATORS: revive player
+ // TRANSLATORS: gm commands
mBrowserBox->addRow("/gmcommands 'NAME'", _("Show commands"));
// TRANSLATORS: popup menu item
+ // TRANSLATORS: gm char commands
+ mBrowserBox->addRow("/gmcharcommands 'NAME'", _("Show char commands"));
+ // TRANSLATORS: popup menu item
// TRANSLATORS: go to player position
mBrowserBox->addRow("goto", _("Goto"));
// TRANSLATORS: popup menu item
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 15816dcd9..4ffd21800 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5281,6 +5281,12 @@ static const InputActionData inputActionData
"gmcommands|playergmcommands|playercommands",
UseArgs_true,
Protected_true},
+ {"keyPlayerCharGmCommands",
+ defaultAction(&Actions::playerCharGmCommands),
+ InputCondition::INGAME,
+ "gmcharcommands|playerchargmcommands|playercharcommands",
+ UseArgs_true,
+ Protected_true},
};
#undef defaultAction
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index b839096a8..31dd89f02 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -108,6 +108,8 @@ class AdminHandler notfinal
virtual void mobSpawnSearch(const std::string &name) const = 0;
virtual void playerGmCommands(const std::string &name) const = 0;
+
+ virtual void playerCharGmCommands(const std::string &name) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index e15c1dd19..f5f5099ae 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -195,4 +195,12 @@ void AdminHandler::playerGmCommands(const std::string &name) const
chatHandler->talk("#commands " + name, GENERAL_CHANNEL);
}
+void AdminHandler::playerCharGmCommands(const std::string &name) const
+{
+ if (name.empty() || (localPlayer && name == localPlayer->getName()))
+ chatHandler->talk("@charcommands", GENERAL_CHANNEL);
+ else
+ chatHandler->talk("#charcommands " + name, GENERAL_CHANNEL);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h
index 5f18c5d63..c84368d8b 100644
--- a/src/net/eathena/adminhandler.h
+++ b/src/net/eathena/adminhandler.h
@@ -83,6 +83,9 @@ class AdminHandler final : public Ea::AdminHandler
void playerGmCommands(const std::string &name) const override final;
+ void playerCharGmCommands(const std::string &name) const
+ override final;
+
protected:
static std::string mStatsName;
};
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index 6050d2375..91a1985b1 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -150,4 +150,8 @@ void AdminHandler::playerGmCommands(const std::string &name A_UNUSED) const
{
}
+void AdminHandler::playerCharGmCommands(const std::string &name A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h
index fab21a9ed..35a12913a 100644
--- a/src/net/tmwa/adminhandler.h
+++ b/src/net/tmwa/adminhandler.h
@@ -86,6 +86,9 @@ class AdminHandler final : public Ea::AdminHandler
void playerGmCommands(const std::string &name) const override final
A_CONST;
+
+ void playerCharGmCommands(const std::string &name) const override final
+ A_CONST;
};
} // namespace TmwAthena