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

Replay System part 3 #381

Merged
merged 11 commits into from
Aug 3, 2024
Merged

Conversation

NQNStudios
Copy link
Collaborator

2 core changes:

  • I moved the replay_next_action() call into the actual game loop and only process one action per frame, so things actually redraw in between actions.
  • Fixed replaying control clicks inside subclasses of cContainer (so cStack and cScrollPane), which had the same problem that led groups previously had

Aside from that, added recording and replay for several relatively trivial actions.

@NQNStudios
Copy link
Collaborator Author

NQNStudios commented Aug 1, 2024

I made the app-quitting logic DRY, with one interesting change to the appleevents.mm file:

A TODO comment in it said that the mac quit event handling was causing a crash. I wasn't actually able to reproduce this crash, so that's weird, but I decided it might be smart while de-duplicating all the quitting logic, to also stop letting apple handle the actual quitting, and let the game-loop ending do it for all 3 platforms. So I'm cancelling the apple quit events and queuing fake sfml quit events instead.

Let's see what these CI build errors are...

@@ -361,32 +355,36 @@ void handle_events() {
cFramerateLimiter fps_limiter;

while(!All_Done) {
if(replaying && has_next_action()){
replay_next_action();
}else{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's not super important, but you could've avoided indenting all this code by just adding continue on the line above…

return l;
}

short short_from_action(Element& action) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good place to use templates (if you need more than just these two).

@NQNStudios
Copy link
Collaborator Author

I accidentally pushed an unrelated commit from an experiment, the force-push just removed it

@CelticMinstrel
Copy link
Member

A TODO comment in it said that the mac quit event handling was causing a crash.

If I recall correctly, the crash occurred when quitting via the menu but not if you quit by some other means (I think possibly even Cmd+Q didn't cause the crash?). It looks like your change probably does fix it, so if there's an open issue for that we should close it when this merges. Though I'll test it first, of course.

NQNStudios added a commit to NQNStudios/cboe that referenced this pull request Aug 3, 2024
@NQNStudios
Copy link
Collaborator Author

NQNStudios commented Aug 3, 2024

Whoops, I pushed a commit (to a separate branch) called Fix #381 when it should have said Fix #148

@CelticMinstrel
Copy link
Member

You can reword the commit by amending it and force-push it.

@CelticMinstrel CelticMinstrel merged commit 09b2c0c into calref:master Aug 3, 2024
6 checks passed
NQNStudios added a commit to NQNStudios/cboe that referenced this pull request Aug 3, 2024
NQNStudios added a commit to NQNStudios/cboe that referenced this pull request Aug 3, 2024
@NQNStudios NQNStudios deleted the more-actions-2 branch September 8, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants