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

◆ DisplayHint()

void ScriptConsoleToolTipEventHandler::DisplayHint ( string message)
inlineprotected

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

965 {
966 if (message)
967 {
968 m_HintWidgetRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/script_console/script_console_hint.layout");
969 m_HintWidgetBackground = ImageWidget.Cast(m_HintWidgetRoot.FindAnyWidget("Background"));
970 m_HintWidget = RichTextWidget.Cast(m_HintWidgetRoot.FindAnyWidget("HintText"));
971
972 m_HintWidgetRoot.Show(true);
973 m_HintWidget.SetText(message);
974
975 int offsetX = 0;
976 int offsetY = 10;
977
978 int screenW, screenH;
979 GetScreenSize(screenW, screenH);
980
981 int mouseX, mouseY;
982 GetMousePos(mouseX,mouseY);
983
984 float relativeX = mouseX / screenW;
985 float relativeY = mouseY / screenH;
986
987 int width, height;
988 m_HintWidget.GetTextSize(width, height);
989 if (relativeX > 0.8)
990 offsetX = -width - offsetX;
991 if (relativeY > 0.8)
992 offsetY = -height - offsetY;
993
994 m_HintWidgetRoot.SetPos(mouseX + offsetX ,mouseY + offsetY);
995 m_HintWidgetBackground.SetScreenSize(width + 5, height + 5);
996
997 }
998 }
DayZGame g_Game
Определения DayZGame.c:4074
Widget m_HintWidgetRoot
Определения ScriptConsole.c:921
ImageWidget m_HintWidgetBackground
Определения ScriptConsole.c:922
RichTextWidget m_HintWidget
Определения ScriptConsole.c:923
proto void GetScreenSize(out int x, out int y)
proto void GetMousePos(out int x, out int y)

Перекрестные ссылки g_Game, GetMousePos(), GetScreenSize(), m_HintWidget, m_HintWidgetBackground и m_HintWidgetRoot.

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