示例#1
0
 protected override void OnEnter()
 {
     base.OnEnter();
     this.App.UI.SetScreen("StarSystem");
     this._piechart = new BudgetPiechart(this.App.UI, "piechart", this.App.AssetDatabase);
     EmpireBarUI.SyncTitleBar(this.App, "gameEmpireBar", this._piechart);
     EmpireBarUI.SyncTitleFrame(this.App);
     this.InitializeClimateSlider(this.App.UI.Path("colonyControl", "partClimateSlider"));
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partTradeSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partTerraSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partInfraSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partShipConSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partCivSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partOverDevelopment"), "only_user_events", true);
     this.App.UI.SetPropertyBool("gameSystemContentsList", "only_user_events", true);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partCivSlider"), 0, 100, 50);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partTerraSlider"), 0, 100, 50);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partInfraSlider"), 0, 100, 50);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partShipConSlider"), 0, 100, 50);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partOverDevelopment"), 0, 100, 50);
     this.InitializeClimateSlider(this.App.UI.Path("gamePlanetDetails", "partClimateSlider"));
     StarSystemUI.SyncSystemDetailsWidget(this.App, "systemDetailsWidget", this.CurrentSystem, false, true);
     StarSystemUI.SyncPlanetListWidget(this.App.Game, "planetListWidget", this.App.GameDatabase.GetStarSystemPlanets(this.CurrentSystem));
     StarSystemUI.SyncColonyDetailsWidget(this.App.Game, "colonyDetailsWidget", this.SelectedObject, "");
     StarSystemUI.SyncPlanetDetailsWidget(this.App.Game, "planetDetailsWidget", this.CurrentSystem, this.SelectedObject, this.GetPlanetViewGameObject(this.CurrentSystem, this.SelectedObject), this._planetView);
     this.App.HotKeyManager.AddListener((IKeyBindListener)this);
 }
