lichie567 / LMeter

A Dalamud Plugin to display ACT combat log data in FFXIV
MIT License
63 stars 38 forks source link

rank is not the bar index #73

Closed juan-medina closed 3 months ago

juan-medina commented 3 months ago

Currently, rank is the bar index when it should be the position in the sorted combatants.

For example, if you're set to show 8 bars but as DPS in an alliance raid / hunt you are the 12th top DPS and you have set to always displayer the player your rank will be display as 8th, not as 12th.

First I've changed Rank to be an int, there is no reason to be a string and this will help to not convert to string the combatants not show on the window.

Then I've added the rank after getting the sorted combatants.

However, they were some code not working properly if you also choose to replace YOU with the player name if you have summoned your companion/chocobo.

Currently, in the ACT struct your companion is named as: "Name (YOU)", and the original code was trying to find a string that contains YOU but replace the whole string with the player name. So for example, "Chocobo (YOU)" if the player was named "FFXIV Player" was replaced to "FFXIV Player" instead of "Chocobo (FFXIV Player)" this is now fixed and consistent to how other players companions show.

Now when we were trying to Move the Player Into viewable range they were as well a check to the Name string containing "YOU" or PlayerName, that was as well wrong since the chocobo will match those cases too, so I fixed using an exact match, we do not need to do partial match for it.

I've tested all of this and works correctly now

Before the change

12 DPS in a party image

Chocobo a Player end with the sane name image

After the change

12 DPS in a party image

Chocobo a Player have now different name image