Varsuuk
January 3rd, 2021, 08:36
I had guessed this had to do with the:
-- manager_custom_dice.lua file and the add_roll_type() method (arg named "action_icon")
So I found an example, The Dark Eye extension by Trenloe. I loaded it and it did just that with /dsadamage 1d6 result being draggable and the text is replaced with a little drop of blood icon.
I thought, simple and did same for my manager_custom_thac0.lua - based roller. I copied the "attack" icon from MoreCore and set this up in my own graphics_icons.xml and passed it in the "action_icon" argument.
Nothing. Still drags the roll definition text when I try to drag the results. I tried several variations (including using the exact icon TDE used in case it was size/type related.) More things tried and still nothing.
So. I added some debug code to MoreCore in a likely place and it seems it IS related but I can't figure what is missing:
in MoreCore, manager_actions.lua I added the Debugs and the "else" clause:
function onChatDragStart(draginfo)
local sDragType = draginfo.getType();
Debug.console("MC) -- sDragType", sDragType)
if GameSystem.actions[sDragType] and GameSystem.actions[sDragType].sIcon then
Debug.console("MC) -- sDragType icon found", GameSystem.actions[sDragType].sIcon)
draginfo.setIcon(GameSystem.actions[sDragType].sIcon);
else
Debug.console("MC) -- sDragType icon NOT found")
end
end
The result was, from the console log:
...
Runtime Notice: s'performAction: ' | nil | { s'sType' = s'pc', s'sCreatureNode' = s'charsheet.id-00003', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'Varsuuk' } | s'1d6 Melee Attack'
...
Runtime Notice: s'MC) -- sDragType' | s'dsadamage'
Runtime Notice: s'MC) -- sDragType icon found' | s'attack'
...
Runtime Notice: s'performAction: ' | nil | { s'sType' = s'pc', s'sCreatureNode' = s'charsheet.id-00003', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'Varsuuk' } | s'1d20x0 Melee Attack'
Runtime Notice: s'MC) -- sDragType' | s'number'
Runtime Notice: s'MC) -- sDragType icon NOT found'
The actual roller is not finished - I was just trying to get the icon up so I removed all of that from the log.
Interestingly, the dragType when it works is the name of the roll (dsadamage). On my roller, it is "number" instead. The original dsadamage used a different icon name - I changed it while trying to figure out what was wrong and left it that way. The icon it uses is the one >I< was trying to get working on my roller.
Any good advice or how-to on this dragging-icon behavior?
-- manager_custom_dice.lua file and the add_roll_type() method (arg named "action_icon")
So I found an example, The Dark Eye extension by Trenloe. I loaded it and it did just that with /dsadamage 1d6 result being draggable and the text is replaced with a little drop of blood icon.
I thought, simple and did same for my manager_custom_thac0.lua - based roller. I copied the "attack" icon from MoreCore and set this up in my own graphics_icons.xml and passed it in the "action_icon" argument.
Nothing. Still drags the roll definition text when I try to drag the results. I tried several variations (including using the exact icon TDE used in case it was size/type related.) More things tried and still nothing.
So. I added some debug code to MoreCore in a likely place and it seems it IS related but I can't figure what is missing:
in MoreCore, manager_actions.lua I added the Debugs and the "else" clause:
function onChatDragStart(draginfo)
local sDragType = draginfo.getType();
Debug.console("MC) -- sDragType", sDragType)
if GameSystem.actions[sDragType] and GameSystem.actions[sDragType].sIcon then
Debug.console("MC) -- sDragType icon found", GameSystem.actions[sDragType].sIcon)
draginfo.setIcon(GameSystem.actions[sDragType].sIcon);
else
Debug.console("MC) -- sDragType icon NOT found")
end
end
The result was, from the console log:
...
Runtime Notice: s'performAction: ' | nil | { s'sType' = s'pc', s'sCreatureNode' = s'charsheet.id-00003', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'Varsuuk' } | s'1d6 Melee Attack'
...
Runtime Notice: s'MC) -- sDragType' | s'dsadamage'
Runtime Notice: s'MC) -- sDragType icon found' | s'attack'
...
Runtime Notice: s'performAction: ' | nil | { s'sType' = s'pc', s'sCreatureNode' = s'charsheet.id-00003', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'Varsuuk' } | s'1d20x0 Melee Attack'
Runtime Notice: s'MC) -- sDragType' | s'number'
Runtime Notice: s'MC) -- sDragType icon NOT found'
The actual roller is not finished - I was just trying to get the icon up so I removed all of that from the log.
Interestingly, the dragType when it works is the name of the roll (dsadamage). On my roller, it is "number" instead. The original dsadamage used a different icon name - I changed it while trying to figure out what was wrong and left it that way. The icon it uses is the one >I< was trying to get working on my roller.
Any good advice or how-to on this dragging-icon behavior?