示例#2
0
        protected override void OnEnter()
        {
            this._finalSync = false;
            this.App.UI.SetScreen("FleetManager");
            this.App.UI.UnlockUI();
            this.App.UI.GameEvent       += new UIEventGameEvent(this.UICommChannel_GameEvent);
            this._sky.Active             = true;
            this._camera                 = new OrbitCameraController(this.App);
            this._camera.DesiredPitch    = MathHelper.DegreesToRadians(-75f);
            this._camera.TargetPosition  = new Vector3(0.0f, 0.0f, 0.0f);
            this._camera.MaxDistance     = 6000f;
            this._camera.DesiredDistance = this._camera.MaxDistance;
            this.App.UI.ClearItems("partFleetShips");
            this._manager.PostSetProp("CameraController", (IGameObject)this._camera);
            this._manager.PostSetProp("InputEnabled", true);
            this._manager.PostSetProp("SyncShipList", "partFleetShips");
            this._manager.PostSetProp("SyncCommandPointDisplay", "cmdpointsValue");
            this._manager.Active = true;
            this.App.GameDatabase.GetPlayerHomeworld(this.App.LocalPlayer.ID);
            IEnumerable <FleetInfo> fleetInfoBySystemId = this.App.GameDatabase.GetFleetInfoBySystemID(this._targetSystemID, FleetType.FL_ALL);

            this.SyncShipContextMenu(fleetInfoBySystemId);
            EmpireBarUI.SyncTitleFrame(this.App);
            this._fleetWidget.SetSyncedFleets(fleetInfoBySystemId.Where <FleetInfo>((Func <FleetInfo, bool>)(x =>
            {
                if (x.PlayerID == this.App.LocalPlayer.ID)
                {
                    return(!Kerberos.Sots.StarFleet.StarFleet.IsGardenerFleet(this.App.Game, x));
                }
                return(false);
            })).ToList <FleetInfo>());
            this._manager.PostSetProp("FleetWidget", this._fleetWidget.ObjectID);
            this._fleetWidget.ShipSelectionEnabled = true;
            if (this.App.LocalPlayer.Faction.Name == "loa")
            {
                this.App.UI.SetEnabled("fleetmanagerloaCompose", true);
                this.App.UI.SetVisible("fleetmanagerloaCompose", true);
                this.App.UI.SetVisible("ngpWarning", true);
            }
            else
            {
                this.App.UI.SetEnabled("fleetmanagerloaCompose", false);
                this.App.UI.SetVisible("fleetmanagerloaCompose", false);
                this.App.UI.SetVisible("ngpWarning", false);
            }
            this.App.UI.AutoSize("buttonPanel");
            this.App.UI.ForceLayout("buttonPanel");
            this.App.UI.AutoSize("fleetDetailsWidget");
            this.App.UI.ForceLayout("fleetDetailsWidget");
            this.App.UI.AutoSize("leftPanel");
            this.App.UI.ForceLayout("leftPanel");
            this.App.UI.AutoSize("buttonPanel");
            this.App.UI.ForceLayout("buttonPanel");
            this.App.UI.AutoSize("fleetDetailsWidget");
            this.App.UI.ForceLayout("fleetDetailsWidget");
            this.App.UI.AutoSize("leftPanel");
            this.App.UI.ForceLayout("leftPanel");
            this.App.HotKeyManager.AddListener((IKeyBindListener)this);
        }
        protected override void OnEnter()
        {
            base.OnEnter();
            this._crits.Activate();
            this._dummies.Activate();
            this.App.UI.UnlockUI();
            this.App.UI.SetScreen("StationPlacement");
            this.App.UI.SetPropertyBool("gameCancelMissionButton", "lockout_button", true);
            this.App.UI.SetPropertyBool("gameConfirmMissionButton", "lockout_button", true);
            this.App.UI.SetPropertyBool("gameExitButton", "lockout_button", true);
            this._piechart = new BudgetPiechart(this.App.UI, "piechart", this.App.AssetDatabase);
            EmpireBarUI.SyncTitleFrame(this.App);
            EmpireBarUI.SyncTitleBar(this.App, "gameEmpireBar", this._piechart);
            this.Camera.DesiredPitch    = MathHelper.DegreesToRadians(-40f);
            this.Camera.DesiredDistance = 80000f;
            this.Camera.MinPitch        = MathHelper.DegreesToRadians(-60f);
            this.Camera.MaxPitch        = MathHelper.DegreesToRadians(-20f);
            this._manager.Active        = true;
            this._starsystem.SetAutoDrawEnabled(false);
            bool flag = false;

            if (this._stationType == StationType.MINING)
            {
                int?planetForStation = StarSystem.GetSuitablePlanetForStation(this.App.Game, this.App.LocalPlayer.ID, this._targetSystemID, this._stationType);
                if (planetForStation.HasValue)
                {
                    this.SetSelectedObject(planetForStation.Value, "");
                    flag = true;
                }
            }
            else
            {
                foreach (PlanetInfo planetInfo in this.App.GameDatabase.GetPlanetInfosOrbitingStar(this._targetSystemID))
                {
                    if (planetInfo != null)
                    {
                        ColonyInfo colonyInfoForPlanet = this.App.GameDatabase.GetColonyInfoForPlanet(planetInfo.ID);
                        if (colonyInfoForPlanet != null && colonyInfoForPlanet.PlayerID == this.App.LocalPlayer.ID)
                        {
                            this.SetSelectedObject(planetInfo.ID, "");
                            flag = true;
                            break;
                        }
                    }
                }
            }
            if (!flag)
            {
                this.SetSelectedObject(-1, "");
            }
            StationPlacementState.RefreshFleetAdmiralDetails(this.App, this._selectedFleetID);
            OverlayConstructionMission.RefreshMissionUI(this.App, this._selectedPlanetID, this._targetSystemID);
            OverlayConstructionMission.ReRefreshMissionDetails(this.App, this._missionEstimate);
            this.App.UI.AutoSizeContents("gameMissionDetails");
        }
