• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] Food/Gold Upkeep HuD

Level 9
Joined
Mar 26, 2020
Messages
209
1770370858884.png
1770370866282.png

quick help, as the picture says, i tried scouring the text-general, but i can't find this one thingy "100%" does anyone know where is that located??
im planning to get rid it
 
Last edited:
View attachment 573394View attachment 573395
quick help, as the picture says, i tried scouring the text-general, but i can't find this one thingy "100%" does anyone know where is that located??
im planning to get rid it
It should be were you would edit and replace the UI in the game , i believe its on the far right of the tabs on the top in the editor.. Im not home at the moment to help with this.
 
It should be were you would edit and replace the UI in the game , i believe its on the far right of the tabs on the top in the editor.. Im not home at the moment to help with this.
Game Interface? yea, i've rid like 90% of tooltips from the food/gold upkeep, but that 100% i've been looking for it for an hour and i still cannot find it, not even on Gameplay Constant because mostly there are true/false and flat numbers... :cry:
 
If you're on 1.31+ (maybe 1.32+) then you can modify the UI frames yourself, just be careful of common desyncs. Here's an example:
vJASS:
library ModifyUpkeepUI

    globals
        framehandle upkeepHoverButton = null
        framehandle upkeepLabelText   = null
        framehandle upkeepTipBG       = null
        framehandle upkeepTipText     = null
    endglobals

    private function HideUIByName takes string name, integer index returns nothing
        local framehandle fh = BlzGetFrameByName(name, index)
        if fh == null then
            return
        endif

        // "Hide" by moving away + scaling tiny
        call BlzFrameClearAllPoints(fh)
        call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 3.0, 3.0)
        call BlzFrameSetScale(fh, 0.001)
    endfunction

    private function CreateHoverButton takes nothing returns framehandle
        local framehandle btn = BlzCreateFrameByType( "GLUETEXTBUTTON", "MyUpkeepHoverBtn", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScriptDialogButton", 0)

        // position/size where upkeep text is
        call BlzFrameSetAbsPoint(btn, FRAMEPOINT_CENTER, 0.76, 0.59)
        call BlzFrameSetSize(btn, 0.08, 0.02)

        // invisible but still gets mouse hover
        call BlzFrameSetText(btn, "")
        call BlzFrameSetAlpha(btn, 0)

        return btn
    endfunction

    private function CreateLabelOnButton takes framehandle btn, string text returns framehandle
        local framehandle label = BlzCreateFrameByType("TEXT", "MyUpkeepLabel", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)

        // Place label exactly on top of the button.
        call BlzFrameSetPoint(label, FRAMEPOINT_TOPLEFT, btn, FRAMEPOINT_TOPLEFT, 0.0, -0.001)
        call BlzFrameSetPoint(label, FRAMEPOINT_BOTTOMRIGHT, btn, FRAMEPOINT_BOTTOMRIGHT, 0.0, -0.001)

        // Appearance
        call BlzFrameSetTextAlignment(label, TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_MIDDLE)
        call BlzFrameSetText(label, text)

        // Ensure label doesn't eat mouse input (so hover still hits button)
        call BlzFrameSetEnable(label, false)

        return label
    endfunction

    private function CreateTooltipForButton takes framehandle btn, string tip returns nothing
        // Background template (looks like WC3 tooltip-ish)
        set upkeepTipBG = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)

        // Text inside background
        set upkeepTipText = BlzCreateFrameByType("TEXT", "MyUpkeepTooltipText", upkeepTipBG, "", 0)
        call BlzFrameSetTextAlignment(upkeepTipText, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_CENTER)

        // Adjust UI width and height
        call BlzFrameSetSize(upkeepTipText, 0.2, 0.1)
        call BlzFrameSetSize(upkeepTipBG, 0.2, 0.1)

        // Background fits text with padding
        call BlzFrameSetAbsPoint(upkeepTipText, FRAMEPOINT_CENTER, 0.7, 0.52)
        call BlzFrameSetAbsPoint(upkeepTipBG, FRAMEPOINT_CENTER, 0.7, 0.52)

        // Assign tooltip
        call BlzFrameSetTooltip(btn, upkeepTipBG)

        // Tooltip text should not take mouse
        call BlzFrameSetEnable(upkeepTipText, false)

        call BlzFrameSetText(upkeepTipText, tip)
    endfunction

    function InitMUU takes nothing returns nothing
        // Hide the original upkeep title
        call HideUIByName("ResourceBarUpkeepText", 0)

        // Create invisible hover button
        set upkeepHoverButton = CreateHoverButton()

        // Create new label where the button is
        set upkeepLabelText = CreateLabelOnButton(upkeepHoverButton, "Upkeep")

        // Tooltip content
        call CreateTooltipForButton(upkeepHoverButton, "Your custom upkeep text goes here!")
    endfunction

endlibrary
  • ModifyUpkeepUI Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- (WARNING - POTENTIAL DESYNC) --------
      • -------- It might be safer to delay this Action until you're certain that all Players are loaded in! --------
      • Custom script: call InitMUU()
 

Attachments

