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

[Freeciv-Dev] 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
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] patch: allow duplicate tags in tilespec files (PR#227)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Thu, 6 Jan 2000 18:22:12 -0800 (PST)

The "tilespec" system has a problem that it isn't easy to replace
just selected graphics.  Eg, to replace hitpoint bars, can supply
a new xpm with just hitpoint bars, and corresponding spec file,
but because image tag strings must be unique, have to edit the
distribution tiles.spec file to remove hitpoint bar tags there.

Thats not very nice because would like to not have to mess with
the distribution spec files, and track changes there, etc.
(This issue was raised by Falk Hueffner - see 
http://arch.freeciv.org/freeciv-dev-199908/msg00386.html)

I considered using some sort of prefix system as suggested
in Falk's post, but realised 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.  Then to override selected graphics, just put 
the new spec file earlier in the 'files' list in the toplevel 
.tilespec file.  (Regardless, you do need to provide a 
replacement .tilespec file.)

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? 

-- David

Attachment: tilespec_duplicates.diff.gz
Description: GNU Zip compressed data


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