Thread Tools Display Modes
01/29/15, 04:05 PM   #21
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
There are some UI objects that are difficult to get hold of, because they're only kept in local variables.

ingame/mainmenu/mainmenu.lua
Function ZO_MainMenuManager:Initialize creates an instance of ZO_AddOnManager, and puts it in a local variable. In AddonProfiles, I override ZO_AddOnManager:OnShow with the sole purpose of getting that instance. If not global, it could at least be a member in ZO_MainMenuManager (MAIN_MENU).

ingame/campaign/campaignbrowser.lua
CAMPAIGN_BROWSER is local in this file
Again, I was able to get it, but this one required a dirty hack. As to what for, it's a not-yet-ready add-on that flattens campaign tree, so that all (Normal) campaigns appear in one list.

ingame/leaderboards/leaderboards_shared.lua
And now for something completely different. Function ZO_LeaderboardsListManager_Shared:IndexFunction, which is used to implement __index meta-method on data tables, returns dataTable[key]. As long as every accessed key either exists or is added in SetupDataTable, it works. But when someone foolish enough attempts to access dataTable.foobar, it will lead to infinite recursion. Yes, I learned that the hard way The function should return rawget(dataTable, key).
  Reply With Quote
01/30/15, 03:42 PM   #22
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
Originally Posted by sirinsidiator View Post
Would be nice to see any or all of them in the future
Thanks for the list. I'll pass it along to server since most of these have server implications.
  Reply With Quote
01/30/15, 06:45 PM   #23
katkat42
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 155
ITEMTYPE enums and provisioning ingredients:
With the new provisioning changes, we now have one in-game item with ITEMTYPE_SPICE, one in-game item with ITEMTYPE_FLAVORING, and alllllllll the rest have ITEMTYPE_INGREDIENT. Perhaps the following might be implemented?
ITEMTYPE_MEAT (fish, white meat, red meat, game, small game, poultry)
ITEMTYPE_FRUIT (apples, bananas, jazbay grapes, melons, tomatoes, pumpkins)
ITEMTYPE_VEGETABLE (carrots, potatoes, corn, radishes, beets, greens)
ITEMTYPE_ALCOHOL, ITEMTYPE_TEA, ITEMTYPE_TONIC similarly
And the other 12 ingredients can stay ITEMTYPE_INGREDIENT, since they're pretty generic.

I figure, since enchanting runes got subdivided, it's worth a shot, and it would make certain things in SousChef much easier :-)
  Reply With Quote
01/31/15, 03:01 AM   #24
BornDownUnder
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 59
Question

Originally Posted by ZOS_ChipHilseberg View Post
Feel free to post any questions or concerns about the 1.6 Addon API changes here.
I have a question which most addons authors/users would (should) have... Is there a reason for the limiting of the file name structure to 128 characters in length? It was perfectly fine before and I can't possibly see any justification for the alteration at all
  Reply With Quote
02/01/15, 12:44 PM   #25
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
Originally Posted by ZOS_ChipHilseberg View Post
Thanks for the list. I'll pass it along to server since most of these have server implications.
Hi, man!
im not really a developer, but can ZOS add to api smthing to detect all number of players in the home campaing to calculate a "gold reward position"? afaik its top 10%

like described there

http://www.esoui.com/forums/showthread.php?t=4260

Last edited by QuadroTony : 02/01/15 at 12:55 PM.
  Reply With Quote
02/02/15, 09:23 AM   #26
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
Originally Posted by BornDownUnder View Post
I have a question which most addons authors/users would (should) have... Is there a reason for the limiting of the file name structure to 128 characters in length? It was perfectly fine before and I can't possibly see any justification for the alteration at all
Did you have an addon path that worked before 1.6 and that doesn't work now? I'm not aware of any (intentional) changes to that code.
  Reply With Quote
02/02/15, 09:55 AM   #27
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
sorry, looks like rewards for campaign works like this
- first 100 ppl det purple items
- first 10 ppl get gold items

disregard my prev question
  Reply With Quote
02/03/15, 02:04 PM   #28
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
I have wondered if this one:
EVENT_QUEST_ADDED (integer eventCode, integer journalIndex, string questName, string objectiveName)
could get changed to something like this:
EVENT_QUEST_ADDED (integer eventCode, integer journalIndex, string questName, string objectiveName, integer questID)
so we can get the quest ID's.
Actually I would like to be able to get/use ID's for all those quest events.
  Reply With Quote
