private void HandleOrderHallNavButtonSelected(OrderHallNavButton navButton)
 {
     if (navButton == this)
     {
         if (!this.m_isSelected)
         {
             this.m_normalImage.set_enabled(false);
             this.m_selectedImage.set_enabled(true);
             this.StopGlowEffect();
             this.m_greenSelectionGlow.get_gameObject().SetActive(true);
             this.m_glowSpinHandle  = UiAnimMgr.instance.PlayAnim("PrestigeSpin", this.m_selectionGlowRoot.get_transform(), Vector3.get_zero(), 1.66f, 0f);
             this.m_glowPulseHandle = UiAnimMgr.instance.PlayAnim("PrestigePulse", this.m_selectionGlowRoot.get_transform(), Vector3.get_zero(), 1.66f, 0f);
             UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", base.get_transform(), Vector3.get_zero(), 2f, 0f);
             this.m_label.SetActive(true);
             this.ResizeForSelect();
             this.m_isSelected = true;
         }
     }
     else
     {
         this.m_label.SetActive(false);
         this.m_normalImage.set_enabled(true);
         this.m_selectedImage.set_enabled(false);
         if (this.m_isSelected)
         {
             this.StopGlowEffect();
             this.ResizeForDeselect();
             this.m_isSelected = false;
         }
     }
 }
Ejemplo n.º 2
0
 private void Update()
 {
     if (this.m_training)
     {
         long  num        = GarrisonStatus.CurrentTime() - (long)this.m_shipmentCreationTime;
         float fillAmount = Mathf.Clamp((float)num / (float)this.m_shipmentDuration, 0f, 1f);
         this.m_troopBuildProgressRing.set_fillAmount(fillAmount);
         this.m_troopBuildProgressFill.set_fillAmount(fillAmount);
         long num2 = (long)this.m_shipmentDuration - num;
         if (num2 < 0L)
         {
             num2 = 0L;
         }
         if (num2 > 0L)
         {
             Duration duration = new Duration((int)num2);
             this.m_timeRemainingText.set_text(duration.DurationString);
         }
         else if (this.m_glowLoopHandle == null)
         {
             this.m_glowLoopHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", base.get_transform(), Vector3.get_zero(), 3f, 0f);
             this.m_timeRemainingText.set_text(StaticDB.GetString("COLLECT", null));
             Main.instance.m_UISound.Play_TroopsReadyToast();
         }
     }
 }
 private void HandleCollectTroopResult(SHIPMENT_RESULT result, ulong shipmentDBID)
 {
     if (result == SHIPMENT_RESULT.SUCCESS && shipmentDBID == this.m_shipmentDBID)
     {
         if (this.m_glowLoopHandle != null)
         {
             UiAnimation anim = this.m_glowLoopHandle.GetAnim();
             if (anim != null)
             {
                 anim.Stop(0.5f);
             }
             this.m_glowLoopHandle = null;
         }
         UiAnimMgr.instance.PlayAnim("GreenCheck", this.m_greenCheckEffectRoot, Vector3.get_zero(), 1.8f, 0f);
         Main.instance.m_UISound.Play_GreenCheck();
         this.m_training = false;
         this.m_troopBuildProgressRing.get_gameObject().SetActive(false);
         this.m_troopBuildProgressFill.get_gameObject().SetActive(false);
         this.m_troopOwnedCheckmark.get_gameObject().SetActive(true);
         this.m_troopPortraitImage.get_gameObject().SetActive(true);
         this.m_timeRemainingText.get_gameObject().SetActive(false);
         this.m_troopPortraitImage.set_material(null);
         PersistentShipmentData.shipmentDictionary.Remove(shipmentDBID);
         MobilePlayerRequestShipmentTypes obj = new MobilePlayerRequestShipmentTypes();
         Login.instance.SendToMobileServer(obj);
         MobilePlayerRequestShipments obj2 = new MobilePlayerRequestShipments();
         Login.instance.SendToMobileServer(obj2);
         MobilePlayerGarrisonDataRequest mobilePlayerGarrisonDataRequest = new MobilePlayerGarrisonDataRequest();
         mobilePlayerGarrisonDataRequest.GarrTypeID = 3;
         Login.instance.SendToMobileServer(mobilePlayerGarrisonDataRequest);
     }
 }
