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

◆ CalculateTooltipSlotPosition()

void ItemManager::CalculateTooltipSlotPosition ( int x = 0,
int y = 0 )
inlineprotected

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

601 {
602 int screen_w, screen_h;
603 float w, h;
604 GetScreenSize(screen_w, screen_h);
605 //m_TooltipSlotWidget.GetScreenSize(w,h);
606 m_TooltipSlotWidget.GetSize(w,h);
607 int slot_normal_w = SlotsIcon.GetNormalWidth();
608 int slot_normal_h = SlotsIcon.GetNormalHeight();
609 //minimal edge distance adjustments..
610 screen_w -= 10;
611 screen_h -= 10;
612
613#ifndef PLATFORM_CONSOLE
614 x += 5;
615 y += slot_normal_h + 5;
616#else
617 x += 5;
618 y += 15;
619#endif
620 Widget scrollerWidget = m_TooltipSourceWidget.GetParent();
621 while (scrollerWidget)
622 {
623 if (ScrollWidget.Cast(scrollerWidget))
624 {
625 break;
626 }
627 else
628 {
629 scrollerWidget = scrollerWidget.GetParent();
630 }
631 }
632
633 int rightEdge = x + w;
634 if (rightEdge > screen_w)
635 {
636 x = screen_w - w;
637 }
638
639 int bottomEdge = y + h;
640 if (scrollerWidget)
641 {
642 float scrollerX, scrollerY, scrollerSizeX, scrollerSizeY;
643 scrollerWidget.GetScreenPos(scrollerX,scrollerY);
644 scrollerWidget.GetScreenSize(scrollerSizeX,scrollerSizeY);
645
646 int scroller_bottom = scrollerY + scrollerSizeY;
647 if (bottomEdge > scroller_bottom)
648 {
649 y = scroller_bottom - slot_normal_h;
650 bottomEdge = y + h;
651 }
652 }
653 /*else
654 {
655 ErrorEx("No scroller widget! | m_TooltipSourceWidget: " + m_TooltipSourceWidget);
656 }*/
657
658 if (bottomEdge > screen_h) //should mostly never proc now
659 {
660 y = screen_h - h;
661 }
662
665 }
Icon x
Icon y
ref Widget m_TooltipSlotWidget
Определения ItemManager.c:10
Widget m_TooltipSourceWidget
Определения ItemManager.c:36
int m_TooltipPosX
Определения ItemManager.c:34
int m_TooltipPosY
Определения ItemManager.c:35
proto void GetScreenSize(out int x, out int y)
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки SlotsIcon::GetNormalHeight(), SlotsIcon::GetNormalWidth(), GetScreenSize(), m_TooltipPosX, m_TooltipPosY, m_TooltipSlotWidget, m_TooltipSourceWidget, x и y.

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