HearthSim / HSTracker

A deck tracker and deck manager for Hearthstone on macOS
https://hsreplay.net/downloads/
MIT License
1.15k stars 173 forks source link

Curses not counting #1289

Closed Eppin closed 1 year ago

Eppin commented 1 year ago

Describe the bug While looking through the 'Player tracker'-settings I saw the 'Show Abyssal counter' setting, which doesn't seem to be working.

To Reproduce Play a Curse-card during a game.

Game mode

Expected behavior Abyssal curse counter to increase (and shown).

Additional context Looking at the Power.log and the code, I've got a feeling that something has changed. Because from what I see is that, the code is expecting the curses to be in a line containing BLOCK_END (https://github.com/HearthSim/HSTracker/blob/master/HSTracker/Logging/Parsers/PowerGameStateParser.swift#L903,L929). However, I saw that it's in the BLOCK_START

Here's a part of the Power.log:

D 20:18:04.3073170 GameState.DebugPrintPower() - META_DATA - Meta=SLUSH_TIME Data=200 InfoCount=1
D 20:18:04.3073170 GameState.DebugPrintPower() -             Info[0] = [entityName=Mature Wildseed id=129 zone=PLAY zonePos=0 cardId=REV_360t1e player=2]
D 20:18:04.3073170 GameState.DebugPrintPower() - BLOCK_START BlockType=TRIGGER Entity=[entityName=Abyssal Curse id=139 zone=HAND zonePos=3 cardId=TSC_955t player=2] EffectCardId=System.Collections.Generic.List`1[System.String] EffectIndex=0 Target=0 SubOption=-1 TriggerKeyword=349
D 20:18:04.3073170 GameState.DebugPrintPower() -     SUB_SPELL_START - SpellPrefabGUID=TSCFX_AbyssalCurse_Impact_Super:9c3984b010928944b93b9ec0df28f62a Source=0 TargetCount=1
D 20:18:04.3073170 GameState.DebugPrintPower() -                       Targets[0] = [entityName=Giantstalker Rexxar id=86 zone=PLAY zonePos=0 cardId=HERO_05e player=2]
D 20:18:04.3073170 GameState.DebugPrintPower() -         META_DATA - Meta=TARGET Data=0 InfoCount=1

If you think I could be right, I can try to fix it (have some little Swift experience) :-)

fmoraes74 commented 1 year ago

I just test it against AI and it is working there. Can you double check if that works as expected?

Eppin commented 1 year ago

Ah, I found it. The issue seems to be full screen vs windowed. When playing in full screen I don't see the Curse counter, but when I uncheck the 'Fullscreen' in HS, I do see the counter.

So it seems the code for counting/detecting if a curse is played it correct, but displaying it in full screen seems to be not working properly.

fmoraes74 commented 1 year ago

Must mean that the SizeHelper function didn't take into account the proper coordinates for full screen.

fmoraes74 commented 1 year ago

Figured out the issue. It was due to the XIB using NSWindow instead of NSPael. I will have it fixed on the next version.

Eppin commented 1 year ago

Thank you very much!