3 private const int EDITBOX_TEXT_SIZE = 16;
6 private ScrollWidget m_ContentScroll;
7 private MultilineEditBoxWidget m_Content;
8 private ButtonWidget m_OKButton;
10 void ScriptConsoleUniversalInfoDialog();
11 void ~ScriptConsoleUniversalInfoDialog();
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"));
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);