~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gui/chatwindow.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-09-17 10:35:51 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130917103551-az7p3nz9jgxwqjfn
Tags: 1.3.9.15-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "actorspritemanager.h"
26
26
#include "client.h"
27
27
#include "commandhandler.h"
28
 
#include "commands.h"
29
28
#include "configuration.h"
30
29
#include "game.h"
31
30
#include "guild.h"
32
 
#include "inputmanager.h"
33
 
#include "keyevent.h"
34
 
#include "localplayer.h"
35
31
#include "party.h"
36
 
#include "playerinfo.h"
37
32
#include "spellshortcut.h"
38
 
#include "soundmanager.h"
 
33
 
 
34
#include "being/localplayer.h"
 
35
#include "being/playerinfo.h"
 
36
 
 
37
#include "input/inputmanager.h"
 
38
#include "input/keyevent.h"
39
39
 
40
40
#include "gui/emotewindow.h"
41
41
#include "gui/gui.h"
49
49
#include "gui/widgets/dropdown.h"
50
50
#include "gui/widgets/itemlinkhandler.h"
51
51
#include "gui/widgets/langtab.h"
52
 
#include "gui/widgets/layouthelper.h"
53
52
#include "gui/widgets/scrollarea.h"
54
53
#include "gui/widgets/textfield.h"
55
54
#include "gui/widgets/tradetab.h"
65
64
#include "resources/resourcemanager.h"
66
65
 
67
66
#include <guichan/focushandler.hpp>
68
 
#include <guichan/focuslistener.hpp>
69
67
 
70
68
#include <sstream>
71
69
 
213
211
    mChatHistoryIndex(0),
214
212
    mAwayLog(),
215
213
    mHighlights(),
 
214
    mGlobalsFilter(),
216
215
    mGMLoaded(false),
217
216
    mHaveMouse(false),
218
217
    mAutoHide(config.getBoolValue("autohideChat")),
289
288
    initTradeFilter();
290
289
    loadCustomList();
291
290
    parseHighlights();
 
291
    parseGlobalsFilter();
292
292
 
293
293
    config.addListener("autohideChat", this);
294
294
    config.addListener("showBattleEvents", this);
 
295
    config.addListener("globalsFilter", this);
295
296
 
296
297
    enableVisibleSound(true);
297
298
}
1681
1682
    mHighlights.push_back(player_node->getName());
1682
1683
}
1683
1684
 
 
1685
void ChatWindow::parseGlobalsFilter()
 
1686
{
 
1687
    mGlobalsFilter.clear();
 
1688
    if (!player_node)
 
1689
        return;
 
1690
 
 
1691
    splitToStringVector(mGlobalsFilter, config.getStringValue(
 
1692
        "globalsFilter"), ',');
 
1693
 
 
1694
    mHighlights.push_back(player_node->getName());
 
1695
}
 
1696
 
1684
1697
bool ChatWindow::findHighlight(const std::string &str)
1685
1698
{
1686
1699
    return findI(str, mHighlights) != std::string::npos;
1706
1719
        mAutoHide = config.getBoolValue("autohideChat");
1707
1720
    else if (name == "showBattleEvents")
1708
1721
        mShowBattleEvents = config.getBoolValue("showBattleEvents");
 
1722
    else if (name == "globalsFilter")
 
1723
        parseGlobalsFilter();
1709
1724
}
1710
1725
 
1711
1726
void ChatWindow::mouseMoved(gcn::MouseEvent &event)
1766
1781
    BLOCK_END("ChatWindow::logicChildren")
1767
1782
}
1768
1783
#endif
 
1784
 
 
1785
void ChatWindow::addGlobalMessage(const std::string &line)
 
1786
{
 
1787
    if (debugChatTab && findI(line, mGlobalsFilter) != std::string::npos)
 
1788
        debugChatTab->chatLog(line, BY_OTHER);
 
1789
    else
 
1790
        localChatTab->chatLog(line, BY_GM);
 
1791
}