This article relates to the game "Dota 2". Click here for more information.
This article relates to the SDK/Workshop Tools for "Dota 2 Workshop Tools". Click here for more information.
This article's documentation is for Source 2. Click here for more information.

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.pngNote:In recent updates, the use of a <script> tag within custom_ui_manifest.xml file is no longer allowed. Developers should implement additional logics (such as disabling default UIs) in separate files and include them here like the below example
Note.pngNote:Custom Loading Screens screens are treated differently.

custom_ui_manifest.xml

<root>
	<scripts>
        	<include src="file://{resources}/scripts/custom_game/main.js" />
	</scripts>
		
	<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>

content/dota_addons/ADDON_NAME/panorama/scripts/custom_game/main.js

// 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 );

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 );
Todo: Fill out descriptions for the below default UI elements.
Default UI Element Description
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ACTION_MINIMAP Minimap.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ACTION_PANEL Hero actions UI.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_AGHANIMS_STATUS
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_CUSTOMUI_BEHIND_HUD_ELEMENTS
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ELEMENT_COUNT
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ENDGAME Endgame scoreboard.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ENDGAME_CHAT
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_FIGHT_RECAP
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_FLYOUT_SCOREBOARD Lefthand flyout scoreboard.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_CLOCK Hero selection clock.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_GAME_NAME Hero selection game mode name display.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_HEADER
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_TEAMS Hero selection Radiant and Dire player lists.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVALID
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_COURIER Courier controls.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_GOLD Gold display.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_ITEMS Player items.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_PANEL Entire Inventory UI.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_PROTECT Glyph.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_QUICKBUY Quickbuy.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_SHOP Shop portion of the Inventory.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_KILLCAM
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_PREGAME_STRATEGYUI
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_QUICK_STATS The K/D/A and LH/DN stats on the top left.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_SHOP_COMMONITEMS
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_SHOP_SUGGESTEDITEMS Suggested items shop panel.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_BAR
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_BAR_BACKGROUND
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_BAR_DIRE_TEAM
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_BAR_RADIANT_TEAM
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_BAR_SCORE
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_HEROES Heroes and team score at the top of the HUD.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_MENU_BUTTONS Top-left menu buttons in the HUD.
DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_TIMEOFDAY Time of day (clock).