• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[JASS] How to fake the cursor dragging an item?

Status
Not open for further replies.
Level 29
Joined
Feb 2, 2006
Messages
1,691
Hi,
I was wondering if it is possible to fake the drag effect when right clicking and releasing an item in the inventory.
It changes the cursor and adds the icon of the item. I was just wondering if it is possible to retrieve the framehandle of the cursor and change it.
The following thread did not receive any real answer: Change cursor at runtime
Is it a frame or not?

Reading this tutorial: The Big UI-Frame Tutorial
I only found something like CursorSprite.

My idea is to add icon of the item as a frame and move the frame to the cursor position using
JASS:
BlzGetTriggerPlayerMousePosition
and
JASS:
EVENT_PLAYER_MOUSE_MOVE
. Maybe I can somehow make it overlay the actual cursor?
However, in Warcraft III the cursor changes its texture when taking an item. I will have to create two frames: one with the item icon and one with the changed cursor.

Any better ideas/solutions? Maybe some systems do already exist which do already provide this?
 
Last edited:
BlzGetTriggerPlayerMousePosition returns map coordinates, not screen coordinates.

But you wouldn't need that function anyway, when you can access the original cursor frame, right?

Using BlzFrameSetPoint to connect the desired item frame with the cursor frame should automatically move the one with the other.

Not sure about performance and whether you can access the cursor frame at all, though...
 
As far as I know the UI-frame API does not provide direct access to the Mouse Cursor only to it's parent or something like that which is the last child of GameUI (when one didn't play around with BlzFrameSetLevel/prio).

CursorSprite:
Changes the MouseCursor while it is in the Frame's controled space. Unsure how exactly it works, was only able to get the confirm target texture from the default cursors.

As there is no built in Mouse on Screen pos you need to do some workaround either use the world coords + camera view + resolution + advanced 3D math or cluster the screen with frames which tell you the current position. I once wrote something to fill the screen with frames. But I think both options are bad.
Screw the draging.

According to the datamined game.dll data BlacklightsC shared, there is a DRAG feature in fdf but I had no success in using it. FrameDefinedFile Keyword.xlsx
 
Status
Not open for further replies.
Back
Top