示例#4
0
 protected override void OnEnter()
 {
     this.App.UI.UnlockUI();
     this.App.UI.SetScreen("PlanetManager");
     this.App.UI.AddItem("filterDropdown", "", 0, App.Localize("@UI_PLANET_MANAGER_ALL_PLANETS"));
     this.App.UI.AddItem("filterDropdown", "", 1, App.Localize("@UI_PLANET_MANAGER_SURVEYED_PLANETS"));
     this.App.UI.AddItem("filterDropdown", "", 2, App.Localize("@UI_PLANET_MANAGER_OWNED_PLANETS"));
     this.App.UI.AddItem("filterDropdown", "", 3, App.Localize("@UI_PLANET_MANAGER_ENEMY_PLANETS"));
     this.App.UI.SetSelection("filterDropdown", 0);
     this._currentFilterMode = PlanetManagerState.PlanetFilterMode.AllPlanets;
     this.App.UI.SetPropertyBool("gameExitButton", "lockout_button", true);
     EmpireBarUI.SyncTitleFrame(this.App);
     this._planetWidgets = new List <PlanetWidget>();
     this.SyncPlanetList();
 }
示例#5
0
        public static void SyncTitleBar(App game, string panelId, BudgetPiechart piechart)
        {
            PlayerInfo playerInfo        = game.GameDatabase.GetPlayerInfo(game.LocalPlayer.ID);
            Vector3    primaryColor      = playerInfo.PrimaryColor;
            string     withoutExtension1 = Path.GetFileNameWithoutExtension(playerInfo.BadgeAssetPath);
            string     withoutExtension2 = Path.GetFileNameWithoutExtension(playerInfo.AvatarAssetPath);

            game.UI.SetPropertyString(panelId, "avatar", withoutExtension2);
            game.UI.SetPropertyString(panelId, "badge", withoutExtension1);
            game.UI.SetPropertyString(panelId, "name", playerInfo.Name.ToUpper());
            game.UI.SetPropertyColorNormalized(panelId, "empire_color", primaryColor);
            string propertyValue = string.Format("{0} {1}", (object)App.Localize("@UI_GENERAL_TURN"), (object)game.GameDatabase.GetTurnCount());

            game.UI.SetPropertyString("turn_count", "text", propertyValue);
            long savings          = (long)playerInfo.Savings;
            long psionicPotential = (long)playerInfo.PsionicPotential;

            game.UI.SetPropertyString("gameEmpireSavings", "text", savings.ToString("N0"));
            game.UI.SetVisible("pnlPsiLevel", game.GameDatabase.PlayerHasTech(game.LocalPlayer.ID, "PSI_Clairvoyance") | game.GameDatabase.PlayerHasTech(game.LocalPlayer.ID, "PSI_Empathy") | game.GameDatabase.PlayerHasTech(game.LocalPlayer.ID, "PSI_Telekinesis") && game.LocalPlayer.Faction.Name != "loa");
            game.UI.SetPropertyString("lblPsiValue", "text", psionicPotential.ToString("N0"));
            EmpireHistoryData historyForPlayer = game.GameDatabase.GetLastEmpireHistoryForPlayer(game.LocalPlayer.ID);
            Vector3           vector3_1        = new Vector3((float)byte.MaxValue, (float)byte.MaxValue, (float)byte.MaxValue);
            Vector3           vector3_2        = new Vector3(0.0f, (float)byte.MaxValue, 0.0f);
            Vector3           vector3_3        = new Vector3((float)byte.MaxValue, 0.0f, 0.0f);

            if (historyForPlayer != null)
            {
                if (psionicPotential > (long)historyForPlayer.psi_potential)
                {
                    game.UI.SetPropertyColor("lblPsiValue", "color", vector3_2);
                }
                else if (psionicPotential < (long)historyForPlayer.psi_potential)
                {
                    game.UI.SetPropertyColor("lblPsiValue", "color", vector3_3);
                }
                else
                {
                    game.UI.SetPropertyColor("lblPsiValue", "color", vector3_1);
                }
            }
            EmpireBarUI.SyncResearchSlider(game, "gameEmpireResearchSlider", playerInfo, piechart);
        }
示例#6
0
        public static void SyncResearchSlider(App game, string sliderId, BudgetPiechart piechart)
        {
            PlayerInfo playerInfo = game.GameDatabase.GetPlayerInfo(game.LocalPlayer.ID);

            EmpireBarUI.SyncResearchSlider(game, sliderId, playerInfo, piechart);
        }