Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOP stuck on intro screen - focus events #16435

Open
avelican opened this issue May 23, 2024 · 0 comments
Open

CLOP stuck on intro screen - focus events #16435

avelican opened this issue May 23, 2024 · 0 comments
Labels
avm2 AVM2 (ActionScript 3.0) issues bug Something isn't working

Comments

@avelican
Copy link

avelican commented May 23, 2024

Describe the bug

CLOP won't let me start the game in Ruffle.
Note: this affects both browser extension and ruffle desktop.

Game says click to start. This seems to be handled by an onFocus event:
PlayState.as:730 private function onFocus(param1:Event) : void

This game uses Flixel. onFocus seems to be a Flixel thing that's called when event.ACTIVATE is called, but I'm not sure what calls that.

Note: In desktop flash player I can't start the game by just clicking.
I have to defocus the window and then click it again.

Apparently it worked fine in the flash browser plugin version though.
EDIT: I was able to test the page in a browser with the official flash player ("Basilisk Portable with Flash Player"), and indeed it works normally (handles the event.ACTIVATE event on the first click and starts the game).

In desktop ruffle, this doesn't work (additionally, the game doesn't pause when defocused).


NOTE: The SWF is site-locked.
To run it, the URL must be exactly:
http://www.foddy.net/CLOP.html
(Note the www and the lack of https)
Some browsers (Chrome & Chrome-based?) force HTTPS. So you may need to use Firefox.

Alternatvely, you may mod the SWF to disable the URL check, or use the Ruffle player's SWF url spoofing feature.
I modded the SWF using FFDec.
Simply disable the if-check at
org.flixel.system/FlxPreloader.as:76
i.e. I changed the if(...) to if (false && ...)

See this issue:
#9440

Expected behavior

Click to start game

Content Location

http://www.foddy.net/CLOP.html
http://www.foddy.net/CLOP.swf

Affected platform

Browser's extension

Operating system

Windows 10

Browser

Brave Browser - Version 1.66.113 Chromium: 125.0.6422.76 (Official Build) (64-bit)

Additional information

Have made several attempts to modify the SWF in FFDec to make it work with Ruffle.

The relevant code is stage.addEventListener(Event.ACTIVATE,this.onFocus);
in org.flixel.FlxGame.as:create()
Apparently the Event.ACTIVATE is not handled in Ruffle.

So, I changed this to
stage.addEventListener(MouseEvent.CLICK,this.onFocus);
and
stage.addEventListener(MouseEvent.MOUSE_DOWN,this.onFocus);
but it seems these don't work in Ruffle either?

@avelican avelican added the bug Something isn't working label May 23, 2024
@Lord-McSweeney Lord-McSweeney added the avm2 AVM2 (ActionScript 3.0) issues label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
avm2 AVM2 (ActionScript 3.0) issues bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants