Skip to content

JavaScript API reference

RainbowMage edited this page Mar 26, 2015 · 5 revisions

Functions

OverlayPluginApi.sendMessage(target, message) function

Sends the message to the specified overlay.

You can receive the message by subscribing onMessageReceive event.

  • Parameters
    • target (string): Name of the overlay which receive the message.
    • message (string): Message to send.
  • Returns
    • Nothing.

OverlayPluginApi.broadcastMessage(message) function

Sends the message to entire overlays (including sender itself).

You can receive the message by subscribing onMessageReceive event.

  • Parameters
    • message (string): Message to send.
  • Returns
    • Nothing.

Events

onOverlayDataUpdate event

This event occurs when the OverlayPlugin sends the new data.

You can get updated value with detail property of event argument.

You can subscribe this event (and also other events) like below:

// Subscribe onOverlayDataUpdate event 
document.addEventListener("onOverlayDataUpdate", function (eventArg) {
    console.log("data updated");
});

Mini-parse overlay

  • Encounter (hashtable): Hash table contains encounter information.
    • Keys (string): ACT tags.
    • Values (string): Value of the tag.
  • Combatant (hashtable): Hash table contains combatant information.
    • Keys (string): Character names marked as ally.
    • Values (hashtable): Hash table contains combat informatin of the character.
      • Keys (string): ACT tags.
      • Values (string): Value of the tag.
  • isActive (boolean)
    • The boolean value whether the player is combatting or not.

Spell timer overlay

  • timerFrames (array): The array contains timer properties objects.
    • name (string): Name of the spell timer.
    • key (string): Group name and spell timer name formatted as group-name|spelltimer-name.
    • color (number): 32-bit color value (0xAARRGGBB).
    • startCount (number): Starting count.
    • warningCount (number): Warning count.
    • expireCount (number): Expiration count.
    • tooltip (string): Tooltip string.
    • spellTimers (array): Array of the objects which contain working timer property.
      • startTime (number): Started time of the timer in POSIX time.

onOverlayStateUpdate event

This event occurs when the overlay setting has changed.

detail property of the event argument have values listed below:

  • isLocked (boolean)
    • The boolean value whether the overlay is locked or not.

onMessageReceive event

This event occurs when the overlay received the message from overlay using OverlayPluginApi.sendMessage function or OverlayPluginApi.broadcastMessage function.

detail property of the event argument have values listed below:

  • message (string)
    • Received message.