Mana
Loading...
Searching...
No Matches
emoteshortcut.h
Go to the documentation of this file.
1/*
2 * Extended support for activating emotes
3 * Copyright (C) 2009 Aethyra Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#define SHORTCUT_EMOTES 12
25
30{
31 public:
33
35
39 void load();
40
46 int getEmote(int index) const
47 { return mEmotes[index] - 1; }
48
52 int getEmoteCount() const
53 { return SHORTCUT_EMOTES; }
54
58 int getEmoteSelected() const
59 { return mEmoteSelected; }
60
66 void setEmote(int index)
67 { setEmotes(index, mEmoteSelected); }
68
75 void setEmotes(int index, int emoteId)
76 { mEmotes[index] = emoteId + 1; }
77
83 void setEmoteSelected(int emoteId)
84 { mEmoteSelected = emoteId; }
85
89 bool isEmoteSelected() const
90 { return mEmoteSelected != -1; }
91
95 void removeEmote(int index)
96 { mEmotes[index] = 0; }
97
103 void useEmote(int index);
104
105 private:
109 void save();
110
112 int mEmoteSelected = -1;
114};
115
The class which keeps track of the emote shortcuts.
int mEmotes[SHORTCUT_EMOTES]
The emote stored.
int getEmoteCount() const
Returns the amount of shortcut Emotes.
void useEmote(int index)
Try to use the Emote specified by the index.
void setEmoteSelected(int emoteId)
Set the Emote that is selected.
void load()
Load the configuration information.
bool isEmoteSelected() const
A flag to check if the Emote is selected.
void removeEmote(int index)
Remove a Emote from the shortcut.
int getEmoteSelected() const
Returns the emote ID that is currently selected.
int getEmote(int index) const
Returns the shortcut Emote ID specified by the index.
void setEmote(int index)
Adds the selected emote ID to the emotes specified by the index.
void save()
Save the configuration information.
int mEmoteSelected
The emote held by cursor.
void setEmotes(int index, int emoteId)
Adds a emoticon to the emotes store specified by the index.
EmoteShortcut * emoteShortcut
#define SHORTCUT_EMOTES