ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   How do I figure out what api parameters are/do? (https://www.esoui.com/forums/showthread.php?t=7306)

Elmofuntz 08/19/17 06:39 PM

How do I figure out what api parameters are/do?
 
So I'm new to lua but not programming in general but I also don't do it for a living.. I'm trying to figure out how I can determine what the ZOS api calls are looking for as parameters and what they do. Specifically at the moment I'm looking at ZO_ReticleContainerInteract. I've looked at a couple addon's (craftautoloot) that use it and someone's example here but not clear on what the parameters are (and the board example is different than the addon code). I'm sure some of this confusion is due to not totally understanding lua yet.

Also why when I look at the wiki does it seem the esoui api is always behind? like right now it says "Page up-to-date to API Version 100020 (except ESOUI API which is at 100016)" Thanks for any assistance you can give a newcomer as I try to figure this all out. :)

Ayantir 08/19/17 08:33 PM

http://www.esoui.com/downloads/info1...ourcecode.html

Download, Browse, find.

Quote:

Also why when I look at the wiki does it seem the esoui api is always behind? like right now it says "Page up-to-date to API Version 100020 (except ESOUI API which is at 100016)" Thanks for any assistance you can give a newcomer as I try to figure this all out.
I'm lazy.

And ZO_ReticleContainerInteract is not part of the API, ZO_ReticleContainerInteract is defined in the Lua code, it does not come from the C++ Code.

And I would add that it's not even defined in a .lua file, but in an XML Definition.
\esoui\ingame\reticle\reticle.xml
So it don't have any parameter because it's not a function, it's a variable.

Lua Code:
  1. <GuiXml>
  2.     <Controls>
  3.         <TopLevelControl name="ZO_ReticleContainer" hidden="true" tier="LOW" layer="BACKGROUND">
  4.             <AnchorFill/>
  5.  
  6.             <OnInitialized>
  7.                 ZO_Reticle_Initialize(self)
  8.             </OnInitialized>
  9.  
  10.             <Controls>
  11.                        
  12.                 <Control name="$(parent)Interact" hidden="true">
  13.                     <Dimensions x="200" y="50" />
  14.                     <Anchor point="LEFT" relativePoint="CENTER" offsetX="45" offsetY="40" />
  15.                     <Controls>
  16.                         <Label name="$(parent)Context">
  17.                             <DimensionConstraints maxX="380" />
  18.                             <Anchor point="BOTTOMLEFT" />
  19.                         </Label>
  20.  
  21.                         <Control name="$(parent)KeybindButton" inherits="ZO_KeybindButton">
  22.                             <Anchor point="TOPLEFT" relativeTo="$(parent)Context" relativePoint="BOTTOMLEFT" offsetX="20" offsetY="6"/>
  23.                         </Control>
  24.  
  25.                         <Label name="$(parent)AdditionalInfo" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_CONTRAST">
  26.                             <Anchor point="TOPLEFT" relativeTo="$(parent)KeybindButtonNameLabel" relativePoint="BOTTOMLEFT" offsetY="6"/>
  27.                         </Label>
  28.                     </Controls>
  29.                 </Control>

Elmofuntz 08/20/17 07:51 AM

Ok cool I was not sure if there was a reason the versions were behind or just whoever did it was not able to get to it yet. I would hardly call anyone doing addon work for the community lazy. It "gets my goat" when people bitch about addon's not working especially right after a patch, like it's something they are owed. This is one reason I am trying to do one myself this time around (I avoided it in WoW and EQ).

The link to the source helps as well thanks. I guess I am still a bit confused about my question the line I was looking at shows this

Code:

ZO_ReticleContainerInteract:SetHandler("OnShow", function()
      local action, container, _, _, additionalInfo, _ = GetGameCameraInteractableActionInfo()

Then a giant if statement all wrapped up in that SetHandler and to me it looked like a function passing or setting variables. I was trying to figure out what some of that like the _'s are for. Like I said I'm very unfamiliar with lua more a PowerShell, vb, some C# guy and I only dabble for fun. I get the general gist of what the entire code does. I've been able to modify it and add new action types and objects to it but i'm looking to do more and while theres a good chance none of the rest of that line does anything I care about I tend to get stuck on trying to know all the details just in case.

BTW I did actually find an example of that XML in all my googling somewhere and it actually added to my confusion since as you stated its clearly not a function there..

I do appreciate all the help.

-E

Rhyono 08/20/17 08:22 AM

In that example, ZO_ReticleContainerInteract is the target, SetHandler is being executed on it and adding a function on show. The function is grabbing the data from GetGameCameraInteractableActionInfo() which is shown in the ESO API:

Returns: string:nilable action, string:nilable name, boolean interactBlocked, boolean isOwned, number additionalInfo, number:nilable contextualInfo, string:nilable contextualLink, boolean isCriminalInteract

Elmofuntz 08/20/17 06:50 PM

Ah thanks for the info!

manavortex 08/26/17 05:22 AM

Here's the API documentation:
http://wiki.esoui.com/Api

:)

Elmofuntz 08/26/17 06:45 PM

Quote:

Originally Posted by manavortex (Post 32445)
Here's the API documentation:
http://wiki.esoui.com/Api

:)

Um ok. Thanks? Been there couldn't find it (cause its not in there) thus the post and the helpful replies already. But thanks anyhow for trying! :)

Rhyono 08/26/17 06:58 PM

She was building on my response; not trying to answer the original question.

Elmofuntz 08/27/17 09:33 PM

Quote:

Originally Posted by Rhyono (Post 32451)
She was building on my response; not trying to answer the original question.

That's cool. All the help I can get. I guess one should never assume someone knows about something unless its clearly stated in a post. I failed to say I had seen the API listing and gotten totally lost trying to find what I needed. My bad. Again thanks for all the help you all have been great so far.


All times are GMT -6. The time now is 10:03 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI