CookieMonsterTeam / CookieMonster

Addon for Cookie Clicker that offers a wide range of tools and statistics to enhance the game
MIT License
501 stars 206 forks source link

[Steam Version] Cannot click the big cookie #950

Closed AFKoncore closed 3 years ago

AFKoncore commented 3 years ago

Describe the bug When loading this mod on the Steam version and clicking the big cookie the animation plays fine but you get no cookie, the number of time clicked in the Stats tab does not increase.

Browser Steam Version (Electron)

DanielNoord commented 3 years ago

I currently don't have the Steam version myself so I can't really investigate this. Does the game work besides the big cookie?

TFHatGuy commented 3 years ago

I currently don't have the Steam version myself so I can't really investigate this. Does the game work besides the big cookie?

It seems to from what I've seen of it – the bottom bar appears, and the colourings work on buildings as intended; though I hadn't bothered importing my web save to check on things like sounds or flashes, I imagine they would work fine too – though I wouldn't be 100% certain of that.

AFKoncore commented 3 years ago

@DanielNoord I sent you a DM on reddit re: getting you the Steam version, if you want it.

DanielNoord commented 3 years ago

See my response to your DM on reddit.

For others, I currently don't have access to a windows computer (only a Mac) so even with the game I wouldn't be able to test anything. When I get my hands on a windows computer I will try and fix these bugs asap. In the meantime, if anybody wants to open a PR to try and fix some of the issues you are more than welcome to!

Reaver01 commented 3 years ago

Here's what I can gather rn on the clicking issue:

image

It looks like e ends up undefined and breaks clicking.

image

It can technically be fixed by removing this section out of the if statement on line 4634 in main.js, but there is probably a better solution that I'm too tired to think of.

Urganot commented 3 years ago

@Reaver01 hwo do you open the console ingame? I might be able to help but i have no idea how to debug it

LeapingSheep commented 3 years ago

@Reaver01 hwo do you open the console ingame? I might be able to help but i have no idea how to debug it

steamapps\common\Cookie Clicker\resources\app Edit start.js and at line 7 change false to true.

Urganot commented 3 years ago

The problem seems to be the eventhandler itself. for some reason it is called but doesnt receive the event. image

Urganot commented 3 years ago

When executing AddEvent(bigCookie,'click',Game.ClickCookie); in the console, the handler will be called twice. the first time e is undefined the second time e is populated. Maybe the AddEvent(bigCookie,'click',Game.ClickCookie); (line 4713) is too early in the lifecycle?

Urganot commented 3 years ago

@DanielNoord The problem lies int he FixMouseY function after being initialized here image The function then calls the Game.CookieClicked eventhandler image In the end the event doesnt reach the Game.ClickCookie method

I dont know js well enough to fix this though

Urganot commented 3 years ago

They changed the code here from the web game in the web its image while in steam its image

Urganot commented 3 years ago

I think i fixed it. I opened PR #953 ypu can test it by using https://urganot.github.io/CookieMonster/dist/CookieMonsterDev.js as the source image

Version warning is not fixed

LeapingSheep commented 3 years ago

❤️ Its working with your CookieMonsterDev.js!!!

DanielNoord commented 3 years ago

Going to push this ASAP! Thanks for your amazing and quick work here @Urganot

DanielNoord commented 3 years ago

Closed with #953, let me know if there are any problems accessing it from the normal link!