PDA

View Full Version : You guys exhaust me - another bug in TEST



SilentRuin
October 31st, 2024, 04:38
I've spent more than 10+ hours chasing these down and getting you to fix them. I'm exhausted by it and no longer have the will to care any more.

You have my code - you go figure it out. Combat group extension code:



-- function to set old_eyes and select token options
function setOldEyesSelectToken(tokenCT, nodeCT)
if tokenCT.isActive() then
if Session.IsHost then
local nDU = GameSystem.getDistanceUnitsPerGrid();
local nSpace = math.ceil(DB.getValue(nodeCT, "space", nDU) / nDU);
if OptionsManager.isOption("OLD_EYES", "faction") then
-- Faction/space underlay
local sFaction = DB.getValue(nodeCT, "friendfoe", "");
if sFaction == "friend" then
tokenCT.addUnderlay(nSpace, "3F" .. ColorManager.COLOR_TOKEN_FACTION_FRIEND);
elseif sFaction == "foe" then
tokenCT.addUnderlay(nSpace, "3F" .. ColorManager.COLOR_TOKEN_FACTION_FOE);
elseif sFaction == "neutral" then
tokenCT.addUnderlay(nSpace, "3F" .. ColorManager.COLOR_TOKEN_FACTION_NEUTRAL);
else
tokenCT.addUnderlay(nSpace, "3F00FFFF");
end
elseif not OptionsManager.isOption("OLD_EYES", "off") then
local sHexRBG = OptionsManager.getOption("OLD_EYES");
tokenCT.addUnderlay(nSpace, "3F" .. sHexRBG);
end
end
if OptionsManager.isOption("SELECT_OWNERS_TOKEN", "on") then
local sOwner = DB.getOwner(nodeCT);
-- if this has an owner sent request to select token - otherwise assume host controlling
if sOwner and sOwner ~= "" then
local msgOOB = {};
msgOOB.type = OOB_MSGTYPE_USERSELTOK;
msgOOB.sNodeCT = DB.getPath(nodeCT);
-- deliver message to the host for processing on it (can't do a lot of updates to DB from clients)
Comm.deliverOOBMessage(msgOOB, sOwner);
-- if this was a turn generated from host then it too must be updated on its select so vision/centering is triggered
if Session.IsHost then
-- make the selected item when active CT entry is set.
local imageControl = ImageManager.getImageControl(tokenCT, false);
if imageControl then
imageControl.clearSelectedTokens();
imageControl.selectToken( tokenCT, true ) ;
end
end
else
-- make the selected item when active CT entry is set.
local imageControl = ImageManager.getImageControl(tokenCT, false);
if imageControl then
imageControl.clearSelectedTokens();
imageControl.selectToken( tokenCT, true ) ;
end
end
end
end
end


No longer sets the active token underlay color.

62491

So this shot has got me, and as they say in the recent season of "Only Murders in the Building" I've scrawled my death indicator next to where my extension fell...

62492

pindercarl
October 31st, 2024, 12:23
I've spent more than 10+ hours chasing these down and getting you to fix them. I'm exhausted by it and no longer have the will to care any more.

You have my code - you go figure it out. Combat group extension code:



-- function to set old_eyes and select token options
function setOldEyesSelectToken(tokenCT, nodeCT)
if tokenCT.isActive() then
if Session.IsHost then
local nDU = GameSystem.getDistanceUnitsPerGrid();
local nSpace = math.ceil(DB.getValue(nodeCT, "space", nDU) / nDU);
if OptionsManager.isOption("OLD_EYES", "faction") then
-- Faction/space underlay
local sFaction = DB.getValue(nodeCT, "friendfoe", "");
if sFaction == "friend" then
tokenCT.addUnderlay(nSpace, "3F" .. ColorManager.COLOR_TOKEN_FACTION_FRIEND);
elseif sFaction == "foe" then
tokenCT.addUnderlay(nSpace, "3F" .. ColorManager.COLOR_TOKEN_FACTION_FOE);
elseif sFaction == "neutral" then
tokenCT.addUnderlay(nSpace, "3F" .. ColorManager.COLOR_TOKEN_FACTION_NEUTRAL);
else
tokenCT.addUnderlay(nSpace, "3F00FFFF");
end
elseif not OptionsManager.isOption("OLD_EYES", "off") then
local sHexRBG = OptionsManager.getOption("OLD_EYES");
tokenCT.addUnderlay(nSpace, "3F" .. sHexRBG);
end
end
if OptionsManager.isOption("SELECT_OWNERS_TOKEN", "on") then
local sOwner = DB.getOwner(nodeCT);
-- if this has an owner sent request to select token - otherwise assume host controlling
if sOwner and sOwner ~= "" then
local msgOOB = {};
msgOOB.type = OOB_MSGTYPE_USERSELTOK;
msgOOB.sNodeCT = DB.getPath(nodeCT);
-- deliver message to the host for processing on it (can't do a lot of updates to DB from clients)
Comm.deliverOOBMessage(msgOOB, sOwner);
-- if this was a turn generated from host then it too must be updated on its select so vision/centering is triggered
if Session.IsHost then
-- make the selected item when active CT entry is set.
local imageControl = ImageManager.getImageControl(tokenCT, false);
if imageControl then
imageControl.clearSelectedTokens();
imageControl.selectToken( tokenCT, true ) ;
end
end
else
-- make the selected item when active CT entry is set.
local imageControl = ImageManager.getImageControl(tokenCT, false);
if imageControl then
imageControl.clearSelectedTokens();
imageControl.selectToken( tokenCT, true ) ;
end
end
end
end
end


No longer sets the active token underlay color.

62491

So this shot has got me, and as they say in the recent season of "Only Murders in the Building" I've scrawled my death indicator next to where my extension fell...

62492

Checking in the Live build with your sample campaign, I don't see the underlay for the token active in the CT. The "Highlight token for Old Eyes (on turn)" option is set to magenta. Is there another button, knob, or switch that I need to set for the extension?

SilentRuin
October 31st, 2024, 13:34
Don't know what you mean. Anything with active turn will have that underlay so it can better be seen with "old eyes".

This is my LIVE - if you have something else going on - I have no idea. Your describing what I see in TEST which is nothing. LIVE works. When I gave you campaign (and extensions/modules I used so you had exact test I'm running) it looked something like this and one of the CT entries had an active turn. Thus - magenta underlay.

62493

And in TEST - no underlay.

62494

I can't see why any Unit test code you have to run through FGU is not picking up the errors I have to find by luck. Anything in here should be being tested with some automation to insure the calls all still work as per any dev team who provides calls to 3rd parties. Nothing I end up finding is something a unit test would not have already found. Except it takes me way longer and pure luck to notice it.

https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644535/Developer+Guide+-+API+Reference

pindercarl
October 31st, 2024, 14:45
Don't know what you mean. Anything with active turn will have that underlay so it can better be seen with "old eyes".

This is my LIVE - if you have something else going on - I have no idea. Your describing what I see in TEST which is nothing. LIVE works. When I gave you campaign (and extensions/modules I used so you had exact test I'm running) it looked something like this and one of the CT entries had an active turn. Thus - magenta underlay.

62493

And in TEST - no underlay.

62494

I can't see why any Unit test code you have to run through FGU is not picking up the errors I have to find by luck. Anything in here should be being tested with some automation to insure the calls all still work as per any dev team who provides calls to 3rd parties. Nothing I end up finding is something a unit test would not have already found. Except it takes me way longer and pure luck to notice it.

https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644535/Developer+Guide+-+API+Reference

There was an error with the updater when I switched to the Live channel. I can reproduce the underlay now. Thanks.

pindercarl
October 31st, 2024, 15:16
Submitted a fix. Should be addressed when the next Test build is updated.

SilentRuin
November 1st, 2024, 03:04
Submitted a fix. Should be addressed when the next Test build is updated.

There was a check update in TEST but this fix must not have been in in as it remains the same issue.

pindercarl
November 1st, 2024, 12:06
There was a check update in TEST but this fix must not have been in in as it remains the same issue.

There will be an updated post in https://www.fantasygrounds.com/forums/showthread.php?82973-Beta-Release-FG-v4-6-0 whenever a new build is pushed. Any other updates would be for rulesets or products.