3 void ScriptConsoleAddLocation()
8 void ~ScriptConsoleAddLocation()
14 m_EditboxPos.SetText(pos.ToString());
20 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console_add_location_dialogue.layout");
21 m_EditboxName =
EditBoxWidget.Cast( layoutRoot.FindAnyWidget(
"LocationName") );
22 m_EditboxPos =
EditBoxWidget.Cast( layoutRoot.FindAnyWidget(
"Position") );
23 m_Label =
TextWidget.Cast( layoutRoot.FindAnyWidget(
"WindowLabel") );
24 m_ClearButton = ButtonWidget.Cast( layoutRoot.FindAnyWidget(
"ButtonClear") );
25 m_Label.SetText(
"ADD NEW LOCATION");
32 super.OnClick(w,
x,
y, button);
34 if (w.GetUserID() ==
IDC_OK)
36 string name = m_EditboxName.GetText();
41 if (!tab.IsLocationNameAvailable(
name) ||
name ==
"" || m_EditboxPos.GetText() ==
"")
45 tab.RefreshLocations();
54 else if (w == m_ClearButton)
56 m_EditboxPos.SetText(
"");
67 ButtonWidget m_ClearButton;