private void OnRelocateClicked(UXButton button)
        {
            PlanetVO vO = this.currentPlanet.VO;

            Service.Get <EventManager>().SendEvent(EventId.LootTableRelocateTapped, vO.Uid);
            ConfirmRelocateScreen.ShowModal(vO, null, null);
        }
Beispiel #2
0
        public void Prepare(PlanetVO planet, AssetsCompleteDelegate onLoadComplete, object cookie)
        {
            if (planet == this.currentPlanet)
            {
                onLoadComplete(cookie);
                return;
            }
            AssetManager assetManager = Service.Get <AssetManager>();

            if (this.planetAssetHandle != AssetHandle.Invalid)
            {
                assetManager.Unload(this.planetAssetHandle);
                this.planetAssetHandle = AssetHandle.Invalid;
            }
            this.currentPlanet = planet;
            this.Reset();
            List <string> list = new List <string>();
            string        text = HardwareProfile.IsLowEndDevice() ? (planet.AssetName + "-lod1") : planet.AssetName;

            list.Add(text);
            assetManager.RegisterPreloadableAsset(text);
            List <object> list2 = new List <object>();

            list2.Add(this.currentPlanet);
            List <AssetHandle> list3 = new List <AssetHandle>();

            list3.Add(AssetHandle.Invalid);
            assetManager.MultiLoad(list3, list, new AssetSuccessDelegate(this.AssetSuccess), null, list2, onLoadComplete, cookie);
            this.planetAssetHandle = list3[0];
        }
 public void SelectPlanet(PlanetVO planet)
 {
     if (this.planetGrid != null && planet != null)
     {
         UXCheckbox       uXCheckbox  = null;
         List <UXElement> elementList = this.planetGrid.GetElementList();
         int i     = 0;
         int count = elementList.Count;
         while (i < count)
         {
             UXElement uXElement = elementList[i];
             PlanetVO  planetVO  = uXElement.Tag as PlanetVO;
             if (planetVO != null && planetVO.Uid == planet.Uid)
             {
                 uXCheckbox = (uXElement as UXCheckbox);
                 break;
             }
             i++;
         }
         if (uXCheckbox != null)
         {
             uXCheckbox.Selected = true;
             this.NewPlanetOptionClicked(uXCheckbox, true);
         }
     }
 }
Beispiel #4
0
        private Planet FindFirstUnlockedPlanet()
        {
            PlanetVO      planetVO = Service.StaticDataController.Get <PlanetVO>("planet1");
            Planet        planet   = null;
            List <Planet> listOfUnlockedPlanets = Service.GalaxyPlanetController.GetListOfUnlockedPlanets();
            int           i     = 0;
            int           count = listOfUnlockedPlanets.Count;

            while (i < count)
            {
                Planet planet2 = listOfUnlockedPlanets[i];
                if (planet2.VO != planetVO)
                {
                    return(planet2);
                }
                planet = planet2;
                i++;
            }
            if (planet != null)
            {
                Service.Logger.ErrorFormat("Could not find any unlocked planets other than the default", new object[0]);
                return(planet);
            }
            Service.Logger.ErrorFormat("Could not find any unlocked planets at all", new object[0]);
            return(new Planet(planetVO));
        }
        public PlayPlanetIntroStoryAction(StoryActionVO vo, IStoryReactor parent) : base(vo, parent)
        {
            this.reactionUID = "";
            this.planetUID   = Service.Get <CurrentPlayer>().GetFirstPlanetUnlockedUID();
            if (!string.IsNullOrEmpty(vo.PrepareString))
            {
                this.planetUID = this.prepareArgs[0];
            }
            PlanetVO optional = Service.Get <IDataController>().GetOptional <PlanetVO>(this.planetUID);

            if (optional == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(optional.IntroStoryAction))
            {
                return;
            }
            string pref = Service.Get <SharedPlayerPrefs>().GetPref <string>(optional.Uid + "Viewed");

            if ("1".Equals(pref))
            {
                return;
            }
            this.reactionUID = optional.IntroStoryAction;
        }
        private void InitPlanetOptionTournamentTab()
        {
            IDataController dataController = Service.Get <IDataController>();
            CurrentPlayer   currentPlayer  = Service.Get <CurrentPlayer>();
            bool            flag           = false;

            this.planetGrid.Clear();
            this.planetGrid.Visible = true;
            List <TournamentVO> allLiveAndClosingTournaments = TournamentController.GetAllLiveAndClosingTournaments();
            int num = 2147483647;

            foreach (TournamentVO current in allLiveAndClosingTournaments)
            {
                PlanetVO planetVO = dataController.Get <PlanetVO>(current.PlanetId);
                if (planetVO != null)
                {
                    if (planetVO.Uid == currentPlayer.Planet.Uid)
                    {
                        flag = true;
                    }
                    if (current.EndTimestamp < num)
                    {
                        this.selectedPlanet = planetVO;
                        num = current.EndTimestamp;
                    }
                    this.AddPlanetButton(planetVO, true, planetVO.Uid == currentPlayer.Planet.Uid);
                }
                if (flag)
                {
                    this.selectedPlanet = currentPlayer.Planet;
                }
            }
            this.planetOptionPanelBackground.Height = (float)this.planetGrid.Count * this.planetGrid.CellHeight + 20f;
            this.planetGrid.RepositionItems();
        }
