-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Keyboard shortcuts for track construction #5200
Keyboard shortcuts for track construction #5200
Conversation
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) | ||
return; | ||
|
||
rct_window * w = window_find_by_class(WC_RIDE_CONSTRUCTION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather see this code in the construction window file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Reason being that the widgets[9]
etc is difficult to maintain)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean move the whole code to src/openrct2/windows/ride_construction.c
?
ca74879
to
28a33e6
Compare
I have refactored the "turn left" keyboard shortcut, can you please tell me if it's better that way ? If it's good then I'll do the same for the rest |
src/openrct2/ride/track.h
Outdated
@@ -537,4 +537,6 @@ void game_command_remove_track(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *ed | |||
void game_command_set_maze_track(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx, sint32 *esi, sint32 *edi, sint32 *ebp); | |||
void game_command_set_brakes_speed(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx, sint32 *esi, sint32 *edi, sint32 *ebp); | |||
|
|||
void window_ride_construction_keyboard_shortcut_turn_left(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in window.h
return; | ||
} | ||
|
||
switch (_currentTrackCurve) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation of the switch cases is inconsistent.
Made a few style-related comments. @IntelOrca Can you go over |
Methods declaration moved from I'm doing the rest while waiting for @IntelOrca 's review implementation-wise. |
Maybe could squash them all together in the end and insert a 'Fix: XXXX'? :p |
7f76a96
to
0b4b372
Compare
@Nubbie Commits have been squashed ^^ |
9c3d4d3
to
952e34f
Compare
My laptop has a Numpad that I have disabled most of the time, with some of the keys having double meaning (8/up, 4/left, 6/right, 2/down, 7/home, 9/page up, 1/end, 3/page down), but this doesn't take into account whether I have Numpad enabled or disabled. With Numpad enabled I expect Num 9 to act only as Num 9, and with Numpad disabled I expect it to act only act as the page up key (in my case of course). |
If I understood correctly, you want "Keypad 8" (I'm using the term "Keypad" because that's how SDL2 call them) and "Page Up" to act the same ? |
@JoelTroch No, exactly the opposite. In other applications when I have Numpad disabled (Numlock off), Keypad 9 acts like Page Up, and when Numpad is enabled, it acts as "Keypad 9" (In a text editor, it would either scroll up, or write down the "9"). This issue has probably been here before this PR too, I just only found out about it now. |
This issue should probably get solved by #3908. Unfortunately that PR is rather stuck. |
@Broxzier I see what you mean, I have the same layout as you. After a very quick Google search, it might be related to Unicode input but someone more expert with input stuff should confirm or deny my sentence. |
952e34f
to
e5b7cba
Compare
e5b7cba
to
fe93ae6
Compare
What's the status of this? |
It can be merged whenever the main OpenRCT2 developers desire to do so. About the issue mentioned by @Broxzier , this isn't in the scope of this PR but @marijnvdwerf mentioned that #3908 could fix it if it's rebased and free of merge conflicts. |
@JoelTroch can you rebase? |
fe93ae6
to
47ef32e
Compare
@janisozaur Done ^^ |
47ef32e
to
e944b0d
Compare
contributors.md
Outdated
@@ -55,6 +55,7 @@ Includes all git commit authors. Aliases are GitHub user names. | |||
* Niels NTG Poldervaart (Niels-NTG) - Misc. | |||
* (zaxcav) - Improvements to original pathfinding algorithm. | |||
* Hielke Morsink (Broxzier) - Tile inspector, misc. | |||
* Joël Troch (Shepard62FR) - Keyboard shortcuts for ride construction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your Github username is JoelTroch, not Shepard62FR.
distribution/changelog.txt
Outdated
@@ -1,5 +1,6 @@ | |||
0.0.7 (in development) | |||
------------------------------------------------------------------------ | |||
- Feature: [#1730] Add keyboard shortcuts for track construction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Feature: [#1730] Keyboard shortcuts for track construction.
e944b0d
to
b77b137
Compare
Requested changes applied |
1fcbde5
to
e4c01f4
Compare
@Gymnasiast I looked briefly at the code and it looked simple enough for me not to expect any bugs in there. There was still a misindented line or two there. I trust your judgement. |
e4c01f4
to
d3e3240
Compare
@janisozaur I fixed one of the misaligned line, let me know if there are more. UPDATE : Removed trailing whitespaces |
d3e3240
to
bb89ebb
Compare
This PR add some keyboard shortcuts for track construction (especially for custom designs). I tried my best to optimize and have a clean code as much as possible.
Related issue: #1730