• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Hide Min Damage

Introduction

A small custom UI edit. It removes the min damage part of attack 1 and 2.
8 - 11 +3 becomes 11 +3
1230 - 20000 -110 becomes 20000 -110

Contains a Lua and Vjass version.
Requires Warcraft 3 V1.31 or higher.

How to import:

Option A, download map
(Optional) Get the 2 imported files from the map and import them into your map.
war3mapImported\HideMinDamage.fdf
war3mapImported\HideMinDamage.toc
(beaware that in the non current version "Export All Files" can be buggy).​
Open Trigger Editor copy paste the wanted version into your map.

Option B copy the following Lua or vjass code.
Lua:
-- HideMinDamageV7
do
    local realFunction = MarkGameStarted
    local timer, damageA, damageB, parentA, parentB, damageA2, damageB2, text, index
    local oldTextA,oldTextB
    local function update(sourceFrame, targetFrame, oldText)
        text = BlzFrameGetText(sourceFrame)
        if text ~= oldText then
            index = string.find(text, " - ", 1, true)
            BlzFrameSetText(targetFrame, string.sub( text, index + 3))
            return text
        end
    end
    local function Init()
        BlzLoadTOCFile("war3mapImported\\HideMinDamage.toc")
        if not timer then 
            timer = CreateTimer()
            if FrameLoaderAdd then FrameLoaderAdd(Init) end
        end
        damageA = BlzGetFrameByName("InfoPanelIconValue", 0)
        damageB = BlzGetFrameByName("InfoPanelIconValue", 1)
        parentA = BlzGetFrameByName("SimpleInfoPanelIconDamage",0)
        parentB = BlzGetFrameByName("SimpleInfoPanelIconDamage",1)
        local frame = BlzCreateSimpleFrame("CustomDamageString", parentA, 0)
        if GetHandleId(frame) > 0 then
            damageA2 = BlzGetFrameByName("CustomDamageStringValue", 0)
            BlzCreateSimpleFrame("CustomDamageString", parentB, 1)
            damageB2 = BlzGetFrameByName("CustomDamageStringValue", 1)
        else -- no fdf
            BlzCreateSimpleFrame("SimpleInfoPanelDestructableDetail", parentA, 11)
            damageA2 = BlzGetFrameByName("SimpleDestructableNameValue", 11)
            BlzFrameClearAllPoints(damageA2)
            BlzFrameSetPoint(damageA2, FRAMEPOINT_TOPLEFT, BlzGetFrameByName("InfoPanelIconLabel", 0), FRAMEPOINT_BOTTOMLEFT, 0.002625, -0.003)
            if SkinManagerGetLocalPath then BlzFrameSetFont(damageA2, SkinManagerGetLocalPath("InfoPanelTextFont"), 0.008, 0) else BlzFrameSetFont(damageA2, "Fonts/frizqt__.ttf", 0.008, 0) end

            BlzCreateSimpleFrame("SimpleInfoPanelDestructableDetail", parentB, 12)
            damageB2 = BlzGetFrameByName("SimpleDestructableNameValue", 12)
            BlzFrameClearAllPoints(damageB2)
            BlzFrameSetPoint(damageB2, FRAMEPOINT_TOPLEFT, BlzGetFrameByName("InfoPanelIconLabel", 1), FRAMEPOINT_BOTTOMLEFT, 0.002625, -0.003)
            if SkinManagerGetLocalPath then BlzFrameSetFont(damageB2, SkinManagerGetLocalPath("InfoPanelTextFont"), 0.008, 0) else BlzFrameSetFont(damageB2, "Fonts/frizqt__.ttf", 0.008, 0) end
        end
        BlzFrameSetFont(damageA, "", 0, 0)
        BlzFrameSetFont(damageB, "", 0, 0)
        
        TimerStart(timer, 0.05, true, function()
            if BlzFrameIsVisible(parentA) then
                local text = update(damageA, damageA2, oldTextA)
                if text then oldTextA = text end
            end
            if BlzFrameIsVisible(parentB) then
                local text = update(damageB, damageB2, oldTextB)
                if text then oldTextB = text end
            end
        end)
    end
    HideMinDamageInit = Init
    if OnInit then -- Total Initialization v5.2.0.1 by Bribe
        OnInit.final(Init)
    else -- without
        local real = MarkGameStarted
        function MarkGameStarted()
            real()
            Init()
        end
    end
