anzz1 / TacoTip

Better player tooltips - class colors, talents/specialization, GearScore & more - for Classic / TBC / WoTLK
8 stars 18 forks source link

Fix gearscore color #8

Closed ForestJ316 closed 1 year ago

ForestJ316 commented 2 years ago

Green and Blue was switched

anzz1 commented 1 year ago

Did this https://github.com/anzz1/TacoTip/pull/5 fix it ? Because from the testing I did a month ago it seemed that the colors for total gearscores were correct, but I didn't check the individual items so a simple typo ended up shifting the result left making the values wrong like this: red=item level , green=red, blue=green and original blue value not used at all.

ForestJ316 commented 1 year ago

Yeah it's correct color now. When I was editing the tooltip for myself I just noticed that vars were switched so thought it was flipped but now I look at it again the result is exactly the same, just it's not intuitive.

Blue is assigned to Green values and vice versa: https://github.com/anzz1/TacoTip/blob/babc3143e73b03807e66d5bee36d23a37649e1fd/gearscore.lua#L94-L99 but then Blue is passed values that Blue should use, just key is called Green, same for Green -> Blue: https://github.com/anzz1/TacoTip/blob/babc3143e73b03807e66d5bee36d23a37649e1fd/gearscore.lua#L159-L164

So I guess in the end this PR is just de-spaghetti the vars

anzz1 commented 1 year ago

Yeah the original GearScoreLite where the tables for the scores and color values are from was definitely among some of the best carbonara I ever tasted. The original version actually switched the colors around multiple times and finally output them in the wrong order (what was named green was output as blue, and vice-versa), but the thing is that the result is the color palette and calculations everyone grew to know by heart. So while un-spaghettifying it I had to be careful to not actually change the result.

That's why it still looks pretty much like your friday spaghetti night as I didn't want to change anything (and was lazy to fully un-spaghettify/clean it to make it more intuitive and better code, that's why it isn't released as a lib yet as I haven't gotten around to do that).

One thing is that, as has been reported, the individual item scores for hunter weapons are wrong, as the calculation for the total score applies a score multiplier for the MH/OH/ranged wep for hunters, but this doesn't happen in the individual itemscore calculation, only after it. This is how it originally was too, so like everything else, I didn't change it.

But maybe that's something I should fix though? As it really is pretty stupid and unintuitive that the total score and individual item scores for hunters don't match.

ForestJ316 commented 1 year ago

It can be done. But you would need to decide how u want to display it. Give players the option to toggle it on/off? Do you show it only if the "player" unit is hunter, or do you show it for all players (in case they want to see how much it would benefit their alt hunter etc.)? What do you do about item links in chat (here is where the toggle would be useful I guess)? Also would want to change GearScore text on tooltip to HunterScore or perhaps it's better to just add an extra line below GearScore to display HunterScore. If I remember correctly, the version I was using in 3.3.5a just added HunterScore on a new line after GearScore if I was a hunter, on other classes I wouldn't see it. Perhaps it can be done in same way just with a toggle option in settings, so in case players that are not hunters want to see HunterScore, they can toggle it on.

anzz1 commented 1 year ago

HunterScore for individual items added in v0.2.9 https://github.com/anzz1/TacoTip/commit/b5f24b80f011e68c5310d1dd4fb3b3e5c0636b1c

By default it always shows if you are a Hunter or inspecting a Hunter. And if not, can show it by pressing a modifier key like CTRL/SHIFT/ALT.

There is also an option to always show it, but it's not currently in the options menu. You can set it manually if you like by entering in chat: /run TacoTipConfig.show_gs_items_hs = true

Just like the original, the HunterScore uses the color value from the GearScore value, so they are both of the same color instead that HunterScore would have the right color for its' value. I don't know whether I should change the color to represent the value. Maybe it'll be "too colorful" then?

Also HunterScore only checks the itemEquipLoc, not whether the item is actually equippable, so items like wands do also show a hunterscore. Maybe the items should be checked by ItemSubType instead, to not show a hunterscore for items which a hunter cannot equip.


In any case, the original problem has been fixed, closing this PR.