DICE PACKS BUNDLE
Page 1 of 2 12 Last
  1. #1

    Button tabs in PC and NPC sheet

    I'm unsure what is being done with tabs now.

    Previously had overridden common/scripts/buttongroup_tabs.lua to provide a call back function so that I knew when tabs were clicked. This required overriding numerous functions to allow the trigger of the callback. The code is common for both PC and NPC sheets so does not need to distinguish which is which.

    When I ran with TEST - the PC sheet did not seem to have an issue. All good.

    But as soon as I brought up an NPC sheet the

    self.parentcontrol.window.tabs.setCallback (PolymorphismManager.TabsCallback, self);

    function call setting the callback (same as in PC) claimed "tabs" was nil.

    I need to understand how to recreate my stuff in this new world where PC and NPC tabs have somehow diverged.

    So what has happened with "tabs" and how to do I implement my buttongroup_tabs.lua functionality that lets me know when tabs have been clicked or double clicked or whatever I do in my override.

    I have had to replace code that added a tab into an NPC sheet - but that does not really tell me how or where the functionality I had in this buttongroup_tabs.lua would go.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  2. #2
    You need to just do this
    <windowclass name="npc" copy="record_window_tabbed">

    and add your tabs like this
    <tab>
    <name>main</name>
    <resource>tab_main</resource>
    <class>npc_main</class>
    <embed />
    </tab>
    <tab merge="add">
    <name>inventory</name>
    <resource>tab_inventory</resource>
    <class>npc_inventory</class>
    <embed />
    </tab>

    <tab merge="add">
    <name>psi</name>
    <resource>tab_powers</resource>
    <class>charsheet_powers</class>
    <embed />
    </tab>

    none of it is in sheedata

  3. #3
    As I said - I already updated things where i had to add tabs in - so this is known to me already.

    I have code that intercepts the low level code to determine when a callback is made when a tab is selected - and it still works in PC but not in NPC. I need to know how to DO what I was doing with existing tabs - nothing to do with adding tabs.

    Also the fact PC and NPC are now doing things differently for tabs is wrecking the common code - though I don't understand how I'm to replace that in the new tabs of NPC or if PC will eventually become common way of doing tabs.

    Its all confusing right now and I'd like a hint on if the buttongroup_tabs.lua is still in play in the new way - and if so what I'm supposed to do to access the tabs as it used to be self.parentcontrol.window.tabs in the window access - what is it now?

    Going through another many hour deconstruction code hunt is not something I want to do again, as I've already done that twice for two different update changes in this TEST round.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  4. #4
    I'm going to assume "hope" that the code is still the same at the low level for tabs and that the self.parentcontrol.window.tabs has just moved location. Trial and error here I come (sigh).

    First guess will be [Wrong guess - here we go (sigh)] - but with my luck I'll be doing Debug.console prints of these till I can find where its at.

    Its just going to be a pain to support PC and NPC differently (guess I'll have to check where tabs is for both now?).
    Last edited by SilentRuin; February 16th, 2024 at 19:51.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  5. #5
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,272
    Blog Entries
    9
    Have you asked Moon for help/clarification via Discord? Seems like he's willing to help if he's available.

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  6. #6
    Having wasted his time on a corrupt (I assume) campaign in discord where the problem could not be duplicated anywhere but on my machine - I figured he'd get to this when he can.

    I'm going on two major assumptions:

    1) The underlying common/scripts/buttongroup_tabs.lua has not changed - just the location of "tabs" in window references has. The "/debug on" chat option seems to show its still in the same place - so there must be some trick to getting the window reference correct.

    For PCs - which still work as they used to:

    Type: genericcontrol
    Window: charsheet
    Control: tabs
    Frame(tabs)

    reference control from my subwindow as

    window.parentcontrol.window.tabs

    works. This is the same path that used to work with NPCs also.

    For NPCs - which no longer work as they used to:

    Type: genericcontrol
    Window: npc
    Control: tabs
    Frame(tabs)

    the reference no longer works with
    window.parentcontrol.window.tabs

    So I'm guessing with no luck on where it went with Debug.console(window.parentcontrol.window.getContr ols()) - its just no longer where I would think it would be. Stuck randomly guessing now how to access it.


    2) That PC and NPC will be the same reference as they used to be at some point.

    Gist being - this should be simple to figure out - but its not. No idea why. My subwindow is "invisibly" present in both sheets so one would think if I can back track to parentcontrol.window I'd be at where I was.
    Last edited by SilentRuin; February 16th, 2024 at 20:30.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  7. #7
    I'm going to have to wait for clarification from @MoonWizard as I don't understand how the "/debug on" chat option is telling me the control is in same place relatively as it was before - but can't be referenced. Looking at the code it goes down into record_window_tabbed for the NPC while the PC is still as it was. I'm beginning to think there is no commonality with things I overrode in LIVE anymore - or at least a disconnect between PC and NPC sheets now.

    Yeah its the ultimate nightmare with two tabbing systems and no direction on how to port from old one. I'm guessing at this point common/scripts/buttongroup_tabs.lua is not longer used at all in NPC and instead some new manager_window_tab.lua along with some other new undocumented wonders will have to be done from scratch by me to get my old callback logic.

    I'm going to wait for feedback before I try to guess my way out of this one. It's to convoluted to move from the current tabbing PC mechanism that works still - to the new NPC tabbing mechanism which I'm beggining to suspect I will have to redesign and start from scratch. That way I can gain - nothing - and be back where I was. Maybe.
    Last edited by SilentRuin; February 16th, 2024 at 21:01.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  8. #8
    Just to be absolutely clear on what I'm doing with tabs:

    I override common/scripts/buttongroup_tabs.lua with new tab functionality.

    I use "tabs" for PC and NPC as follows:

    self.parentcontrol.window.tabs.setCallback (PolymorphismManager.TabsCallback, self);

    local nActiveTab = window.parentcontrol.window.tabs.getIndex();

    local sSub, sDisplay = window.parentcontrol.window.tabs.getTab(nActiveTab );

    I now realize I have .main_creature references all over the place (including TabsCallback) that will have to be rewritten also (triple sigh). This brings up another reference issue on how you reference the new NPC main window?

    Previously it was from NPC level:

    window.main_creature

    Not sure what it is now.
    Last edited by SilentRuin; February 16th, 2024 at 21:19.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  9. #9
    Wow. And its even more confusing. I printed out my window.getControls() for the NPC window to figure out what to replace main_creature with (it's main) and I see the "tabs" in that reference. But clearly do not when backtracking through parentcontrol in the other extension's reference.

    I need to stop giving a running commentary as it reads to me as "insane". Yet true.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  10. #10
    Well one thing I've found is that self.parentcontrol.window.tabs called from a subwindow's onInit is evidently not present yet. Its completely shifted where its put into the window structure so that the attempt to access it as part of a subwindows init gets nil. I found this out by pushing past that failure to see what happens and later the code found tabs in the same reference (after app was up and initialized fully).

    I swear this update is trying to drive me nuts.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Product Walkthrough Playlist

Log in

Log in