project-navigation
Personal tools

Author Topic: Patch: double click movement  (Read 5395 times)

tomshackell

  • Guest
Patch: double click movement
« on: September 27, 2006, 03:31:34 pm »
Hi,

I've put together a patch to support "double click" movement. It solves the problem of accidentally moving the current soldier when trying to select another, but is much less awkward to use than "confirm_action 1".

The way it works is the first time the user clicks the "position to walk to" is marked on the battlescape with a cyan box and the walk path to that position is displayed. Unlike the old "confirm_action 1" code, the cursor box is still shown and mouse functions like selecting another unit work fine.

If the user then clicks on the same spot again then the selected soldier will walk there. The same will happen if the user presses the "confirm_action" key.

However, If the user clicks somewhere else on the battlescape then that new position is marked as the "position to walk to".

Of course simply double-clicking works fine if the user doesn't want to preview the walk path. This fits in with the "single click to select, double click to perform" idea.

Double-click mode is controlled by the "confirm_movement" cvar. You get different effects depending of the values of both confirm_movement and confirm_action:
  • confirm_action = 1, confirm_movement = anything
    Both double-click movement and confirmed firing/etc enabled.

  • confirm_action = 0, confirm_movement = 1
    Double-click movement enabled but confirmed firing/etc disabled.

  • confirm_action = 0, confirm_movement = 0
    Current default RC4 behaviour.
The patch is to the lastest SVN and is available at:
http://www-users.cs.york.ac.uk/~shackell/files/double-click-movement.patch

Currently confirm_movement is disabled by default. However, if the community approves then it might be worth making the default behaviour; since in my (biased) view it really reduces the number of times you scream "Oh my God! don't walk there!" at the computer ;)

If it is decided to be the default then it just requires a change to the line in cl_main.c

Let me know if/when you commit it and I'll cross post to one of the other boards so people can play with it :-)

Comments and suggestions welcome.

Thanks :)

Tom

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Patch: double click movement
« Reply #1 on: September 27, 2006, 04:57:40 pm »
Quote
Let me know if/when you commit it and I'll cross post to one of the other boards so people can play with it


ok, i let you know, that you commited it already :-D