To retreive the "topdeeps" and make sure it's the actual highest value, you can set in the ACT plugin configuration page the sort key and the sort direction (ascending or descending).
For instance you would set the sort key to damage / damage% and the type to descending, this way first player in the list will always be the one having pulled the most dps.
^ By doing that, you ensure that if the first item of data.Combatant is the player with the highest dps.
With that settled you can pretty much do the following to retreive top dps:
Code:
// part of updateCombatantList()
{
// ...
var count = 0;
var topdeeps = 1;
for (var combatantName in data.Combatant) {
var combatant = data.Combatant[combatantName];
// Top dps needs to be only set once according to first player's damage value.
if (count == 0) {
count = 1;
topdeeps = parseActFormat("{damage}", combatant);
}
var deeps = parseActFormat("{damage}", combatant);
// Loop goes on there: bar drawing and setting the style incl formula for backgroundsize.
}
// ...
Dunno if it's better now ? e;
And yes it should set it to 100% since first player will get when applying le backgroundSize:
(deeps * 100) / topdeeps | where deeps = topdeeps.
Aka 100%