• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[JASS] Move part of origin UI

Status
Not open for further replies.
Level 24
Joined
Feb 28, 2007
Messages
3,479
Hello,

I'm working on making some (seemingly) simple changes to the default hero UI. I wanted to hide the icon that gives information about what bonuses each attribute provide.
This works well with the following line of code:
JASS:
call BlzFrameSetAbsPoint(BlzGetFrameByName("InfoPanelIconHeroIcon", 6), FRAMEPOINT_BOTTOM, 0.4, -0.18)

However, a side-effect is that the attribute labels and values are then pushed to the left, is there any simple way to "anchor" them to the right again?
1657795485768.png


Thanks in advance!
 
Level 24
Joined
Feb 28, 2007
Messages
3,479
Hmm, does BlzFrameSetVisible work for that frame? If not, we may have to look for the container frame of the attribute labels and values and move it manually. @Tasyen may be able to help you out here.
Like this?
JASS:
call BlzFrameSetVisible(BlzGetFrameByName("InfoPanelIconHeroIcon", 6), false)

I tried the above but it immediately caused a crash. I'm a real noob when it comes to custom UI so maybe I am doing something wrong?
 
Yep. Sorry to hear that it crashed.

It might have been a simpleframe, which doesn't play well with certain frame natives such as what I mentioned above, causing the game to crash on such occasions.

Since the current frame in question is likely a background frame, you'll have to get the parent frame first and test by moving it to the desired position. If that doesn't work, you may have to do the same process for each child of the parent frame, one at a time.
 
Level 24
Joined
Feb 28, 2007
Messages
3,479
I derped around with this a bit further and tried a different approach. Results are better while not perfect:
1657803110907.png


Basically instead of moving the hero icon to limbo-land I changed it to a very small size:
JASS:
call BlzFrameSetSize(BlzGetFrameByName("InfoPanelIconHeroIcon", 6), 0.00001, 0.00001)

How and why this (almost) works (or if there's any side effects) I'm not really sure. Maybe someone else who knows this better can chime in.

Edit: Forgot to mention that my solution above came from Tasyen's UI pastebin, so kudos goes to him.
 
Last edited:
InfoPanelIconHeroIcon is a Texture-SimpleFrame it displays the HeroAttribute Icon. Warcraft 3 does not like many frame natives used onto Texture/String-SimpleFrames. I see them as pseudo SimpleFrames they are different from SimpleFrames (they can't have children and only exist as children).

The tooltip mousehover mimics it's Size/Position, that mousehover can be reached using the UI-Frame child api (V1.32.6+). In that Version one could lay it over the Texts to show the tooltip then.

The Attribute Texts are relative to the Hero Icon, hence they moved when you changed it's space on the screen. Some of this connections can be found in the fdfs. The fdfs containing the blueprints for some of the match ui can be found in the folder of the gamefiles ui\framedef\ui\ (casc/mpq).


part from ui\framedef\ui\simpleinfopanel.fdf
Code:
Frame "SIMPLEFRAME" "SimpleInfoPanelIconHero" {
    UseActiveContext,
    SetAllPoints,
    DecorateFileNames,
    Height 0.0625,
    // --- icon -------------------------------------------------------------
    Texture "InfoPanelIconHeroIcon" INHERITS "InfoPanelIconTemplate" {
        File "HeroStrengthIcon",
        Anchor LEFT, 0.004, 0.0,
    }
    Frame "SIMPLEFRAME" "SimpleInfoPanelIconHeroText" {
        UseActiveContext,
        DecorateFileNames,
        SetPoint LEFT, "InfoPanelIconHeroIcon", RIGHT, 0.0, 0.0,
        SetPoint RIGHT, "SimpleInfoPanelIconHero", RIGHT, 0.0, 0.0,
        SetPoint TOP, "SimpleInfoPanelIconHero", TOP, 0.0, 0.0,
        SetPoint BOTTOM, "SimpleInfoPanelIconHero", BOTTOM, 0.0, 0.0,
        // --- strength ---------------------------------------------------------
        String "InfoPanelIconHeroStrengthLabel" INHERITS "SimpleInfoPanelLabelTextTemplate" {
            Anchor TOPLEFT, 0.0, -0.003,
            Text "COLON_STRENGTH",
            Width 0.24,
        }
        String "InfoPanelIconHeroStrengthValue" INHERITS "SimpleInfoPanelValueTextTemplate" {
            SetPoint TOPLEFT, "InfoPanelIconHeroStrengthLabel", BOTTOMLEFT, 0.005, -0.002,
            Font "InfoPanelTextFont",0.008,
            Width 0.24,
        }
        // --- agility ----------------------------------------------------------
        String "InfoPanelIconHeroAgilityLabel" INHERITS "SimpleInfoPanelLabelTextTemplate" {
            SetPoint TOPLEFT, "InfoPanelIconHeroStrengthValue", BOTTOMLEFT, -0.005, -0.004,
            Text "COLON_AGILITY",
            Width 0.24,
        }
        String "InfoPanelIconHeroAgilityValue" INHERITS "SimpleInfoPanelValueTextTemplate" {
            SetPoint TOPLEFT, "InfoPanelIconHeroAgilityLabel", BOTTOMLEFT, 0.005, -0.002,
            Font "InfoPanelTextFont",0.008,
            Width 0.24,
        }
        // --- intellect --------------------------------------------------------
        String "InfoPanelIconHeroIntellectLabel" INHERITS "SimpleInfoPanelLabelTextTemplate" {
            SetPoint TOPLEFT, "InfoPanelIconHeroAgilityValue", BOTTOMLEFT, -0.005, -0.004,
            Text "COLON_INTELLECT",
            Width 0.24,
        }
        String "InfoPanelIconHeroIntellectValue" INHERITS "SimpleInfoPanelValueTextTemplate" {
            SetPoint TOPLEFT, "InfoPanelIconHeroIntellectLabel", BOTTOMLEFT, 0.005, -0.002,
            Font "InfoPanelTextFont",0.008,
            Width 0.24,
        }
    }
}

Not all frames have blueprints in fdf some are just created on the fly by the game.
 
Status
Not open for further replies.
Top