mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 02:15:32 +00:00
Allow drag-and-drop to be cancelled (Esc or Inventory key)
This commit is contained in:
parent
269094ba8d
commit
531e7ac586
3 changed files with 18 additions and 4 deletions
|
@ -125,6 +125,8 @@ void DragAndDrop::finish()
|
|||
{
|
||||
mIsOnDragAndDrop = false;
|
||||
mSourceSortModel->clearDragItems();
|
||||
// since mSourceView doesn't get updated in drag()
|
||||
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->updateItemView();
|
||||
|
||||
MyGUI::Gui::getInstance().destroyWidget(mDraggedWidget);
|
||||
mDraggedWidget = 0;
|
||||
|
|
|
@ -755,7 +755,14 @@ namespace MWGui
|
|||
mGarbageDialogs.push_back(dialog);
|
||||
}
|
||||
|
||||
void WindowManager::exitCurrentGuiMode() {
|
||||
void WindowManager::exitCurrentGuiMode()
|
||||
{
|
||||
if (mDragAndDrop && mDragAndDrop->mIsOnDragAndDrop)
|
||||
{
|
||||
mDragAndDrop->finish();
|
||||
return;
|
||||
}
|
||||
|
||||
switch(mGuiModes.back()) {
|
||||
case GM_QuickKeysMenu:
|
||||
mQuickKeysMenu->exit();
|
||||
|
@ -1247,6 +1254,11 @@ namespace MWGui
|
|||
|
||||
void WindowManager::popGuiMode()
|
||||
{
|
||||
if (mDragAndDrop && mDragAndDrop->mIsOnDragAndDrop)
|
||||
{
|
||||
mDragAndDrop->finish();
|
||||
}
|
||||
|
||||
if (!mGuiModes.empty())
|
||||
{
|
||||
mGuiModeStates[mGuiModes.back()].update(false);
|
||||
|
|
|
@ -177,13 +177,13 @@ namespace MWInput
|
|||
|
||||
void InputManager::channelChanged(ICS::Channel* channel, float currentValue, float previousValue)
|
||||
{
|
||||
if (mDragDrop)
|
||||
return;
|
||||
|
||||
resetIdleTime ();
|
||||
|
||||
int action = channel->getNumber();
|
||||
|
||||
if (mDragDrop && action != A_GameMenu && action != A_Inventory)
|
||||
return;
|
||||
|
||||
if((previousValue == 1 || previousValue == 0) && (currentValue==1 || currentValue==0))
|
||||
{
|
||||
//Is a normal button press, so don't change it at all
|
||||
|
|
Loading…
Reference in a new issue