Thread Tools Display Modes
06/03/14, 03:13 PM   #1
Awaz
Join Date: Jun 2014
Posts: 2
Adding a new menu to the player menu

Just a brief background, I have been involved in IT for the past 14 years. I did a lot of coding in archaic languages as well as C#, C and JAVA. Used DB2 as database, yada, yada. Although, for the past 5 years or so, I am doing more management and lead type stuff, so not much coding. Now, I have never coded in XML, but I have to review and understand XML codes written in projects I manage.
Trying to get back into technical side of things (personal level) and been trying out some Lua code. Got this game not too long back and would love to try out some addon. The first thing I want to try is to see if I can add another menu to the existing player menu that comes up when you press the ALT button. I tried to look around to see if there is a pre-defined XML that lays out that UI, but I did not find any. Is that even possible? If so, any direction on how I go about it?
  Reply With Quote
06/03/14, 04:10 PM   #2
Tonyleila
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 288
the alt button always goes back to the menu you opend last time but if you want to add something to player/bag menu you may look into:
Vicster's InventoryInsight
http://www.esoui.com/downloads/info2...ryInsight.html

Wykkyd's Outfitter

http://www.esoui.com/downloads/info5...Outfitter.html
  Reply With Quote
06/04/14, 03:21 PM   #3
katkat42
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 155
I've found lua to be closer to PHP than any other language I've dealt with; and the GUI bears a fair resemblance to the web's DOM. If you want to get a handle on the structure of stuff, my suggestion is to download the add-on Zgoo and look around. The root node of the UI in ESO is the object/table called GuiRoot. The lua manual is also helpful for grasping the differences between lua and everything else.
  Reply With Quote
06/04/14, 04:37 PM   #4
Awaz
Join Date: Jun 2014
Posts: 2
Originally Posted by Tonyleila View Post
the alt button always goes back to the menu you opend last time but if you want to add something to player/bag menu you may look into:
Vicster's InventoryInsight
http://www.esoui.com/downloads/info2...ryInsight.html

Wykkyd's Outfitter

http://www.esoui.com/downloads/info5...Outfitter.html
Thanks for the suggestion. My original thought was to try to create a totally separate menu similar to the inventory, group, guild, etc. But adding something to the bag/inventory menu is a good start.

@katkat42 - For now I download Lua for windows and it comes with a nice editor as well as an interactive console.
  Reply With Quote
06/04/14, 08:22 PM   #5
Tonyleila
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 288
Then maybe check options window of insJunkYard /jy setup
Or MobileBank for an extra window
  Reply With Quote
06/05/14, 04:54 AM   #6
b|m
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 2
i considered to add content to the main menu myself and spent quite some time trying to find out how it can be done. this is what i figure resp. how i understand things work.

basically everything in eso is a scene (e.g. the hud, the settings menu, etc). a scene can contain an arbitrary number of fragments. a fragment is merely a wrapper around a top level window (to be precise there are other types of fragments as well, but ill leave them out for now), that will toggle the visibility of the top level window when the fragment's visibility changes.

every category of the main menu (e.g. inventory, skills, grouping options, etc) has its own scene. however the scenes share some fragments, e.g. the mainMenuCategoryBar (e.g. the buttonbar in the top of the screen). if you click one of the buttons, the ui will simply change the current scene to the one for that category.

edit: rest of the post was utter bull**** and has been edited out. see garkins reply below

Last edited by b|m : 06/06/14 at 01:12 AM.
  Reply With Quote
06/05/14, 06:12 AM   #7
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
How to add category button to the main menu:

Lua Code:
  1. --create scene which I can add to the main menu:
  2. local tlw, texture
  3. tlw = WINDOW_MANAGER:CreateTopLevelWindow()
  4. tlw:SetDimensions(128,128)
  5. tlw:SetAnchor(CENTER, GuiRoot, CENTER, 0, 0)
  6. tlw:SetHidden(true)
  7. texture = WINDOW_MANAGER:CreateControl(nil, tlw, CT_TEXTURE)
  8. texture:SetTexture("/esoui/art/icons/poi/poi_groupboss_complete.dds")
  9. texture:SetAnchorFill(tlw)
  10.  
  11. local fragment = ZO_FadeSceneFragment:New(tlw)
  12.  
  13. local myAddonScene = ZO_Scene:New("myAddonScene", SCENE_MANAGER)
  14. myAddonScene:AddFragmentGroup(FRAGMENT_GROUP.UI_WINDOW) --standard UI elements such as mouse or keybind strap
  15. myAddonScene:AddFragment(fragment)
  16.  
  17.  
  18. --code for main menu category starts here:
  19. local binding = "TOGGLE_MY_ADDON"
  20. local categoryIndex = #MAIN_MENU.categoryInfo + 1
  21. local categoryName = "MY_CATEGORY_NAME"
  22.  
  23. --create string indexes
  24. ZO_CreateStringId("SI_BINDING_NAME_" .. binding, "Toggle my category")
  25. ZO_CreateStringId(categoryName, "My addon category")
  26.  
  27. --layout for category button
  28. local categoryLayoutInfo = {
  29.    binding = binding,
  30.    categoryName = categoryName,
  31.    callback = function() MAIN_MENU:OnCategoryClicked(categoryIndex) end,
  32.    descriptor = categoryIndex,
  33.    normal = "EsoUI/Art/WorldMap/map_indexIcon_key_up.dds",
  34.    pressed = "EsoUI/Art/WorldMap/map_indexIcon_key_down.dds",
  35.    disabled = "EsoUI/Art/WorldMap/map_indexIcon_key_up.dds",   --I do not have disabled icon :-(
  36.    highlight = "EsoUI/Art/WorldMap/map_indexIcon_key_over.dds",
  37. }
  38. --add category button
  39. ZO_MenuBar_AddButton(MAIN_MENU.categoryBar, categoryLayoutInfo)
  40.  
  41. --create subcategory bar, support for function MAIN_MENU:AddSceneGroup(categoryIndex, sceneGroupName, iconData)
  42. local subcategoryBar = CreateControlFromVirtual("ZO_MainMenuSubcategoryBar", MAIN_MENU.control, "ZO_MainMenuSubcategoryBar", i)
  43. subcategoryBar:SetAnchor(TOP, MAIN_MENU.categoryBar, BOTTOM, 0, 7)
  44. local subcategoryBarFragment = ZO_FadeSceneFragment:New(subcategoryBar)
  45. MAIN_MENU.categoryInfo[categoryIndex] = {
  46.    barControls = {},
  47.    subcategoryBar = subcategoryBar,
  48.    subcategoryBarFragment = subcategoryBarFragment,
  49. }  
  50.  
  51. --add scene to the main menu category
  52. MAIN_MENU:AddScene(categoryIndex, "myAddonScene")

Last edited by Garkin : 06/05/14 at 06:21 AM.
  Reply With Quote
06/05/14, 06:59 AM   #8
b|m
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 2
nice, i missed that
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Adding a new menu to the player menu


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