Skip to content

Commit a8b98e6

Browse files
Refactor drag and drop (AscensionGameDev#2667)
* deactivating old drag and drop and starting to using native wg * added drag and drop logic on slot items * dont interact when is dragging * expose icon image * dont let player do some actions when is dragging * hide details when dragging slot items * trying to block user input on root * IconImage => Icon * _descWindow => _descriptionWindow * cleanup drag and drop handle drop * Globals.ContentManager? => GameContentManager.Current * add buy item when dragging from shop to inventory * refactor the core of system with correct data/type * more cleaning and refactor * small tweaks * fix guild bank not swapping for guildless user
1 parent 0c9bf2c commit a8b98e6

File tree

17 files changed

+597
-1388
lines changed

17 files changed

+597
-1388
lines changed

Intersect.Client.Core/Core/Input.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Intersect.Client.Entities;
33
using Intersect.Client.Framework.GenericClasses;
44
using Intersect.Client.Framework.Graphics;
5+
using Intersect.Client.Framework.Gwen.DragDrop;
56
using Intersect.Client.Framework.Gwen.Input;
67
using Intersect.Client.Framework.Input;
78
using Intersect.Client.General;
@@ -138,6 +139,11 @@ public static void OnKeyPressed(Keys modifier, Keys key)
138139
return;
139140
}
140141

142+
if (DragAndDrop.IsDragging)
143+
{
144+
return;
145+
}
146+
141147
var gameUi = Interface.Interface.GameUi;
142148

143149
// First try and unfocus chat then close all UI elements, then untarget our target.. and THEN open the escape menu.
@@ -196,7 +202,7 @@ public static void OnKeyPressed(Keys modifier, Keys key)
196202
break;
197203

198204
case Control.ToggleGui:
199-
if (currentGameState == GameStates.InGame)
205+
if (currentGameState == GameStates.InGame && !DragAndDrop.IsDragging)
200206
{
201207
Interface.Interface.HideUi = !Interface.Interface.HideUi;
202208
}
@@ -249,6 +255,11 @@ public static void OnKeyPressed(Keys modifier, Keys key)
249255
break;
250256
}
251257

258+
if (DragAndDrop.IsDragging)
259+
{
260+
break;
261+
}
262+
252263
switch (control)
253264
{
254265
case Control.Block:

0 commit comments

Comments
 (0)