[Freeciv-Dev] "tilespec" system
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Hi,
I like the tilespec system very much, it's a great improvement.
However, I had some problems:
It seems there is no way to exchange a tile from an .xpm without
editing the .spec file, since tags mustn't appear more than once. So
if I have two files providing u.catapult, I have to comment it out of
one. I would like it better if the .spec file would be edited only by
the tile author, since that would give him the freedom to shuffle
things around without breaking anything. Concretely, I hit this
problem when I wanted to replace the hit point bars; I had to make a
copy of tiles.xpm.spec and modify it.
A way to achieve this would be to have no tile named as a tag from the
client, but to prefix them with the tile-set name,
e. g. "trident.u.catapult", so that tile names would be unique
everywhere. The .tilespec file would then give patterns to which ones
actually to take, with a possibility to use a tile with a different
name.
For example, if I wanted to replace the flags, the hit point bars, and
also use a civ2 trimaran as trireme:
use {
"u.trireme" : "civ2.u.trimaran"
"hp." : "myhpbars."
"flags." : "myflags."
"" : "default."
}
So, for every tile request from the client, it would scan this map
from top, check if the tag starts with the key, and look if there's a
tile with the value corresponding to the key anywhere, possibly
attaching the part of the tag that was missing in the key if the key
ends with a '.'. Regexps would make this nicer, but there is no
standard library for them, and I think this suffices.
I don't know how easy this would be to add, but it would be really
nice.
BTW, I had crashes when a tile name didn't contain a '.', I will track
that.
Falk
- [Freeciv-Dev] "tilespec" system,
Falk Hueffner <=
|
|