diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-05-14 10:32:17 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-05-14 10:32:48 -0600 |
commit | 2032ca0fb1fd6b59c025180b673e6760d9c12bdc (patch) | |
tree | 043e8783ce04dcdaf802a79d5992b5197feb3db4 | |
parent | 39e06227df101a73aa5b9078a3afb6a7a71b89ba (diff) | |
download | mana-client-2032ca0fb1fd6b59c025180b673e6760d9c12bdc.tar.gz mana-client-2032ca0fb1fd6b59c025180b673e6760d9c12bdc.tar.bz2 mana-client-2032ca0fb1fd6b59c025180b673e6760d9c12bdc.tar.xz mana-client-2032ca0fb1fd6b59c025180b673e6760d9c12bdc.zip |
Add QOAL's outfit window
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/game.cpp | 66 | ||||
-rw-r--r-- | src/gui/itemcontainer.cpp | 4 | ||||
-rw-r--r-- | src/gui/windowmenu.cpp | 7 | ||||
-rw-r--r-- | src/keyboardconfig.cpp | 1 | ||||
-rw-r--r-- | src/keyboardconfig.h | 1 | ||||
-rw-r--r-- | tmw.cbp | 2 |
8 files changed, 84 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 08110c43..a295f249 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -167,6 +167,8 @@ SET(SRCS gui/npcpostdialog.h gui/okdialog.cpp gui/okdialog.h + gui/outfitwindow.cpp + gui/outfitwindow.h gui/palette.cpp gui/palette.h gui/partywindow.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 47d27ede..a474c963 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -116,6 +116,8 @@ tmw_SOURCES = gui/widgets/avatar.cpp \ gui/npcpostdialog.h \ gui/okdialog.cpp \ gui/okdialog.h \ + gui/outfitwindow.cpp \ + gui/outfitwindow.h \ gui/palette.cpp \ gui/palette.h \ gui/partywindow.cpp \ diff --git a/src/game.cpp b/src/game.cpp index 59c57607..98985e74 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -57,6 +57,7 @@ #include "gui/ministatus.h" #include "gui/npcdialog.h" #include "gui/okdialog.h" +#include "gui/outfitwindow.h" #include "gui/sdlinput.h" #include "gui/sell.h" #include "gui/setup.h" @@ -138,6 +139,7 @@ HelpWindow *helpWindow; DebugWindow *debugWindow; ShortcutWindow *itemShortcutWindow; ShortcutWindow *emoteShortcutWindow; +OutfitWindow *outfitWindow; BeingManager *beingManager = NULL; FloorItemManager *floorItemManager = NULL; @@ -232,6 +234,7 @@ static void createGuiWindows() new ItemShortcutContainer); emoteShortcutWindow = new ShortcutWindow("EmoteShortcut", new EmoteShortcutContainer); + outfitWindow = new OutfitWindow(); localChatTab = new ChatTab(_("General")); @@ -277,6 +280,7 @@ static void destroyGuiWindows() delete itemShortcutWindow; delete emoteShortcutWindow; delete storageWindow; + delete outfitWindow; } Game::Game(): @@ -606,6 +610,65 @@ void Game::handleInput() } } + if (event.key.keysym.mod & KMOD_RCTRL && !chatWindow->isInputFocused()) + { + switch (event.key.keysym.sym) + { + case SDLK_1: + outfitWindow->wearOutfit(0); + used = true; + break; + + case SDLK_2: + outfitWindow->wearOutfit(1); + used = true; + break; + + case SDLK_3: + outfitWindow->wearOutfit(2); + used = true; + break; + + case SDLK_4: + outfitWindow->wearOutfit(3); + used = true; + break; + + case SDLK_5: + outfitWindow->wearOutfit(4); + used = true; + break; + + case SDLK_6: + outfitWindow->wearOutfit(5); + used = true; + break; + + case SDLK_7: + outfitWindow->wearOutfit(6); + used = true; + break; + + case SDLK_8: + outfitWindow->wearOutfit(7); + used = true; + break; + + case SDLK_9: + outfitWindow->wearOutfit(8); + used = true; + break; + + case SDLK_0: + outfitWindow->wearOutfit(9); + used = true; + break; + + default: + break; + } + } + const int tKey = keyboard.getKeyIndex(event.key.keysym.sym); switch (tKey) { @@ -782,6 +845,9 @@ void Game::handleInput() case KeyboardConfig::KEY_WINDOW_EMOTE_SHORTCUT: requestedWindow = emoteShortcutWindow; break; + case KeyboardConfig::KEY_WINDOW_OUTFIT: + requestedWindow = outfitWindow; + break; case KeyboardConfig::KEY_SCREENSHOT: // Screenshot (picture, hence the p) saveScreenshot(); diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 54aa818b..d8ae6e20 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -23,6 +23,7 @@ #include "gui/chat.h" #include "gui/itempopup.h" +#include "gui/outfitwindow.h" #include "gui/palette.h" #include "gui/sdlinput.h" #include "gui/viewport.h" @@ -162,6 +163,7 @@ void ItemContainer::selectNone() { setSelectedIndex(-1); mSelectionStatus = SEL_NONE; + outfitWindow->setItemSelected(-1); } void ItemContainer::setSelectedIndex(int newIndex) @@ -260,6 +262,8 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) mSelectionStatus = SEL_SELECTING; itemShortcut->setItemSelected(item->getId()); + if (item->isEquipment()) + outfitWindow->setItemSelected(item->getId()); } else { diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index 5e33a4ed..d66aa602 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -47,7 +47,7 @@ extern Window *buddyWindow; extern Window *guildWindow; extern Window *magicDialog; #endif - +extern Window *outfitWindow; WindowMenu::WindowMenu(): mEmotePopup(0) @@ -56,6 +56,7 @@ WindowMenu::WindowMenu(): static const char *buttonNames[] = { ":-)", + N_("Outfits"), N_("Status"), N_("Equipment"), N_("Inventory"), @@ -114,6 +115,10 @@ void WindowMenu::action(const gcn::ActionEvent &event) mEmotePopup = 0; } } + else if (event.getId() == "Outfits") + { + window = outfitWindow; + } else if (event.getId() == "Status") { window = statusWindow; diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index b5db3de5..6136f043 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -80,6 +80,7 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { {"keyWindowDebug", SDLK_F10, _("Debug Window")}, {"keyWindowParty", SDLK_F11, _("Party Window")}, {"keyWindowEmoteBar", SDLK_F12, _("Emote Shortcut Window")}, + {"keyWindowOutfit", SDLK_o, _("Emote Shortcut Window")}, {"keyEmoteShortcut1", SDLK_1, strprintf(_("Emote Shortcut %d"), 1)}, {"keyEmoteShortcut2", SDLK_2, strprintf(_("Emote Shortcut %d"), 2)}, {"keyEmoteShortcut3", SDLK_3, strprintf(_("Emote Shortcut %d"), 3)}, diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h index 68a5efa6..b6a07f16 100644 --- a/src/keyboardconfig.h +++ b/src/keyboardconfig.h @@ -191,6 +191,7 @@ class KeyboardConfig KEY_WINDOW_DEBUG, KEY_WINDOW_PARTY, KEY_WINDOW_EMOTE_SHORTCUT, + KEY_WINDOW_OUTFIT, KEY_EMOTE_1, KEY_EMOTE_2, KEY_EMOTE_3, @@ -297,6 +297,8 @@ <Unit filename="src/gui/npcstringdialog.h" /> <Unit filename="src/gui/okdialog.cpp" /> <Unit filename="src/gui/okdialog.h" /> + <Unit filename="src/gui/outfitwindow.cpp" /> + <Unit filename="src/gui/outfitwindow.h" /> <Unit filename="src/gui/palette.cpp" /> <Unit filename="src/gui/palette.h" /> <Unit filename="src/gui/partywindow.cpp" /> |