• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Issue with moving item buttons using new natives

Status
Not open for further replies.
Level 1
Joined
Apr 27, 2018
Messages
4
I've been testing out the new UI natives, and playing around with clearing and re-customizing the UI.

My thought process was to hide everything then just display what I want and move/transform them to my needs.

This works just fine for command buttons and portraits, however I'm unable to do the same for item buttons.
Well, not completely at least.

Below I've attached some screenshots and snippets of code that illustrate my problem.


Item buttons don't show as intended.
Example: https://i.imgur.com/tddD707.jpg

Code:
init
   doAfter(10) () ->
       hideOriginFrames(true)
       let gameUI = getOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0)
       gameUI.setScale(.01)

       //SetHeroPortraits()
       ShowOriginElement(ORIGIN_FRAME_ITEM_BUTTON, 5)

function ShowOriginElement(originframetype elementName, int index)
for int x = 0 to index
var fh = getOriginFrame(elementName, x)
fh.show()
fh.clearAllPoints()
fh.setScale(1)
fh.setAbsPoint(FRAMEPOINT_BOTTOM, .2 + x*.04, .2)




Item buttons show as intended
Example: https://i.imgur.com/mBw2iBt.jpg

Code:
init
   doAfter(10) () ->
       hideOriginFrames(false)
       let gameUI = getOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0)
       gameUI.setScale(.01)

       //SetHeroPortraits()
       ShowOriginElement(ORIGIN_FRAME_ITEM_BUTTON, 5)


function ShowOriginElement(originframetype elementName, int index)
for int x = 0 to index
var fh = getOriginFrame(elementName, x)
fh.show()
fh.clearAllPoints()
fh.setScale(1)
fh.setAbsPoint(FRAMEPOINT_BOTTOM, .2 + x*.04, .2)

I'm thinking there might be a bug that's blocking item buttons from re-showing after being hidden.

Does anyone have some insight on this/have you run into this issue as well?
 
I also encountered that problem.
In code 1, The item buttons parent is hidden which also hides the item buttons. (the inventoryFrame is hidden, its not its name but one can imagine it that way more easy, in my opinion)
My solution was: change the parent of the item buttons or making the parent of the item buttons visible.
Making the parent visible or the parents parent (not sure here), has some sideffects, also makes the ui-Console-Texture on that place visible when an unit/item/destruct without inventory is selected.​
 
Level 1
Joined
Apr 27, 2018
Messages
4
I also encountered that problem.
In code 1, The item buttons parent is hidden which also hides the item buttons. (the inventoryFrame is hidden, its not its name but one can imagine it that way more easy, in my opinion)
My solution was: change the parent of the item buttons or making the parent of the item buttons visible.
Making the parent visible or the parents parent (not sure here), has some sideffects, also makes the ui-Console-Texture on that place visible when an unit/item/destruct without inventory is selected.​


Oh wow.

I tried going down that path before, but then came to the conclusion that the ORIGIN frames were the topmost level parents since none of the parents above had names.

LOOKS LIKE I WAS WRONG!

Thanks a bunch Tasyen!

If I could rep you more than once I would.
 
Status
Not open for further replies.
Top