• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Item@onDrop:drop(d,m) no parameters in my (Mine)crafting table window

monodark

New Member
Joined
Dec 30, 2007
Messages
33
Reaction score
4
Location
Netherlands
Hi folks,

My problem is that the drop event parameters on an Item widget are null.

I'm trying to understand how creating OTClient UI's works, which is actually going quiet well.
So I decided to add a minecraft style crafting table to the game, as shown below.

AoMviCq.png


In my .otui file I have a event handler attached to the Item widget:
Code:
  Item
    id: slot1
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 10
    &position: {x=65500, y=1, z=0}
    @onDrop: modules.game_tibiacraft.itemDropped()

The function in the LUA file is as follows:
Code:
function itemDropped(droppedItem, mousePosition)
   if droppedItem == nil then
       modules.game_textmessage.displayPrivateMessage('no item dropped') 
   end
   if mousePosition == nil then
       modules.game_textmessage.displayPrivateMessage('no mouse position') 
   end
end

Both messages are send..

So I checked the code in the source of OTClient (uimanager.cpp - updateDraggingWidget - line 191):
Code:
if(child->onDrop(oldDraggingWidget, clickedPos)) {
...
}

Here the parameters are send, but never recieved in the lua code.

Can anyone help me with this?

Thanks in advance!
 
"@onDrop: modules.game_tibiacraft.itemDropped()" calling your function only on drop without any parameters.
 
Back
Top