Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: [RFC] Map decorations
Home

[Freeciv-Dev] Re: [RFC] Map decorations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC] Map decorations
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 7 Oct 2001 18:17:41 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Oct 07, 2001 at 12:07:53PM +0200, Raimar Falke wrote:
> 
> This is a preparation for unit agents. It would be nice if for example
> the SMA (settler management agent something like the current auto
> settler function) can show which action a settler plans to carry out
> and to show certain information. See the attached picture for an
> example made with a drawing program (there is a settler in the south
> east corner, it was just "blinked out" at the screenshot).
> 
> Another point is that the current way of drawing the goto line is very
> ugly. The goto code calls the GUI code (if the line is started or
> changes) and the GUI code calls the goto code (if the mapview is
> refreshed).
> 
> So something like the following is useful IMHO:
> 
> struct map_decoration
> {
>   int elements_used;
>   struct {
>     int x,y;
>     char *text;
>     enum color_std line_color, text_color;
>   } elements[MAX_MAP_DECORATIONS_ELEMENTS];
> };
> 
> /*
>  * Draws line between the centers of the tiles which are mentioned in
>  * the elements fields. Note that the tiles doesn't have to be
>  * adjacent. If a text is given this is drawn at the
>  * tile. Returns an id.
>  */
> int add_map_decoration(struct map_decoration *p);
> 
> void remove_map_decoration(int id);
> 
> So the goto (or the SMA) code controls/calls the GUI code.
> 
> There may be extra modifiers for the text (position, size) and maybe
> also multiple texts.
> 
> Comments?

Here is a first implementation. I had to change the interface.

Todo:
 - make it faster
 - implement description
 - don't allow lines to be drawn over each other
 - there may be some cases where the lines aren't drawn correctly

You may press the middle button at a unit if you commanded a goto for
this unit.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Transported to a surreal landscape, a young girl kills the first woman
  she meets and then teams up with three complete strangers to kill again."
    -- TV listing for the Wizard of Oz in the Marin Independent Journal

Attachment: map_deco1.diff
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]