Ejemplo n.º 4
0
 private void StopGlowEffect()
 {
     if (this.m_glowSpinHandle != null)
     {
         UiAnimation anim = this.m_glowSpinHandle.GetAnim();
         if (anim != null)
         {
             anim.Stop(0.5f);
         }
         this.m_glowSpinHandle = null;
     }
     if (this.m_glowPulseHandle != null)
     {
         UiAnimation anim2 = this.m_glowPulseHandle.GetAnim();
         if (anim2 != null)
         {
             anim2.Stop(0.5f);
         }
         this.m_glowPulseHandle = null;
     }
 }
 private void StopGlowEffect()
 {
     if (this.m_glowSpinHandle != null)
     {
         UiAnimation anim = this.m_glowSpinHandle.GetAnim();
         if (anim != null)
         {
             anim.Stop(0.5f);
         }
         this.m_glowSpinHandle = null;
     }
     if (this.m_glowPulseHandle != null)
     {
         UiAnimation anim2 = this.m_glowPulseHandle.GetAnim();
         if (anim2 != null)
         {
             anim2.Stop(0.5f);
         }
         this.m_glowPulseHandle = null;
     }
     this.m_greenSelectionGlow.get_gameObject().SetActive(false);
 }
Ejemplo n.º 6
0
 public void HandleMissionChanged(int newMissionID)
 {
     if (this.m_isStackablePreview || this.m_garrMissionID == 0)
     {
         return;
     }
     if (this.m_selectedEffectAnimHandle != null)
     {
         UiAnimation anim = this.m_selectedEffectAnimHandle.GetAnim();
         if (anim != null)
         {
             anim.Stop(0.5f);
         }
     }
     if (newMissionID == this.m_garrMissionID)
     {
         this.m_selectedEffectAnimHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_selectedEffectRoot, Vector3.get_zero(), 2.5f, 0f);
     }
     if (this.m_selectionRing != null)
     {
         this.m_selectionRing.get_gameObject().SetActive(newMissionID == this.m_garrMissionID);
     }
 }
Ejemplo n.º 7
0
 private void Update()
 {
     if (this.timeRemainingUntilLootEffect <= 0f)
     {
         return;
     }
     this.timeRemainingUntilLootEffect -= Time.get_deltaTime();
     if (this.timeRemainingUntilLootEffect <= 0f)
     {
         if (this.m_enableLootEffect_success)
         {
             this.m_greenCheck.get_gameObject().SetActive(true);
             this.m_effectHandle = UiAnimMgr.instance.PlayAnim(this.m_uiAnimation_success, this.m_greenCheckEffectRootTransform, Vector3.get_zero(), this.m_animScale_success, 0f);
             Main.instance.m_UISound.Play_GreenCheck();
         }
         if (this.m_enableLootEffect_fail)
         {
             this.m_redX.get_gameObject().SetActive(true);
             this.m_effectHandle = UiAnimMgr.instance.PlayAnim(this.m_uiAnimation_fail, this.m_redFailXEffectRootTransform, Vector3.get_zero(), this.m_animScale_fail, 0f);
             Main.instance.m_UISound.Play_RedFailX();
         }
     }
 }
    private void Update()
    {
        int num = 0;

        AdventureMapMissionSite[] componentsInChildren = AdventureMapPanel.instance.m_missionAndWordQuestArea.GetComponentsInChildren <AdventureMapMissionSite>(true);
        AdventureMapMissionSite[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            AdventureMapMissionSite adventureMapMissionSite = array[i];
            if (!adventureMapMissionSite.m_isStackablePreview)
            {
                if (adventureMapMissionSite.m_completeMissionGroup.get_gameObject().get_activeSelf())
                {
                    num++;
                }
            }
        }
        if (num != this.m_numReadyTroops)
        {
            this.m_theActualButton.SetActive(num > 0);
            if (num == 0)
            {
                this.ClearEffects();
            }
            if (num > this.m_numReadyTroops)
            {
                this.ClearEffects();
                this.m_glowHandle     = UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", this.m_theActualButton.get_transform(), Vector3.get_zero(), 3f, 0f);
                this.m_glowLoopHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_theActualButton.get_transform(), Vector3.get_zero(), 3f, 0f);
                iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitWobble",
                    "x",
                    this.amount,
                    "y",
                    this.amount,
                    "time",
                    this.duration,
                    "delay",
                    0.1f,
                    "looptype",
                    iTween.LoopType.none
                }));
                iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitWobbleL",
                    "x",
                    this.amount,
                    "y",
                    this.amount,
                    "time",
                    this.duration,
                    "delay",
                    this.delay,
                    "looptype",
                    iTween.LoopType.loop
                }));
                iTween.PunchRotation(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitButtonSwing",
                    "z",
                    -30f,
                    "time",
                    2f
                }));
                iTween.PunchRotation(this.m_numReadyTroopsTextBG, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitNumSwing",
                    "z",
                    -50f,
                    "time",
                    3f
                }));
                Main.instance.m_UISound.Play_LootReady();
            }
            this.m_numReadyTroops = num;
            this.m_numReadyTroopsText.set_text(string.Empty + ((this.m_numReadyTroops <= 0) ? string.Empty : (string.Empty + this.m_numReadyTroops)));
            this.m_numReadyTroopsTextBG.SetActive(this.m_numReadyTroops > 0);
        }
    }
Ejemplo n.º 9
0
    public void SetCharShipment(int charShipmentID, ulong shipmentDBID, int ownedGarrFollowerID, bool training, int iconFileDataID = 0)
    {
        CharShipmentRec record = StaticDB.charShipmentDB.GetRecord(charShipmentID);

        if (record == null)
        {
            Debug.LogError("Invalid Shipment ID: " + charShipmentID);
            return;
        }
        if (this.m_glowLoopHandle != null)
        {
            this.m_glowLoopHandle.GetAnim().Stop(0f);
            this.m_glowLoopHandle = null;
        }
        this.m_collected           = false;
        this.m_ownedGarrFollowerID = ownedGarrFollowerID;
        this.m_training            = training;
        this.m_shipmentDBID        = shipmentDBID;
        if (training)
        {
            if (!PersistentShipmentData.shipmentDictionary.ContainsKey(shipmentDBID))
            {
                training = false;
                Debug.LogWarning("Shipment not found in Persistent: " + charShipmentID);
            }
            else
            {
                JamCharacterShipment jamCharacterShipment = (JamCharacterShipment)PersistentShipmentData.shipmentDictionary.get_Item(shipmentDBID);
                this.m_shipmentCreationTime = jamCharacterShipment.CreationTime;
                this.m_shipmentDuration     = jamCharacterShipment.ShipmentDuration;
            }
        }
        if (record.GarrFollowerID > 0u)
        {
            this.SetCharShipmentTroop(record, iconFileDataID);
        }
        else if (record.DummyItemID > 0)
        {
            this.SetCharShipmentItem(record);
        }
        if (ownedGarrFollowerID != 0)
        {
            this.m_troopBuildProgressRing.get_gameObject().SetActive(false);
            this.m_troopBuildEmptyRing.get_gameObject().SetActive(false);
            this.m_troopBuildProgressFill.get_gameObject().SetActive(false);
            this.m_troopOwnedCheckmark.get_gameObject().SetActive(true);
            this.m_troopPortraitImage.get_gameObject().SetActive(true);
            this.m_timeRemainingText.get_gameObject().SetActive(false);
            return;
        }
        if (training)
        {
            this.m_troopBuildEmptyRing.get_gameObject().SetActive(true);
            this.m_troopBuildProgressRing.get_gameObject().SetActive(true);
            this.m_troopBuildProgressRing.set_fillAmount(0f);
            this.m_troopBuildProgressFill.get_gameObject().SetActive(true);
            this.m_troopBuildProgressFill.set_fillAmount(0f);
            this.m_troopOwnedCheckmark.get_gameObject().SetActive(false);
            this.m_troopPortraitImage.get_gameObject().SetActive(true);
            this.m_timeRemainingText.get_gameObject().SetActive(true);
            this.m_timeRemainingText.set_text(string.Empty);
            if (this.m_grayscaleShader != null)
            {
                Material material = new Material(this.m_grayscaleShader);
                this.m_troopPortraitImage.set_material(material);
            }
        }
        else
        {
            this.m_troopBuildEmptyRing.get_gameObject().SetActive(false);
            this.m_troopBuildProgressRing.get_gameObject().SetActive(false);
            this.m_troopBuildProgressFill.get_gameObject().SetActive(false);
            this.m_troopOwnedCheckmark.get_gameObject().SetActive(false);
            this.m_troopPortraitImage.get_gameObject().SetActive(false);
            this.m_timeRemainingText.get_gameObject().SetActive(false);
        }
    }
