diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-09 00:05:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-09 00:05:38 +0300 |
commit | b28730a1ecf54cd50b09e5e93dfb454fc46c2300 (patch) | |
tree | 4fd9c679b026eea8c05c308a04187852b5199200 /src/gui/widgets/itemlinkhandler.cpp | |
parent | 86cb4a51351b8217ede6672703a1b39b91ddb572 (diff) | |
download | manaplus-b28730a1ecf54cd50b09e5e93dfb454fc46c2300.tar.gz manaplus-b28730a1ecf54cd50b09e5e93dfb454fc46c2300.tar.bz2 manaplus-b28730a1ecf54cd50b09e5e93dfb454fc46c2300.tar.xz manaplus-b28730a1ecf54cd50b09e5e93dfb454fc46c2300.zip |
Open quest in quests window if quest link was clicked.
Diffstat (limited to 'src/gui/widgets/itemlinkhandler.cpp')
-rw-r--r-- | src/gui/widgets/itemlinkhandler.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 983129a3f..b2e4a89c9 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -34,6 +34,7 @@ #include "gui/windows/confirmdialog.h" #include "gui/windows/helpwindow.h" +#include "gui/windows/questswindow.h" #include "input/inputmanager.h" @@ -178,11 +179,14 @@ void ItemLinkHandler::handleSearchLink(const std::string &link) void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *const event) { + if (link.empty()) + return; + if (strStartWith(link, "http://") || strStartWith(link, "https://")) { handleHttpLink(link, event); } - else if (!link.empty() && link[0] == '?') + else if (link[0] == '?') { handleSearchLink(link); } @@ -203,10 +207,14 @@ void ItemLinkHandler::handleLink(const std::string &link, if (helpWindow) helpWindow->loadHelpSimple("news"); } - if (link == "copyright") + else if (link == "copyright") { inputManager.executeAction(InputAction::WINDOW_ABOUT); } + else if (link[0] == 'q') + { + questsWindow->selectQuest(atoi(link.substr(1).c_str())); + } else { handleItemLink(link); |