[EDIT:] To clarify, I need a better understanding of what such a program would have to do, not how to code it (I may already know enough to do the latter once I know the former). So, for instance, are they all simple tileset switchers, or do they handle raw-modifying graphics sets as well (and if so, what's the basic idea of how)?
4 things that need to be changed:
- Tilesets and init files
init.txt has entries that point to the tileset df is supposed to use. It must be located in data/art/. Either a png with alpha transparency or a bmp with magenta as transparency. You also set GRAPHICS to YES or NO to tell DF whether or not to use creature graphics there.
d_init.txt has some entries which tiles are supposed to be used for certain things (minecart tracks, the new trees, pillar, sky, etc), and some other settings (varied ground tiles, engravings, toggling numerical display of water).
You need to keep a backup/reference of the default init.txt and d_init.txt and generate these files depending on the tileset/graphic set. It's sufficient to just copy the tileset in data/art. you don't need to overwrite or delete anything there.
- Colors
data/init/colors.txt
Must be named colors.txt
You need to keep a backup/reference of the default colors.txt and generate colors.txt depending on the tileset/graphic set.
- Font
data/art/font.ttf
Must be named font.ttf
You need to keep a backup/reference of the default font.ttf and generate font.ttf depending on the tileset/graphic set.
- Creature graphics and raw changes
located in /raw/ and data/save/<your save folder name>/raw
creature graphics (png tilesets) go in the raw/graphics folder.
They need a text file (usually named identical to the respective creature graphic tileset) that tells DF what tiles to use for what creature
by default DF comes with a graphics_example.txt and example tiles for dwarves
Most graphic sets change several raw files to use different tiles for objects (for example ores and stones)
You need to keep a backup/reference of the default raws. ]
You need to delete graphics_example.txt or replace it with an empty dummy file.
You need to delete the creature graphic folder and restore the default raws before switching to/applying another graphic set.
Furthermore, you'd need the tilesets/graphic sets to be prepared correctly. Most of them have downloads that already have the correct folder hierarchy and you would just have to drop them into the DF folder to install. Separate tilesets, fonts, etc would be less trivial. So you probably want to have both an automatic process (with something like a preview or log: "found tileset in : mygraphicset_df_40.02.zip/data/art/mytileset.png; found init.txt in mygraphicset_df_40.02.zip/data/init/init.txt", etc)and let the user choose elements he wants to install.
That's all I can think of.
The procedure for changing any tileset or graphic set would possibly look something like this:
- create backup of current tileset/graphic set configuration
- prepare files to install (and generate as necessary - for example an init.txt file in case you only want to install a new tileset)
- restore all defaults, delete creature graphics folder
- copy all relevant files in the correct folders, overwriting as necessary
There's probably more, but that should give you a start for testing.
Also note that some users reported a problem with the LNP:
Upon installing CLA (I don't know about other graphic sets) with the LNP, data/art/mouse.png seems to be missing, which prevents DF from starting.
I speculate that this might be because the LNP purges
all files from data/art before installing a new tileset, and since CLA only includes files that need to be changed, mouse.png is missing afterwards.