Ejemplo n.º 10
0
    private void Update()
    {
        int numCompletedMissions = PersistentMissionData.GetNumCompletedMissions(true);

        if (numCompletedMissions != this.m_numReadyTroops)
        {
            this.m_theActualButton.SetActive(numCompletedMissions > 0);
            if (numCompletedMissions == 0)
            {
                this.ClearEffects();
            }
            if (numCompletedMissions > this.m_numReadyTroops)
            {
                this.ClearEffects();
                this.m_glowHandle     = UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", this.m_theActualButton.get_transform(), Vector3.get_zero(), 3f, 0f);
                this.m_glowLoopHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_theActualButton.get_transform(), Vector3.get_zero(), 3f, 0f);
                iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitWobble",
                    "x",
                    this.amount,
                    "y",
                    this.amount,
                    "time",
                    this.duration,
                    "delay",
                    0.1f,
                    "looptype",
                    iTween.LoopType.none
                }));
                iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitWobbleL",
                    "x",
                    this.amount,
                    "y",
                    this.amount,
                    "time",
                    this.duration,
                    "delay",
                    this.delay,
                    "looptype",
                    iTween.LoopType.loop
                }));
                iTween.PunchRotation(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitButtonSwing",
                    "z",
                    -30f,
                    "time",
                    2f
                }));
                iTween.PunchRotation(this.m_numReadyTroopsTextBG, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitNumSwing",
                    "z",
                    -50f,
                    "time",
                    3f
                }));
                Main.instance.m_UISound.Play_LootReady();
            }
            this.m_numReadyTroops = numCompletedMissions;
            this.m_numReadyTroopsText.set_text(string.Empty + ((this.m_numReadyTroops <= 0) ? string.Empty : (string.Empty + this.m_numReadyTroops)));
            this.m_numReadyTroopsTextBG.SetActive(this.m_numReadyTroops > 0);
        }
    }
    private void Update()
    {
        int         num        = 0;
        IEnumerator enumerator = PersistentShipmentData.shipmentDictionary.get_Values().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                JamCharacterShipment jamCharacterShipment = (JamCharacterShipment)enumerator.get_Current();
                long num2 = GarrisonStatus.CurrentTime() - (long)jamCharacterShipment.CreationTime;
                long num3 = (long)jamCharacterShipment.ShipmentDuration - num2;
                if (num3 <= 0L)
                {
                    num++;
                }
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        if (num != this.m_numReadyTroops)
        {
            if (num == 0 || num < this.m_numReadyTroops)
            {
                this.ClearEffects();
            }
            if (num > this.m_numReadyTroops)
            {
                this.ClearEffects();
                this.m_glowHandle     = UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", base.get_transform(), Vector3.get_zero(), 3f, 0f);
                this.m_glowLoopHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", base.get_transform(), Vector3.get_zero(), 3f, 0f);
                iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitWobble",
                    "x",
                    this.amount,
                    "y",
                    this.amount,
                    "time",
                    this.duration,
                    "delay",
                    0.1f,
                    "looptype",
                    iTween.LoopType.none
                }));
                iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitWobbleL",
                    "x",
                    this.amount,
                    "y",
                    this.amount,
                    "time",
                    this.duration,
                    "delay",
                    this.delay,
                    "looptype",
                    iTween.LoopType.loop
                }));
                iTween.PunchRotation(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitButtonSwing",
                    "z",
                    30f,
                    "time",
                    2f
                }));
                iTween.PunchRotation(this.m_numReadyTroopsTextBG, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitNumSwing",
                    "z",
                    50f,
                    "time",
                    3f
                }));
            }
            this.m_numReadyTroops = num;
            this.m_numReadyTroopsText.set_text(string.Empty + ((this.m_numReadyTroops <= 0) ? string.Empty : (string.Empty + this.m_numReadyTroops)));
            this.m_numReadyTroopsTextBG.SetActive(this.m_numReadyTroops > 0);
        }
    }
