summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-11 15:48:13 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-11 15:48:13 +0300
commit1db8072c112d0bc5b3cbf3b3151dfa8be9419189 (patch)
tree6fa6980acc0db8f1ee61a0b059bec1215fdc4731
parent8de44a41862b3a0ff714e68169b6443a2a06b3aa (diff)
downloadmanaplus-1db8072c112d0bc5b3cbf3b3151dfa8be9419189.tar.gz
manaplus-1db8072c112d0bc5b3cbf3b3151dfa8be9419189.tar.bz2
manaplus-1db8072c112d0bc5b3cbf3b3151dfa8be9419189.tar.xz
manaplus-1db8072c112d0bc5b3cbf3b3151dfa8be9419189.zip
Add chat command for select debug tab.
New chat command: /debugtab Alias: /debugchattab
-rw-r--r--src/actions/chat.cpp9
-rw-r--r--src/actions/chat.h1
-rw-r--r--src/gui/windows/chatwindow.cpp4
-rw-r--r--src/gui/windows/chatwindow.h4
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h5
6 files changed, 20 insertions, 4 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp
index d5b3d9475..0e719fb75 100644
--- a/src/actions/chat.cpp
+++ b/src/actions/chat.cpp
@@ -467,7 +467,14 @@ impHandler0(clearChat)
impHandler0(chatGeneralTab)
{
if (chatWindow)
- chatWindow->selectGeneralTab();
+ chatWindow->selectTabByType(ChatTabType::INPUT);
+ return true;
+}
+
+impHandler0(chatDebugTab)
+{
+ if (chatWindow)
+ chatWindow->selectTabByType(ChatTabType::DEBUG);
return true;
}
diff --git a/src/actions/chat.h b/src/actions/chat.h
index ccad18739..6f6708a99 100644
--- a/src/actions/chat.h
+++ b/src/actions/chat.h
@@ -50,6 +50,7 @@ namespace Actions
decHandler(addText);
decHandler(clearChat);
decHandler(chatGeneralTab);
+ decHandler(chatDebugTab);
} // namespace Actions
#undef decHandler
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index c3b78f066..4799f65f4 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -374,7 +374,7 @@ void ChatWindow::nextTab()
mChatTabs->setSelectedTabByIndex(tab);
}
-void ChatWindow::selectGeneralTab()
+void ChatWindow::selectTabByType(const ChatTabType::Type &type)
{
if (!mChatTabs)
return;
@@ -384,7 +384,7 @@ void ChatWindow::selectGeneralTab()
{
ChatTab *const tab = dynamic_cast<ChatTab*>(
mChatTabs->getTabByIndex(f));
- if (tab && tab->getType() == ChatTabType::INPUT)
+ if (tab && tab->getType() == type)
{
mChatTabs->setSelectedTab(tab);
break;
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index d4dfa602d..df8ba8b06 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -29,6 +29,8 @@
#include "gui/widgets/window.h"
+#include "gui/widgets/tabs/chat/chattabtype.h"
+
#include "listeners/actionlistener.h"
#include "listeners/attributelistener.h"
#include "listeners/configlistener.h"
@@ -285,7 +287,7 @@ class ChatWindow final : public Window,
bool isTabPresent(const ChatTab *const tab) const A_WARN_UNUSED;
- void selectGeneralTab();
+ void selectTabByType(const ChatTabType::Type &type);
void attributeChanged(const int id,
const int oldVal,
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index 9a93863e7..80190ff56 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -527,6 +527,7 @@ namespace InputAction
PET_AI_START,
PET_AI_STOP,
CHAT_GENERAL_TAB,
+ CHAT_DEBUG_TAB,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index bb0a27e61..691870011 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -3929,6 +3929,11 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputCondition::INGAME,
"generaltab|generalchattab|general",
false},
+ {"keyDebugTab",
+ defaultAction(&Actions::chatDebugTab),
+ InputCondition::INGAME,
+ "debugtab|debugchattab",
+ false},
};
#undef defaultAction