PlaneShift
Gameplay => General Discussion => Topic started by: Aiwendil on November 27, 2011, 12:55:03 pm
-
Okay 0.5.8 is out...so a few notes on the changed spellchecker.
The installing instructions for the dictionary didn't change:
First you will need a dictionary. You can use the openOffice.org dicts for that. Either get one here (http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/) or just use the en_US (http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries/en_US.zip) one. Now go in your PlaneShift installation directory to the "data" directory and create a new "dict" folder. In that new folder unzip the dictionary (spellchecker looks for planeshift/data/dict/<dict>.dic and planeshift/data/dict/<dict>.aff).
No need anymore to edit any config files as the spellchecker got a config gui in game now.
The real important change (for users) is that it now works for every "pawsEditTextBox" and "pawsMultilineEditTextBox". But by default it's turned off for any of those. In the default skin spellchecking is only done for the chat window input box and for books (title and text). But it's really no problem to have char description, quest notes, private and public notes in guild and a lot more spellchecked as well. Giving an example for the char description here...but works the same for almost everything else (And this is for the default elves skin...for other skins you have to edit the files contained in that skin):
First you need to find the xml file that defines the gui for the char description. That's not that hard...just go to "<planeshift-install-dir>/data/gui". In that folder is a file called "chardescwindow.xml". Open that file in your preferred text editor:
vim chardescwindow.xml
Now you have to find the part that defines the Edit box for editing the char description. Again not very hard as there is only one EditBox in this file...just search for "pawsMultilineEditTextBox". You should find a part looking like this:
...
<pawsMultilineEditTextBox name="Description">
<frame x="25" y="30" width="270" height="185" border="no" />
<attachpoints>
<attach point="PROPORTIONAL_RIGHT" />
<attach point="PROPORTIONAL_TOP" />
<attach point="PROPORTIONAL_LEFT" />
<attach point="PROPORTIONAL_BOTTOM" />
</attachpoints>
</pawsMultilineEditTextBox>
...
Now all you have to do is add a "<spellChecker enable="true" r="255" g="0" b="0"/>" line to that "pawsMultilineEditTextBox" so it looks like this (position doesn't matter...could as well be put as the first line under <pawsMultilineEditTextBox>:
...
<pawsMultilineEditTextBox name="Description">
<frame x="25" y="30" width="270" height="185" border="no" />
<attachpoints>
<attach point="PROPORTIONAL_RIGHT" />
<attach point="PROPORTIONAL_TOP" />
<attach point="PROPORTIONAL_LEFT" />
<attach point="PROPORTIONAL_BOTTOM" />
</attachpoints>
<spellChecker enable="true" r="255" g="0" b="0"/>
</pawsMultilineEditTextBox>
...
The "enable" in that line turns on the spellchecker. In case you only want to turn it off but keep that line for easier changing it later again just set it to "false". The "r", "g," and "b" values define the color of the typos (range 0-255). In the example I simply use red (Use http://www.colorpicker.com/ to figuring out what values you want). That's about it.
Oh..and of course the spellchecker is only used in case it's available. It's no problem to turn it on in the xml files even on the windows client which doesn't have it...it just doesn't change anything then. Same if no dictionary could be found...the widget will just act as if the spellchecker is turned off.
A last notice on the gui.xml files. The pawsEditTextBox and pawsMultilineEditTextBox come in two versions there: "<pawsMultilineEditTextBox name="Description">" as in the example or "<widget name="body" factory="pawsMultilineEditTextBox" style="textinput">" (example for that in "bookwriting.xml"). For the spellchecker that makes no difference. Just add the one line and fine.
Further infos in http://bugs.hydlaaplaza.com/flyspray/index.php?task_id=4922.
-
vim chardescwindow.xml
Ph! Vim! That's a vimsical excuse for a text editor! Real men use ed!
Thanks for the instructions!
-
true..ed is fine...everything is better than emacs.
/me runs and grabs some popcorn for the upcoming flamewar.
-
Awesome, another Vim user. :thumbup:
And thanks for these instructions. I might have to try turning on the speling cheker.
-
:D miomo: The Apache (webserver) module "mod_speling" is misnamed exactly on this purpose.
vim? ed? Darned nerds. ;)
-
vim? ed? Darned nerds. ;)
Actually, I just said ed because these kind of arguments are usually about vim, ed, and emacs. Personally, I prefer to edit text files only with echo and cat.
-
mmmh, nobody still using midnight commander? oh gawd.
-
Nerds I said -- because there are only Linux users talking among each other. Not even expecting any other OS.
-
Hey...it's not my fault the windows client has no spellchecker yet. It -should- work there.
And as far as I know it works on macs.
-
I'm not sure why you say you no longer need to edit any files and then go on to tell us how to edit files.
By the way, I linked my browser spell check files as they are the ones I add to the most. I'm not sure a symlink will work but I think it ought to.
-
I'm not sure why you say you no longer need to edit any files and then go on to tell us how to edit files.
Because that (http://www.hydlaaplaza.com/smf/index.php?topic=39193.msg443668#msg443668) is how it worked before this version...you had to edit the config files to enable the spellchecker. The editing I explain here is more for people creating their own themes. For all others I think it's enough if they have the spellchecker enabled in books and chatwindow in the default theme.
By the way, I linked my browser spell check files as they are the ones I add to the most. I'm not sure a symlink will work but I think it ought to.
Good question...would be interested if that works. I think it should...but no clue how the VFS from CS handles symlinks.
-
So I put the links in the directory and enabled the spellchecker and it seems to be working as words turn red but is there a way to get tab completion or to add words to the dictionary or is it just informative? Also do I need to enter the filenames in the spellchecker options?
-
No tab-completion for misspelled words. It's only informative as you call it. To add new words not in your dictionary yet use options->spellchecker.
-
OK. is that what the entry field is in the spellchecker options? I thought it was where you specify the data files.