02/03/15, 07:01 PM   #29
BornDownUnder
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 59
Red face

Originally Posted by ZOS_ChipHilseberg View Post
Did you have an addon path that worked before 1.6 and that doesn't work now? I'm not aware of any (intentional) changes to that code.
I apologize and fully retract my previous question. It seems I was mistaken completely in my troubleshooting of an addon on PtS.

I also apologize for the delay in response, am under the weather with hay-fever at present.
  Reply With Quote
02/06/15, 08:34 PM   #30
Dero
 
Dero's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 14
what does
Code:
GetChampionPointAttributeForRank()
exactly do?

Atm it returns 0
Does it returns an integer, that describes, what the next CP will be?
Like
0 = Blue
1 = Red
2 = Green
?

And another important thing:
Can we get the Buffs/Hots/Dots and Debuffs back please?
Especially in trials its really hard to see if a buff or debuff is active or if it's not. And the current API gives only feedback on a really low number of buffs / debuffs.
For example: Poison arrow. You can see an effect on the target and you can see your hands glowing green. Everything fine, while playing solo. But if you are fighting in a big crowd like in trials or PvP you can't see if a buff is up or if its not. I know, that there are some addons wich show buffs, but these buffs are only interpreted by klicking a button with the assigned skill and they also say that there is a buff running, when you have canceled the skill or pressed it while stunned or something. i think a working buffinfo from the API would be really nice, and a lot of people would love to see this feature!
  Reply With Quote
02/06/15, 09:27 PM   #31
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
I will answer just the first part of your question:
Originally Posted by Dero View Post
what does
Code:
GetChampionPointAttributeForRank()
exactly do?

Atm it returns 0
Does it returns an integer, that describes, what the next CP will be?
Like
0 = Blue
1 = Red
2 = Green
?
Return values are:
ATTRIBUTE_NONE = 0
ATTRIBUTE_HEALTH = 1
ATTRIBUTE_MAGICKA = 2
ATTRIBUTE_STAMINA = 3

So it is more like:
0 = None
1 = Red
2 = Blue
3 = Green


Here is a small piece of code from UI (center screen anounnce handler) which shows how to use this function:
Lua Code:
  1. --EsoUI\Ingame\CenterScreenAnnounce\CenterScreenAnnounceHandlers.lua, lines 735-742
  2. CSH[EVENT_CHAMPION_POINT_GAINED] = function()
  3.     local rankGained = GetPlayerChampionPointsEarned()
  4.     local pointType = GetChampionPointAttributeForRank(rankGained)
  5.     local icon = GetChampionPointAttributeIcon(pointType)
  6.     local constellationGroupName = ZO_Champion_GetConstellationGroupNameFromAttribute(pointType)
  7.     local secondLine = zo_strformat(SI_CHAMPION_POINT_TYPE, constellationGroupName)
  8.     return CSA_EVENT_COMBINED_TEXT, SOUNDS.CHAMPION_POINT_GAINED, GetString(SI_CHAMPION_POINT_EARNED), secondLine, icon, nil, nil, nil, nil, CSA_OPTION_SUPPRESS_ICON_FRAME
  9. end
  10.  
  11. --EsoUI\Ingame\ChampionPerks\ChampionPerks.lua, lines 20-29
  12. local ATTRIBUTE_TO_CONSTELLATION_GROUP_NAME =
  13. {
  14.     [ATTRIBUTE_HEALTH] = GetString(SI_CHAMPION_CONSTELLATION_GROUP_HEALTH_NAME),
  15.     [ATTRIBUTE_MAGICKA] = GetString(SI_CHAMPION_CONSTELLATION_GROUP_MAGICKA_NAME),
  16.     [ATTRIBUTE_STAMINA] = GetString(SI_CHAMPION_CONSTELLATION_GROUP_STAMINA_NAME),
  17. }
  18.  
  19. function ZO_Champion_GetConstellationGroupNameFromAttribute(attribute)
  20.     return ATTRIBUTE_TO_CONSTELLATION_GROUP_NAME[attribute]
  21. end
  Reply With Quote
02/07/15, 06:08 AM   #32
Dero
 
Dero's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 14
Ty Garkin,
that was exactly what i was looking for.
  Reply With Quote
