Example #1
0
        protected override void OnPanelMessage(string panelName, string msgType, string[] msgParams)
        {
            if (!(msgType == "button_clicked"))
            {
                return;
            }
            if (panelName == "ignoreButton")
            {
                this._app.UI.CloseDialog((Dialog)this, true);
            }
            if (panelName == "attackButton")
            {
                this._app.Game.DeclareWarFormally(this._app.Game.LocalPlayer.ID, this._playerID);
                this._app.UI.CloseDialog((Dialog)this, true);
            }
            if (!(panelName == "diploButton"))
            {
                return;
            }
            StarMapState currentState = (StarMapState)this._app.CurrentState;

            new OverlayConstructionMission(this._app, currentState, currentState.StarMap, new SpecialConstructionMission()
            {
                _project           = SpecialProjectType.IndependentStudy,
                _forcedStationType = StationType.SCIENCE,
                _targetplayerid    = this._playerID,
                _targetsystemid    = this._systemID,
                _targetplanet      = this._planetID
            }, "OverlayStationMission", MissionType.CONSTRUCT_STN).Show(this._systemID);
            this._app.UI.CloseDialog((Dialog)this, true);
        }
Example #2
0
 public StationManagerDialog(App game, StarMapState starmap, int systemid = 0, string template = "dialogStationManager")
     : base(game, template)
 {
     this._starmap  = starmap;
     this.App       = game;
     this._systemID = systemid;
 }
        protected override void OnBack()
        {
            StarMapState gameState = this.App.GetGameState <StarMapState>();

            this.App.SwitchGameState((GameState)gameState);
            gameState.ShowOverlay(MissionType.CONSTRUCT_STN, this._targetSystemID);
        }
 public OverlayDeployAccelMission(
     App game,
     StarMapState state,
     StarMap starmap,
     string template = "OverlayAcceleratorMission")
     : base(game, state, starmap, MissionType.DEPLOY_NPG, template)
 {
 }
Example #5
0
 public OverlayEvacuationMission(
     App game,
     StarMapState state,
     StarMap starmap,
     string template = "OverlayEvacuationMission")
     : base(game, state, starmap, MissionType.EVACUATE, template)
 {
 }
 public OverlaySpecialConstructionMission(
     App game,
     StarMapState state,
     StarMap starmap,
     SpecialConstructionMission smission = null,
     string template = "OverlayGMBuildStationMission")
     : base(game, state, starmap, smission, template, MissionType.SPECIAL_CONSTRUCT_STN)
 {
 }
Example #7
0
 public OverlayConstructionMission(
     App game,
     StarMapState state,
     StarMap starmap,
     SpecialConstructionMission smission = null,
     string template = "OverlayStationMission",
     MissionType mt  = MissionType.CONSTRUCT_STN)
     : base(game, state, starmap, mt, template)
 {
     this._superspecialsecretmission = smission;
 }
