UI/API Patch Change Notes

Here you can find any notes I make available regarding upcoming changes to the WAR API and other UI-related changes. Most of these are based off of changes that appear on the PTS. Note that these are not full patch notes, but rather just things I've noted that are relevant to addon authors.

1.2.0 WAR API Changes

The changes listed in this post are being made to the WAR interface API as part of the 1.2.0 game patch. Read on for details of things that an addon author might want to know about.

Note: This list is not guaranteed nor necessarily expected to be comprehensive. I will add more and/or update as I am made aware of things.

The default UI module EA_BattlegroupWindow no longer exists in 1.2.0. It has been rolled into the EA_OpenPartyWindow module along with certain other group management functions (such as the party loot options previously contained in EA_GroupWindow). As a result, any addon which previously listed a dependency on EA_BattlegroupWindow will need to have that dependency removed or else they will fail to load.

The default UI module EA_OpenPartyWindow now manages open party discovery, party management, warband management, and looting options.

The PartyUtils Lua object has been introduced which consolidates all party/warband data into a single object. Dump the PartyUtils table for a full list of methods and properties (it's better to use the PartyUtils.Get____() functions rather than access the PartyUtils.m_______ properties directly - doing the latter may result in out-of-date information).

The button MainAssist window is now EA_AssistWindowMainAssist (inside the EA_AssistWindow container window).

TextLogs can now have certain filter types disregarded completely, at the base level, as opposed to just hiding them in a text display. Disregarded filter types will not even be recorded in the log for as long as they are disabled (and thus not affect log display line limits). TextLogSetFilterEnabled(logName, filterId, enabled) and TextLogGetFilterEnabled(logName, filterId) are the relevant functions.

The event ZONE_CONTROL_DETAIL_AMOUNTS_UPDATED will fire when the breakdown of the current zone's victory point type contribution is updated, at which point GetZoneControlDetailAmounts(realm) will return 5 values. The realm argument is one of the constant values defined in the GameData.Realm table, and the 5 arguments are the scenario, skirmish, objective, pve, and prior-zone contribution percentages, in that order. They are specified as percentages of their maximum contribution, so each argument will be 0 if none of that type of VP contribution is active, and up to 100 if the full amount of that type of VP contribution is active.

The function GetZoneTransitionPoints(mapDisplayName) can be used to get a table of items corresponding to transition points between the currently displayed zone on a mapdisplay and its neighbors. Each entry in the returned table will specify the neighbor's zone id as well as X and Y coordinates on the map for that transition point. This function's results are valid only after the new WORLD_MAP_POINTS_LOADED event has fired.

The flags field in any individual itemdata table has had the constants used as its indices increased by one. The table itself has not changed. These constants are the ones of the form GameData.Item.EITEMFLAG_XXXXXXXXX. The constants used to begin at 0 (and thus had to have 1 added to them when indexing the table); they now begin at 1 and thus can be used directly to index the flags table, without needing to +1 them first.

A pair of new functions TextEditBoxSetMaxChars(textBoxName, max) and the corresponding TextEditBoxGetMaxChars(textBoxName) have been added which allows you to dynamically adjust the maximum number of characters allowed in the box. Also, any items with a "maxchars" XML attribute will default to unlimited (instead of previously 255) if not explicitly specified.

The GetMapPointData(mapDisplay, pointId) function has been changed to return a table with much more specific information about a particular map point. The contents of this table may vary depending on the type of point (though the fields id, pointType, name, and specialType are all guaranteed to hold some sort of value for any point).

The GetZoneLargestHotspotSize(zone) function can now be used to query a zone for the largest battle hotspot marker size present in that zone. Possible result values are enumerated in the GameData.HotSpotSize table. The PAIRING_MAP_HOTSPOT_DATA_UPDATED event can be used to know when to check for new data.

1.2.1 WAR API Changes

The changes listed in this post are being made to the WAR interface API as part of the 1.2.1 game patch. Read on for details of things that an addon author might want to know about.

Note: This list is not guaranteed nor necessarily expected to be comprehensive. I will add more and/or update as I am made aware of things. Also note that some items may be subject to change from the PTR.

Windows should no longer lose their alpha settings upon being hidden and re-shown. In addition, the performance hit for rapidly hiding and re-showing windows should be reduced.

A new tag, VersionSettings, has been added to the .mod file options; it allows setting a number of parameters that provide info about the versions of various parts of the mod to the game. The syntax looks like this:

<VersionSettings gameVersion="1.2.1" windowsVersion="1.0" savedVariablesVersion="1.0" />

Each of the parameters serves a different purpose:

gameVersion is monitored by the client, and when a new WAR patch is released will automatically disable addons whose gameVersions do not match the new version (but will prompt the user with which mods were disabled and ask if they wish to re-enable them anyways).

windowsVersion defines the version of the saved window data for an addon; if it is set, window positions will no longer reset whenever the addon's main version is changed, but instead only when the windowsVersion value changes.

savedVariablesVersion defines the version of the saved Lua variable data for an addon; if it is set, the value of SVs will no longer reset whenever the addon's main version is changed, but instead only when the savedVariablesVersion changes.

WAR will now load the highest version of any addon it finds in the Interface\Addons directory tree, rather than just loading whatever copy it found first and ignoring any others. "Highest" is defined by a string comparison of the values for the main "version" fields in each copy's .mod file - "1.6" is higher than "1.5", but keep in mind that "Beta 1.2" is higher than "1.4" (because B is higher than 1 in string comparisons).

The Dependency tag now has two additional (and optional) parameters that can be specified:

<Dependency name="RandomModHere" optional="true" forceEnable="true" />
optional specifies whether the dependency must be present in order for this addon to load. If the specified mod isn't present, this dependency will be ignored; if it is present, it will be loaded before the current addon.

forceEnable specifies whether or not the dependency should be automatically enabled if it is found to exist in the Interface\Addons path - if this is true, even if the dependency was explicitly turned off, it will be enabled by the client automatically and loaded before the current addon. If it's false, then it will not be. Note: This defaults to true. For optional dependencies, you should probably set this explicitly to false.

A new UI profiles system has been implemented, which allows saving of multiple settings profiles per character. If a character does not have a profile, the user will be prompted to create one (and optionally import the settings from another profile). UI profiles can be switched between at any time, but require a UI reload to do so. Settings can be imported from one profile to another.

The SavedVariable tag now has an additional, optional attribute named "global". If set to true, this saved variable will be available to all characters and profiles. If it is false (the default), it will only be available to the current profile. Example syntax:

<SavedVariable name="MyTestAddon.Settings" global="true" />

The PartyUtils Lua object has been fixed to properly report entityIds (aka worldObjNum) and main assist flags immediately, as opposed to not updating until other events forced a refresh. Also, entity Ids should now update immediately when a warband member moves in/out of rendering range.

The variables GameData.Player.career.tier and GameData.Player.career.rank have been removed; use GameData.Player.career.level instead.

The table of constants SystemData.ChapterHubService has been renamed to SystemData.HubService (no more "Chapter"). All of the individual constant names within that table (like CAREER_TRAINER) are the same; only the table name has been changed.

The table of constants GameData.TargetObjectTypes no longer exists. It was redundant with the table SystemData.TargetObjectType, and the latter should be used in its place. The names of the constants vary slightly between the two tables, but all of the same constants are present. Here are the translations (it's pretty straightforward):

GameData.TargetObjectTypes. => SystemData.TargetObjectType.
TARGET_OBJECT_NONE => NONE
TARGET_OBJECT_SELF => SELF
TARGET_OBJECT_ALLY_PLAYER => ALLY_PLAYER
TARGET_OBJECT_ALLY_NON_PLAYER => ALLY_NON_PLAYER
TARGET_OBJECT_ENEMY_PLAYER => ENEMY_PLAYER
TARGET_OBJECT_ENEMY_NON_PLAYER => ENEMY_NON_PLAYER
TARGET_OBJECT_STATIC => STATIC
TARGET_OBJECT_STATIC_ATTACKABLE => STATIC_ATTACKABLE

The WindowResizeOnChildren() function will no longer include hidden child windows in its consideration of how to resize the parent, only visible ones.

DoesWindowExist() will now properly return false if a window is pending deletion due to having been DestroyWindow()'d but not yet fully removed if currently processing an event handler for that window.

TimeUtils.FormatSeconds and TimeUtils.FormatRoundedSeconds should now properly round their values instead of just flooring them - any fraction of a minute above 29 seconds will now be rounded up, 29 and below will be rounded down. Also, if the flag to return a string value is set (the default value for the flag is now true), the numeric values for minutes and seconds will no longer be returned, only the string. If the flag is false, then only the numeric values will be returned.

Added 4/16/2009:
GetMapPointTypeName() appears to have been removed. Not sure whether this is intentional or not, but it can be replaced with GetStringFromTable("MapPointTypes", mapPinType).

DialogManager.MakeTextEntryDialog() now takes 5 arguments - a wstring argument has been added after the 'title' argument to specify a line of text prompt that can be displayed. Order of arguments is now title, prompt, defaultvalue, okFunction, cancelFunction.

1.3.0 WAR API Changes

The changes listed in this post are being made to the WAR interface API as part of the 1.3.0 game patch. Read on for details of things that an addon author might want to know about.

Note: This list is not guaranteed nor necessarily expected to be comprehensive. I will add more and/or update as I am made aware of things. Also note that some items may be subject to change from the PTR.

The events used by the Scenario Queue window have been changed, because the available queues list is now automatically kept up-to-date:

  • INTERACT_SELECT_SCENARIO_QUEUE_LIST has been removed.
  • INTERACT_SHOW_SCENARIO_QUEUE_LIST has been added (and should be fired to show the window).
  • INTERACT_UPDATED_SCENARIO_QUEUE_LIST has been added (and is automatically fired by the game when the list of available scenarios is updated).

The potential data returned by GetMapPointData() has been expanded to include some new types of info:

  • In addition to existing PQ reward types, SystemData.PublicQuestTypes.TOKEN_REWARDS is now also a possible value.
  • The .realm property has been added to chapter hubs/warcamps to indicate the owner of that point. Its value will be either GameData.Realm.ORDER or GameData.Realm.DESTRUCTION if applicable.
  • Chapter hubs and warcamps can now potentially be factionless (not controlled by a specific race); so .faction may now be GameData.Factions.NONE for these points.
  • The .glyphAwarded property has been added for PQs that reward a Glyph (LotD). This property will be set to the name of the glyph awarded by the PQ, or nil if no glyph is awarded by the PQ.
  • The .glyphsRequired property has been added for landmarks that require glyphs for entry. If relevant, this property will be a table whose values are the names of the glyphs required; otherwise it will be nil.

With the addition of the new crafting/currency bags, new API functions have been added for those bags and existing functions have been modified to handle them:

  • SendGuildVaultCommand() and CreateAuction() now both take a second argument to specify which type of backpack should be acted upon.
  • SendMailboxCommand() now takes a second argument which is a table of backpack types to correspond with each item specified. If no items are specified in the command, pass {} instead.
  • The values EA_Window_Backpack.TYPE_CURRENCY and EA_Window_Backpack.TYPE_CRAFTING have been added (in addition to the existing EA_Window_Backpack.TYPE_QUEST and EA_Window_Backpack.TYPE_INVENTORY).
  • The functions GetCraftingItemData() and GetCurrencyItemData() have been added. They behave exactly like GetInventoryItemData(), except that they return tables for the Crafting or Currency backpacks, respectively. Both functions also have corresponding DataUtils functions: DataUtils.GetCraftingItems() and DataUtils.GetCurrencyItems(). Using the DataUtils very is more efficient for repeated access as it does not regenerate the table each time.
  • The function TransferBetweenBackpacks() has been added to move an item between one backpack and another.
  • The constant GameData.Player.numCraftingSlots has been added.
  • The constants GameData.ItemLocs.CRAFTING_ITEM and GameData.ItemLocs.CURRENCY_ITEM have been added.
  • The variable GameData.InteractStoreData.CurrentBackpackIndex has been added.
  • The events PLAYER_CRAFTING_SLOT_UPDATED and PLAYER_CURRENCY_SLOT_UPDATED have been added. They behave exactly like PLAYER_INVENTORY_SLOT_UPDATED, except for the crafting and currency backpacks respectively.

The function MapBeginAutoUpdating() now takes a third argument, a table of flags specifying which kinds of information on the map should be updated (flags are from the SystemData.AutoUpdateType.* set of constants).

The EA_CityInstanceSelectionWindow module has been removed, since city instances are no longer user-selectable. In addition, the following API elements have been modified due to this change:

  • The events CITY_CAPTURE_JOIN, CITY_CAPTURE_CLEAR_JUMP, CITY_CAPTURE_LEAVE, and CITY_SCENARIO_INSTANCE_LIST_UPDATED have been removed.
  • The function GameData.GetCityInstances() has been removed.
  • The events CITY_CAPTURE_LEAVE_QUEUE and CITY_CAPTURE_FLEE have been added.
  • The variable GameData.CityQueueData.selectedId has been removed. Instead, use the separate events specified above to specify between leaving the queue and fleeing.

QuestUtils.SetCompletionIcon() no longer takes a boolean value as its first parameter, but instead a questData table. Also, it will now change the slice for the DynamicImage instead of changing the texture.

The function GetGameTime() has been added. It returns the number of seconds elapsed since the game client initialized. This can be used to keep track of things such as talisman timers which are reported relative to the game time.

The attribute bonus system has been rewritten and new API support for it is now available:

  • GetBuffBonus() and GetItemSetData() have been removed.
  • GetBonus() has been added. It takes two parameters, the first is the id of the attribute you wish to query, and the second is the base value of the attribute. The return value is the total value of the attribute. (This change was made to allow for multiplicative bonuses, as opposed to just additive ones.)

GameData.Player.career.tier and GameData.Player.career.rank have been removed, as they are unnecessary due to GameData.Player.level which should be used instead.

Registering a Lua event handler for the TextLog-update event corresponding to the UiLog will no longer cause an infinite loop CTD when Function Logging is enabled.

Passing weird types (non-string/number) to error() should no longer cause a CTD.

To support the new opt-out feature for PQs, the following additions have been made:

  • The event PUBLIC_QUEST_OPTOUT has been added. It supplies two parameters to its handler - the first is the objective id whose opt-out status has been updated, and the second is a boolean value.
  • The function LootRollOptOut() has been added. It takes two arguments, the first being the id of the objective to change the opt-out state of, and the second being a boolean value.
  • The PQData object now has a .optedOut property, as does the table returned by GetPQTopContributors().

EASystem_ActionBarClusterManager has had support for new layout modes added (including the option for a 5th action bar). Specifically, LAYOUT_MODE_3_ACTION_BARS and LAYOUT_MODE_5_ACTION_BARS have been added.

Key bindings are now saved as part of a UI profile. As part of this, the event KEYBINDINGS_UPDATED has been added.

As part of the new Sigils system, the following additions have been made:

  • TargetInfo:UnitSigilEntryId() can be used to get info on which sigil (if any) a given hostile npc has. Will return 0 if the target is not related to any sigil.
  • The function TomeGetSigilDisplayInfo() has been added. It takes a sigil id and returns an info table for that sigil.
  • The constant GameData.Tome.SECTION_ARMORY_SIGILS has been added.

Related to map support for the Tomb Kings live expansion, the following additions have been made:

  • The GameData.ExpansionMapRegion.TOMB_KINGS constant has been added.
  • The function GetZoneRanksForCurrentRealm() has been added. It takes one parameter, the zone id.
  • The RRQProgressBar module has been added to support tracking of the Realm Resource Quests.
  • The GlyphDisplay module has been added to support tracking of Glyphs needed for entry into certain areas.
  • The function EA_Window_WorldMap.CreateAppropriateZoneTooltip() has been added.

The addons window now has enable all/disable all buttons available.

The function DataUtils.PlayerCanEventuallyUseItem() has been added.

1.3.1 WAR API Changes

The changes listed in this post are being made to the WAR interface API as part of the 1.3.1 game patch. Read on for details of things that an addon author might want to know about.

Note: This list is not guaranteed nor necessarily expected to be comprehensive. I will add more and/or update as I am made aware of things. Also note that some items may be subject to change from the PTR.

GameData.ItemSlots has changed to GameData.EquipSlots. For mods which deal with equipment, the former will need to be replaced with the latter.

The scenario API has undergone some changes in order to support the addition of a "wrap up" period at the end of scenarios before players are forced to leave the scenario instance.

  • The following events have been added:
    • SCENARIO_POST_MODE - broadcast by the game to inform the UI that the 2-minute wrap up period has begun.
    • SCENARIO_FINAL_SCOREBOARD_CLOSED - this event is broadcast by the UI to inform the game that the player is done viewing the scoreboard and should be zoned back into the game world.
  • The GetScenarioData() function has been removed. It was effectively redundant with GameData.GetScenarioPlayers() which should be used instead.
  • The variables GameData.ScenarioData.running and GameData.ScenarioData.hasEnded have been removed. The removed variables have been replaced with a single status variable, GameData.ScenarioData.mode - the value of which can be one of the following:
    • GameData.ScenarioMode.PRE_MODE - Scenario has not yet started (start timer counting down).
    • GameData.ScenarioMode.RUNNING - Scenario is currently in progress (game timer counting down).
    • GameData.ScenarioMode.POST_MODE - Scenario has finished but is in the new "wrap up" time (2 minute timer).
    • GameData.ScenarioMode.ENDED - The player is not in a scenario.

The functions MapGetCoordinatesForPoint() and MapGetPointForCoordinates have been altered as part of fixing them to return the proper values in certain zones (e.g. cities).

  • MapGetCoordinatesForPoint() now expects its input values to have already been scaled relative to the UI scale. This means that if before you were passing x,y to it, you should now divide both x and y by the value returned from InterfaceCore.GetResolutionScale() first.
  • MapGetPointForCoordinates() now returns its output values already scaled to match the current resolution. Thus if you were previously dividing the x,y output values by the resolution scaling factor, you no longer need to.

A new function ActionButtonGroupSetShowing(buttonGroup, buttonIndex, show) has been added. It allows individual buttons within an ActionButtonGroup to be shown/hidden at will.

Two new functions, TextEditBoxGetCursorPosition(name) and TextEditBoxSetCursorPosition(name, pos), have been added to allow the UI to determine and control the position of the cursor within an EditBox. The position is an integer value specifying how many characters come before the cursor (thus if the cursor as at the beginning of the box, the position is 0).

The GameData.Realms table of constants has been removed. It was redundant with the GameData.Realm table which should be used instead. Note that the keys to each table are slightly different - the removed table used GameData.Realms.REALM_ORDER while the remaining table uses GameData.Realm.ORDER, et cetera.

The savesettings parameter for windows which are anchored to Root now defaults to "false" - if you wish to have a window's position saved automatically by the game, you will need to explicitly set this option to "true".

Some new options have been added to the .mod format to provide expanded capabilities and to allow for increased the increased functionality of the overhauled Addons window in 1.3.1:

  • A new tag, <Replaces name="DefaultUIModuleName">, has been added. This tag allows you to specify that your mod is designed to replace an existing default UI module. If such a tag is encountered by the WAR addon loader, it will not load the default UI module specified, but instead trust that your addon implements all of the necessary functionality previously provided by the default module. When using this tag, the default UI module you specific is not loaded at all - you need to implement ALL of the functionality of the default module, or else you might cause other default/addon modules to break! For this reason, you probably shouldn't replace default modules that load things like fonts, since you won't be able to load those resources yourself!
  • A new container tag, <WARInfo> has been added. It contains two other types of tags to specify what categories and careers a mod is recommended for. An example WarInfo with all of the possible options is included below; you can copy-paste it into your .mod file and then simply remove the lines which do not apply. There is no limit on how many categories or careers you may specify for your mod, nor does it affect how your mod operates - these are merely for display purposes and easier management of addons by the player.
    <WARInfo>
        <Categories>
            <Category name="ACTION_BARS" />
            <Category name="ITEMS_INVENTORY" />
            <Category name="BUFFS_DEBUFFS" />
            <Category name="RVR" />
            <Category name="GROUPING" />
            <Category name="CAREER_SPECIFIC" />
            <Category name="MAIL" />
            <Category name="COMBAT" />
            <Category name="AUCTION" />
            <Category name="CHAT" />
            <Category name="QUESTS" />
            <Category name="MAP" />
            <Category name="CRAFTING" />
            <Category name="SYSTEM" />
            <Category name="DEVELOPMENT" />
            <Category name="OTHER" />
        </Categories>
        <Careers>
            <Career name="BLACKGUARD" />
            <Career name="WITCH_ELF" />
            <Career name="DISCIPLE" />
            <Career name="SORCERER" />
            <Career name="IRON_BREAKER" />
            <Career name="SLAYER" />
            <Career name="RUNE_PRIEST" />
            <Career name="ENGINEER" />
            <Career name="BLACK_ORC" />
            <Career name="CHOPPA" />
            <Career name="SHAMAN" />
            <Career name="SQUIG_HERDER" />
            <Career name="WITCH_HUNTER" />
            <Career name="KNIGHT" />
            <Career name="BRIGHT_WIZARD" />
            <Career name="WARRIOR_PRIEST" />
            <Career name="CHOSEN" />
            <Career name= "MARAUDER" />
            <Career name="ZEALOT" />
            <Career name="MAGUS" />
            <Career name="SWORDMASTER" />
            <Career name="SHADOW_WARRIOR" />
            <Career name="WHITE_LION" />
            <Career name="ARCHMAGE" />
        </Careers>
    </WARInfo>