View Full Version : FGU Updates (2020.10.30) docs?
celestian
October 30th, 2020, 18:06
Would it be possible to get param/vars expected for:
[DEV] Added API functions: Interface.getAssetSize, generriccontrol.getAsset, genericcontrol.setAsset
[DEV] Added API handlers: DB.onExport
I've tried a few different things for interface.getAssetSize() but not having any luck...
and im curious what is DB.onExport()'s purpose? I'm guessing to hook into the export process so you dont have to overwrite the corerpg version?
Moon Wizard
October 30th, 2020, 19:00
Interface.getAssetSize(assetKey) - Same information stored in draginfo.getTokenData, databasenode.getText (for image value and token value).
genericcontrol.getAsset()/setAsset(assetKey) - Same as above.
DB.onExport - There was already a handler for onImport; and I was adding the other export pieces, so I added onExport. Example in CoreRPG.
Regards,
JPG
celestian
October 30th, 2020, 19:40
Interface.getAssetSize(assetKey) - Same information stored in draginfo.getTokenData, databasenode.getText (for image value and token value).
genericcontrol.getAsset()/setAsset(assetKey) - Same as above.
DB.onExport - There was already a handler for onImport; and I was adding the other export pieces, so I added onExport. Example in CoreRPG.
Regards,
JPG
Not having any luck with getAssetSize(). Tried various things to see if I could get something...
Code:
Debug.console("manager_author_adnd.lua","createBlockImage","nodeImage",nodeImage);
Debug.console("manager_author_adnd.lua","createBlockImage","sImageAsset",sImageAsset);
Debug.console("manager_author_adnd.lua","createBlockImage","Interface.getAssetSize(nodeImage)",Interface.getAssetSize(nodeImage));
Debug.console("manager_author_adnd.lua","createBlockImage","Interface.getAssetSize(nodeImage.getText())",Interface.getAssetSize(nodeImage.getText()));
Debug.console("manager_author_adnd.lua","createBlockImage","Interface.getAssetSize(sImageAsset)",Interface.getAssetSize(sImageAsset));
Output:
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'nodeImage' | databasenode = { image.id-00002 }
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'sImageAsset' | s'image.id-00002.image'
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'Interface.getAssetSize(nodeImage)' | #0 | #0
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'Interface.getAssetSize(nodeImage.getText())' | #0 | #0
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'Interface.getAssetSize(sImageAsset)' | #0 | #0
----
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'nodeImage' | databasenode = { image.id-00001@B2: THe Keep on the Borderlands (HighRes) }
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'sImageAsset' | s'image.id-00001@B2: THe Keep on the Borderlands (HighRes).image'
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'Interface.getAssetSize(nodeImage)' | #0 | #0
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'Interface.getAssetSize(nodeImage.getText())' | #0 | #0
[10/30/2020 1:35:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'Interface.getAssetSize(sImageAsset)' | #0 | #0
Moon Wizard
November 1st, 2020, 00:19
I added this line to ref_blocklayoutmanager.lua:Line 57:
Debug.chat("ASSET SIZE", sAsset, Interface.getAssetSize(sAsset));
This returned this message in the chat box when I opened the 5E PHB reference manual:
s'ASSET SIZE' | s'images/Cover.jpg@DD PHB Deluxe' | #1000 | #700
Regards,
JPG
celestian
November 1st, 2020, 04:29
I added this line to ref_blocklayoutmanager.lua:Line 57:
Debug.chat("ASSET SIZE", sAsset, Interface.getAssetSize(sAsset));
This returned this message in the chat box when I opened the 5E PHB reference manual:
s'ASSET SIZE' | s'images/Cover.jpg@DD PHB Deluxe' | #1000 | #700
Regards,
JPG
What object allows you to reference down to the image object (sAsset above) from the image record (image.id-XXXX)? I tried various things on my own but have not managed to come across anything that does that. If there is some example code I can review in CoreRPG let me know. I did a search but didnt find anything that I could figure it out from after experimentation.
Moon Wizard
November 1st, 2020, 16:51
There's an example in line 55 of the ref_blocklayoutmanager.lua file.
JPG
celestian
November 1st, 2020, 19:35
There's an example in line 55 of the ref_blocklayoutmanager.lua file.
JPG
Thats the example I found and tested with no positive results. Here is what I tried.
local w = Interface.openWindow("imagewindow",nodeImage);
if w then
local sAsset = DB.getText(w.getDatabaseNode(), "image", "");
Debug.console("manager_author_adnd.lua","createBlockImage","w.getDatabaseNode()",w.getDatabaseNode());
Debug.console("manager_author_adnd.lua","createBlockImage","sAsset",sAsset);
Debug.console("manager_author_adnd.lua","createBlockImage","Interface.getAssetSize(sAsset)",Interface.getAssetSize(sAsset));
...
Log from above
11/1/2020 1:30:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'w.getDatabaseNode()' | databasenode = { image.id-00001@B2: THe Keep on the Borderlands (HighRes) }
[11/1/2020 1:30:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'sAsset' | s''
[11/1/2020 1:30:17 PM] s'manager_author_adnd.lua' | s'createBlockImage' | s'Interface.getAssetSize(sAsset)' | #0 | #0
sAsset is always '' no matter what image record I load.
Moon Wizard
November 1st, 2020, 20:49
The getText will only return a value if there is a single image layer in the image value. If you have more than one image layer, then it will return empty string.
Regards,
JPG
celestian
November 1st, 2020, 23:26
The getText will only return a value if there is a single image layer in the image value. If you have more than one image layer, then it will return empty string.
Regards,
JPG
So if the source has LOS/effects/etc layers it'll not work? (This appears to be my experience so far but I also have multi-layer map). If so... Unfortunately this means I won't be able to have inline ref-man from maps linked any longer in FGU?
I've also just noticed that if the source has any XML escape characters it causes problems because it doesn't match the module name. My guess is previously FGC did not require escape versions of specific XML characters in formatted text links. It looks like DB.findNode() doesn't resolve XML escapes such as "&".
After knowing the above 2 issues I was able to get a simple image to give me asset and the w/h.
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.