Custom Resource Manipulator is a GUI-friendly trigger library and UI addition dependency created and distributed by Alzarath that adds custom resource icons and labels that can be created and manipulated.
It should be noted that this is not a true resource and can not be used directly in data. You'll need to use triggers.
The 4 standard resources--Minerals, Vespene, Terrazine, and Custom Resource--have custom resource entries set up by default. Whether or not you plan to manipulate the standard resources, it's recommended you use them if you plan to add custom resources as the custom resources are offset based on the standard variants of the custom resources.
To use the standard resources, it's recommended to hide the existing resource display with the Show/Hide Resource action, then show the custom versions with the Show/Hide Custom Resource action.
Creating custom resources is fairly simple. Run the Create Custom Resource action. It will create a new resource panel for you offset from the last created resource (initially this is Custom Resource).
You'll probably want to get and store the index of the resource. This index, an integer, can be acquired from the Last Created Custom Resource Index function. The index will be used for parsing and modifying the resource.
To customize the resource, you have a few options available to you:
- Set Custom Resource Icon sets the image of the icon of the given resource type.
- Set Custom Resource Text sets the text of the label of the given resource type.
- Set Custom Resource Tooltip sets the tooltip of the icon of the given resource type.
Finally, you can show the custom resource along with your other resources using the Show/Hide Custom Resource action.
To manipulate the value of your custom resource, the following functions are provided:
- Modify Custom Player Property is a function that reflects the built-in Modify Property functions. Using this over Set Custom Resource Text has the benefit of animating the value and allowing the value to be retrieved by the following function. It comes in Real and Integer flavors. The underlying value is always a Real.
- Custom Player Property reflects the built-in Player Property. It gets the value set by the Modify Custom Player Property function.
By default, we display 5 columns of resources at a time. This can be changed with the Set Custom Resource Columns action.
Supply information is not handled by the Custom Resource Manipulator, and so the position of the resources is not
directly affected by its visibility. Should you wish to hide supply info and want the resources to line up with the
far side of the screen, you can use the Set Supplies Visible For Custom Resources action to indicate whether
supplies are visible. By default this is set to True.
Finally, if for whatever reason you want to modify the label of the standard resources without worrying about it getting overwritten, you can use the Turn On/Off Standard Resource Updates action to disable automatic updates.