end
JASS:
library HideMinDamageText initializer init_function requires optional FrameLoader
// HideMinDamageV7
    globals
        private framehandle DamageA
        private framehandle DamageB
        private framehandle DamageA2
        private framehandle DamageB2
        private framehandle ParentA
        private framehandle ParentB
        private string Text
        private string OldTextA = ""
        private string OldTextB = ""
        private integer Index
        private integer LoopA
        private integer LoopAEnd
    endglobals
    private function find takes nothing returns nothing
        set LoopAEnd = StringLength(Text) - 1
        set LoopA = 1
        loop
            exitwhen LoopA >= LoopAEnd
            if SubString(Text, LoopA, LoopA +3) == " - " then
                set Index = LoopA + 3
                return
            endif
            set LoopA = LoopA + 1
        endloop
        set Index = 0
    endfunction
    
    private function update takes nothing returns nothing
        if BlzFrameIsVisible(ParentA) then
            set Text = BlzFrameGetText(DamageA)
            if Text != OldTextA then
                set OldTextA = Text
                call find()
                call BlzFrameSetText(DamageA2, SubString(Text, Index, StringLength(Text)))
            endif
        endif
        if BlzFrameIsVisible(ParentB) then
            set Text = BlzFrameGetText(DamageB)
            if Text != OldTextB then
                set OldTextB = Text
                call find()
                call BlzFrameSetText(DamageB2, SubString(Text, Index, StringLength(Text)))
            endif
        endif
    endfunction
    private function At0s takes nothing returns nothing
        call BlzLoadTOCFile("war3mapImported\\HideMinDamage.toc")
        set ParentA = BlzGetFrameByName("SimpleInfoPanelIconDamage", 0)
        set ParentB = BlzGetFrameByName("SimpleInfoPanelIconDamage", 1)
        set DamageA = BlzGetFrameByName("InfoPanelIconValue", 0)
        set DamageB = BlzGetFrameByName("InfoPanelIconValue", 1)
        call BlzCreateSimpleFrame("CustomDamageString", ParentA, 0)
        set DamageA2 = BlzGetFrameByName("CustomDamageStringValue", 0)
        if GetHandleId(DamageA2) > 0 then
            call BlzCreateSimpleFrame("CustomDamageString", ParentB, 1)
            set DamageB2 = BlzGetFrameByName("CustomDamageStringValue", 1)
        else
            call BlzCreateSimpleFrame("SimpleInfoPanelDestructableDetail", ParentA, 11)
            set DamageA2 = BlzGetFrameByName("SimpleDestructableNameValue", 11)
            //call BlzFrameSetFont(DamageA2, SkinManagerGetLocalPath("InfoPanelTextFont"), 0.008, 0)
            call BlzFrameSetFont(DamageA2, "Fonts/frizqt__.ttf", 0.008, 0)
            call BlzFrameClearAllPoints(DamageA2)
            call BlzFrameSetPoint(DamageA2, FRAMEPOINT_TOPLEFT, BlzGetFrameByName("InfoPanelIconLabel", 0), FRAMEPOINT_BOTTOMLEFT, 0.002625, -0.003)

            call BlzCreateSimpleFrame("SimpleInfoPanelDestructableDetail", ParentB, 12)
            set DamageB2 = BlzGetFrameByName("SimpleDestructableNameValue", 12)
            //call BlzFrameSetFont(DamageB2, SkinManagerGetLocalPath("InfoPanelTextFont"), 0.008, 0)
            call BlzFrameSetFont(DamageB2, "Fonts/frizqt__.ttf", 0.008, 0)
            call BlzFrameClearAllPoints(DamageB2)
            call BlzFrameSetPoint(DamageB2, FRAMEPOINT_TOPLEFT, BlzGetFrameByName("InfoPanelIconLabel", 1), FRAMEPOINT_BOTTOMLEFT, 0.002625, -0.003)
        endif
        call BlzFrameSetFont(DamageA, "", 0, 0)
        call BlzFrameSetFont(DamageB, "", 0, 0)
        call TimerStart(GetExpiredTimer(), 0.05, true, function update)
    endfunction
    private function init_function takes nothing returns nothing
        static if LIBRARY_FrameLoader then
            call FrameLoaderAdd(function At0s)
        endif
        call TimerStart(CreateTimer(), 0, false, function At0s)
    endfunction
endlibrary

Insight

Technically it "hides" the default String-Frame and places a custom String-Frame at the same spot. It creates a custom one to be free from hardcoded behaviours (difficult to detect update times which lead to ugly fast updating text).

ChangeLog

V7) fused non fdf & fdf version, skips some unneeded update calls
V6) Added a non fdf version.
V5) replaced the included FrameLoader Lua (Save&Load)
V4)
vjass) made FrameLoader optional.
Lua) replaced the FrameLoader with the new version
V3) Frame Fix saving&Loading
V2) Perfroms smoother
(smaller default Timeout)
Skips not visible attacks
some optimiziations in vjass
Contents

Hide Min Damage V7 (Map)

Updated to V2)
Default update rate is now 0.05s.
VJass finding now searches from second index to last, instead of last to second.
Requires less steps for units with bonus/reduced damage.​
VJass Library Renamed to HideMinDamageText
Checks the visibility of Damage Info Frames instead of Single Unit selection Frame.
Removed the valid index found check. If the Damage Frame is visible it will have that searched string.
Less actions for units with 1 or no attack.​
 
