DIFF

class UIManagerSource

Methods 36

proto native UIScriptedMenu CreateScriptedMenu(int id, UIMenuPanel parent)
proto native void EnterServerBrowser(UIMenuPanel parentMenu)
proto native void HideScriptedMenu(UIScriptedMenu menu)
proto native Widget GetWidgetUnderCursor()
proto native bool IsDialogHiding()

Returns true for a single frame whenever a dialog is hidden.

proto native bool IsModalVisible()
proto native void HideDialog()
proto native void ShowDialog(string caption, string text, int id, int butts, int def, int type, UIScriptedMenu handler)

Shows message dialog

caption
text
id
custom user id
butts
\ref DialogBoxType
def
\ref DialogBoxButton
type
\ref DialogMessageType
handler

usage :
const int QUIT_DIALOG_ID = 76;
g_Game.GetUIManager().ShowDialog("Quit", "Do You really want to quit?", QUIT_DIALOG_ID, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
...
// after user pass dialog, callback on menu/event handler is called
ScriptedWidgetEventHandler::OnModalResult( Widget  w,	int  x,	int  y,	int  code,	int  result	)
{
	if (code == QUIT_DIALOG_ID && result == DBB_YES) // yes this is callback for dialog we show earlier and user press YES button
	{
		Quit();
	}
}
proto native bool ShowCursor(bool visible)

natively checks game focus on cursor hiding

proto native bool IsCursorVisible()
proto native bool IsDialogQueued()
proto native bool ShowQueuedDialog()
proto native int GetLoginQueuePosition()
proto native bool ScreenFadeVisible()
proto native void ScreenFadeIn(float duration, string text, int backgroundColor, int textColor)
proto native bool IsScaledMode()
proto native void SetScaledMode(bool enabled)
proto native UIScriptedMenu GetMenu()

Returns most-top open menu

bool CloseAllSubmenus()

Close all opened menus except first menu

bool CloseMenu(int id)

Close menu with specific ID (see \ref MenuID)

UIScriptedMenu FindMenu(int id)

Returns menu with specific ID if it is open (see \ref MenuID)

void DeleteWindow(UIScriptedWindow window)
bool IsWindowOpened(int id)