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:

A CYCLE with icons in the Character object, used for the template selection on top

A CYCLE with icons in the Character object, used for the template selection on top

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:

A normal LONG CYCLE

Before

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:

A pretty CYCLE BUTTON with icons

After

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 “~“.

Advertisements