View Single Post
12/19/23, 05:37 PM   #3
wookiefriseur
 
wookiefriseur's Avatar
Join Date: Mar 2014
Posts: 53
Lightbulb

Yeah, like Baertram mentioned you need your own autocomplete files in addition to the ESO-Api ones.

You can add multiple ones. That's what one of my workspace configs looks like:

JSON Code:
  1. "Lua.workspace.library": [
  2.       "S:/ESOAPI/IntelliJ_ESOUI_AutoCompletion/Releases/API100035",
  3.       "Z:/Dokumente/Elder Scrolls Online/live/AddOns/FurnitureShoppingList/FurnitureShoppingList.lua",
  4.       "Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibAddonMenu-2.0/LibAddonMenu-2.0.lua",
  5.       "Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibCustomMenu/LibCustomMenu.lua",
  6.       "Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibAsync/LibAsync.lua",
  7.       "Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibCharacterKnowledge/Public.lua",
  8.       "Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibCharacterKnowledge/Internal.lua",
  9.       "Z:/Dokumente/Elder Scrolls Online/live/AddOns/sidTools/StartUp.lua",
  10.       "S:/ESOAPI/eso-api_base_manual.lua",
  11.       "Z:/Dokumente/Elder Scrolls Online/live/AddOns/FurnitureCatalogue/.scripts/luaDoc_Definitions.lua"
  12.     ],


Most of the GUI elements are just Control. As long as you have a definition for Control somewhere, you can type hint global elements as Control in the autocomplete file and custom variables directly, if you want. Something like:


Lua Code:
  1. -- In autocomplete file
  2.  
  3. ---@class Control
  4. GuiRoot = nil
  5. -- or like this
  6.  
  7. GuiRoot = Control
  8.  
  9.  
  10. -- type hinting of a local variable
  11. ---@class Control
  12. local someControl = WINDOW_MANAGER:CreateControlFromVirtual(...)
  13. someControl:SetHidden(true)




And this is what I have as Definition of control and GuiRoot in some file:
Lua Code:
  1. ---@class Control
  2. ---@field GetNamedChild fun(self: Control, childName: string): Control
  3. ---@field SetAnchor void
  4. ---@field SetHidden fun(self: Control, aHidden: boolean): void
  5. ---@field SetMouseEnabled void
  6. ---@field icon
  7. ---@field mats
  8. ---@field text Control
  9. ---@field comboBox ZO_ComboBox_Base
  10. ---@field SetText fun(self: Control, text: string): Control
  11. ---@field SetNormalTexture fun(self: Control, texture: string): Control
  12. ---@field SetMouseOverTexture fun(self: Control, texture: string): Control
  13. ---@field SetPressedTexture fun(self: Control, texture: string): Control
  14. Control = nil
  15.  
  16.  
  17. GuiRoot = Control


With the autocomplete hints you can get rid of all false positive errors and concentrate on the real error messages.





Generation Script

If you don't want to do it manually and have Python you can try my project specific generator. Should work with most other ESO-GUI XML files.


https://github.com/manavortex/Furnit...generateGui.py

And that's the result:
https://github.com/manavortex/Furnit...ns.lua#L22-L99
  Reply With Quote