Beispiel #7
0
        public void SendRelocationRequest(PlanetVO planetVO, bool payHardCurrency)
        {
            Service.Get <UserInputManager>().Enable(false);
            this.relocating           = false;
            this.relocationInProgress = true;
            Service.Get <EventManager>().SendEvent(EventId.PlanetConfirmRelocate, planetVO.Uid);
            if (this.destinationVO != null)
            {
                Service.Get <UserInputManager>().Enable(true);
                Service.Get <StaRTSLogger>().Error("Relocation request for " + planetVO.Uid + " before previous finished.");
                return;
            }
            CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>();

            if (planetVO != null && currentPlayer.UnlockedPlanets.Contains(planetVO.Uid))
            {
                this.destinationVO = planetVO;
                RelocatePlanetRequest   request = new RelocatePlanetRequest(planetVO.Uid, payHardCurrency);
                PlanetRelocationCommand planetRelocationCommand = new PlanetRelocationCommand(request);
                planetRelocationCommand.AddSuccessCallback(new AbstractCommand <RelocatePlanetRequest, DefaultResponse> .OnSuccessCallback(this.OnRelocateSuccess));
                planetRelocationCommand.AddFailureCallback(new AbstractCommand <RelocatePlanetRequest, DefaultResponse> .OnFailureCallback(this.OnRelocateFail));
                Service.Get <ServerAPI>().Sync(planetRelocationCommand);
                return;
            }
            Service.Get <UserInputManager>().Enable(true);
            Service.Get <StaRTSLogger>().Error("Invalid relocation request.");
        }
Beispiel #8
0
        private void OpenRelocateView(string data)
        {
            string text = Service.CurrentPlayer.PlanetId;
            CampaignScreenSection section = CampaignScreenSection.Main;

            if (!string.IsNullOrEmpty(data))
            {
                string[] array = data.Split(new char[]
                {
                    '|'
                });
                if (array.Length >= 1)
                {
                    text = array[0];
                }
            }
            bool flag = Service.BuildingLookupController.HasNavigationCenter();

            if (flag)
            {
                if (this.holonetScreen != null)
                {
                    this.holonetScreen.Close(null);
                }
                Service.GalaxyViewController.GoToPlanetView(text, section);
                PlanetVO planetVO = Service.StaticDataController.Get <PlanetVO>(text);
                ConfirmRelocateScreen.ShowModal(planetVO, null, null);
            }
            else
            {
                Service.UXController.MiscElementsManager.ShowPlayerInstructionsError(Service.Lang.Get("HOLONET_RELOCATE_NO_PC", new object[0]));
            }
        }
        public static void ShowModal(PlanetVO planetVO, OnScreenModalResult onModalResult, object modalResultCookie)
        {
            CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>();
            bool          flag          = Service.Get <BuildingLookupController>().HasNavigationCenter();

            if (planetVO == null || !planetVO.PlayerFacing || planetVO == currentPlayer.Planet || !currentPlayer.IsPlanetUnlocked(planetVO.Uid) || !flag)
            {
                return;
            }
            string text   = currentPlayer.IsRelocationRequirementMet().ToString();
            string cookie = string.Concat(new object[]
            {
                currentPlayer.GetRawRelocationStarsCount(),
                "|",
                text,
                "|",
                planetVO.PlanetBIName,
                "|",
                currentPlayer.Planet.PlanetBIName
            });

            Service.Get <EventManager>().SendEvent(EventId.PlanetRelocateButtonPressed, cookie);
            ConfirmRelocateScreen confirmRelocateScreen = new ConfirmRelocateScreen(planetVO);

            confirmRelocateScreen.OnModalResult     = onModalResult;
            confirmRelocateScreen.ModalResultCookie = modalResultCookie;
            confirmRelocateScreen.IsAlwaysOnTop     = true;
            Service.Get <ScreenController>().AddScreen(confirmRelocateScreen);
        }
