03/11/15, 06:29 PM | #1 |
Stumped By GUILD_ROSTER Changes
So, for some time now I've had a neat feature in ddSK that re-does the whole Guild Roster screen so that members sales data can be shown/ranked in the winder.
But now, for the life of me I can't get the UI to recognize the <Label> controls in individual rows--the data is there, and the text is there, but the controls ain't loading. Prior to 1.6, this is the code I used to add those controls to ZO_GuildRosterList: Code:
ZO_ScrollList_AddDataType(GUILD_ROSTER.list, 2, "ddSKRosterRow", 30, function(control, data) GUILD_ROSTER:SetupGuildMember(control, data) end) Obviously, GUILD_ROSTER is now a mess of keyboard and gamepad changes. Here's the best effort I have to simply adapt to the new Roster classes: Code:
ZO_ScrollList_AddDataType(GUILD_ROSTER_KEYBOARD.list, 2, "ddSKRosterRow", 30, function(control, data) GUILD_ROSTER_MANAGER:SetupRow(control, data) end) I've also updated the XML file so that: Code:
<Control name="ddSKRosterRow" mouseEnabled="true" virtual="true" inherits="ZO_GuildRosterRow"> is now: Code:
<Control name="ddSKRosterRow" mouseEnabled="true" virtual="true" inherits="ZO_KeyboardGuildRosterRow"> What am I missing here? I just need the labels themselves, the fancy things that make the window display text, from my ddSKRosterRow control to show up. |
|
03/11/15, 07:07 PM | #2 |
|
Lua Code:
So you need to hook BuildMasterList on GUILD_ROSTER_MANAGER, and FilterScrollList on GUILD_ROSTER_KEYBOARD. Also for FilterScrollList, I wouldn't replace the function, but call the original and then rewrite all entries' typeId. Or, and this may seem dirty but is nonetheless awesome, don't hook it at all, and make the original create entries with your typeId: Lua Code:
|
03/11/15, 07:13 PM | #3 |
I didn't try it and don#t know your addon, so i couldn't test it, but couldn't you just use GUILD_ROSTER_MANAGER:SetupGuildMember() again to add the controls?
|
|
03/11/15, 07:56 PM | #4 | |
Code:
function ddShopkeeper.SetupGuildMember(self, control, data) origSetupGuildMember(self, control, data) local UserId = GetControl(control, "DisplayName") local Zone = GetControl(control, "Zone") local Class = GetControl(control, "Class") local Level = GetControl(control, "Level") local Vet = GetControl(control, "Veteran") local Note = GetControl(control, "Note") UserId:SetText(data.sortIndex.." "..data.displayName) local tRosterSales = ddShopkeeper.Ledger.Options.cRosterSales.getFunc() local tRosterPurchases = ddShopkeeper.Ledger.Options.cRosterPurchases.getFunc() local tRosterTax = ddShopkeeper.Ledger.Options.cRosterTax.getFunc() local Sales = GetControl(control, "SalesLabel") local Purchases = GetControl(control, "PurchaseLabel") local Tax = GetControl(control, "TaxLabel") local SalesText = ddShopkeeper.LocalizedNumber(data.sales).." "..zo_iconFormat("esoui/art/currency/currency_gold.dds", 14, 14) local PurchText = ddShopkeeper.LocalizedNumber(data.purchases).." "..zo_iconFormat("esoui/art/currency/currency_gold.dds", 14, 14) local TaxesText = ddShopkeeper.LocalizedNumber(data.tax).." "..zo_iconFormat("esoui/art/currency/currency_gold.dds", 14, 14) So, "SalesText" etc. can easily go to chat with a simple display function ( d(SalesText) ) and it'll post 500 lines of it to chat. Likewise, I can manipulate all the original controls like Vet and Note. But the "Sales", etc., variables, based on a GetControl("MyddSKRosterRowLabelName") function, come up nil. As best I can tell, the issue is that my control(s) never get added like they used to, from this function: Code:
ZO_ScrollList_AddDataType(GUILD_ROSTER_KEYBOARD.list, 2, "ddSKRosterRow", 30, function(control, data) GUILD_ROSTER_MANAGER:SetupRow(control, data) end) |
||
03/11/15, 09:40 PM | #5 | |
|
Btw, you should give that "2" type a name, it'll be easier to find where it's used in the code And final note for tonight. ZO_ScrollList_AddDataType with setup function that calls the base version, and then overriding the base version, is complicated and wrong -- if you're adding data type 2, you should not be changing the setup procedure for data type 1. Instead, provide a function that will call the base setup, and then your additional setup: Lua Code:
|
|
03/11/15, 09:47 PM | #6 | |
|
1. game starting 2. original BuildMasterList 3. original FilterScrollList => all entries have typeId == 1 4. ddSK installs hooks 5. list is shown, row controls are created for type 1 6. ddSK SetupGuildMember wonders where are children for type 2 |
|
03/12/15, 02:35 AM | #7 |
MailBuddy
I've also had similar problems with MailBuddy. ZO_FriendsList was renamed and we've tried to account for it by changing the name in the code, but it still doesn't anchor AT ALL... stumped...
|
|
03/12/15, 08:15 PM | #8 | |
|
||
03/13/15, 03:41 AM | #9 | |
|
For example KEYBINDING_MANAGER creates complete data entries for the underlying ZO_ScrollList in BuildMasterList, and then in FilterScrollList only throws these into ZO_ScrollList. GUILD_ROSTER_MANAGER, on the other hand, creates only its inner data tables in BuildMasterList, and GUILD_ROSTER_KEYBOARD wraps them in ZO_ScrollList_CreateDataEntry later in FilterScrollList. This is necessary because the masterList is shared between KB and GP lists, but ZO_ScrollList assumes ownership of the entries you put in it, so KB and GP must create their own entries. |
|
03/13/15, 12:30 PM | #10 | |
1) I still need to replace the old SetupGuildMember with my own, and call the old one in it first. Splitting it into two functions in the AddDataType function seems to only create more problems. 2) "2" has been assigned to a new local global DDSK_GUILD_ROSTER_DATA, just for fancy naming purposes. 3) Everything goes right in BuildMasterList. But my FilterScrollList replacement hook ain't adding DDSK_GUILD_ROSTER_DATA to row controls like it did pre-1.6. That seems to be where I'm screwed--all the data is available, but my XML label controls just aren't getting added to each row control's children so there's no control, like "SalesLabel", for my GetControl calls in the SetupGuildMember function. Why? |
||
03/13/15, 01:08 PM | #11 | ||
|
GUILD_MEMBER_DATA -> template "ZO_KeyboardGuildRosterRow" -> function ZO_KeyboardGuildRosterManager:SetupRow DDSK_GUILD_ROSTER_DATA -> template "ddSKRosterRow" -> function ddSKRosterRowSetup All row controls created from the template "ddSKRosterRow" will use your ddSKRosterRowSetup function. There's no point in hooking SetupGuildMember, any control not going through ddSKRosterRowSetup wil not have been created from your template.
|
||
03/13/15, 02:31 PM | #12 | ||
Solved it.
For everyone's benefit, these are my hooks, the FilterScrollList function, and the critical first part of my SetupGuildMember function: Hooks: Code:
origSetupGuildMember = GUILD_ROSTER_MANAGER.SetupGuildMember origBuildMasterList = GUILD_ROSTER_MANAGER.BuildMasterList GUILD_ROSTER_MANAGER.SetupGuildMember = ddShopkeeper.SetupGuildMember GUILD_ROSTER_MANAGER.BuildMasterList = ddShopkeeper.RosterBuildMasterList GUILD_ROSTER_KEYBOARD.FilterScrollList = ddShopkeeper.RosterFilterScrollList GUILD_ROSTER_KEYBOARD.CompareGuildMembers = ddShopkeeper.CompareGuildMembers ZO_ScrollList_AddDataType(ZO_GuildRosterList, DDSK_GUILD_MEMBER_DATA, "ddSKRosterRow", 30, function(control, data) GUILD_ROSTER_MANAGER:SetupGuildMember(control, data) end) Code:
function ddShopkeeper.RosterFilterScrollList(self) local scrollData = ZO_ScrollList_GetDataList(self.list) ZO_ClearNumericallyIndexedTable(scrollData) local searchTerm = self.searchBox:GetText() local masterList = GUILD_ROSTER_MANAGER:GetMasterList() for i = 1, #masterList do local data = masterList[i] if (searchTerm == "" or GUILD_ROSTER_MANAGER:IsMatch(searchTerm, data)) then table.insert(scrollData, ZO_ScrollList_CreateDataEntry(DDSK_GUILD_MEMBER_DATA, data)) end end end Code:
function ddShopkeeper.SetupGuildMember(self, control, data, selected) GUILD_ROSTER_KEYBOARD:ColorRow(control, data, selected) origSetupGuildMember(self, control, data, selected) Last edited by Deome : 03/13/15 at 02:36 PM. |
|||
03/13/15, 02:47 PM | #13 | |
Join Date: Jun 2014
Posts: 2
|
Nice
Great work Deome, thanks for your hard work we appreciate it. Thanks for those who bounced ideas off him too.
Be blessed! E |
|
03/13/15, 04:03 PM | #14 | |
|
Lua Code:
Note the original setup function, which I also used a few posts above, you should've copied that. Here is the function for reference: Lua Code:
|
|
ESOUI » Developer Discussions » General Authoring Discussion » Stumped By GUILD_ROSTER Changes |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|