More IDE setup stuff
Add Lua, XML and TOC file templates
To add a new Lua file template:
Go to
File > Settings > IDE Settings > File Templates
Click the
Templates tab and press the plus [+] button just above to add a new template. On the left side, Type a name for this template such as
RoM Add-on Lua File and in the Extension box type
lua. Make sure the
Reformat according to style checkbox is checked. and in the box just below it, add the following:
|
Source code
|
1
|
#parse("RoM Add-on Header.lua")
|
Now click the
Includes tab and press the plus [+] button again to add a new include file. Give this one a name of
RoM Add-on Header and also an extension of
lua (to match the name given in the parse command previously). Add the following (or something similar, as you like) to the code box:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
|
--[[
${NAME}
TODO: Add Description
Version: TODO: Add Version number
Author: TODO: Your Name Here!
Date: ${DATE}
License: TODO: Add-on license here
--]]
|
Click apply.
Adding a new XML file template:
There are some details that we'll fix in a bit, but for now...
Go back to the
Templates tab and click the plus [+] button once again. Give this template an appropriate name such as
RoM Add-on XML file and give it the extension
xml. Make sure the
Reformat according to style checkbox is
not checked (well it can be if you really want, but I prefer it unchecked for the XML file). Now in the box below the checkbox, add the following:
|
Source code
|
1
2
3
4
5
6
7
8
|
<Ui xmlns="http://www.runewaker.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.runewaker.com/UI.xsd">
</Ui>
|
Click Apply.
Finally the TOC file entry:
(This one I can't get working right, but it is still useful).
Yet again, on the
Templates tab, click plus [+] to add a third template and give it a name of
RoM Add-on TOC and an extension of
toc. Check or un-check the reformatting checkbox as you wish, and add the following if you wish (I can't get it to actually be used, so I'll leave it up to you if you want these details):
|
Source code
|
1
2
3
4
5
|
## Interface: TODO: Add RoM version
## Title: ${PACKAGE_NAME}
## Version: TODO: Add Version
## Description: TODO: Add Description
## Author: TODO: Your Name Here
|
Click apply.
Now when you create a new file in a project folder, you'll get the option to create a RoM Add-on Lua File, RoM Add-on XML File, or RoM Add-on TOC. When you select these, you can give a filename
without an extension and it will create the file with the correct extension and even add the appropriate header to it (except for the TOC which I still can't get to work).
There will be problems detected with the XML file, to get around some of these go to
File > Settings > Project Settings > Schemas and DTDs
In the
Ignored Schemas and DTDs box, click the plus [+] button on the right and add the following URL to the ignored list:
|
Source code
|
1
|
http://www.runewaker.com/
|
Click Apply and then OK.
This should fix the issues with the XML header errors. It'll still give a few warnings, but they can mostly be ignored or at least looked at just in case.
Adding TOC files as a new file type:
Go to
File > Settings > IDE Settings > File Types and click the Add button on the right.
In the pop-up dialog, Set the name to
RoM TOC File and add an appropriate description. Set the
Line Comment box to
#.
In the
Keywords box, add
$language,
$locale, and
$root to one of the numbered tabs. Each numbered tab will give a different color for the highlighted keywords. Tab 1 keywords show up in dark blue, Tab 2 in a dark purple, Tab 3 in dark green, and Tab 4 in dark red. So use whichever tab you want for coloring. I put $root in tab 2 and the other two in tab 3. Click OK to when done with this dialog.
In the
Registered Patterns box, add an entry via the plus [+] button on the right and register
*.toc as the pattern. If it says that it is already registered with Text files, reassign it.
Click Apply, then OK. Now the TOC files will have the comments and special keywords highlighted.