mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-02 14:56:39 +00:00
Remove dedicated 'Unequip' button and just us 'A'
This commit is contained in:
parent
defd1edb6f
commit
ab03e01127
2 changed files with 14 additions and 27 deletions
|
|
@ -337,8 +337,7 @@ namespace MWGui
|
||||||
|
|
||||||
// Show a dialog to select a count of items, but not when using an item from the inventory
|
// Show a dialog to select a count of items, but not when using an item from the inventory
|
||||||
// in controller mode. In that case, we skip the dialog and just use one item immediately.
|
// in controller mode. In that case, we skip the dialog and just use one item immediately.
|
||||||
if (count > 1 && !shift && mPendingControllerAction != ControllerAction::Use
|
if (count > 1 && !shift && mPendingControllerAction != ControllerAction::Use)
|
||||||
&& mPendingControllerAction != ControllerAction::Unequip)
|
|
||||||
{
|
{
|
||||||
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
||||||
std::string message = "#{sTake}";
|
std::string message = "#{sTake}";
|
||||||
|
|
@ -370,18 +369,20 @@ namespace MWGui
|
||||||
sellItem(nullptr, count);
|
sellItem(nullptr, count);
|
||||||
else if (mPendingControllerAction == ControllerAction::Use)
|
else if (mPendingControllerAction == ControllerAction::Use)
|
||||||
{
|
{
|
||||||
// Drag and drop the item on the avatar to activate it.
|
|
||||||
dragItem(nullptr, count);
|
dragItem(nullptr, count);
|
||||||
onAvatarClicked(nullptr); // Equip or use
|
if (item.mType == ItemStack::Type_Equipped)
|
||||||
// Drop any remaining items back in inventory. This is needed when clicking on a
|
{
|
||||||
// stack of items; we only want to use the first item.
|
// Drop the item on the inventory background to unequip it.
|
||||||
onBackgroundSelected();
|
onBackgroundSelected();
|
||||||
}
|
}
|
||||||
else if (mPendingControllerAction == ControllerAction::Unequip)
|
else
|
||||||
{
|
{
|
||||||
// Drop on inventory background to unequip
|
// Drop the item on the avatar to activate or equip it.
|
||||||
dragItem(nullptr, count);
|
onAvatarClicked(nullptr);
|
||||||
onBackgroundSelected();
|
// Drop any remaining items back in inventory. This is needed when clicking on a
|
||||||
|
// stack of items; we only want to use the first item.
|
||||||
|
onBackgroundSelected();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (mPendingControllerAction == ControllerAction::Drop)
|
else if (mPendingControllerAction == ControllerAction::Drop)
|
||||||
dropItem(nullptr, count);
|
dropItem(nullptr, count);
|
||||||
|
|
@ -973,21 +974,18 @@ namespace MWGui
|
||||||
mControllerButtons.a = "#{OMWEngine:InventorySelect}";
|
mControllerButtons.a = "#{OMWEngine:InventorySelect}";
|
||||||
mControllerButtons.b = "#{Interface:Close}";
|
mControllerButtons.b = "#{Interface:Close}";
|
||||||
mControllerButtons.x.clear();
|
mControllerButtons.x.clear();
|
||||||
mControllerButtons.y.clear();
|
|
||||||
mControllerButtons.r2 = "#{sCompanionShare}";
|
mControllerButtons.r2 = "#{sCompanionShare}";
|
||||||
break;
|
break;
|
||||||
case MWGui::GM_Container:
|
case MWGui::GM_Container:
|
||||||
mControllerButtons.a = "#{OMWEngine:InventorySelect}";
|
mControllerButtons.a = "#{OMWEngine:InventorySelect}";
|
||||||
mControllerButtons.b = "#{Interface:Close}";
|
mControllerButtons.b = "#{Interface:Close}";
|
||||||
mControllerButtons.x = "#{sTakeAll}";
|
mControllerButtons.x = "#{sTakeAll}";
|
||||||
mControllerButtons.y.clear();
|
|
||||||
mControllerButtons.r2 = "#{sContainer}";
|
mControllerButtons.r2 = "#{sContainer}";
|
||||||
break;
|
break;
|
||||||
case MWGui::GM_Barter:
|
case MWGui::GM_Barter:
|
||||||
mControllerButtons.a = "#{sSell}";
|
mControllerButtons.a = "#{sSell}";
|
||||||
mControllerButtons.b = "#{Interface:Cancel}";
|
mControllerButtons.b = "#{Interface:Cancel}";
|
||||||
mControllerButtons.x = "#{sOffer}";
|
mControllerButtons.x = "#{sOffer}";
|
||||||
mControllerButtons.y.clear();
|
|
||||||
mControllerButtons.r2 = "#{sBarter}";
|
mControllerButtons.r2 = "#{sBarter}";
|
||||||
break;
|
break;
|
||||||
case MWGui::GM_Inventory:
|
case MWGui::GM_Inventory:
|
||||||
|
|
@ -995,7 +993,6 @@ namespace MWGui
|
||||||
mControllerButtons.a = "#{sEquip}";
|
mControllerButtons.a = "#{sEquip}";
|
||||||
mControllerButtons.b = "#{sBack}";
|
mControllerButtons.b = "#{sBack}";
|
||||||
mControllerButtons.x = "#{sDrop}";
|
mControllerButtons.x = "#{sDrop}";
|
||||||
mControllerButtons.y = "#{sUnequip}";
|
|
||||||
mControllerButtons.r2.clear();
|
mControllerButtons.r2.clear();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1045,15 +1042,6 @@ namespace MWGui
|
||||||
tradeWindow->onControllerButtonEvent(arg);
|
tradeWindow->onControllerButtonEvent(arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (arg.button == SDL_CONTROLLER_BUTTON_Y)
|
|
||||||
{
|
|
||||||
if (mGuiMode == MWGui::GM_Inventory)
|
|
||||||
{
|
|
||||||
// Unequip an item.
|
|
||||||
mPendingControllerAction = ControllerAction::Unequip;
|
|
||||||
mItemView->onControllerButton(SDL_CONTROLLER_BUTTON_A);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (arg.button == SDL_CONTROLLER_BUTTON_LEFTSHOULDER)
|
else if (arg.button == SDL_CONTROLLER_BUTTON_LEFTSHOULDER)
|
||||||
{
|
{
|
||||||
if (mFilterAll->getStateSelected())
|
if (mFilterAll->getStateSelected())
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,6 @@ namespace MWGui
|
||||||
Transfer,
|
Transfer,
|
||||||
Sell,
|
Sell,
|
||||||
Drop,
|
Drop,
|
||||||
Unequip,
|
|
||||||
};
|
};
|
||||||
ControllerAction mPendingControllerAction;
|
ControllerAction mPendingControllerAction;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue