Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#3727) Area Selection rectangle take II
Home

[Freeciv-Dev] Re: (PR#3727) Area Selection rectangle take II

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#3727) Area Selection rectangle take II
From: "a-l@xxxxxxx" <a-l@xxxxxxx>
Date: Sat, 12 Apr 2003 04:02:54 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Here is an updated version of the Area Selection patch, finally.

The selection rectangle is now rectangular, not rhomboid, in
iso-view. It is based upon canvas coordinates, and can be bigger than
the mapview; It records mapview_canvas.map_xy0 and adjusts width,
height accordingly when mapview recenters. It wraps. It should be
topology-independent. For that matter, it should work with a
donut-shaped world with an unreal jellybutton. It's verified to work
correctly with varying X/Y proportions, for example when:

  NORMAL_TILE_WIDTH  == 3 * NORMAL_TILE_HEIGHT
  NORMAL_TILE_HEIGHT == 3 * NORMAL_TILE_WIDTH
  NORMAL_TILE_WIDTH  == 2 * NORMAL_TILE_HEIGHT
  NORMAL_TILE_HEIGHT == 2 * NORMAL_TILE_WIDTH

I avoided the stuff that I complained about in PR#3953. (Thanks for
the interesting replies). However, I can imagine that if we get Y
wrapping and the map gets a property boolean, adjustment would be
required. That's why I wanted to modify map_to_canvas_pos() in the
first place, but I'd rather avoid getting knee deep in holy water.

The functionality is the same as previous version, but I removed
SHIFT+CONTROL-right-click for "buy production in city" because it
seemed too ICS'ish, and I would prefere to have something else on
that button anyway.

It applies to GTK1 and GTK2 and maintains compatability for the rest.

Included is a tarball with updated trident/tiles.png and
isotrident/tiles.png. I have gimp'ed in my sprite.

To patch, unload the tarball in the source tree.
autogen is no longer required.

The sprite highlights a tile. Alternatively there could be code to draw
a yellow border around each tile, as with draw_map_grid, but this
would require gui-specific code for iso. I also think it's more
efficient to let the graphics hardware handle bitmaps instead of
drawing even more pixels with the CPU. And the highlighting sprite
doesn't have to be a border box, but I'm no artist.


On Thu, 20 Mar 2003 10:52:45 -0800
"Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx> wrote:

> What we want to avoid 
> is encoding any actual knowledge of the topology into the GUI code.

I believe I am complying with this now. If I am wrong, I think the
problem would be isolated to the wrapping issue. Please comment.


Arnstein





Attachment: hilite_city_sprite.tar
Description: hilite_city_sprite.tar

Attachment: area_selection-2.diff.gz
Description: area_selection-2.diff.gz

--- cvs-Apr-09/data/helpdata.txt        Wed Apr  2 15:41:52 2003
+++ area_selection-2/data/helpdata.txt  Sat Apr 12 11:42:56 2003
@@ -431,12 +431,28 @@
 text = _("\
 Mouse:\n\
 ======\n\
-  Left-click:  (on city):  Pop up city window\n\
-               (on unit):  Activate unit\n\
-  Center-click or\n\
-     Control-right-click:  Show tile info\n\
-  Right-click:             Center tile in view\n\
-  Shift-click:             Adjust city workers from main map\
+  Left-click:  (on city):    Pop up city window\n\
+               (on unit):    Activate unit\n\
+  Center-click:              Show tile info\n\
+  Right-click:               Center tile in view\n\
+\n\
+  Shift-Left-click: (on city or unit):   Copy production\n\
+  Shift-Right-click: (on city):  Paste production into city\n\
+\n\
+  Shift-Control-Left-click:  Adjust city workers from main map\n\
+  Control-Center-click:      Wake up sentried units\n\
+\n\
+  Right-click-and-drag:      Enter Area Selection mode\n\
+\n\
+  In Area Selection mode:\n\
+  =======================\n\
+  Left-click:         Toggle tile highlighting\n\
+  Right-click:        Cancel Area Selection mode\n\
+\n\
+  Shift-Right-click:  Paste production into highlighted cities\n\
+\n\
+  The cities that become highlighted on the map,\n\
+  will also be highlighted in the City List window.\
 "), _("\
 Keyboard:\n\
 =========\n\



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