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
VerbCoin.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");
// select the inventory GUI and action label
VerbCoin.InventoryGui = gInventory;
VerbCoin.ActionLabel = lblAction;
// disable buttons where click events would be unhandled
VerbCoin.ButtonAutoDisable = true;VerbCoin.Radius
int VerbCoin.RadiusSets the radius used when drawing the circle that renders the VerbCoin.
VerbCoin.BackgroundTransparency
int VerbCoin.BackgroundTransparencySets the background transparency level (from 0 to 100) for the VerbCoin
VerbCoin.BackgroundColor
int VerbCoin.BackgroundColorSets the background color (0 to 65535) for the VerbCoin.
VerbCoin.BorderColor
int VerbCoin.BorderColorSets the border color (0 to 65535) for the VerbCoin
VerbCoin.BorderWidth
int VerbCoin.BorderWidth;Sets the border width for the VerbCoin.
VerbCoin.OnClick
VerbCoin.OnClick(GUIControl* control, MouseButton button);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.InterfaceGuiRegisters the GUI used for the VerbCoin.
VerbCoin.InventoryGui
GUI* VerbCoin.InventoryGuiRegisters the GUI used for the inventory window.
VerbCoin.ActionLabel
Label* VerbCoin.ActionLabelRegisters the Label used to display text descriptions.
VerbCoin.Enable
VerbCoin.Enable();Enables the VerbCoin interface.
VerbCoin.Disable
VerbCoin.Disable();Disables the VerbCoin interface.
VerbCoin.IsEnabled
VerbCoin.IsEnabled();Returns true if the VerbCoin interface is currently enabled, else returns false.
VerbCoin.Open
VerbCoin.Open();Opens the VerbCoin interface (i.e. show its GUI).
VerbCoin.Close
VerbCoin.Close();Closes the VerbCoin interface (i.e. hide its GUI)
VerbCoin.IsOpen
VerbCoin.IsOpen();Returns true if the VerbCoin interface is currently open, else returns false.
VerbCoin.CleanUp
VerbCoin.CleanUp();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.