Example #8
0
        protected void SetSyncedSystem(StarSystemInfo system)
        {
            this._selectedSystem = system;
            if (this._app.CurrentState.Name == "StarMapState")
            {
                StarMapState currentState = (StarMapState)this._app.CurrentState;
                currentState.StarMap.SetFocus((IGameObject)currentState.StarMap.Systems.Reverse[system.ID]);
                currentState.StarMap.Select((IGameObject)currentState.StarMap.Systems.Reverse[system.ID]);
            }
            this.App.UI.ClearItems("system_list");
            foreach (SystemWidget systemWidget in this._systemWidgets)
            {
                systemWidget.Terminate();
            }
            this._systemWidgets.Clear();
            foreach (PlanetWidget planetWidget in this._planetWidgets)
            {
                planetWidget.Terminate();
            }
            this._planetWidgets.Clear();
            this.App.UI.ClearItems("system_list");
            List <PlanetInfo> planetInfoList = this.FilteredPlanetList(system);

            this.App.UI.AddItem("system_list", "", system.ID, "", "systemTitleCard");
            this._systemWidgets.Add(new SystemWidget(this.App, this.App.UI.GetItemGlobalID("system_list", "", system.ID, "")));
            this._systemWidgets.Last <SystemWidget>().Sync(system.ID);
            foreach (PlanetInfo planetInfo in planetInfoList)
            {
                if (this.App.AssetDatabase.IsPotentialyHabitable(planetInfo.Type))
                {
                    this.App.UI.AddItem("system_list", "", planetInfo.ID + 999999, "", "planetDetailsM_Card");
                    string itemGlobalId = this.App.UI.GetItemGlobalID("system_list", "", planetInfo.ID + 999999, "");
                    this._planetWidgets.Add(new PlanetWidget(this.App, itemGlobalId));
                    this._planetWidgets.Last <PlanetWidget>().Sync(planetInfo.ID, false, true);
                    this.App.UI.SetPropertyString(this.App.UI.Path(itemGlobalId, "MoraleRow"), "id", "MoraleRow|" + (object)planetInfo.ID);
                }
                else if (this.App.AssetDatabase.IsGasGiant(planetInfo.Type))
                {
                    this.App.UI.AddItem("system_list", "", planetInfo.ID + 999999, "", "gasgiantDetailsM_Card");
                    string itemGlobalId = this.App.UI.GetItemGlobalID("system_list", "", planetInfo.ID + 999999, "");
                    this._planetWidgets.Add(new PlanetWidget(this.App, itemGlobalId));
                    this._planetWidgets.Last <PlanetWidget>().Sync(planetInfo.ID, false, false);
                    this.App.UI.SetPropertyString(this.App.UI.Path(itemGlobalId, "MoraleRow"), "id", "MoraleRow|" + (object)planetInfo.ID);
                }
                else if (this.App.AssetDatabase.IsMoon(planetInfo.Type))
                {
                    this.App.UI.AddItem("system_list", "", planetInfo.ID + 999999, "", "moonDetailsM_Card");
                    string itemGlobalId = this.App.UI.GetItemGlobalID("system_list", "", planetInfo.ID + 999999, "");
                    this._planetWidgets.Add(new PlanetWidget(this.App, itemGlobalId));
                    this._planetWidgets.Last <PlanetWidget>().Sync(planetInfo.ID, false, false);
                    this.App.UI.SetPropertyString(this.App.UI.Path(itemGlobalId, "MoraleRow"), "id", "MoraleRow|" + (object)planetInfo.ID);
                }
            }
        }
Example #9
0
        public static void FleetSelectionChanged(App App, int fleetid)
        {
            StarMapState currentState = (StarMapState)App.CurrentState;

            if (currentState == null || currentState.StarMap == null || !currentState.StarMap.Fleets.Reverse.ContainsKey(fleetid))
            {
                return;
            }
            StarMapFleet starMapFleet = currentState.StarMap.Fleets.Reverse[fleetid];

            if (starMapFleet == null)
            {
                return;
            }
            currentState.StarMap.SetFocus((IGameObject)starMapFleet);
            currentState.StarMap.Select((IGameObject)starMapFleet);
        }
Example #10
0
        public void Commit(App app)
        {
            if (this.AudioEnabled)
            {
                app.TurnOnSound();
            }
            else
            {
                app.TurnOffSound();
            }
            app.PostSetVolumeMusic(this.MusicVolume);
            app.PostSetVolumeSpeech(this.SpeechVolume);
            app.PostSetVolumeEffects(this.EffectsVolume);
            app.PostSpeechSubtitles(this.SpeechSubtitles);
            StarMapState gameState = app.GetGameState <StarMapState>();

            if (app.CurrentState != gameState)
            {
                return;
            }
            gameState.SetEndTurnTimeout(this.EndTurnDelay);
            gameState.EnableFleetCheck = this.CheckForInactiveFleets;
        }
 public ProvinceEditStarMapStateMode(GameSession sim, StarMapState state, StarMap starmap)
     : base(sim)
 {
     this._starmap = starmap;
     this._state   = state;
 }
Example #12
0
 public OverlayColonizeMission(App game, StarMapState state, StarMap starmap, string template = "OverlayColonizeMission")
     : base(game, state, starmap, MissionType.COLONIZATION, template)
 {
 }
Example #13
0
 public OverlayInterdictMission(App game, StarMapState state, StarMap starmap, string template = "OverlaySurveyMission")
     : base(game, state, starmap, MissionType.INTERDICTION, template)
 {
 }
 public OverlayInvasionMission(App game, StarMapState state, StarMap starmap, string template = "OverlayColonizeMission")
     : base(game, state, starmap, MissionType.INVASION, template)
 {
 }
Example #15
0
 public OverlayPiracyMission(App game, StarMapState state, StarMap starmap, string template = "OverlaySurveyMission")
     : base(game, state, starmap, MissionType.PIRACY, template)
 {
 }
Example #16
0
 public OverlayReactionlMission(App game, StarMapState state, StarMap starmap, string template = "OverlayReaction")
     : base(game, state, starmap, MissionType.REACTION, template)
 {
     this._containers = new List <OverlayReactionlMission.ReactionUIContainer>();
 }
		public OverlayInterceptMission(App game, StarMapState state, StarMap starmap, string template = "OverlayInterceptMission")
		  : base(game, state, starmap, MissionType.INTERCEPT, template)
		{
		}
 public OverlayPatrolMission(App game, StarMapState state, StarMap starmap, string template = "OverlaySurveyMission")
     : base(game, state, starmap, MissionType.PATROL, template)
 {
 }
Example #19
0
 protected override void OnPanelMessage(string panelName, string msgType, string[] msgParams)
 {
     if (this._piechart.TryPanelMessage(panelName, msgType, msgParams, PanelBinding.PanelMessageTargetFlags.Self))
     {
         return;
     }
     if (msgType == "slider_value")
     {
         if (this.SelectedObject == StarSystemDetailsUI.StarItemID)
         {
             return;
         }
         if (StarSystemDetailsUI.IsOutputRateSlider(panelName))
         {
             StarSystemDetailsUI.SetOutputRate(this.App, this.SelectedObject, panelName, msgParams[0]);
             StarSystemUI.SyncColonyDetailsWidget(this.App.Game, "colonyDetailsWidget", this.SelectedObject, "");
         }
         else if (panelName == "partOverharvestSlider")
         {
             ColonyInfo colonyInfoForPlanet = this.App.GameDatabase.GetColonyInfoForPlanet(this.SelectedObject);
             colonyInfoForPlanet.OverharvestRate = StarSystemDetailsUI.SliderValueToOutputRate(int.Parse(msgParams[0]));
             this.App.GameDatabase.UpdateColony(colonyInfoForPlanet);
             StarSystemUI.SyncColonyDetailsWidget(this.App.Game, "colonyDetailsWidget", this.SelectedObject, "");
         }
         else
         {
             if (!(panelName == "gameEmpireResearchSlider"))
             {
                 return;
             }
             StarMapState.SetEmpireResearchRate(this.App.Game, msgParams[0], this._piechart);
         }
     }
     else if (msgType == "button_clicked")
     {
         if (panelName == "gameEmpireSummaryButton")
         {
             this.App.SwitchGameState <EmpireSummaryState>();
         }
         else if (panelName == "btnAbandon")
         {
             this._confirmAbandon = this.App.UI.CreateDialog((Dialog) new GenericQuestionDialog(this.App, "@UI_DIALOGCONFIRMABANDON_TITLE", "@UI_DIALOGCONFIRMABANDON_DESC", "dialogGenericQuestion"), null);
         }
         else
         {
             if (!(panelName == "btnSystemOpen"))
             {
                 return;
             }
             bool isOpen = !this.App.GameDatabase.GetStarSystemInfo(this.CurrentSystem).IsOpen;
             this.App.GameDatabase.UpdateStarSystemOpen(this.CurrentSystem, isOpen);
             this.App.UI.SetVisible("SystemDetailsWidget.ClosedSystem", !isOpen);
             this.App.Game.OCSystemToggleData.SystemToggled(this.App.LocalPlayer.ID, this.CurrentSystem, isOpen);
         }
     }
     else
     {
         if (!(msgType == "dialog_closed") || !(panelName == this._confirmAbandon) || !bool.Parse(msgParams[0]))
         {
             return;
         }
         PlanetInfo planetInfo = this.App.GameDatabase.GetPlanetInfo(this.SelectedObject);
         if (planetInfo == null)
         {
             return;
         }
         GameSession.AbandonColony(this.App, this.App.GameDatabase.GetColonyInfoForPlanet(planetInfo.ID).ID);
     }
 }
 public OverlayStrikeMission(App game, StarMapState state, StarMap starmap, string template = "OverlaySurveyMission")
     : base(game, state, starmap, MissionType.STRIKE, template)
 {
 }
 public OverlayRelocateMission(App game, StarMapState state, StarMap starmap, string template = "OverlayRelocateMission")
     : base(game, state, starmap, MissionType.RELOCATION, template)
 {
 }
Example #22
0
 public OverlayUpgradeMission(App game, StarMapState state, StarMap starmap)
     : base(game, state, starmap, MissionType.CONSTRUCT_STN, "OverlayUpgradeStationMission")
 {
 }
Example #23
0
 public OverlaySupportMission(App game, StarMapState state, StarMap starmap, string template = "OverlaySupportMission")
     : base(game, state, starmap, MissionType.SUPPORT, template)
 {
     this._supportTripsSpinner = new ValueBoundSpinner(game.UI, "gameSupportTurnsSpinner", 1.0, 1.0, 0.0, 1.0);
 }