DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ DisplayHint()

void UIScriptedMenu::DisplayHint ( string message)
inlineprotected

См. определение в файле ScriptConsole.c строка 443

444 {
445 if (message)
446 {
447 m_HintWidgetRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/script_console/script_console_hint.layout");
448 m_HintWidgetBackground = ImageWidget.Cast(m_HintWidgetRoot.FindAnyWidget("Background"));
449 m_HintWidget = RichTextWidget.Cast(m_HintWidgetRoot.FindAnyWidget("HintText"));
450
451 m_HintWidgetRoot.Show(true);
452 m_HintWidget.SetText(message);
453
454 int offsetX = 0;
455 int offsetY = 10;
456
457 int screenW, screenH;
458 GetScreenSize(screenW, screenH);
459
460 int mouseX, mouseY;
461 GetMousePos(mouseX,mouseY);
462
463 float relativeX = mouseX / screenW;
464 float relativeY = mouseY / screenH;
465
466 int width, height;
467 m_HintWidget.GetTextSize(width, height);
468 if (relativeX > 0.8)
469 offsetX = -width - offsetX;
470 if (relativeY > 0.8)
471 offsetY = -height - offsetY;
472
473 m_HintWidgetRoot.SetPos(mouseX + offsetX ,mouseY + offsetY);
474 m_HintWidgetBackground.SetScreenSize(width + 5, height + 5);
475
476 }
477 }
proto native WorkspaceWidget GetWorkspace()
RichTextWidget m_HintWidget
Определения ScriptConsole.c:10
Widget m_HintWidgetRoot
Определения ScriptConsole.c:7
ImageWidget m_HintWidgetBackground
Определения ScriptConsole.c:8
proto native CGame GetGame()
proto void GetScreenSize(out int x, out int y)
proto void GetMousePos(out int x, out int y)
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.

Перекрестные ссылки WorkspaceWidget::CreateWidgets(), GetGame(), GetMousePos(), GetScreenSize(), CGame::GetWorkspace(), m_HintWidget, m_HintWidgetBackground и m_HintWidgetRoot.

Используется в HoverSuccess().