LONG CYCLEs with icons and separator
by .
You want to display icons in a LONG CYCLE? Easy as pie, this article will show you how it works!
This is how it looks in the Character object:
How it works
If you don’t need a sophisticated solution like the CYCLEBUTTON, but simply some icons in a LONG CYCLE, you can do this with just a small addition to your plugin’s .res file.
Here’s an exemplary .res file with a normal LONG CYCLE:
CONTAINER Omyobject
{
NAME Omyobject;
INCLUDE Obase;
GROUP ID_OBJECTPROPERTIES
{
LONG MYOBJECT_ICONCYCLE
{
CYCLE
{
MYOBJECT_ICONCYCLE_ITEM_0;
MYOBJECT_ICONCYCLE_ITEM_1;
MYOBJECT_ICONCYCLE_ITEM_2;
MYOBJECT_ICONCYCLE_ITEM_3;
}
}
}
}
It will look like this:
Now we add icons to the cycle items 1, 2, and 3, as well as a separator line between the items 0 and 1:
CONTAINER Omyobject
{
NAME Omyobject;
INCLUDE Obase;
GROUP ID_OBJECTPROPERTIES
{
LONG MYOBJECT_ICONCYCLE
{
CYCLE
{
MYOBJECT_ICONCYCLE_ITEM_0;
-1;
MYOBJECT_ICONCYCLE_ITEM_1~Ocube;
MYOBJECT_ICONCYCLE_ITEM_2~Opyramid;
MYOBJECT_ICONCYCLE_ITEM_3~1021433;
}
}
}
}
It now looks like this:
Separator
Create a separator by inserting a “-1” item.
Icons
Add an icon to an item by appending a registered symbol name or a plugin ID to the item ID, separated with a “~“.



hi there, thank you for the valuable information i found on your site. can you explain how i can use custom icons here? do i need to create a separate plugin for every icon i want to add?
You can include lib_iconcollection.h, and use RegisterIcon() to register custom icons.
Use GetIcon() to retrieve it in an IconData object, which will contain a pointer to the bitmap in its bmp member.
thank you!
one thing fater looking up in the sdk: do i really need to get unique plugin id for every single icon i want to use?
Yes, you do. Using unique IDs avoids collisions that might happen if everybody was to just come up with their own.