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

◆ PrimaryAction()

void UIScriptedMenu::PrimaryAction ( Widget w)
inlineprotected

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

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

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

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