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

◆ PrimaryAction()

void UIScriptedMenu::PrimaryAction ( Widget w)
inlineprotected

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

654 {
655 if ( instance.m_SelectedItem )
656 {
657 if ( !GetGame().IsDedicatedServer() )
658 {
659 RadialQuickbarItem quickbar_item;
660 instance.m_SelectedItem.GetUserData( quickbar_item );
661
662 if ( quickbar_item )
663 {
664 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
665
666 //ASSIGN ACTION
667 if ( GetItemToAssign() )
668 {
669 //assign item to slot
670 if ( quickbar_item.GetItem() == GetItemToAssign() )
671 {
672 player.RemoveQuickBarEntityShortcut( GetItemToAssign() );
673 }
674 else
675 {
676 player.SetQuickBarEntityShortcut( GetItemToAssign(), quickbar_item.GetId() );
677 }
678 }
679 //LIGHTS
680 else if (m_CurrentCategory == RadialQuickbarCategory.SPECIALIZED_LIGHTS && quickbar_item.IsLightSourceExtra())
681 {
682 HandleLights(quickbar_item);
683 }
684 //NVG
685 else if (m_CurrentCategory == RadialQuickbarCategory.SPECIALIZED_LIGHTS && quickbar_item.IsNVGExtra())
686 {
687 HandleNVG(quickbar_item);
688 }
689 //change quickbar category
690 else if (quickbar_item.GetCategorySwitchID() != -1)
691 {
692 ChangeCurrentCategory(quickbar_item.GetCategorySwitchID());
693 return;
694 }
695 //SWAP
696 else
697 {
698 EntityAI item = quickbar_item.GetItem();
699
700 if ( item )
701 {
702 //swap
703 player.RadialQuickBarSingleUse( quickbar_item.GetId() + 1 ); //id must begin with 1 (simulating key press 1-9)
704 }
705 }
706
707 RefreshQuickbar( false );
708 }
709 }
710 }
711 }
class LogManager EntityAI
void RefreshQuickbar()
Определения InventoryMenu.c:75
PlayerBase GetPlayer()
Определения ModifierBase.c:51
RadialQuickbarCategory
Определения RadialQuickbarMenu.c:2
void RadialQuickbarItem(int id, EntityAI item, string item_name, int category=RadialQuickbarCategory.DEFAULT, int category_switch=-1)
Определения RadialQuickbarMenu.c:21
int m_CurrentCategory
Определения GesturesMenu.c:123
void HandleLights(RadialQuickbarItem quickbar_item)
Определения RadialQuickbarMenu.c:749
static GesturesMenu instance
Определения GesturesMenu.c:126
void HandleNVG(RadialQuickbarItem quickbar_item)
Определения RadialQuickbarMenu.c:782
static EntityAI GetItemToAssign()
Определения RadialQuickbarMenu.c:135
void ChangeCurrentCategory(int category)
Определения RadialQuickbarMenu.c:519
proto native CGame GetGame()

Перекрестные ссылки ChangeCurrentCategory(), GetGame(), GetItemToAssign(), GetPlayer(), HandleLights(), HandleNVG(), instance, m_CurrentCategory, RadialQuickbarItem() и RefreshQuickbar().

Используется в OnControllerPressSelect() и OnMousePressLeft().