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

◆ DisplayHint()

void UIScriptedMenu::DisplayHint ( string message)
inlineprotected

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

453 {
454 if (message)
455 {
456 m_HintWidgetRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/script_console/script_console_hint.layout");
457 m_HintWidgetBackground = ImageWidget.Cast(m_HintWidgetRoot.FindAnyWidget("Background"));
458 m_HintWidget = RichTextWidget.Cast(m_HintWidgetRoot.FindAnyWidget("HintText"));
459
460 m_HintWidgetRoot.Show(true);
461 m_HintWidget.SetText(message);
462
463 int offsetX = 0;
464 int offsetY = 10;
465
466 int screenW, screenH;
467 GetScreenSize(screenW, screenH);
468
469 int mouseX, mouseY;
470 GetMousePos(mouseX,mouseY);
471
472 float relativeX = mouseX / screenW;
473 float relativeY = mouseY / screenH;
474
475 int width, height;
476 m_HintWidget.GetTextSize(width, height);
477 if (relativeX > 0.8)
478 offsetX = -width - offsetX;
479 if (relativeY > 0.8)
480 offsetY = -height - offsetY;
481
482 m_HintWidgetRoot.SetPos(mouseX + offsetX ,mouseY + offsetY);
483 m_HintWidgetBackground.SetScreenSize(width + 5, height + 5);
484
485 }
486 }
DayZGame g_Game
Определения DayZGame.c:3942
RichTextWidget m_HintWidget
Определения ScriptConsole.c:10
Widget m_HintWidgetRoot
Определения ScriptConsole.c:7
ImageWidget m_HintWidgetBackground
Определения ScriptConsole.c:8
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().