Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2000:
[Freeciv-Dev] Re: patch: allow duplicate tags in tilespec files (PR#227)
Home

[Freeciv-Dev] Re: patch: allow duplicate tags in tilespec files (PR#227)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: patch: allow duplicate tags in tilespec files (PR#227)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Thu, 13 Jan 2000 23:10:53 +1100 (EST)

Falk Hueffner wrote:
> David Pfitzner <dwp@xxxxxxxxxxxxxx> writes:
> >    at least this problem could be overcome with a
> > very simple change: allow duplicate tags, and for each tag, if there
> > are duplicates just use the first entry which appears. 

> > This patch implements this simple solution.  (Although perhaps
> > arguably in a bit of a hackish way, relying on (abusing?)  registry
> > internals etc...)  I like the relative simplicity of the approach
> > (and short patch), but are there other related issues which cannot
> > be solved via this simple fix?
> 
> Well, it makes things easier if you want to replace all tiles from
> image A with those from file B, but not if you want to replace only
> some. For example, my girlfriend prefers the units ripped from Civ2,
> but insists on keeping the Engels engineer. For this, you still have
> to edit the .spec files...

I think with the duplicates_ok patch (now in CVS), you _can_ do 
this without editing the base distribution spec files, as follows:

You make a spec file describing the units as ripped from Civ2
(I assume you have to do this anyway, or are they arranged the
same way as freeciv does?), and then in that spec file, *dont*
include (or comment out) the reference for Engineers.  Then
in the toplevel .tilespec file, reference both engels/units.spec
and myciv2/units.spec, with myciv2 later (for code I just added
to cvs; 'earlier' for original patch).

This is slightly inefficient at run-time, in that pixmaps
will be allocated for unused engels units, but otherwise it
should work fine: the Civ2 units are used, except for any
which are missing (or commented out) which fall-back to 
the distribution/Engels units.

(Yes, you do have to edit eg myciv2/units.spec, but at least
you can still track any distribution changes fairly cleanly.)

-- David



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