3 private const int EDITBOX_TEXT_SIZE = 16;
5 private TextWidget m_Label;
6 private ScrollWidget m_ContentScroll;
8 private ButtonWidget m_OKButton;
10 void ScriptConsoleUniversalInfoDialog();
11 void ~ScriptConsoleUniversalInfoDialog();
13 override Widget
Init()
15 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console_universal_info_dialog.layout");
16 m_Label = TextWidget.Cast(layoutRoot.FindAnyWidget(
"Label"));
17 m_ContentScroll = ScrollWidget.Cast(layoutRoot.FindAnyWidget(
"ContentScroll"));
18 m_ContentScroll.VScrollToPos(0);
19 m_Content = MultilineEditBoxWidget.Cast(layoutRoot.FindAnyWidget(
"Content"));
20 m_OKButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"MessageText"));
25 override bool OnClick(Widget w,
int x,
int y,
int button)
27 super.OnClick(w,
x,
y, button);
29 if (w.GetUserID() ==
IDC_OK)
32 if (consoleMenu != null)
34 ScriptConsole scriptedConsole = ScriptConsole.Cast(consoleMenu);
47 void SetLabel(
string label)
49 m_Label.SetText(label);
52 void SetContent(
string content)
54 m_Content.SetText(content);
56 float contentSizeX, contentSizeY = 0;
57 m_Content.GetSize(contentSizeX, contentSizeY);
58 m_Content.SetSize(contentSizeX, EDITBOX_TEXT_SIZE * m_Content.GetLinesCount());
59 float y_c = m_ContentScroll.GetContentHeight();
61 m_Content.GetScreenSize(
x,
y);
64 m_ContentScroll.SetAlpha(1);
proto native CGame GetGame()