Beispiel #10
0
 protected void PlanetSelected(UXCheckbox checkbox, bool selected)
 {
     if (selected && (this.reqMet || this.tutorialMode))
     {
         this.selectedPlanet = (PlanetVO)checkbox.Tag;
         string planetDisplayName = LangUtils.GetPlanetDisplayName(this.selectedPlanet);
         if (this.tutorialMode)
         {
             this.labelUpgradeUnlockPlanet.Text = this.lang.Get("PLANETS_GNC_TUT_UNLOCK_MODAL_TITLE", new object[]
             {
                 planetDisplayName
             });
             this.buttonTutorialConfirm.Enabled  = true;
             this.labelTutorialConfirm.TextColor = UXUtils.COLOR_ENABLED;
         }
         else
         {
             this.labelUpgradeUnlockPlanet.Text = this.lang.Get("PLANETS_GNC_UPGRADE_MODAL_DESC", new object[]
             {
                 planetDisplayName
             });
             this.buttonPrimaryAction.Enabled = true;
             this.buttonInstantBuy.Enabled    = true;
         }
         for (int i = 0; i < this.unlockablePlanetList.Count; i++)
         {
             this.unlockablePlanetList[i].RadioGroup = 55;
         }
     }
 }
Beispiel #11
0
        public static bool IsValidRewardItem(CrateFlyoutItemVO crateFlyoutItemVO, PlanetVO currentPlanetVO, int currentHqLevel)
        {
            if (crateFlyoutItemVO == null)
            {
                return(false);
            }
            int minHQ = crateFlyoutItemVO.MinHQ;
            int maxHQ = crateFlyoutItemVO.MaxHQ;

            if ((minHQ > 0 && currentHqLevel < minHQ) || (maxHQ > 0 && currentHqLevel > maxHQ))
            {
                return(false);
            }
            string[] planetIds = crateFlyoutItemVO.PlanetIds;
            if (currentPlanetVO != null && planetIds != null)
            {
                bool flag = false;
                int  i    = 0;
                int  num  = planetIds.Length;
                while (i < num)
                {
                    if (planetIds[i] == currentPlanetVO.Uid)
                    {
                        flag = true;
                        break;
                    }
                    i++;
                }
                if (!flag)
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #12
0
        private void PopulateAvailablePlanetsPanel(StaticDataController sdc)
        {
            UXElement element = base.GetElement <UXElement>("PanelPlanetAvailability");

            element.Visible = true;
            base.GetElement <UXLabel>("LabelPlanetAvailability").Text = this.lang.Get("RESEARCH_LAB_ACTIVE_PLANETS", new object[0]);
            UXGrid element2 = base.GetElement <UXGrid>("GridPlanetAvailability");

            element2.SetTemplateItem("TemplatePlanet");
            element2.Clear();
            int i   = 0;
            int num = this.selectedEquipment.PlanetIDs.Length;

            while (i < num)
            {
                string    uid      = this.selectedEquipment.PlanetIDs[i];
                PlanetVO  planetVO = sdc.Get <PlanetVO>(uid);
                UXElement item     = element2.CloneTemplateItem(planetVO.Uid);
                element2.AddItem(item, planetVO.Order);
                element2.GetSubElement <UXLabel>(planetVO.Uid, "LabelAvailablePlanet").Text = LangUtils.GetPlanetDisplayName(uid);
                element2.GetSubElement <UXTexture>(planetVO.Uid, "TextureAvailablePlanet").LoadTexture(planetVO.LeaderboardButtonTexture);
                i++;
            }
            element2.RepositionItemsFrameDelayed();
        }
Beispiel #13
0
        protected override void SetMaterialCustomProperties(Material material)
        {
            PlanetVO planet = Service.CurrentPlayer.Planet;

            material.SetColor("_Color", planet.PlanetPerkShaderColor);
            material.SetFloat("_VerticalRate", 1f);
        }
Beispiel #14
0
 protected void StartTransitionOut(PlanetVO planetVO, bool forSoftWipe, bool zoomOut)
 {
     if (this.softWipe)
     {
         if (this.softWipeComplete)
         {
             this.OnTransitionOutComplete(null);
         }
         else
         {
             this.softWipeWorldLoad = true;
         }
     }
     else
     {
         this.CleanupTransitionVisuals();
         if (planetVO == null)
         {
             planetVO = Service.Get <IDataController>().Get <PlanetVO>("planet1");
         }
         this.transitionVisuals = new TransitionVisuals(planetVO, new TransitionVisualsLoadedDelegate(this.OnTransitionVisualsLoaded), forSoftWipe, false);
         if (zoomOut)
         {
             Service.Get <WorldInitializer>().View.ZoomOut();
         }
     }
     this.softWipe = forSoftWipe;
 }
Beispiel #15
0
        public void UpdateTournamentLeaders(PlanetVO planetVO, LeaderboardController.OnUpdateData callback)
        {
            if (planetVO == null)
            {
                Service.Logger.Error("Tournament leaderboard requested without setting planetVO");
                return;
            }
            PlayerLeaderboardRequest         request         = new PlayerLeaderboardRequest(planetVO.Uid, Service.CurrentPlayer.PlayerId);
            LeaderboardList <PlayerLBEntity> leaderboardList = null;
            LeaderboardList <PlayerLBEntity> value           = null;

            this.GetPlayerLists(PlayerListType.TournamentLeaders, planetVO.Uid, out leaderboardList, out value);
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary["callback"]   = callback;
            dictionary["list"]       = leaderboardList;
            dictionary["listnearby"] = value;
            GetTournamentLeaderboardPlayersCommand getTournamentLeaderboardPlayersCommand = new GetTournamentLeaderboardPlayersCommand(request);

            getTournamentLeaderboardPlayersCommand.Context = dictionary;
            getTournamentLeaderboardPlayersCommand.AddSuccessCallback(new AbstractCommand <PlayerLeaderboardRequest, LeaderboardResponse> .OnSuccessCallback(this.OnLeadersUpdated));
            getTournamentLeaderboardPlayersCommand.AddFailureCallback(new AbstractCommand <PlayerLeaderboardRequest, LeaderboardResponse> .OnFailureCallback(this.OnLeadersUpdateFailure));
            Service.ServerAPI.Sync(getTournamentLeaderboardPlayersCommand);
            leaderboardList.LastRefreshTime = Service.ServerAPI.ServerTime;
        }
Beispiel #16
0
        public CrateInfoModalScreen(string crateUid, string planetID, int hqLevel)
        {
            this.selectedRowIndex = -1;
            base..ctor("gui_modal_crateinfo");
            IDataController dataController = Service.Get <IDataController>();

            this.targetCrateVO = dataController.Get <CrateVO>(crateUid);
            string      text    = null;
            FactionType faction = Service.Get <CurrentPlayer>().Faction;

            if (faction != FactionType.Empire)
            {
                if (faction == FactionType.Rebel)
                {
                    text = this.targetCrateVO.RebelLEIUid;
                }
            }
            else
            {
                text = this.targetCrateVO.EmpireLEIUid;
            }
            if (!string.IsNullOrEmpty(text))
            {
                this.targetLEIVO = dataController.Get <LimitedEditionItemVO>(text);
            }
            this.planetVO            = dataController.GetOptional <PlanetVO>(planetID);
            this.hqLevel             = hqLevel;
            this.filteredFlyoutItems = new List <CrateFlyoutItemVO>();
            CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>();

            string[] array = (currentPlayer.Faction == FactionType.Empire) ? this.targetCrateVO.FlyoutEmpireItems : this.targetCrateVO.FlyoutRebelItems;
            if (array != null)
            {
                int i   = 0;
                int num = array.Length;
                while (i < num)
                {
                    string            text2    = array[i];
                    CrateFlyoutItemVO optional = dataController.GetOptional <CrateFlyoutItemVO>(text2);
                    if (optional == null)
                    {
                        Service.Get <StaRTSLogger>().ErrorFormat("CrateInfoModalScreen: FlyoutItemVO Uid {0} not found", new object[]
                        {
                            text2
                        });
                    }
                    else
                    {
                        bool flag  = UXUtils.IsValidRewardItem(optional, this.planetVO, hqLevel);
                        bool flag2 = UXUtils.ShouldDisplayCrateFlyoutItem(optional, CrateFlyoutDisplayType.Flyout);
                        if ((flag & flag2) && this.filteredFlyoutItems.Count < 4)
                        {
                            this.filteredFlyoutItems.Add(optional);
                        }
                    }
                    i++;
                }
            }
        }
Beispiel #17
0
 public void AttachEffects(GameObject gameObject, object cookie)
 {
     if (!HardwareProfile.IsLowEndDevice())
     {
         PlanetVO planetVO = cookie as PlanetVO;
         this.LoadPlanetFX(planetVO.Uid, this.GetEffectNames(planetVO.PlanetaryFX), gameObject);
     }
 }
Beispiel #18
0
 private void CleanUp()
 {
     this.destinationVO = null;
     if (this.hyperspaceHandle != AssetHandle.Invalid)
     {
         this.assetManager.Unload(this.hyperspaceHandle);
         this.hyperspaceHandle = AssetHandle.Invalid;
     }
     if (this.destinationHandle != AssetHandle.Invalid)
     {
         this.assetManager.Unload(this.destinationHandle);
         this.destinationHandle = AssetHandle.Invalid;
     }
     if (this.currentPlanetHandle != AssetHandle.Invalid)
     {
         this.assetManager.Unload(this.currentPlanetHandle);
         this.currentPlanetHandle = AssetHandle.Invalid;
     }
     if (this.currentPlanetGameObject != null)
     {
         UnityEngine.Object.Destroy(this.currentPlanetGameObject);
         this.currentPlanetGameObject = null;
     }
     if (this.destinationPlanetGameObject != null)
     {
         UnityEngine.Object.Destroy(this.destinationPlanetGameObject);
         this.destinationPlanetGameObject = null;
     }
     if (this.planetGlowGameObject != null)
     {
         UnityEngine.Object.Destroy(this.planetGlowGameObject);
         this.planetGlowGameObject = null;
     }
     if (this.assetHandlePlanetGlow != AssetHandle.Invalid)
     {
         this.assetManager.Unload(this.assetHandlePlanetGlow);
         this.assetHandlePlanetGlow = AssetHandle.Invalid;
     }
     if (this.assetHandleRelocationAudio != AssetHandle.Invalid)
     {
         this.assetManager.Unload(this.assetHandleRelocationAudio);
         this.assetHandleRelocationAudio = AssetHandle.Invalid;
     }
     if (this.hyperspaceGameObject != null)
     {
         UnityEngine.Object.Destroy(this.hyperspaceGameObject);
         this.hyperspaceGameObject = null;
     }
     if (this.transitionVisuals != null)
     {
         this.transitionVisuals.Cleanup();
         this.transitionVisuals = null;
     }
     UnityUtils.DestroyMaterial(this.planetMaterial);
     this.relocationInProgress = false;
 }
Beispiel #19
0
 public void StartWipe(AbstractTransition transition, PlanetVO planetVO)
 {
     if (this.currentTransition != null && this.currentTransition.IsTransitioning())
     {
         Service.Get <StaRTSLogger>().Error("Transition in progress, unable to start another wipe.");
         return;
     }
     this.currentTransition = transition;
     this.currentTransition.StartWipe(planetVO);
 }
Beispiel #20
0
 public void StartWipe(PlanetVO planetVO)
 {
     if (!this.softWipe)
     {
         this.skipTransitions = false;
         this.ChooseRandomWipeDirection();
         this.softWipeComplete  = false;
         this.softWipeWorldLoad = false;
         this.StartTransitionOut(planetVO, true, false);
     }
 }
        private void InitPlanetStats(string id)
        {
            PlanetVO optional = Service.Get <IDataController>().GetOptional <PlanetVO>(this.player.Planet);

            if (optional != null && this.tab != SocialTabs.Tournament)
            {
                this.planetLabel.Text = LangUtils.GetPlanetDisplayName(optional);
                this.planetBgTexture.LoadTexture(optional.LeaderboardTileTexture);
                return;
            }
            this.planetLabel.Visible     = false;
            this.planetBgTexture.Visible = false;
        }
 private void NewPlanetOptionClicked(UXCheckbox box, bool selected)
 {
     if (selected)
     {
         this.selectedPlanet            = (box.Tag as PlanetVO);
         this.planetOptionPanel.Visible = false;
         this.UpdateCurrentPlanetButton();
         if (this.PlanetSelectCallBack != null)
         {
             this.PlanetSelectCallBack.Invoke(this.selectedPlanet);
         }
     }
 }
        protected void PlanetChanged(PlanetVO planet)
        {
            if (!this.Visible)
            {
                return;
            }
            Service.Get <EventManager>().SendEvent(EventId.SquadSelect, null);
            SocialTabInfo tabInfo = base.GetTabInfo(this.curTab);

            tabInfo.LoadAction.Invoke();
            this.top50Button.Enabled  = false;
            this.findMeButton.Enabled = true;
            this.LogLeaderboardPlanetSelection();
        }
        public void ShowWarBoard()
        {
            this.anchorFingerId = -1;
            this.warBoardLoadSequenceFinished           = false;
            this.warboardBackgroundLoadSequenceFinished = false;
            this.warboardAudioFinished            = false;
            this.warboardMaster                   = new GameObject("MasterWarboardParent");
            this.warboardMasterTransform          = this.warboardMaster.transform;
            this.warboardMasterTransform.position = WarBoardViewController.WARBOARD_MASTER_START;
            EventManager eventManager = Service.Get <EventManager>();

            if (this.warBoardHandle == AssetHandle.Invalid)
            {
                WarScheduleVO currentWarScheduleData = Service.Get <SquadController>().WarManager.GetCurrentWarScheduleData();
                PlanetVO      planetVO = Service.Get <IDataController>().Get <PlanetVO>(currentWarScheduleData.WarPlanetUid);
                Service.Get <AssetManager>().Load(ref this.warBoardHandle, planetVO.WarBoardAssetName, new AssetSuccessDelegate(this.OnWarBoardLoaded), new AssetFailureDelegate(this.OnWarBoardLoadFail), null);
            }
            if (this.warboardBackground == AssetHandle.Invalid)
            {
                Service.Get <AssetManager>().Load(ref this.warboardBackground, "warboard_room_bkg", new AssetSuccessDelegate(this.OnWarboardBackgroundLoaded), null, null);
            }
            if (!Service.Get <AudioManager>().LoadAudio("sfx_ui_squadwar_warboard_open"))
            {
                this.WarBoardAudioLoadFinished();
            }
            else
            {
                eventManager.RegisterObserver(this, EventId.PreloadedAudioSuccess);
                eventManager.RegisterObserver(this, EventId.PreloadedAudioFailure);
            }
            if (this.WarBuildingLocators == null)
            {
                this.WarBuildingLocators = new List <Transform>();
            }
            CameraManager cameraManager = Service.Get <CameraManager>();

            if (!Service.Get <WorldTransitioner>().IsTransitioning())
            {
                cameraManager.WarBoardCamera.Enable();
                cameraManager.WarBoardCamera.GroundOffset = -10000f;
                cameraManager.MainCamera.Disable();
            }
            Service.Get <UserInputManager>().SetActiveWorldCamera(cameraManager.WarBoardCamera);
            eventManager.RegisterObserver(this, EventId.WarBoardParticipantBuildingSelected);
            eventManager.RegisterObserver(this, EventId.WarBoardBuffBaseBuildingSelected);
            eventManager.RegisterObserver(this, EventId.WarBoardBuildingDeselected);
            this.flyout       = new SquadWarFlyout();
            this.rotateAmount = 0f;
            this.minRotation  = 0f;
        }
Beispiel #25
0
 public Planet(PlanetVO vo)
 {
     this.THRASH_TIME          = GameConstants.GALAXY_PLANET_POPULATION_UPDATE_TIME;
     this.THRASH_DELTA_PERCENT = GameConstants.GALAXY_PLANET_POPULATION_COUNT_PERCENTAGE;
     this.VO                   = vo;
     this.thrashTimer          = 0f;
     this.ThrashingPopulation  = 0;
     this.thrashValue          = 0;
     this.IsCurrentPlanet      = false;
     this.CurrentBackUIShown   = false;
     this.FriendsOnPlanet      = new List <SocialFriendData>();
     this.CurrentPlanetFXState = PlanetFXState.Unknown;
     this.tournamentState      = TimedEventState.Invalid;
 }
Beispiel #26
0
        private void RefreshPlanetData(uint timeStamp)
        {
            IMapDataLoader mapDataLoader = Service.WorldTransitioner.GetMapDataLoader();

            if (mapDataLoader != null)
            {
                PlanetVO planetData = mapDataLoader.GetPlanetData();
                if (planetData != null && this.planetVO.Uid != planetData.Uid)
                {
                    this.planetVO = planetData;
                    this.InitPlanetLightingData(timeStamp);
                }
                this.UpdateEnvironmentLighting(0f);
            }
        }
 public void Init()
 {
     this.selectedPlanet             = null;
     this.currentPlanetBtn           = this.uxFactory.GetElement <UXButton>("BtnPlanetFilter");
     this.cuttentPlanetBtnLabel      = this.uxFactory.GetElement <UXLabel>("LabelBtnPlanetFilter");
     this.cuttentPlanetBtnBackground = this.uxFactory.GetElement <UXSprite>("SpriteBtnPlanetFilterSymbol");
     this.cuttentPlanetBtnTexture    = this.uxFactory.GetElement <UXTexture>("TextureBtnPlanetFilterSymbol");
     this.currentPlanetBtn.OnClicked = new UXButtonClickedDelegate(this.CurrentPlanetButtonClicked);
     this.planetGrid = this.uxFactory.GetElement <UXGrid>("PlanetFilterGrid");
     this.planetGrid.SetTemplateItem("BtnPlanet");
     this.planetOptionPanel           = this.uxFactory.GetElement <UXElement>("PlanetFilterOptions");
     this.planetOptionPanel.Visible   = false;
     this.planetOptionPanelBackground = this.uxFactory.GetElement <UXSprite>("SpritePlanetFilterBg");
     this.UpdateCurrentPlanetButton();
     this.currentPlanetBtn.Visible = false;
 }
Beispiel #28
0
        public GalaxyDataOverride()
        {
            this.TatooinePlanetPos = Vector3.zero;
            this.DandoranPlanetPos = Vector3.zero;
            this.HothPlanetPos     = Vector3.zero;
            this.ErkitPlanetPos    = Vector3.zero;
            this.YavinPlanetPos    = Vector3.zero;
            StaticDataController staticDataController = Service.StaticDataController;

            this.tatooinePlanetData = staticDataController.Get <PlanetVO>(GameConstants.TATOOINE_PLANET_UID);
            this.dandoranPlanetData = staticDataController.Get <PlanetVO>(GameConstants.DANDORAN_PLANET_UID);
            this.hothPlanetData     = staticDataController.Get <PlanetVO>(GameConstants.HOTH_PLANET_UID);
            this.erkitPlanetData    = staticDataController.Get <PlanetVO>(GameConstants.ERKIT_PLANET_UID);
            this.yavinPlanetData    = staticDataController.Get <PlanetVO>(GameConstants.YAVIN_PLANET_UID);
            this.UpdateGalaxyValues();
            this.UpdatePlanetValues();
        }
Beispiel #29
0
        private void OnPickPlanetResult(object result, object cookie)
        {
            bool         flag         = result != null;
            UXController uXController = Service.UXController;

            uXController.HUD.ToggleExitEditModeButton(true);
            string   tag      = string.Empty;
            PlanetVO planetVO = (PlanetVO)cookie;

            if (planetVO != null)
            {
                tag = planetVO.Uid;
                Service.SharedPlayerPrefs.SetPref("1stPlaName", LangUtils.GetPlanetDisplayNameKey(planetVO.Uid));
            }
            this.LowerLiftedBuildingHelper(this.buildingSelector.SelectedBuilding, (!flag) ? DropKind.CancelPurchase : DropKind.ConfirmPurchase, true, this.lifted, true, true, tag);
            Service.EventManager.SendEvent(EventId.BuildingPurchaseModeEnded, null);
        }
Beispiel #30
0
 public override void OnDestroyElement()
 {
     if (this.selectPlanetGrid != null)
     {
         this.selectPlanetGrid.Clear();
     }
     this.unlockablePlanetList.Clear();
     if (!this.tutorialMode)
     {
         this.buttonViewGalaxyMap.OnClicked = null;
     }
     this.DeactivateHighlight();
     this.selectedPlanet = null;
     Service.ViewTimeEngine.UnregisterFrameTimeObserver(this);
     this.buttonViewGalaxyMap.OnClicked = null;
     base.OnDestroyElement();
 }