mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:49:58 +00:00
Allow binding Hand To Hand in quick keys menu (Fixes #2024)
This commit is contained in:
parent
7fd1c2c2e2
commit
f603a68144
2 changed files with 27 additions and 7 deletions
|
@ -94,6 +94,17 @@ namespace MWGui
|
|||
while (key->getChildCount()) // Destroy number label
|
||||
MyGUI::Gui::getInstance().destroyWidget(key->getChildAt(0));
|
||||
|
||||
if (index == 9)
|
||||
{
|
||||
mAssigned[index] = Type_HandToHand;
|
||||
|
||||
MyGUI::ImageBox* image = key->createWidget<MyGUI::ImageBox>("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<MyGUI::TextBox>("SandText", MyGUI::FloatCoord(0,0,1,1), MyGUI::Align::Default);
|
||||
|
@ -101,6 +112,7 @@ namespace MWGui
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue