How to make hit points/ shields digit values smaller?

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

How to make hit points/ shields digit values smaller?

Postby djambalaz » 31 Aug 2016, 23:24

I want to mod a particular unit and make the hp value digits (For example GC - 99 999 loook smaller 99 999 same with shields. This is when the unit is in the engineer selection not the unit itself. Thanks !
djambalaz
 
Posts: 1
Joined: 31 Aug 2016, 23:21
Has liked: 0 time
Been liked: 0 time
FAF User Name: djambalaz

Re: How to make hit points/ shields digit values smaller?

Postby Uveso » 09 Sep 2016, 06:51

Do you mean something like this:
ShieldNo1.png
ShieldNo1.png (21.29 KiB) Viewed 746 times

ShieldNo2.png
ShieldNo2.png (22.58 KiB) Viewed 746 times


Well you have to change the function "Show()" inside "unitviewDetail.lua"
Search for this code:
Code: Select all
    local showShield = false
    if bp.Defense.Shield and bp.Defense.Shield.ShieldMaxHealth then
        showShield = true
        View.ShieldStat.Value:SetText(bp.Defense.Shield.ShieldMaxHealth)
    end


then add this line to set the fontsize to 10:
Code: Select all
        View.ShieldStat.Value:SetFont(UIUtil.bodyFont, 10)


should look like this now:
Code: Select all
    local showShield = false
    if bp.Defense.Shield and bp.Defense.Shield.ShieldMaxHealth then
        showShield = true
        View.ShieldStat.Value:SetFont(UIUtil.bodyFont, 10)
        View.ShieldStat.Value:SetText(bp.Defense.Shield.ShieldMaxHealth)
    end


This is the only way to make the text smaller.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: How to make hit points/ shields digit values smaller?

Postby Uveso » 09 Sep 2016, 07:09

But i can't recommend to change the function by your mod. This function is critical for the whole tooltip stuff and will be changed in the future from FAF Developer side.
If you decide to hook the file and change the function, have in mind to check this after each FAF update.

In case you want this to be implemented into the FAF maingame, you can start an issue on github:
https://github.com/FAForever/fa/issues

Name it something like "Tooltip enhancement for big numbers"
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest