MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Action

Method Action

ogsr_engine/xrGame/Inventory.cpp:580–629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580bool CInventory::Action(s32 cmd, u32 flags)
581{
582 if (m_iActiveSlot < m_slots.size() && m_slots[m_iActiveSlot].m_pIItem && m_slots[m_iActiveSlot].m_pIItem->Action(cmd, flags))
583 return true;
584
585 switch (cmd)
586 {
587 case kWPN_1:
588 case kWPN_2:
589 case kWPN_3:
590 case kWPN_4:
591 case kWPN_5:
592 case kWPN_6: {
593 if (flags & CMD_START)
594 {
595 if (GetActiveSlot() == cmd - kWPN_1 && ActiveItem())
596 Activate(NO_ACTIVE_SLOT);
597 else
598 Activate(cmd - kWPN_1, eKeyAction);
599 }
600 }
601 break;
602 case kACTIVE_JOBS:
603 case kMAP:
604 case kCONTACTS: {
605 if (flags & CMD_START)
606 {
607 auto Pda = m_pOwner->GetPDA();
608 if (!Pda || !Pda->Is3DPDA() || !psActorFlags.test(AF_3D_PDA))
609 break;
610
611 extern bool g_actor_allow_pda;
612
613 if (GetActiveSlot() == PDA_SLOT && ActiveItem())
614 Activate(NO_ACTIVE_SLOT);
615 else if (g_actor_allow_pda)
616 {
617 auto pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame());
618 if (pGameSP->InventoryMenu->IsShown())
619 break;
620 pGameSP->PdaMenu->SetActiveSubdialog(cmd == kACTIVE_JOBS ? eptQuests : (cmd == kMAP ? eptMap : eptContacts));
621 Activate(PDA_SLOT, eKeyAction);
622 }
623 }
624 }
625 break;
626 }
627
628 return false;
629}
630
631void CInventory::Update()
632{

Callers

nothing calls this directly

Calls 8

GetPDAMethod · 0.80
Is3DPDAMethod · 0.80
UIGameMethod · 0.80
GetUIMethod · 0.80
IsShownMethod · 0.80
SetActiveSubdialogMethod · 0.80
sizeMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected