Settings Files (1)

From TrillWiki

Jump to: navigation, search

by Sjoerd on 09/04/04

You all know what a DTD file is, I assume, so I'll get right to the point.

Make a new file, and name it something appropriate, settings.dtd or something.

Open up trillian.dtd, make a line which says

<!ENTITY % settingfile SYSTEM "settings.dtd"> %settingfile;

this way, we tell trillian to see what is in settings.dtd and view it as a dtd file.

Now, open up settings.dtd, this example, we will make something that will hide or show the buddy icon in chat windows by default. So, say something appropriate for the function.

<!--
budicondescription="Show The Buddy Icon by default in chat windows"
budicontype="checkbox"
budiconchecked="default"
budiconunchecked="non-default"
-->
<!ENTITY % budicon "default">


Since we don't want the user to change a lot of things, just for one setting, we have the rest defined somewhere hidden to their eyes! In trillian.dtd, have the following line:

<!ENTITY % settbudicon SYSTEM "SETTINGS\settbudicon%budicon;.DTD"> %settbudicon;>

Tometheus: This needs a correction here. % entities are bypassed in % SYSTEM entities, so you have to trick the parser into evaluating it.

<!ENTITY % ENTsettbudicon
'<!ENTITY &#37; settbudicon SYSTEM "SETTINGS\settbudicon%budicon;.DTD">'>
%ENTsettbudicon; %settbudicon;

That should work. -Tom

now, let us take a look in settbudicondefault.dtd


<!ENTITY phasebuddyicon "default">
<!ENTITY phasenobuddyicon "non-default">

and in settbudiconnon-default.dtd:

<!ENTITY phasebuddyicon "non-default">
<!ENTITY phasenobuddyicon "default">


This whole trick makes you able to change a lot of settings, while the user thinks it is only changing one setting!

Of course, you could also add this in your settings.dtd:

<!--
phasebuddyicondescription="Select this one if you want to show the buddy icon by default"
phasebuddyicontype="checkbox"
phasebuddyiconchecked="default"
phasebuddyiconunchecked="non-default"
-->
<!ENTITY phasebuddyicon "default">
<!--
phasebuddyicondescription="Select this one if you don't want to show the buddy icon by default"
phasebuddyicontype="checkbox"
phasebuddyiconchecked="default"
phasebuddyiconunchecked="non-default"
-->
<!ENTITY phasebuddyicon "non-default">


But, then you wouldn't be certain that some wacky user wouldn't be able to get it wrong, and then bug you about it.

I don't know if somebody is writing a "settingchanger" program, but it would be nice to have a generic style when somebody writes it. If somebody is already writing it, please make a thread or something how you visioned it, so I can at least edit my tutorial to it. But, when someone is thinking about making a settingchanger, perhaps I could give you a sort of idea for interpretting the files, you could contact me then.

This trick does need you to know a bit of phase-changes, perhaps I could even try to teach you that sometime.


[edit] See also

Settings Files (2)