diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-12 15:41:10 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-12 15:41:10 -0700 |
commit | 7f8f7bcd329e62d240914686b01a9cd68624309c (patch) | |
tree | 1256aff76fa3f81b62724e73197eb94d231d9045 /src/emoteshortcut.h | |
parent | fc1539e019b6d916d1470ddf1f31997044af8396 (diff) | |
download | mana-7f8f7bcd329e62d240914686b01a9cd68624309c.tar.gz mana-7f8f7bcd329e62d240914686b01a9cd68624309c.tar.bz2 mana-7f8f7bcd329e62d240914686b01a9cd68624309c.tar.xz mana-7f8f7bcd329e62d240914686b01a9cd68624309c.zip |
Some rather pedantic changes. Unified all naming for emoticons in the
code so that only one term is used everywhere (to simplify
maintainability), as well as corrected several variable names and
comments where there was copy/pasted code, but it wasn't corrected. Also
moved emote shortcuts back to where they were originally, to reduce
player confusion when the next build comes around.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/emoteshortcut.h')
-rw-r--r-- | src/emoteshortcut.h | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/src/emoteshortcut.h b/src/emoteshortcut.h new file mode 100644 index 00000000..14162f73 --- /dev/null +++ b/src/emoteshortcut.h @@ -0,0 +1,125 @@ +/* + * Aethyra + * Copyright 2009 Aethyra Development Team + * + * This file is part of Aethyra. + * + * Aethyra is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * Aethyra is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Aethyra; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _AETHYRA_EMOTESHORTCUT_H__ +#define _AETHYRA_EMOTESHORTCUT_H__ + +#define SHORTCUT_EMOTES 12 + +/** + * The class which keeps track of the emote shortcuts. + */ +class EmoteShortcut +{ + public: + /** + * Constructor. + */ + EmoteShortcut(); + + /** + * Destructor. + */ + ~EmoteShortcut(); + + /** + * Load the configuration information. + */ + void load(); + + /** + * Returns the shortcut Emote ID specified by the index. + * + * @param index Index of the shortcut Emote. + */ + int getEmote(int index) const + { return mEmotes[index]; } + + /** + * Returns the amount of shortcut Emotes. + */ + int getEmoteCount() const + { return SHORTCUT_EMOTES; } + + /** + * Returns the emote ID that is currently selected. + */ + int getEmoteSelected() const + { return mEmoteSelected; } + + /** + * Adds the selected emote ID to the emotes specified by the index. + * + * @param index Index of the emotes. + */ + void setEmote(int index) + { mEmotes[index] = mEmoteSelected; } + + /** + * Adds a emoticon to the emotes store specified by the index. + * + * @param index Index of the emote. + * @param emoteId ID of the emote. + */ + void setEmotes(int index, int emoteId) + { mEmotes[index] = emoteId; } + + /** + * Set the Emote that is selected. + * + * @param emoteId The ID of the emote that is to be assigned. + */ + void setEmoteSelected(int emoteId) + { mEmoteSelected = emoteId; } + + /** + * A flag to check if the Emote is selected. + */ + bool isEmoteSelected() + { return mEmoteSelected; } + + /** + * Remove a Emote from the shortcut. + */ + void removeEmote(int index) + { mEmotes[index] = 0; } + + /** + * Try to use the Emote specified by the index. + * + * @param index Index of the emote shortcut. + */ + void useEmote(int index); + + private: + /** + * Save the configuration information. + */ + void save(); + + int mEmotes[SHORTCUT_EMOTES]; /**< The emote stored. */ + int mEmoteSelected; /**< The emote held by cursor. */ + +}; + +extern EmoteShortcut *emoteShortcut; + +#endif |