If you're on 1.31+ (maybe 1.32+) then you can modify the UI frames yourself, just be careful of common desyncs. Here's an example:
vJASS:
library ModifyUpkeepUI

    globals
        framehandle upkeepHoverButton = null
        framehandle upkeepLabelText   = null
        framehandle upkeepTipBG       = null
        framehandle upkeepTipText     = null
    endglobals

    private function HideUIByName takes string name, integer index returns nothing
        local framehandle fh = BlzGetFrameByName(name, index)
        if fh == null then
            return
        endif

        // "Hide" by moving away + scaling tiny
        call BlzFrameClearAllPoints(fh)
        call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 3.0, 3.0)
        call BlzFrameSetScale(fh, 0.001)
    endfunction

    private function CreateHoverButton takes nothing returns framehandle
        local framehandle btn = BlzCreateFrameByType( "GLUETEXTBUTTON", "MyUpkeepHoverBtn", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScriptDialogButton", 0)

        // position/size where upkeep text is
        call BlzFrameSetAbsPoint(btn, FRAMEPOINT_CENTER, 0.76, 0.59)
        call BlzFrameSetSize(btn, 0.08, 0.02)

        // invisible but still gets mouse hover
        call BlzFrameSetText(btn, "")
        call BlzFrameSetAlpha(btn, 0)

        return btn
    endfunction

    private function CreateLabelOnButton takes framehandle btn, string text returns framehandle
        local framehandle label = BlzCreateFrameByType("TEXT", "MyUpkeepLabel", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)

        // Place label exactly on top of the button.
        call BlzFrameSetPoint(label, FRAMEPOINT_TOPLEFT, btn, FRAMEPOINT_TOPLEFT, 0.0, -0.001)
        call BlzFrameSetPoint(label, FRAMEPOINT_BOTTOMRIGHT, btn, FRAMEPOINT_BOTTOMRIGHT, 0.0, -0.001)

        // Appearance
        call BlzFrameSetTextAlignment(label, TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_MIDDLE)
        call BlzFrameSetText(label, text)

        // Ensure label doesn't eat mouse input (so hover still hits button)
        call BlzFrameSetEnable(label, false)

        return label
    endfunction

    private function CreateTooltipForButton takes framehandle btn, string tip returns nothing
        // Background template (looks like WC3 tooltip-ish)
        set upkeepTipBG = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)

        // Text inside background
        set upkeepTipText = BlzCreateFrameByType("TEXT", "MyUpkeepTooltipText", upkeepTipBG, "", 0)
        call BlzFrameSetTextAlignment(upkeepTipText, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_CENTER)

        // Adjust UI width and height
        call BlzFrameSetSize(upkeepTipText, 0.2, 0.1)
        call BlzFrameSetSize(upkeepTipBG, 0.2, 0.1)

        // Background fits text with padding
        call BlzFrameSetAbsPoint(upkeepTipText, FRAMEPOINT_CENTER, 0.7, 0.52)
        call BlzFrameSetAbsPoint(upkeepTipBG, FRAMEPOINT_CENTER, 0.7, 0.52)

        // Assign tooltip
        call BlzFrameSetTooltip(btn, upkeepTipBG)

        // Tooltip text should not take mouse
        call BlzFrameSetEnable(upkeepTipText, false)

        call BlzFrameSetText(upkeepTipText, tip)
    endfunction

    function InitMUU takes nothing returns nothing
        // Hide the original upkeep title
        call HideUIByName("ResourceBarUpkeepText", 0)

        // Create invisible hover button
        set upkeepHoverButton = CreateHoverButton()

        // Create new label where the button is
        set upkeepLabelText = CreateLabelOnButton(upkeepHoverButton, "Upkeep")

        // Tooltip content
        call CreateTooltipForButton(upkeepHoverButton, "Your custom upkeep text goes here!")
    endfunction

endlibrary
  • ModifyUpkeepUI Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- (WARNING - POTENTIAL DESYNC) --------
      • -------- It might be safer to delay this Action until you're certain that all Players are loaded in! --------
      • Custom script: call InitMUU()
Cool jass Uncle! unfortunately, i have little to no knowledge of manual codings, anyways i've already solve it by using the hex code, i don't plan to touch the UI frames itself because that will take time for me to tackle
 
Cool jass Uncle! unfortunately, i have little to no knowledge of manual codings, anyways i've already solve it by using the hex code, i don't plan to touch the UI frames itself because that will take time for me to tackle
You don't have to know how to code, you just copy and paste the single Folder from my map's Trigger Editor over to your map's Trigger Editor.

1770575745224.png
1770575834440.png


Then ensure that you've JassHelper enabled, which is a simple checkbox that you have to click one time. See that second picture on the right.

Also, I've attached an even easier version of the map. This is the only trigger that you need to worry about now:
  • ModifyUpkeepUI Init
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • -------- Define the text used here: --------
      • Set VariableSet MUU_Title = New Upkeep
      • Set VariableSet MUU_Tooltip = This is the text in the tooltip!
All you have to do is adjust the text inside of those two string Variables found at the top of the trigger.

MUU_Title = The text that shows up in the resource bar in the top right corner of the screen (next to Food).
MUU_Tooltip = The text that shows up when you mouse over the title.

There's some desync protection stuff in there which you can enable by following the commented instructions, but it's optional. It just delays the Initialization process in an attempt to ensure that everyone has loaded into the game before the UI is modified.
(Desyncs will crash the game for certain players - they're related to very specific and avoidable issues)

But feel free to stick with your approach, I just wanted to show you how easy this is and make it even easier for anyone else that's interested.
 

Attachments

Last edited:
Back
Top