02/07/15, 07:04 AM   #33
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Yesterday I found out that CAMPAIGN_LEADERBOARDS became local. I didn't have much time to investigate, so far it seems it's only obtainable via hooking base class methods. Edit: I don't need it, as I was only hooking UpdatePlayerInfo, which was moved to a base class, so I can hook it there. But the detective work required everytime I want to hook something that's declared local is becoming tedious.

Well, reducing the amount of globals is generally a good thing, but could all those localized capitalized objects be made accessible from outside of their module? I mean ZOS code would keep using locals, but after construction also add them to a global table for add-on tackling.

Last edited by merlight : 02/07/15 at 07:08 AM.
  Reply With Quote
02/08/15, 01:13 AM   #34
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Travel to and Invite Guildmate to group bug

The "Travel to Player" and "Invite to Group" menu items are missing from the guild roster context menu. I can't test, because ZO_KeyboardGuildRosterManager is local, but I believe the issue is located in the function ZO_KeyboardGuildRosterManager:GuildRosterRow_OnMouseUp in the file guildroster_keyboard.lua.

The variable playerAlliance is used to check that the player and the target are in the same alliance, but playerAlliance is not declared within the scope of ZO_KeyboardGuildRosterManager:GuildRosterRow_OnMouseUp.

  Reply With Quote
02/08/15, 04:56 AM   #35
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Randactyl View Post
The "Travel to Player" and "Invite to Group" menu items are missing from the guild roster context menu. I can't test, because ZO_KeyboardGuildRosterManager is local, but I believe the issue is located in the function ZO_KeyboardGuildRosterManager:GuildRosterRow_OnMouseUp in the file guildroster_keyboard.lua.

The variable playerAlliance is used to check that the player and the target are in the same alliance, but playerAlliance is not declared within the scope of ZO_KeyboardGuildRosterManager:GuildRosterRow_OnMouseUp.

Ha, you're right. There is a typo in code.

EsoUI\Ingame\Guild\Keyboard\GuildRoster_Keyboard.lua, lines 232-237:
Lua Code:
  1. if(dataIndex == playerIndex) then
  2.     ZO_AddLeaveGuildMenuItem(guildId)
  3. else
  4.     if(data.hasCharacter and data.online) then
  5.         AddMenuItem(GetString(SI_SOCIAL_LIST_SEND_MESSAGE), function() StartChatInput("", CHAT_CHANNEL_WHISPER, data.displayName) end)
  6.         if(data.alliance == playerAlliance) then --here should be self.playerAlliance instead of just playerAlliance
  7.             AddMenuItem(GetString(SI_SOCIAL_MENU_INVITE), function()
  Reply With Quote
02/08/15, 05:02 AM   #36
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
hmm - so we can fix this? or its the path to internal part of the file we cannot change, only ZOs can?
  Reply With Quote
02/08/15, 05:43 AM   #37
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by QuadroTony View Post
hmm - so we can fix this? or its the path to internal part of the file we cannot change, only ZOs can?
Only ZOS can. We can redefine that function, but we can't change what is in the original code.
Or to be more precise, object ZO_KeyboardGuildRosterManager is local, so we can't redefine it's methods directly - we have to find instance of this object (in this case GUILD_ROSTER_KEYBOARD) and then make a new definition of GuildRosterRow_OnMouseUp method.
  Reply With Quote
02/08/15, 06:17 AM   #38
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
and what about this? icon now always visible on pts
friends indicator

  Reply With Quote
02/08/15, 08:08 AM   #39
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by Garkin View Post
... and then make a new definition of GuildRosterRow_OnMouseUp method.
Or amend its environment. Not entirely sure, but I think it should work (as long as the method is accessible):
Lua Code:
  1. local orgEnv = getfenv(GUILD_ROSTER_KEYBOARD.GuildRosterRow_OnMouseUp)
  2. local newEnv = setmetatable({playerAlliance = GetUnitAlliance("player")}, {__index = orgEnv})
  3. setfenv(GUILD_ROSTER_KEYBOARD.GuildRosterRow_OnMouseUp, newEnv)
  Reply With Quote
02/09/15, 08:56 AM   #40
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Is there easy way to tell if you are interacting with fence or with regular merchant? Intraction type for both is INTREACTION_VENDOR.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » 1.6 Addon API Feedback


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off