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

◆ DisplayHint()

void DisplayHint ( string message)
protected

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

652 {
653 if (message)
654 {
655 m_HintWidgetRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/script_console/script_console_hint.layout");
656 m_HintWidgetBackground = ImageWidget.Cast(m_HintWidgetRoot.FindAnyWidget("Background"));
657 m_HintWidget = RichTextWidget.Cast(m_HintWidgetRoot.FindAnyWidget("HintText"));
658
659 m_HintWidgetRoot.Show(true);
660 m_HintWidget.SetText(message);
661
662 int offsetX = 0;
663 int offsetY = 10;
664
665 int screenW, screenH;
666 GetScreenSize(screenW, screenH);
667
668 int mouseX, mouseY;
669 GetMousePos(mouseX,mouseY);
670
671 float relativeX = mouseX / screenW;
672 float relativeY = mouseY / screenH;
673
674 int width, height;
675 m_HintWidget.GetTextSize(width, height);
676 if (relativeX > 0.8)
677 offsetX = -width - offsetX;
678 if (relativeY > 0.8)
679 offsetY = -height - offsetY;
680
681 m_HintWidgetRoot.SetPos(mouseX + offsetX ,mouseY + offsetY);
682 m_HintWidgetBackground.SetScreenSize(width + 5, height + 5);
683
684 }
685 }
ImageWidget m_HintWidgetBackground
Определения ScriptConsole.c:609
RichTextWidget m_HintWidget
Определения ScriptConsole.c:610
Widget m_HintWidgetRoot
Определения ScriptConsole.c:608
proto native WorkspaceWidget GetWorkspace()
Определения gameplay.c:317
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().