VerbCoin template
This template is a replacement for the previous VerbCoin template, with the aim of dropping legacy features and offering a simpler base to build upon.
The main changes are:
- There is no built-in mechanism for using timed clicks, so no press and hold of a mouse button is required anywhere
- Inventory is still right-click to open, but now BASS style controls are used within the inventory window
- No additional VerbCoin interfaces will be opened over the top of inventory items
- Rather than customize the action description per object/hotspot/character and allow actions to change based on context, the emphasis is on fixed actions with fallback to defaults (using
unhandled_event
)
As a general guide, left click on things to open the Verbcoin, right click to open the inventory window.
The script module functions are mostly to register the interface components used for displaying the VerbCoin and managing the inventory window.
Example:
// setup VerbCoin GUI and buttons
.InterfaceGui = gVerbCoin;
VerbCoin.RegisterButton(btnLook, eVerbCoinPositionNorth, eModeLookat, "Look at");
VerbCoin.RegisterButton(btnTalk, eVerbCoinPositionEast, eModeTalkto, "Talk to");
VerbCoin.RegisterButton(btnInteract, eVerbCoinPositionSouth, eModeInteract, "Use");
VerbCoin.RegisterButton(btnPickup, eVerbCoinPositionWest, eModePickup, "Pick up");
VerbCoin
// select the inventory GUI and action label
.InventoryGui = gInventory;
VerbCoin.ActionLabel = lblAction;
VerbCoin
// disable buttons where click events would be unhandled
.ButtonAutoDisable = true; VerbCoin
VerbCoin.Radius
int VerbCoin.Radius
Sets the radius used when drawing the circle that renders the VerbCoin.
VerbCoin.BackgroundTransparency
int VerbCoin.BackgroundTransparency
Sets the background transparency level (from 0 to 100) for the VerbCoin
VerbCoin.BackgroundColor
int VerbCoin.BackgroundColor
Sets the background color (0 to 65535) for the VerbCoin.
VerbCoin.BorderColor
int VerbCoin.BorderColor
Sets the border color (0 to 65535) for the VerbCoin
VerbCoin.BorderWidth
int VerbCoin.BorderWidth;
Sets the border width for the VerbCoin.
VerbCoin.OnClick
.OnClick(GUIControl* control, MouseButton button); VerbCoin
Since click handlers can currently only be implemented in the global script, this function is used to pass the event back into the VerbCoin module.
VerbCoin.InterfaceGui
GUI* VerbCoin.InterfaceGui
Registers the GUI
used for the VerbCoin.
VerbCoin.InventoryGui
GUI* VerbCoin.InventoryGui
Registers the GUI
used for the inventory window.
VerbCoin.ActionLabel
Label* VerbCoin.ActionLabel
Registers the Label
used to display text descriptions.
VerbCoin.Enable
.Enable(); VerbCoin
Enables the VerbCoin interface.
VerbCoin.Disable
.Disable(); VerbCoin
Disables the VerbCoin interface.
VerbCoin.IsEnabled
.IsEnabled(); VerbCoin
Returns true if the VerbCoin interface is currently enabled, else returns false.
VerbCoin.Open
.Open(); VerbCoin
Opens the VerbCoin interface (i.e. show its GUI).
VerbCoin.Close
.Close(); VerbCoin
Closes the VerbCoin interface (i.e. hide its GUI)
VerbCoin.IsOpen
.IsOpen(); VerbCoin
Returns true if the VerbCoin interface is currently open, else returns false.
VerbCoin.CleanUp
.CleanUp(); VerbCoin
Deletes the dynamic sprite which is used in rendering the VerbCoin user interface. This would typically only be done immediately before exiting the game, in-order to suppress warnings about dynamic sprites still being allocated.