5. Header tags - HafisCZ/sf-tools GitHub Wiki
Header tags can change the behavior of a header
Set the expression that is used to calculate the value of the column.
header My Level
expr Level + 5
Set the expression that is used to determine the title of the category/header. Overrides alias tag
category
expa rgb(255, 255, 255)
header Fortress
expr a
Set the expression that is used to calculate the background color of the column.
header Level
expc Level > 5 ? @green : @red
# You can also use a value calculated in expr
header EE
width 200
expr rgba(209, 20, 172,0.07)
expc this
format `{0}{1} nº1 <img src="https://cdn.discordapp.com/emojis/814927467776442369.png?v=1">`(this,5)
Set the expression that is used to calculate the display value of the column.
header Level
format this + 5
# expf has the same effect (just different spelling)
header Level
expf this + 5
# format() function is especially useful
header Level
format format('Lvl {0} {1}', this, Classes[Class])
# Alternate syntax
header Level
format `Lvl {0} {1}`(this, Classes[Class])
Identical to value expression but simplified. Order matters ➜ first matching condition is applied
header Level
value above or equal 5 Big Level
value above 0 OK Level
value default Bad Level
not defined value Really Bad Level
Identical to color expression but simplified. Order matters ➜ first matching condition is applied
header Level
color above or equal 500 green
color above 400 @orange
color default red
not defined color darkred
Sets the background color for the scope.
header Level
background red
Sets the text color for the header via expression.
header Level
text Level > 500 ? @green : @red
Sets the text color automatically white/black for the header depending on the background color.
header Level
text auto
Sets the sorting expression for a given column.
# Order by custom expression
header Level
order by this * 55 - 5
# Order by difference
header Level
order by difference
Specify the columns by which the table will sort itself when it loads up with glob order <asc|des> <[priority]>
#Sort the table by highest level and on tie sort by lowest HOF rank
header Level
glob order des 0
header Rank
glob order asc 1
Shows a difference in value if a compare file is set.
header Level
difference on
Shows whether player obtained the Dehydration achievement.
header Awards
hydra on
Flips the default sorting order and switches the sign of the difference if displayed.
header Level
difference on
flip on
Shows difference within brackets.
header Level
difference on
brackets on
Enables statistics to be displayed for this header.
header Level
statistics on
Disabling this will not apply any color to statistics
header Level
statistics color off
Shows a fortress level together with the amount of knights.
header Knights
maximum on
Shows whether player has found the Holy Grail.
header Album
grail on
Disables rounding for statistics for the header.
header Level
statistics on
decimal on
Ignores tags inherited globally or from a category
header Level
clean
Adding hard
further ignores predefined tags applied on the header itself
header Level
clean hard
Sets the width of the header.
header Level
width 150
Adds a custom text to the end of the value.
header Level
extra L
If disabled, it will set the font color to the background color.
header Level
visible off
Creates a border around the header.
# Left border
header Level
border left
# Right border
header Level
border right
# Both borders
header Level
border both
Aligns the content of the header
# Left
header Level
align left
# Right
header Level
align right
# Center
header Level
align center
You can also align the title of the header independently by doing: align <content alignment> <title alignment>
# Content on the left and title on the right
header Level
align left right
Enables or sets special formatting for a difference
# Uses the format tag to format the difference
header Level
format this + 5
format difference on
# Uses custom format
header Level
format difference this + 5
Enables or sets special formatting for a statistics
# Uses the format tag to format the statistics
header Level
format this + 5
format statistics on
# Uses custom format
header Level
format statistics this + 5
Enables the info popup for the cells in the header's column
header Name
action show
Disables the default behavior of breaking lines when there are spaces and the width is insufficient.
header Name
breakline off
width 10
Forces the difference to be displayed on a new line always.
header Name
difference on
difference position below
Shorthand for style padding-left
. Adds blank space before the text in the element. Accepts lengths.
header Name
padding 13px
Styling tag that brings the power and liberty of CSS to your element. It's too wide to give in depth guidance but go ham at it with this references basic and all. Expect some properties to not work or not work as intended.
Syntax goes as follows style <property-name> <property-string>
where property string is any valid CSS string for that property.
# red thick border as in https://www.w3schools.com/csS/css_border_shorthand.asp
header Name
style border solid red 5px
If you want to strip some tags on the fly, you can force push the current header / row / statistic as is.
header Level
difference on
push
background red
# The column will display the difference but won't be colored red