Jump to content

SKSE UI script and SkyUI: path targets for UI.GetInt()


Recommended Posts

I'm writing a script where I need to get the FormID of the weapon/armor that has been chosen for enchanting in the Enchanting Menu. However, I cannot seem to find the right path for the UI.GetInt(String menuName, String target) target parameter from schlangster's skyui github.



I know that, in the case of items in the Inventory Menu, I can get the FormID of the selected item as:



Game.GetFormEx(UI.GetInt("InventoryMenu", "_root.Menu_mc.inventoryLists.itemList.selectedEntry.formId"))

In the case of the Enchanting Menu, I tried:



Game.GetFormEx(UI.GetInt("Crafting Menu", "_root.Menu_mc.CraftingLists.itemList.selectedEntry.formId"))

because in the CraftingLists.as source file from schlangster's github we do have a "itemList: TabularList" property just as in the case of the InventoryLists.as source file. However, the UI.GetInt() in this case always returns zero. And even if the above worked, the player selects 3 options before crafting (item, enchantment, soulgem) and I needed the chosen item only. Does anyone know the correct path for that purpose? Any help would be greatly appreciated.



Link to comment
Share on other sites

First step to solve this. Unlike the case of InventoryMenu, MagicMenu, etc, the "Crafting Menu" does not use Menu_mc but simply Menu. For example, calling:



Game.GetFormEx(UI.GetInt("Crafting Menu", "_root.Menu.InventoryLists.itemList.selectedEntry.formId"))

does return the FormID of the form we are currently highlighting in the enchanting menu.



However, I just want the item that we have chosen to enchant. I tried replacing InventoryLists by CraftingLists, thinking that the latter consists only of the array of elements {item, enchantment, soulgem} that we have selected, but that doesn't work, so I'm still stuck on this.


Edited by Cybertaur
Link to comment
Share on other sites

I ended up using a workaround. I'm not too happy with it but it'll do for now. When an enchanter is activated, the script registers the Activate key and will listen for OnKeyPress events. When the Activate key is pressed, the script reads the selected form as indicated above. If it is an armor or weapon, the script stores the form value. This will always catch the selected item that will be enchanted.
Link to comment
Share on other sites

Glad you found a workaround. I haven't done much scripting with UI, so I wouldn't be of much help. I've been wondering for a while now how to get forms from selected inventory items and that line you posted works great! Thanks for the info.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...