PDA

View Full Version : onDoubleClick not working as expected



Valarian
October 29th, 2019, 11:06
Ruleset: The One Ring
Issue: onDoubleClick action not working

The onDoubleClick action defined for the skill on the character sheet doesn't work. The onDragStart action does.


function onDoubleClick(x,y)
local dieLabel = "";
local dieMod = 0;

if dieLabel and dieLabel ~= "" then
dieLabel = dieLabel .. " + " .. window.athleticslabel.getValue();
else
dieLabel = window.athleticslabel.getValue();
end

local weary = window.conditionweary.getState();
if weary then
ChatDice.wearyDiceCheck(getValue(), dieMod, dieLabel);
else
ChatDice.skillDiceCheck(getValue(), dieMod, dieLabel);
end
return true;
end


The code called by the double-click action builds the dice table and uses Comm.throwDice() to roll.


function skillDiceCheck(number, bonus, name)
if Comm then
local dice = {};
table.insert(dice, "d12");
for i = 1, number, 1 do
table.insert(dice, "d6");
end
Comm.throwDice("skilldice", dice, bonus, name);
end
end


I'm also experiencing the problem in the Yggdrasill ruleset, that builds up the dice directly in the char_attribute template onDoubleClick action.


function onDoubleClick(x,y)
local label = getName():gsub("^%l", string.upper);
local woundState = window.getDatabaseNode().getChild("hpstate");
local penalty = window.getDatabaseNode().getChild("hppenalty");
local type = "dice";
if woundState.getValue() == "Severely Wounded" then
type = "wounddice";
else
type = "skilldice";
end
local dice = {};
for i = 1, getValue(), 1 do
table.insert(dice, "d10");
end
Comm.throwDice(type, dice, penalty.getValue(), label);
return true;
end

Moon Wizard
October 31st, 2019, 00:40
Thanks for the report. Filed as FGU-598. I'll be circling back to you to get more detail once I get through the bug submission crush and memory issues.

Cheers,
JPG

superteddy57
April 2nd, 2020, 19:51
I've checked over this issue and appears to be working correctly. Can you check to see if the ruleset is still producing an issue on your end? Also if it is still being replicated, can you provide me the steps in replicating on my end and what issues you may still be experiencing?


32987

Valarian
April 3rd, 2020, 16:47
Seems to be working now.

superteddy57
April 3rd, 2020, 16:51
Thank you. I will push to have this set as resolved.