This script allows you to designate which icon sheet you want to draw your icon from. This allows you to organize your icons so that you don’t need to load one large iconset just to draw one icon.
Separate your icons into separate files, then load them by name and index!
You can even specify different icon sizes for different sheets.
Script: download here
The icon index utility I use in the example below can be found here
Place this script below Materials and above Main.
Setting up icon sheets
Place any custom icon sheets in your Graphics/System folder.
In the configuration below, add the filenames (without extensions) to the
Icon_Sheets hash and the width and height of the icons for those sheets.
You must also include the default icon sheet to use,
which is “Iconset”
Using custom icon sheets
Now that you have set up your icon sheets, you can begin using them.
In your database, note-tag objects with
<icon: name index>
name is the exact filename of the icon sheet, without extensions
index is the index of the icon in the specified file.
For example, suppose I have the following icon sheet called “CustomIcons”
After looking up the icon index, I want to assign it to my Potion item
Now when I load up the game, I will see that my potion is using the custom icon
This script overwrites how icon drawing is done. Instead of simply loading “Iconset”, it instead calls this function
bitmap, new_icon_index = TH::Custom_Icon_Sheets.load_icon_sheet(icon_index)
The function takes the item’s icon index and returns a bitmap, and a new icon index, which are then used to draw the icon. If your script has its own icon drawing methods, then you should update those methods appropriately.