[Freeciv-Dev] patrol command and goto in the client
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
With this patch there is a patrol command. When a unit is put on patrol it
will keep going between two point forever. This can later be extended to
as many points as you like without changes in the server.
Because both "p" and "P" were taken I have chosen the key "q" as a
shortcut. (though I couldn't get it working in the XAW client - must be
some minor oversight)
Also with this patch, a goto command from the client is calculated in the
client and the route sent to the server. This means that the goto now
takes FoW and unknown terrain correctly into account. This can be
extended to allow waypointed gotos in the future without any server
changes.
I also made the gtk client draw a line from the unit to the position of
the cursor when in goto state.
Using the patrol order works like a goto - you hit q and then click on the
map. For now we use the goto cursor.
Instead of adding a patrol_state like there is a paradrop_state and a
goto_state etc. I reworked the cursor hower code so that we now have a
enum cursor_hower_state hower_state and
int hower_unit
(that part of the code was an ugly hack before)
I added a graphics for the patrol activity which you probably won't like -
help accepted :). For some reason diff insists on including the whole
engels/tiles.xpm when diffing, so that is why the patch is so big. I
think the same were a problem in the FoW patch, but someone knew how to
fix it (not that I am sure it is really a bug)
We may want to use the client goto with waypoints and line drawn on the
map for things like the connect command later.
Btw, the client goto code is also useful as a move cost map, as used by
the AI in the server.
The patch add a non-mandatory capability string. If the server has it but
the client don't the server will show ACTIVITY_PATROL as ACTIVITY_GOTO to
the client. If the client knows it and the server don't the patrol command
will be disabled and the client will revert to using the old goto command
in the server.
The patch can be found at
http://hjem.get2net.dk/thue_janus_kristensen/client_goto.diff.bz2
-Thue
- [Freeciv-Dev] patrol command and goto in the client,
Thue <=
|
|