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

Cancel roadbuilding with Esc key #6456

Closed

Conversation

cloudyluna
Copy link

@cloudyluna cloudyluna commented May 17, 2024

Type of change
New feature

Issue(s) closed
Fixes #6284

New behavior
Player now can cancel both road and waterway building with just Esc key for convenience.

Additional context
TODO:

  • Implement the requirement mentioned in the linked issue.

@cloudyluna cloudyluna changed the title Draft: Cancel roadbuilding with esc key WIP: Cancel roadbuilding with esc key May 17, 2024
@bunnybot
Copy link

Mirrored on Codeberg as #CB4818.

@bunnybot bunnybot changed the title WIP: Cancel roadbuilding with esc key WIP: Draft: Cancel roadbuilding with esc key May 17, 2024
@bunnybot bunnybot changed the title WIP: Draft: Cancel roadbuilding with esc key WIP: Cancel roadbuilding with esc key May 18, 2024
@bunnybot bunnybot added the ci:fail CI checks failed label May 18, 2024
@cloudyluna
Copy link
Author

cloudyluna commented May 18, 2024

Okay, currently while this is working for cancelling road & water building mode, it however breaks the Esc shortcut for opening the in-game main menu. Anyone have any advice on how do I solve this? Sorry, I'm new to the project (and coding tbf).

@bunnybot
Copy link

tothxaMirrored from Codeberg
On Sat May 18 22:37:57 CEST 2024, Tóth András (tothxa) wrote:


Hi cloudyluna and welcome to Widelands!

Okay, currently while this is working for cancelling road & water building mode, it however breaks the Esc shortcut for opening the in-game main menu. Anyone have any advice on how do I approach to solve this?

Instead of defining a new hotkey, you should check for road/waterway building mode right in the code.sym == SDLK_ESCAPE block in InteractiveGameBase::handle_key(). So you don't even need the new function either.

@cloudyluna cloudyluna force-pushed the cancel-roadbuilding-with-esc-key branch from 53fd749 to 972fc9d Compare May 19, 2024 13:14
…c-key' of codeberg.org:wl/widelands into mirror/cloudyluna/widelands/cancel-roadbuilding-with-esc-key
@bunnybot bunnybot added ci:fail CI checks failed and removed ci:fail CI checks failed labels May 19, 2024
@cloudyluna
Copy link
Author

cloudyluna commented May 19, 2024

Thanks for the warm welcome and the pointer! This works! 😄

My previous attempt was unnecessarily complicated, indeed. I've rebased my PR/MR to apply your suggestion. though I probably need to run code formatter on my end before pushing the changes in future. 😅

Also, I don't think there's a need to update in-game documentation docs because it's not a new hotkey addition so I believe we're good here?

@cloudyluna
Copy link
Author

I've rebased my commits to a single (the latest) commit and force pushed it here but it seems the old commits still persists for some reason which still keeps breaking the CI. I'm not sure what really is going on here, but let me know if I need to fix anything with git on my end.

@cloudyluna cloudyluna changed the title WIP: Cancel roadbuilding with esc key Cancel roadbuilding with Esc key May 19, 2024
@cloudyluna cloudyluna marked this pull request as ready for review May 19, 2024 13:59
@bunnybot bunnybot changed the title Cancel roadbuilding with Esc key WIP: Cancel roadbuilding with esc key May 19, 2024
@bunnybot bunnybot changed the title WIP: Cancel roadbuilding with esc key Cancel roadbuilding with Esc key May 19, 2024
@bunnybot bunnybot added ci:fail CI checks failed and removed ci:fail CI checks failed labels May 19, 2024
@bunnybot
Copy link

tothxaMirrored from Codeberg
On Tue May 21 13:56:07 CEST 2024, Tóth András (tothxa) wrote:


I've rebased my commits to a single (the latest) commit and force pushed it here but it seems the old commits still persists for some reason which still keeps breaking the CI. I'm not sure what really is going on here, but let me know if I need to fix anything with git on my end.

You have to do the revert in a new commit. Our mirror bot cannot deal with force-pushed updates at all, and they're best avoided both on github and on codeberg in PR branches anyway. PRs are merged in a single ("squashed") commit, so master commit history stays clean even if the PR branch was messy.

@cloudyluna
Copy link
Author

You have to do the revert in a new commit. Our mirror bot cannot deal with force-pushed updates at all, and they're best avoided both on github and on codeberg in PR branches anyway. PRs are merged in a single ("squashed") commit, so master commit history stays clean even if the PR branch was messy.

Thanks for the explanation. I've reverted the offending commits and hopefully (finger crossed) the CI will pass this time.

@bunnybot bunnybot removed the ci:fail CI checks failed label May 21, 2024
Copy link

@bunnybot bunnybot left a comment

Choose a reason for hiding this comment

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

tothxaMirrored from Codeberg
On Tue May 21 19:09:42 CEST 2024, Tóth András (tothxa) approved this pull request:

Thank you. Tested and works.

@bunnybot bunnybot added review:approve The pull request has been approved. ci:success CI checks succeeded labels May 21, 2024
@hessenfarmer
Copy link
Contributor

ci is green, PR is approved so
@bunnybot merge

@bunnybot bunnybot closed this May 21, 2024
@bunnybot
Copy link

The pull request was merged in the mirrored repo, but the head branch could not be deleted (error code 404).

Please delete the branch manually.

@hessenfarmer
Copy link
Contributor

hi @cloudyluna thanks for your first contribution to this project.
The only open question is how do you like to be credited in our credits?

bunnybot pushed a commit that referenced this pull request May 21, 2024
@cloudyluna
Copy link
Author

@hessenfarmer :) hmm I assume by credits you mean the in-game window credits? Using this handle: Luna Cloudberry (cloudyluna) would be fine. and thx.

@bunnybot bunnybot added this to the v1.3 milestone May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:success CI checks succeeded review:approve The pull request has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cancel Roadbuilding with Esc Key
3 participants