Camelot Unchained Wiki
Register
Advertisement


cuAPI is the interface between a user interface widget and the client. The interface is divided into various sections, most of which are only included if a corresponding flag is included in the widget's .ui file.

General[ | ]

This section covers all the standard cuAPI methods and properties that are included regardless of any "handles...." flags in the .ui file.

Events[ | ]

Events allow inter-UI communication. An event fired in one UI can be listened for and received in another UI. It follows the pub/sub pattern though with a slightly quirky [due to technical limitations] interface. For an example of a more traditional pub/sub interface wrapper to these events see here.

cuAPI.listen(topic)
Tells the client to send events for the specified topic. Topic should match the name of an event fired by this or other UIs.
cuAPI.OnEvent(handler)
Callback from the client when a previously listened for topic is seen. The handler receives the topic and an object with the payload (arguments) of the event.
cuAPI.Ignore(topic)
Stop listening for events for topic.
cuAPI.Fire(topic, args)
Fire an event with a payload / arguments.

Abilities[ | ]

"handlesAbilities": true

Methods for handling abilities.

Announcements[ | ]

"handlesAnnouncements": true

Methods for handling announcements.

BeginChat[ | ]

"handlesBeginChat": true

This UI handles the cuAPI.OnBeginChat() callback. Only one UI can handle begin chat at a time, as it links the pressing ENTER in the client to the UI that will handle the chat.

Building[ | ]

"handlesBuilding": true

Methods for handling building.

Character[ | ]

"handlesCharacter": true

Methods for handling character (player).

Chat[ | ]

"handlesChat": true

Methods for handling chat.

Config[ | ]

"handlesConfig": true

Methods for handling config.

Console[ | ]

"handlesConsole": true

Methods for handling console commands.

EnemyTarget[ | ]

"handlesEnemyTarget": true

Methods for handling the enemy target.

EquippedGear[ | ]

"handlesEquippedGear": true

Methods for handling equipped gear.

FriendlyTarget[ | ]

"handlesFriendlyTarget": true

Methods for handling the friendly target.

Input[ | ]

"handlesInput": true

This flag tells the client that input events (keyboard and mouse) should be sent to this UI. If a UI does not need to handle input, it should not set this flag in order to maximize performance.

Inventory[ | ]

"handlesInventory": true

Methods for handling the inventory.

Login[ | ]

"handlesInventory": true

Methods for handling the login process.

Advertisement