Ejemplo n.º 1
0
        public void CheckInventoryHUDNecessity(CheckInventoryHUDNecessityEvent e, HUDNodes.SelfBattleUserAsTankNode selfUser, [JoinByUser, Combine] SlotNode slot, [JoinByModule] ModuleNode module)
        {
            IList <ModuleUsesCounterNode> source = base.Select <ModuleUsesCounterNode>(module.Entity, typeof(ModuleGroupComponent));
            bool flag = (source.Count == 0) || ((source.Count > 0) && (source.First <ModuleUsesCounterNode>().userItemCounter.Count > 0L));

            e.Necessity = e.Necessity || flag;
        }
 public void TryActivate(UpdateEvent e, HUDNodes.SelfBattleUserAsTankNode self, [JoinByUser, Combine] HUDNodes.Modules.SlotWithModuleNode slot, [JoinByModule] SingleNode <ItemButtonComponent> hud, [JoinByModule] NotAutostartModuleNode module)
 {
     if (slot.Entity.HasComponent <InventoryEnabledStateComponent>())
     {
         if (slot.Entity.HasComponent <InventorySlotTemporaryBlockedComponent>())
         {
             foreach (KeyValuePair <string, Slot> pair in this.actionToSlotMap)
             {
                 if (InputManager.GetActionKeyDown(pair.Key) && (slot.slotUserItemInfo.Slot == ((Slot)pair.Value)))
                 {
                     hud.component.PressedWhenDisable();
                 }
             }
         }
         else
         {
             foreach (KeyValuePair <string, Slot> pair2 in this.actionToSlotMap)
             {
                 if (InputManager.GetActionKeyDown(pair2.Key) && (slot.slotUserItemInfo.Slot == ((Slot)pair2.Value)))
                 {
                     hud.component.Activate();
                     base.ScheduleEvent <ActivateModuleEvent>(slot);
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 public void InitSlots(InitSlotsEvent e, HUDNodes.SelfBattleUserAsTankNode selfUser, [JoinByUser, Combine] SlotNode slot, [JoinByModule] ModuleNode module, [JoinByModule] ICollection <ModuleHUDNode> moduleHuds, [JoinAll] SingleNode <InventoryHUDComponent> inventory)
 {
     if (moduleHuds.Count <= 0)
     {
         EntityBehaviour behaviour = inventory.component.CreateModule(slot.slotUserItemInfo.Slot);
         module.moduleGroup.Attach(behaviour.Entity);
         if (module.Entity.HasComponent <GoldBonusModuleItemComponent>())
         {
             inventory.component.CreateGoldBonusesCounter(behaviour);
         }
     }
 }
Ejemplo n.º 4
0
 public void InitForTank(NodeAddedEvent e, HUDNodes.SelfBattleUserAsTankNode tank, SingleNode <MainHUDComponent> hud)
 {
     hud.component.SetTankMode();
 }
Ejemplo n.º 5
0
 public void UpdateMaxScore(UpdateDMHUDScoreEvent e, BattleNode battle, [JoinByBattle] Optional <ScoreLimitNode> scoreLimit, BattleNode battle2, [JoinByBattle] HUDNodes.SelfBattleUserAsTankNode self, BattleNode battle3, [JoinByBattle] ICollection <RoundUserNode> roundUsers, [JoinAll] SingleNode <DMScoreHUDComponent> hud)
 {
     hud.component.MaxScore = !scoreLimit.IsPresent() ? roundUsers.Min <RoundUserNode>().roundUserStatistics.ScoreWithoutBonuses : scoreLimit.Get().scoreLimit.ScoreLimit;
     hud.component.Players  = roundUsers.Count;
 }
Ejemplo n.º 6
0
 public void SetScoresTDMPosition(NodeAddedEvent e, SingleNode <TeamScoreHUDComponent> hud, HUDNodes.SelfBattleUserAsTankNode battleUser, [JoinByBattle] BattleNode battle)
 {
     hud.component.SetTdmMode();
 }
Ejemplo n.º 7
0
 public void ActivateForTank(NodeAddedEvent e, HUDNode hud, HUDNodes.SelfBattleUserAsTankNode battleUser, SingleNode <DMHUDMessagesComponent> messages, [JoinByBattle] BattleNode battle)
 {
     hud.dmScoreHUD.gameObject.SetActive(true);
     hud.mainHUD.ShowMessageWithPriority(messages.component.MainMessage, 0);
     hud.mainHUD.SetMessageTDMPosition();
 }
Ejemplo n.º 8
0
        public void InitSlots(NodeAddedEvent e, SingleNode <InventoryHUDComponent> inventory, HUDNodes.SelfBattleUserAsTankNode selfUser, [JoinByUser] ICollection <ModuleNode> modules)
        {
            CheckInventoryHUDNecessityEvent eventInstance = new CheckInventoryHUDNecessityEvent();

            base.ScheduleEvent(eventInstance, selfUser);
            if (eventInstance.Necessity)
            {
                base.ScheduleEvent <InitSlotsEvent>(selfUser);
            }
        }