-
June 7th, 2020, 20:59 #1
A bit more help with the comabt tracker
I've added in some extra buttongroups to show in the Npc's combat tracker by adding to the ct_host.xml file.
These display where I want them when the NPC is the active character, bu they also display on the minimized sheets of the non-active characters, PC's included.
Whereabouts (I'm assuming somewhere in the ct_entry.lua file) do I need to insert the setVisible commands (depending on the character being active or not) to display/hide the new buttons as necessary.
I've tried injecting/testing into the functions I think are the correct ones but I'm having no luck.
Any assistance would be appreciated.
Cheers, Steve.
-
June 7th, 2020, 21:18 #2
Within the 5E ct_entry.lua file there is a comment "-- SECTION VISIBILITY FUNCTIONS" - after this there are a number of function that have the .setVisible commands for the various controls within a specific section.
You'll also see these section functions being called at the start of the onInit function.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
June 7th, 2020, 21:27 #3
Yeah, it's around those function I've been experimenting but not having much luck
I'll take another look and try and get it working.
Thanks for the info Trenloe.
Cheers, Steve.
-
June 7th, 2020, 22:07 #4
Hmm, looks like it may be an issue with my overrides.
The setActiveVisible() function is only called when the CT is 1st opened, but doesn't fire when the current actor is changed :S
It all seems OK to me though, guess I've some digging it do.
Cheers, Steve.
-
June 7th, 2020, 23:22 #5
So this is really making my head hurt
here's my current new 'ct_entry.lua' file, referenced in my cthost.xml file like so :
Code:<root> <windowclass name="ct_entry" merge="join"> <script file="ct/scripts/new_ct_entry.lua" /> <sheetdata>
Code:-- -- Please see the license.html file included with this distribution for -- attribution and copyright information. -- function onInit() if super and super.onInit() then super.onInit() end end function updateDisplay() if super and super.updateDisplay then super.updateDisplay() end end function linkToken() if super and super.linkToken then super.linkToken() end end function onMenuSelection(selection, subselection) if super and super.onMenuSelection(selection, subselection) then super.onMenuSelection(selection, subselection) end end function delete() if super and super.delete then super.delete() end end function onLinkChanged() if super and super.onLinkChanged then super.onLinkChanged() end end function onHealthChanged() if super and super.onHealthChanged then super.onHealthChanged() end end function onIDChanged() if super and super.onIDChanged then super.onIDChanged() end end function onFactionChanged() if super and super.onFactionChanged then super.onFactionChanged() end end function onVisibilityChanged() if super and super.onVisibilityChanged then super.onVisibilityChanged() end end function onActiveChanged() if super and super.onActiveChanged then super.onActiveChanged() end end function linkPCFields() if super and super.linkPCFields then super.linkPCFields() end end -- -- SECTION VISIBILITY FUNCTIONS -- function setTargetingVisible() if super and super.setTargetingVisible then super.setTargetingVisible() end end function setAttributesVisible() if super and super.setAttributesVisible then super.setAttributesVisible() end end function setActiveVisible() Debug.console("new setactivevisible") --if super and super.setActiveVisible then --super.setActiveVisible() --end end function setSpacingVisible(v) if super and super.setSpacingVisible then super.setSpacingVisible(v) end end function setEffectsVisible(v) if super and super.setEffectsVisible then super.setEffectsVisible(V) end end
What the hell am I doing wrong here ?
Cheers, Steve.
-
June 7th, 2020, 23:47 #6
Look through the other XML and LUA associated with the CT for a call to setActiveVisible - use find in files.
-
June 8th, 2020, 00:01 #7
One other mention in the 5e ruleset, and that's in template_ct.xml... but it doesn't seem like that's what is calling the original setActiveVisible function.
I'm off to sleep on this one, 'cos I'm going round in circles :P
Cheers, STeve.
-
June 8th, 2020, 05:21 #8
I really think super.stuff is meant for when you are updating just one or two functions out of a larger file.
When you are updating 15 just replace the whole file!
My 2c.
-
June 8th, 2020, 08:41 #9
So, there are two approaches here.
1) copy everything from the 5E ruleset and modify as needed. The XML, the LUA, everything. This is what @damned is essentially suggesting. The advantage of this is that it’s quicker/easier to do this. The disadvantage is that the chances of a future update (or another extension) breaking your functionality is pretty high. So, maybe more work in the long run.
2) only change what you’re actually changing. Which is what we’re trying here. More work up front, maybe less headaches in the long run.
Two approaches, each have their pros and cons.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
June 8th, 2020, 08:57 #10
Yeah, I get what damned is saying, and doing that removes my problem...However that is going to remove any possibility of this extension playing nicely with any others that change/edit the combat tracker which I'm trying to avoid.
Even after a nights sleep I can't figure out why it still calls the original file :P
I'll keep plugging away at it though.
Damned, Trenloe, once again thanks for our input it's invaluable.
Cheers, Steve.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks