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.
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.
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.
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:
The potential data returned by GetMapPointData() has been expanded to include some new types of info:
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:
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:
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:
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:
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:
Related to map support for the Tomb Kings live expansion, the following additions have been made:
The addons window now has enable all/disable all buttons available.
The function DataUtils.PlayerCanEventuallyUseItem() has been added.
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 functions MapGetCoordinatesForPoint() and MapGetPointForCoordinates have been altered as part of fixing them to return the proper values in certain zones (e.g. cities).
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:
<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>