summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTametomo <irarice@gmail.com>2009-05-10 14:45:44 -0600
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-14 20:54:02 +0100
commit3eed2628ecb10a688f48db0c3cc7bac70dca22b7 (patch)
tree96bcc244c0fee8c1179c87078cf776c744288671 /src
parent48ad9754e83a26d598b71e495d255915e873424f (diff)
downloadmana-3eed2628ecb10a688f48db0c3cc7bac70dca22b7.tar.gz
mana-3eed2628ecb10a688f48db0c3cc7bac70dca22b7.tar.bz2
mana-3eed2628ecb10a688f48db0c3cc7bac70dca22b7.tar.xz
mana-3eed2628ecb10a688f48db0c3cc7bac70dca22b7.zip
Some slight logic cleanups in the shortcut classes, as well as some
style cleanups. TODO: Either abstract out all of the shared information between these two classes to a parent class, or combine the two if it can be done without doing it clumsily. Signed-off-by: Tametomo <irarice@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/emoteshortcut.cpp9
-rw-r--r--src/itemshortcut.cpp8
2 files changed, 3 insertions, 14 deletions
diff --git a/src/emoteshortcut.cpp b/src/emoteshortcut.cpp
index 80376983..50879e4f 100644
--- a/src/emoteshortcut.cpp
+++ b/src/emoteshortcut.cpp
@@ -31,10 +31,6 @@ EmoteShortcut *emoteShortcut;
EmoteShortcut::EmoteShortcut():
mEmoteSelected(0)
{
- for (int i = 0; i < SHORTCUT_EMOTES; i++)
- {
- mEmotes[i] = i + 1;
- }
load();
}
@@ -49,10 +45,7 @@ void EmoteShortcut::load()
{
int emoteId = (int) config.getValue("emoteshortcut" + toString(i), i + 1);
- if (emoteId)
- {
- mEmotes[i] = emoteId;
- }
+ mEmotes[i] = emoteId;
}
}
diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp
index 50bd85b7..22cb64b3 100644
--- a/src/itemshortcut.cpp
+++ b/src/itemshortcut.cpp
@@ -30,14 +30,11 @@
#include "utils/stringutils.h"
-ItemShortcut::ItemShortcut *itemShortcut;
+ItemShortcut *itemShortcut;
ItemShortcut::ItemShortcut():
mItemSelected(-1)
{
- for (int i = 0; i < SHORTCUT_ITEMS; i++)
- mItems[i] = -1;
-
load();
}
@@ -52,8 +49,7 @@ void ItemShortcut::load()
{
int itemId = (int) config.getValue("shortcut" + toString(i), -1);
- if (itemId != -1)
- mItems[i] = itemId;
+ mItems[i] = itemId;
}
}