Exemplo n.º 1
0
        public static void RefreshFleetAdmiralDetails(App game, int fleetId)
        {
            FleetInfo fleetInfo = game.GameDatabase.GetFleetInfo(fleetId);
            string    str1      = game.GameDatabase.GetFactionName(game.GameDatabase.GetFleetFaction(fleetId));
            string    str2      = string.Empty;
            string    str3      = string.Empty;

            if (fleetInfo.AdmiralID != 0)
            {
                AdmiralInfo admiralInfo = game.GameDatabase.GetAdmiralInfo(fleetInfo.AdmiralID);
                str2 = admiralInfo.Name;
                str3 = StationPlacementState.GetAdmiralTraitsString(game, fleetInfo.AdmiralID);
                str1 = admiralInfo.Race;
            }
            string upperInvariant1 = string.Format(App.Localize("@MISSIONWIDGET_ADMIRAL"), (object)str2).ToUpperInvariant();

            game.UI.SetText("gameAdmiralName", upperInvariant1);
            string upperInvariant2 = string.Format(App.Localize("@MISSIONWIDGET_FLEET"), (object)fleetInfo.Name).ToUpperInvariant();

            game.UI.SetText("gameAdmiralFleet", upperInvariant2);
            string text = string.Format(App.Localize("@MISSIONWIDGET_ADMIRAL_TRAITS"), (object)str3);

            game.UI.SetText("gameAdmiralSkills", text);
            string propertyValue = string.Format("admiral_{0}", (object)str1);

            if (fleetInfo.AdmiralID != 0)
            {
                propertyValue = Kerberos.Sots.StarFleet.StarFleet.GetAdmiralAvatar(game, fleetInfo.AdmiralID);
            }
            game.UI.SetPropertyString("gameAdmiralAvatar", "sprite", propertyValue);
        }
Exemplo n.º 2
0
        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");
        }
Exemplo n.º 3
0
        public static string GetAdmiralTraitsString(App game, int admiralId)
        {
            string empty = string.Empty;

            foreach (AdmiralInfo.TraitType traitType in (AdmiralInfo.TraitType[])Enum.GetValues(typeof(AdmiralInfo.TraitType)))
            {
                if (game.GameDatabase.GetLevelForAdmiralTrait(admiralId, traitType) > 0)
                {
                    if (!string.IsNullOrEmpty(empty))
                    {
                        empty += ", ";
                    }
                    empty += StationPlacementState.GetAdmiralTraitText(traitType);
                }
            }
            return(empty);
        }