Last edited:
Updated to V3.
Recently someone told me that one of my UI systems broke when the game was saved and later loaded. I did some research about that and found out that custom created Frames and Frame modifications are not save nor loaded and that using references to the now broken custom Frames can crash the game. This applies to V1.31, V1.32.8 and V1.32.9 PTR.

I added a custom FrameLoader Trigger that reruns the whole system again when the game is Loaded.
 
When it hides the default but doesn't show anything anymore. Then it is likely that there something went wrong with the custom frame creation.

Make sure you add the Files HideMinDamage.toc and HideMinDamage.fdf into your map.
HideMinDamage.toc should contain 2 lines: the path of HideMinDamage.fdf in your map and an empty Line. (only one \)

HideMinDamage.fdf should have ~10 lines describing a Frame

Inside the script the path to HideMinDamage.toc is also mentoned in
BlzLoadTOCFile (\\)

Make sure the paths mentioned are the ones used in your map.
 
When it hides the default but doesn't show anything anymore. Then it is likely that there something went wrong with the custom frame creation.

Make sure you add the Files HideMinDamage.toc and HideMinDamage.fdf into your map.
HideMinDamage.toc should contain 2 lines: the path of HideMinDamage.fdf in your map and an empty Line. (only one \)

HideMinDamage.fdf should have ~10 lines describing a Frame

Inside the script the path to HideMinDamage.toc is also mentoned in
BlzLoadTOCFile (\\)

Make sure the paths mentioned are the ones used in your map.

That totally fixed it, thanks :D
 
in my new map, im trying to remove all numbers like HP, Mana and Damage,
Than you don't need hide-min damage at all.
When 0s expired Change the Font of all the StringSimpleFrames.
Also hide the children of the unitinfos to disable their tooltip.

But I wonder if you don't want numbers, What you need from the single unit selection at all, could hide all of it?
 
Change the Font of all the StringSimpleFrames.
Also hide the children of the unitinfos to disable their tooltip.

What? :ugly:
Couldnt understand what exactly i have to do.



But I wonder if you don't want numbers, What you need from the single unit selection at all, could hide all of it?

I do still want them to be selectable because the players must be able to read the damage & armor type and read their strength and weakness, and sometimes for using abilities.
 
I do still want them to be selectable because the players must be able to read the damage & armor type and read their strength and weakness, and sometimes for using abilities.
Well I don't know how to change the text inside the default tooltip.
Best I would know, how to do is to disable the normal unit info tooltips and then to display a custom one instead.

What? :ugly:
Couldnt understand what exactly i have to do.
This will "hide" the amounts of the unit infos: But you might not want all of them: The number after "InfoPanelIconValue" is the index that maps to this unit infos. Call the wanted BlzFrameSetFont() at 0s to "hide" the amount display.
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 0),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 1),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 2),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 3),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 4),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 5),"", 0.0, 0)

Unit infos:
("SimpleInfoPanelIconDamage",0)
("SimpleInfoPanelIconDamage",1)
("SimpleInfoPanelIconArmor",2)
("SimpleInfoPanelIconRank",3)
("SimpleInfoPanelIconFood",4)
("SimpleInfoPanelIconGold",5)

The other part about childrens was to disable the mouse listener to show the default tooltip
 
Well I don't know how to change the text inside the default tooltip.
Best I would know, how to do is to disable the normal unit info tooltips and then to display a custom one instead.


This will "hide" the amounts of the unit infos: But you might not want all of them: The number after "InfoPanelIconValue" is the index that maps to this unit infos. Call the wanted BlzFrameSetFont() at 0s to "hide" the amount display.
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 0),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 1),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 2),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 3),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 4),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 5),"", 0.0, 0)

Unit infos:
("SimpleInfoPanelIconDamage",0)
("SimpleInfoPanelIconDamage",1)
("SimpleInfoPanelIconArmor",2)
("SimpleInfoPanelIconRank",3)
("SimpleInfoPanelIconFood",4)
("SimpleInfoPanelIconGold",5)

The other part about childrens was to disable the mouse listener to show the default tooltip


so you mean it is possible to hide unit damage and armor icons?
 
Did you copy the script & enabled, also have imported?
war3mapImported\HideMinDamage.fdf
war3mapImported\HideMinDamage.toc

It can happen that the toc and fdf changed their content:
In your map the war3mapImported\HideMinDamage.fdf has to contain code while war3mapImported\HideMinDamage.toc only contains file path(s).

This resource is only meant to be used with the default UI, I saw in one of your posts that you have a custom UI, then you would only need the part that calcs the text without min dmg and set your frame's text instead.
 
