-
January 28th, 2023, 17:40 #1
2023 - 02 Ruleset Update PowerManager Request
There are a handful of extensions that add new types of actions for PC Powers and it would be greatly appreciated if there were an easier mechanism for including them. For example in 5E this requires overriding getActionButtonIcons, getActionText, and getActionTooltip (assuming PowerManager.performAction was already overridden before these updates). And then the entire set of action handlers must be set again via PowerActionManagerCore.registerActionHandlers. Ideally, it would be preferable to simply add in the information for the new action type, as can be done with the UI changes.
My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
-
January 28th, 2023, 21:01 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 18,927
So, are you talking about the ability to just add a new action type? (i.e. PowerManager.addActionType)
Or are you talking about selectively overriding functions in PowerManager.registerActionHandlers?
Thanks,
JPGFG Wish List - http://fgapp.idea.informer.com/
-
January 28th, 2023, 21:43 #3My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
-
January 28th, 2023, 21:46 #4
Also, a correlated request would be to use PowerManagerCore.getPowerActorNode more reliably throughout so that can be a single override to that function could add functionality rather than being spread out in multiple places such as manager_power.lua in 5E still having things such as
Code:local rActor = ActorManager.resolveActor(DB.getChild(nodeAction, "....."));
My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
-
January 29th, 2023, 00:14 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 18,927
After thinking about this a bit, I think I might want to restructure this area to allow easier overrides for specific action types, as well as registering new action types. Let me tinker with it a bit.
Regards,
JPGFG Wish List - http://fgapp.idea.informer.com/
-
January 29th, 2023, 02:29 #6My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
-
January 30th, 2023, 18:56 #7
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 18,927
Ok, I pushed a new Test channel update to allow actions to be registered separately, as well as a way to override specific functions for any action.
I also added in your suggested changes on the getPowerActorNode, though I only found that one in 5E, and only a few others across the other rulesets.
Regards,
JPGFG Wish List - http://fgapp.idea.informer.com/
-
February 1st, 2023, 11:19 #8
Working like a charm so far, thanks again!
My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
-
February 1st, 2023, 23:06 #9
Found an issue that could be a bit trickier: radial menu support for more than 5 types of actions. There are handful of extensions out there that support different actions types, though even narrowing it down to extensions that are associated with FG Store products this could become a concern. The Kingdoms and Warfare extension that comes with the product of the same name adds a new type of action to support the domain mechanics. And one of the recommended (though not required) free extensions for the Beastheart adds a new action type that supports the ferocity mechanic central to the class.
If it helps, my plan should this be beyond the scope of the upcoming release would be to have overflow action types go into a submenu on the 1 slot on the radial menu expanding the total count to 10. Though I hope this is possible to address from the ruleset, as that approach will very likely lead to conflicts among the other action-type extensions.Last edited by MeAndUnique; February 1st, 2023 at 23:06. Reason: typo
My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
-
February 4th, 2023, 13:53 #10
Also of note regarding PowerManagerCore.registerDefaultPowerMenu:
- If this function is to be a full handler for action menu items, it should likely reset them when read-only. Otherwise it would be better to leave the read-only handling to the caller entirely.
- There could be cases where the UI structure doesn't have the power window contained within a windowlist for the purposes of read-only detection. Either utilizing a read-only function parameter or having more fault-tolerant detection logic would be preferable.
My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks