Custom UI Manifest

From Valve Developer Community
Jump to: navigation, search

The root of any custom game Panorama UI is the Custom UI Manifest XML. This file describes to the game what additional XML files to load for your custom UI:

content/dota_addons/ADDON_NAME/panorama/layout/custom_game/custom_ui_manifest.xml

Example

Here is a simple UI manifest that swaps out the Dota topbar scoreboard for the Valve-authored multi-team version. Your manifest can contain any number of CustomUIElement entries, and refer to Valve-authored XMLs or your own custom XMLs.

Note:The use of a <script> section rather than referring to an external JS file via <scripts> is a matter of style. It's usually preferable to separate your XML and JS into separate files (separation of concerns, easier to manage changes, and you'll get better editor syntax highlighting), but in the specific case of the UI manifest file it's very convenient to centralize information about your configuration into a single file.
Note:Custom Loading Screens screens are treated differently.
<root>
	<script>
		// Disable built-in top scoreboard in favor of multiteam_top_scoreboard.xml
		GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_TIMEOFDAY, false );
		GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_HEROES, false );
		GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_FLYOUT_SCOREBOARD, false );
	</script>
		
	<Panel>
		<!-- Use the Valve-authored multi-team-compatible scoreboard, instead of the default Dota 2-team scoreboard. -->
		<CustomUIElement type="HudTopBar" layoutfile="file://{resources}/layout/custom_game/multiteam_top_scoreboard.xml" />
	</Panel>
</root>

CustomUIElement

This is a special panel type intended solely for use in the Custom UI Manifest file. It has two properties: 'type' and 'layoutfile' that are used to register additional XML files with the system to be loaded and displayed at the appropriate times.

You can register multiple elements with the same type - they will layer on top of each other in the order listed in the manifest file.


Property Description
type The type of UI that the layoutfile describes (See "Custom UI Element Type" table below)
layoutfile An XML filename that will be loaded and displayed along with any other UI of the same type.


Custom UI Element Type Description Default UI
Hud Game HUD - visible after hero selection. (None)
HeroSelection Hero selection - visible after game setup, before the game starts (or if the player hasn't selected a hero yet.) (None)
GameInfo Special panel used to display quick info about your custom game. Accessible via the "i" info tab starting at Game Setup, throughout the game. (None)
GameSetup UI for setting up your custom game (team select, voting, etc.) See: Dota_2_Workshop_Tools/Custom_Game_Setup layout/custom_game/team_select.xml
FlyoutScoreboard Scoreboard visible when a player uses the '+showscores' command or the 'scoreboard' menu button. (None)
HudTopBar Similar to HUD, but visible during the endgame state as well. (None)
EndScreen Displayed after a game has finished. (None)

Disabling Dota Default UI

Example:

// Use GameUI.SetDefaultUIEnabled to suppress default UI (may behave unexpectedly if you try to dynamically toggle UI)
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_TIMEOFDAY, false );
Default UI Element Description
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_TIMEOFDAY Time of day (clock).
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_HEROES Heroes and team score at the top of the HUD.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_FLYOUT_SCOREBOARD Lefthand flyout scoreboard.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ACTION_PANEL Hero actions UI.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ACTION_MINIMAP Minimap.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_PANEL Entire Inventory UI
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_SHOP Shop portion of the Inventory.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_ITEMS Player items.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_QUICKBUY Quickbuy.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_COURIER Courier controls.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_PROTECT Glyph.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_GOLD Gold display.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_SHOP_SUGGESTEDITEMS Suggested items shop panel.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_TEAMS Hero selection Radiant and Dire player lists.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_GAME_NAME Hero selection game mode name display.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_CLOCK Hero selection clock.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_MENU_BUTTONS Top-left menu buttons in the HUD.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ENDGAME Endgame scoreboard.