Opened 14 years ago

Closed 14 years ago

#588 closed enhancement (fixed)

Key Rotation when building construction is selected

Reported by: Kieran P Owned by: Kieran P
Priority: Nice to Have Milestone: Alpha 2
Component: Core engine Keywords:
Cc: Patch:

Description

Using the mouse to rotate produces unexpected results and makes wall/gate building much harder. It would be nice to have the 'q' rotate 45 degrees anti-clockwise, and the 'w' key rotate 45 degrees clockwise, when a building is selected for construction.

I'm going to attempt to write a patch in my free time, but if it hasn't been done yet, please go ahead and do this yourself. From what I understand, it should be very easy.

Attachments (1)

add_rotate_keys.patch (1.5 KB ) - added by Kieran P 14 years ago.
Adding building rotate keys

Download all attachments as: .zip

Change History (6)

comment:1 by Andrew, 14 years ago

Milestone: UnclassifiedOS Alpha 2
Owner: set to Kieran P
Priority: majorminor

I am going to give this k776 and mark it as a minor task for now. If you can get it done by then do so but if not then we can push it.

comment:2 by Kieran P, 14 years ago

To implement this requires a new Hotkey system, where the actions for viewport rotate buttons Q & E can be overwritten/replaced.

comment:3 by Philip Taylor, 14 years ago

I'd suggest using different keys (regardless of technical limitations), like PageUp/PageDown or [/] perhaps, since it doesn't seem nice to disable some of the camera movement keys when the player is trying to look for a space to put their building in.

by Kieran P, 14 years ago

Attachment: add_rotate_keys.patch added

Adding building rotate keys

comment:4 by Philip Taylor, 14 years ago

Thanks! Just made a few modifications:

Changed the key definitions to be SDLK_ constants. Reused placementPosition instead of targetPosition since they don't need to be separate.

var rotation_step = Math.PI / 12; // 12 clicks make a full rotation

Actually 24 clicks, since there's 2*pi radians in a circle.

comment:5 by philip, 14 years ago

Resolution: fixed
Status: newclosed

(In [8314]) # Add "," keys to rotate buildings during placement, based on patch from k776. Fixes #588.

Note: See TracTickets for help on using tickets.