yes, one can "hide" the tooltip, the label, the value,, the icon or all of it.
One can hide the hero stats.
The ally resources and many more.
Just changing the tooltip text that is a no go. Here one would have to recreate it (as far as I know).
is it possible to do it for each type? not all of them?
i mean an unique tooltip for Normal and other etc.
or only one tooltip for all damage types?
if its possible, please teach me.
 
the default UI only has one set of frames onto which the unit's data is displayed onto.

it is possible to have unique tooltips for each type, if you get the attack type of the current unit and change/show the current needed tooltip while the tooltip of the attack icon is shown. Might need to add a custom simpleframe as tooltip to know the user points at the attack icon.

But are you sure that your attackType Tooltips need such different formats. Can't it be generalized?
 
the default UI only has one set of frames onto which the unit's data is displayed onto.

it is possible to have unique tooltips for each type, if you get the attack type of the current unit and change/show the current needed tooltip while the tooltip of the attack icon is shown. Might need to add a custom simpleframe as tooltip to know the user points at the attack icon.

But are you sure that your attackType Tooltips need such different formats. Can't it be generalized?

Imagine youre trying to hide min and max damage, but when you go to read description of an attack type, you can read the min and max damage.

So you try using custom description so min and max damage in the description will disappear, but youll have to do something to let the people know the weakness and strength of that attack type.


Hmm, you said tooltip?
If thats not the whole text, so what part of it is the "tooltip"?
If thats separate, do the description of attack type stays what it is?
 
Imagine youre trying to hide min and max damage, but when you go to read description of an attack type, you can read the min and max damage.
What is the problem? Dota 2 does the same: shows only avg number on the ui, but in the tooltip you see more.

When you hover the attack frame. You see the tooltip-Box&Text:

The top is the damage amounts.
Followed by Type(Name), Range, Speed and finally the attack type description text from Game Interface.

But for Frame-UI, Tooltip is just another Frame that is shown while some Frame is hovered.
 
What is the problem? Dota 2 does the same: shows only avg number on the ui, but in the tooltip you see more.

When you hover the attack frame. You see the tooltip-Box&Text:

The top is the damage amounts.
Followed by Type(Name), Range, Speed and finally the attack type description text from Game Interface.

But for Frame-UI, Tooltip is just another Frame that is shown while some Frame is hovered.
tooltip is for example only this part?: 17 - 43
if it is, then please tell me how can i destroy/remove/delete this annoying part from my map.
im trying to not let the people know how much HP and dmg each unit does have, instead im telling them how strong a unit is.
for example i say:

HP: Good
DMG: Bad
ATK SPD: Very Good
SPD: Perfect
...

i think you got it, no NUMBER.
 
Well I don't know how to change the text inside the default tooltip.
Best I would know, how to do is to disable the normal unit info tooltips and then to display a custom one instead.


This will "hide" the amounts of the unit infos: But you might not want all of them: The number after "InfoPanelIconValue" is the index that maps to this unit infos. Call the wanted BlzFrameSetFont() at 0s to "hide" the amount display.
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 0),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 1),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 2),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 3),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 4),"", 0.0, 0)
BlzFrameSetFont(BlzGetFrameByName("InfoPanelIconValue", 5),"", 0.0, 0)

Unit infos:
("SimpleInfoPanelIconDamage",0)
("SimpleInfoPanelIconDamage",1)
("SimpleInfoPanelIconArmor",2)
("SimpleInfoPanelIconRank",3)
("SimpleInfoPanelIconFood",4)
("SimpleInfoPanelIconGold",5)

The other part about childrens was to disable the mouse listener to show the default tooltip
HOW DO I EVEN USE THIS SCRIPTS?
are they jass or lua?
i need the Jass version, and then how do i use them?
where do i put ("SimpleInfoPanelIconDamage",0)?
 
("SimpleInfoPanelIconDamage",0)
is a argument for BlzGetFrameByName, to read from the game's frame storage to get a framehandle stored at 0 with name "SimpleInfoPanelIconDamage".
BlzGetFrameByName ("SimpleInfoPanelIconDamage",0)

Imagine it like a warcraft 3 "hashtables" which is filled by the game.
 
Updated to V7)
fused fdf and non fdf version
added the systems codes to the hive page can copy paste them without opening the map.
performance upgrade: skips find and setting text when the current Text is the same as the text from the last time it updated the text, this skips many update calls when one selects 1 unit for a while and the dmg not changes.

vjass verison without fdf: in reforged one should enable the BlzFrameSetFont with SkinManagerGetLocalPath and disable the one with the hardcoded font-FilePath.

//call BlzFrameSetFont(DamageA2, SkinManagerGetLocalPath("InfoPanelTextFont"), 0.008, 0)
call BlzFrameSetFont(DamageA2, "Fonts/frizqt__.ttf", 0.008, 0)
 
Last edited:
Back
Top