diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index a102de1e5..8f595df80 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -94,12 +94,24 @@ namespace MWGui while (key->getChildCount()) // Destroy number label MyGUI::Gui::getInstance().destroyWidget(key->getChildAt(0)); - mAssigned[index] = Type_Unassigned; + if (index == 9) + { + mAssigned[index] = Type_HandToHand; + + MyGUI::ImageBox* image = key->createWidget("ImageBox", + MyGUI::IntCoord(14, 13, 32, 32), MyGUI::Align::Default); + image->setImageTexture("icons\\k\\stealth_handtohand.dds"); + image->setNeedMouseFocus(false); + } + else + { + mAssigned[index] = Type_Unassigned; - MyGUI::TextBox* textBox = key->createWidgetReal("SandText", MyGUI::FloatCoord(0,0,1,1), MyGUI::Align::Default); - textBox->setTextAlign (MyGUI::Align::Center); - textBox->setCaption (MyGUI::utility::toString(index+1)); - textBox->setNeedMouseFocus (false); + MyGUI::TextBox* textBox = key->createWidgetReal("SandText", MyGUI::FloatCoord(0,0,1,1), MyGUI::Align::Default); + textBox->setTextAlign (MyGUI::Align::Center); + textBox->setCaption (MyGUI::utility::toString(index+1)); + textBox->setNeedMouseFocus (false); + } } void QuickKeysMenu::onQuickKeyButtonClicked(MyGUI::Widget* sender) @@ -338,6 +350,11 @@ namespace MWGui store.setSelectedEnchantItem(it); MWBase::Environment::get().getWorld()->getPlayer().setDrawState(MWMechanics::DrawState_Spell); } + else if (type == Type_HandToHand) + { + store.unequipSlot(MWWorld::InventoryStore::Slot_CarriedRight, player); + MWBase::Environment::get().getWorld()->getPlayer().setDrawState(MWMechanics::DrawState_Weapon); + } } // --------------------------------------------------------------------------------------------------------- @@ -409,6 +426,7 @@ namespace MWGui switch (type) { case Type_Unassigned: + case Type_HandToHand: break; case Type_Item: case Type_MagicItem: @@ -489,6 +507,7 @@ namespace MWGui break; } case Type_Unassigned: + case Type_HandToHand: unassign(button, i); break; } diff --git a/apps/openmw/mwgui/quickkeysmenu.hpp b/apps/openmw/mwgui/quickkeysmenu.hpp index 00afa4561..afbcff001 100644 --- a/apps/openmw/mwgui/quickkeysmenu.hpp +++ b/apps/openmw/mwgui/quickkeysmenu.hpp @@ -37,15 +37,16 @@ namespace MWGui void activateQuickKey(int index); + /// @note This enum is serialized, so don't move the items around! enum QuickKeyType { Type_Item, Type_Magic, Type_MagicItem, - Type_Unassigned + Type_Unassigned, + Type_HandToHand }; - void write (ESM::ESMWriter& writer); void readRecord (ESM::ESMReader& reader, uint32_t type); void clear();