Ejemplo n.º 12
0
    private void Update()
    {
        switch (this.m_navButtonType)
        {
        case OrderHallNavButton.NavButtonType.missions:
        {
            int numCompletedMissions = PersistentMissionData.GetNumCompletedMissions(true);
            if (numCompletedMissions == 0 && this.m_notificationBadgeRoot.get_activeSelf())
            {
                this.m_notificationBadgeRoot.SetActive(false);
            }
            else if (numCompletedMissions > 0)
            {
                if (!this.m_notificationBadgeRoot.get_activeSelf())
                {
                    this.m_notificationBadgeRoot.SetActive(true);
                }
                if (this.m_notificationPulseHandle == null)
                {
                    this.m_notificationPulseHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_notificationBadgeRoot.get_transform(), Vector3.get_zero(), 1f, 0f);
                }
                this.m_notificationBadgeText.set_text(string.Empty + numCompletedMissions);
            }
            break;
        }

        case OrderHallNavButton.NavButtonType.recruit:
        {
            int numReadyShipments = PersistentShipmentData.GetNumReadyShipments();
            if (numReadyShipments == 0 && this.m_notificationBadgeRoot.get_activeSelf())
            {
                this.m_notificationBadgeRoot.SetActive(false);
            }
            else if (numReadyShipments > 0)
            {
                if (!this.m_notificationBadgeRoot.get_activeSelf())
                {
                    this.m_notificationBadgeRoot.SetActive(true);
                }
                if (this.m_notificationPulseHandle == null)
                {
                    this.m_notificationPulseHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_notificationBadgeRoot.get_transform(), Vector3.get_zero(), 1f, 0f);
                }
                this.m_notificationBadgeText.set_text(string.Empty + numReadyShipments);
            }
            break;
        }

        case OrderHallNavButton.NavButtonType.talents:
        {
            bool flag = AllPanels.instance.m_talentTreePanel.TalentIsReadyToPlayGreenCheckAnim();
            if (!flag && this.m_notificationBadgeRoot.get_activeSelf())
            {
                this.m_notificationBadgeRoot.SetActive(false);
            }
            else if (flag && !this.m_notificationBadgeRoot.get_activeSelf())
            {
                this.m_notificationBadgeRoot.SetActive(true);
                this.m_notificationBadgeText.set_text("1");
                if (this.m_notificationPulseHandle == null)
                {
                    this.m_notificationPulseHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_notificationBadgeRoot.get_transform(), Vector3.get_zero(), 1f, 0f);
                }
            }
            break;
        }
        }
    }