summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-15 20:37:18 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-15 20:37:18 +0300
commitf6cb5519a2cc4452055ff0bfb6f38990bc3e9e65 (patch)
treea4b22c43caebdccb79969dc95356f8745600d36c /src/actions
parentacc395f67dbe683787f1aeb0bf96fe0a16f62c5e (diff)
downloadmv-f6cb5519a2cc4452055ff0bfb6f38990bc3e9e65.tar.gz
mv-f6cb5519a2cc4452055ff0bfb6f38990bc3e9e65.tar.bz2
mv-f6cb5519a2cc4452055ff0bfb6f38990bc3e9e65.tar.xz
mv-f6cb5519a2cc4452055ff0bfb6f38990bc3e9e65.zip
Allow open server info window from game.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/windows.cpp21
-rw-r--r--src/actions/windows.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/src/actions/windows.cpp b/src/actions/windows.cpp
index 1cc9548c5..7c9b57d0a 100644
--- a/src/actions/windows.cpp
+++ b/src/actions/windows.cpp
@@ -21,6 +21,7 @@
#include "actions/windows.h"
#include "actormanager.h"
+#include "client.h"
#include "actions/actiondef.h"
@@ -45,10 +46,13 @@
#include "gui/windows/minimap.h"
#include "gui/windows/outfitwindow.h"
#include "gui/windows/setupwindow.h"
+#include "gui/windows/serverinfowindow.h"
#include "gui/windows/shopwindow.h"
#include "gui/windows/shortcutwindow.h"
#include "gui/windows/updaterwindow.h"
+#include "gui/widgets/createwidget.h"
+
#include "gui/widgets/tabs/chat/chattab.h"
#include "utils/gettext.h"
@@ -320,6 +324,23 @@ impHandler0(mailWindowShow)
return true;
}
+impHandler0(serverInfoWindowShow)
+{
+ if (serverInfoWindow != nullptr &&
+ serverInfoWindow->isWindowVisible())
+ {
+ serverInfoWindow->close();
+ serverInfoWindow = nullptr;
+ }
+ else
+ {
+ serverInfoWindow = CREATEWIDGETR(ServerInfoWindow,
+ client->getCurrentServer());
+ serverInfoWindow->requestMoveToTop();
+ }
+ return true;
+}
+
impHandler(showItems)
{
const std::string args = event.args;
diff --git a/src/actions/windows.h b/src/actions/windows.h
index 3820ee9fe..8b6311281 100644
--- a/src/actions/windows.h
+++ b/src/actions/windows.h
@@ -54,6 +54,7 @@ namespace Actions
decHandler(cartWindowShow);
decHandler(quickWindowShow);
decHandler(mailWindowShow);
+ decHandler(serverInfoWindowShow);
decHandler(showItems);
} // namespace Actions