Exemple #1
0
 private void OnScoutButton(UXButton button)
 {
     if (this.buffBaseData != null)
     {
         SquadWarManager warManager = Service.SquadController.WarManager;
         string          empty      = string.Empty;
         if (warManager.CanScoutBuffBase(this.buffBaseData, ref empty))
         {
             string buffBaseId = this.buffBaseData.BuffBaseId;
             if (Service.SquadController.WarManager.ScoutBuffBase(buffBaseId))
             {
                 this.Close(null);
             }
         }
         else
         {
             Service.UXController.MiscElementsManager.ShowPlayerInstructions(empty);
         }
     }
 }
 private void OnScoutBuffBaseClicked(UXButton button)
 {
     if (this.buffBaseData != null)
     {
         SquadWarManager warManager = Service.Get <SquadController>().WarManager;
         string          empty      = string.Empty;
         if (warManager.CanScoutBuffBase(this.buffBaseData, ref empty))
         {
             string buffBaseId = this.buffBaseData.BuffBaseId;
             if (Service.Get <SquadController>().WarManager.ScoutBuffBase(buffBaseId))
             {
                 this.Hide();
                 return;
             }
         }
         else
         {
             Service.Get <UXController>().MiscElementsManager.ShowPlayerInstructions(empty);
         }
     }
 }
        public void ShowBuffBaseOptions(UXCheckbox checkbox, SquadWarBuffBaseData data)
        {
            if (this.buffBaseData != null && this.buffBaseData == data)
            {
                return;
            }
            this.buffBaseData     = data;
            this.opponentState    = null;
            this.Visible          = true;
            this.transformToTrack = null;
            Vector3[] worldCorners = checkbox.GetWorldCorners();
            Vector3   position     = checkbox.Root.transform.position;

            if (worldCorners != null)
            {
                position.y = worldCorners[0].y;
            }
            this.rootTrans.position = position;
            this.animator.Play("Off", 0, 1f);
            this.animator.ResetTrigger("Off");
            this.animator.ResetTrigger("ShowTop");
            this.animator.SetTrigger("ShowBottom");
            SquadWarManager warManager = Service.Get <SquadController>().WarManager;
            string          empty      = string.Empty;

            if (warManager.CanScoutBuffBase(this.buffBaseData, ref empty))
            {
                this.scoutBuffBaseButton.VisuallyEnableButton();
                this.scoutBuffBaseLabel.TextColor = this.scoutBuffBaseLabel.OriginalTextColor;
            }
            else
            {
                this.scoutBuffBaseButton.VisuallyDisableButton();
                this.scoutBuffBaseLabel.TextColor = UXUtils.COLOR_LABEL_DISABLED;
            }
            this.PlayShowAudioClip();
        }
Exemple #4
0
        private void Refresh()
        {
            WarBuffVO         warBuffVO   = Service.Get <IDataController>().Get <WarBuffVO>(this.buffBaseData.BuffBaseId);
            SquadWarManager   warManager  = Service.Get <SquadController>().WarManager;
            SquadWarSquadData squadData   = warManager.GetSquadData(this.buffBaseData.OwnerId);
            FactionType       factionType = FactionType.Neutral;
            string            text        = this.buffBaseData.GetDisplayBaseLevel().ToString();

            if (squadData != null)
            {
                factionType = squadData.Faction;
            }
            string uid;
            string text2;

            if (factionType == FactionType.Empire)
            {
                uid   = warBuffVO.MasterEmpireBuildingUid;
                text2 = LangUtils.GetFactionName(factionType);
            }
            else if (factionType == FactionType.Rebel)
            {
                uid   = warBuffVO.MasterRebelBuildingUid;
                text2 = LangUtils.GetFactionName(factionType);
            }
            else
            {
                uid   = warBuffVO.MasterNeutralBuildingUid;
                text2 = this.lang.Get("BUFF_BASE_UNOWNED_FACTION_NAME", new object[0]);
            }
            this.spriteFactionIcon.SpriteName = UXUtils.GetIconNameFromFactionType(factionType);
            this.labelBuffBaseName.Text       = this.lang.Get("WAR_BOARD_BUFF_BASE_TITLE", new object[]
            {
                this.lang.Get(warBuffVO.BuffBaseName, new object[0]),
                LangUtils.GetPlanetDisplayName(warBuffVO.PlanetId)
            });
            this.labelBuffBaseLevel.Text = this.lang.Get("WAR_BOARD_BUFF_BASE_LEVEL", new object[]
            {
                text,
                text2
            });
            this.labelCaptureRequirement.Text = this.lang.Get("WAR_BOARD_BUFF_BASE_CAPTURE_REQUIREMENT", new object[0]);
            this.labelProduces.Text           = this.lang.Get("BUFF_BASE_PRODUCES", new object[0]);
            this.labelBuffDescription.Text    = this.lang.Get(warBuffVO.BuffStringDesc, new object[0]);
            this.labelLocked.Text             = this.lang.Get("PLANET_LOCKED_REQUIREMENT", new object[0]);
            this.labelLocked.Visible          = !Service.Get <CurrentPlayer>().IsPlanetUnlocked(warBuffVO.PlanetId);
            TextureVO       textureVO      = null;
            IDataController dataController = Service.Get <IDataController>();

            if (warBuffVO.PlanetId == GameConstants.TATOOINE_PLANET_UID)
            {
                textureVO = dataController.GetOptional <TextureVO>("squadwars_basedetails_tatooine");
            }
            else if (warBuffVO.PlanetId == GameConstants.YAVIN_PLANET_UID)
            {
                textureVO = dataController.GetOptional <TextureVO>("squadwars_basedetails_yavin");
            }
            else if (warBuffVO.PlanetId == GameConstants.DANDORAN_PLANET_UID)
            {
                textureVO = dataController.GetOptional <TextureVO>("squadwars_basedetails_dandoran");
            }
            else if (warBuffVO.PlanetId == GameConstants.ERKIT_PLANET_UID)
            {
                textureVO = dataController.GetOptional <TextureVO>("squadwars_basedetails_erkit");
            }
            else if (warBuffVO.PlanetId == GameConstants.TFA_PLANET_UID)
            {
                textureVO = dataController.GetOptional <TextureVO>("squadwars_basedetails_tfa");
            }
            else if (warBuffVO.PlanetId == GameConstants.HOTH_PLANET_UID)
            {
                textureVO = dataController.GetOptional <TextureVO>("squadwars_basedetails_hoth");
            }
            if (textureVO != null)
            {
                this.textureBaseDetail.LoadTexture(textureVO.AssetName);
            }
            BuildingTypeVO data = Service.Get <IDataController>().Get <BuildingTypeVO>(uid);

            UXUtils.SetupGeometryForIcon(this.spriteBuffBaseIcon, data);
            this.spriteBuffIcon.SpriteName = warBuffVO.BuffIcon;
            string empty = string.Empty;

            if (warManager.CanScoutBuffBase(this.buffBaseData, ref empty))
            {
                this.btnScout.VisuallyEnableButton();
                this.labelScout.TextColor = this.labelScout.OriginalTextColor;
                return;
            }
            this.btnScout.VisuallyDisableButton();
            this.labelScout.TextColor = UXUtils.COLOR_LABEL_DISABLED;
        }