private void OnQuitResult(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes) { IRuntimeService service = Services.GetService <IRuntimeService>(); if (service != null) { ISessionService service2 = Services.GetService <ISessionService>(); Diagnostics.Assert(service2 != null); Diagnostics.Assert(service2.Session != null); Diagnostics.Assert(service.Runtime != null); Diagnostics.Assert(service.Runtime.FiniteStateMachine != null); if (!TutorialManager.IsActivated) { int lobbyData = service2.Session.GetLobbyData <int>("NumberOfMajorFactions", 0); EmpireInfo[] array = new EmpireInfo[lobbyData]; for (int i = 0; i < lobbyData; i++) { array[i] = EmpireInfo.Read(service2.Session, i); } service.Runtime.FiniteStateMachine.PostStateChange(typeof(RuntimeState_OutGame), new object[] { "GameEnded", array }); } else { service.Runtime.FiniteStateMachine.PostStateChange(typeof(RuntimeState_OutGame), new object[0]); } } } }
private void DoCancelRequest(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes) { base.HandleCancelRequest(); } }
private void OnExitDesktopResult(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes) { Amplitude.Unity.Framework.Application.Quit(); } }
private void DoClose(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes) { this.Hide(false); } }
private void OnDestroyCityImprovementResult(object sender, MessagePanelResultEventArgs e) { MessagePanelResult result = e.Result; if (result == MessagePanelResult.Ok) { List <ConstructedBuildingGuiItem> children = this.CityImprovementsTable.GetChildren <ConstructedBuildingGuiItem>(true); for (int i = 0; i < children.Count; i++) { if (children[i].Toggle.State && this.playerControllerRepository != null) { base.AgeTransform.Enable = false; OrderDestroyCityImprovement order = new OrderDestroyCityImprovement(this.City.Empire.Index, children[i].CityImprovement); Ticket ticket; this.playerControllerRepository.ActivePlayerController.PostOrder(order, out ticket, new EventHandler <TicketRaisedEventArgs>(this.OnOrderResponse)); } } List <ConstructedBuildingGuiItem> children2 = this.RegionBuildingsTable.GetChildren <ConstructedBuildingGuiItem>(true); for (int j = 0; j < children2.Count; j++) { if (children2[j].Toggle.State && this.playerControllerRepository != null) { base.AgeTransform.Enable = false; OrderDestroyPointOfInterestImprovement order2 = new OrderDestroyPointOfInterestImprovement(this.City.Empire.Index, children2[j].PointOfInterest); Ticket ticket2; this.playerControllerRepository.ActivePlayerController.PostOrder(order2, out ticket2, new EventHandler <TicketRaisedEventArgs>(this.OnOrderResponse)); } } } this.RefreshContent(); }
private void OnConfirmCreateCustomFaction(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes) { this.CreateCustomFaction(); } }
private void OnDisbandUnitsConfirmation(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes) { this.DisbandSelectedUnits(); } }
private void OnPostOrderBuyoutAndActivateBooster(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes && this.guiStackedBooster.BoosterDefinition.Target != BoosterDefinition.TargetType.City) { this.PostOrderBuyoutAndActivateBooster(GameEntityGUID.Zero); } }
private void OnConfirmOpenActivationPanel(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Ok) { base.GuiService.Show(typeof(ActivateRuntimeModulesModalPanel), new object[] { this.SelectedLobby.RuntimeConfiguration, this.SelectedLobby.SteamIDLobby }); } }
private void OnConfirmFileDelete(object sender, MessagePanelResultEventArgs e) { MessagePanelResult result = e.Result; if (result == MessagePanelResult.Ok || result == MessagePanelResult.Yes) { File.Delete(this.GameSaveDescriptor.SourceFileName); this.GameSaveDescriptor = null; this.RefreshContent(); } }
private void OnConfirmDeleteCustomFaction(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Ok) { this.DestroyFactionButton.AgeTransform.Enable = false; if (this.SelectedGuiFaction != null && this.SelectedGuiFaction.Faction != null) { if (!string.IsNullOrEmpty(this.SelectedGuiFaction.Faction.FileName)) { try { File.Delete(this.SelectedGuiFaction.Faction.FileName); } catch { } } IDatabase <Faction> database = Databases.GetDatabase <Faction>(false); if (database != null) { database.Remove(this.SelectedGuiFaction.Faction.Name); } IDownloadableContentService service = Services.GetService <IDownloadableContentService>(); base.GuiService.GetGuiPanel <MenuNewGameScreen>().OnCustomFactionDeleted(this.SelectedGuiFaction.Faction.Name); this.guiFactions.Remove(this.SelectedGuiFaction); if (this.guiFactions.Count > 0) { this.SelectedGuiFaction = this.guiFactions[0]; if (service != null) { bool flag = false; if (!service.TryCheckAgainstRestrictions(DownloadableContentRestrictionCategory.LobbyFaction, this.guiFactions[0].Name, out flag) || !flag) { Faction faction = database.FirstOrDefault((Faction iterator) => iterator.IsStandard && !iterator.IsHidden); for (int i = 0; i < this.guiFactions.Count; i++) { if (this.guiFactions[i].Faction.Name == faction.Name) { this.SelectedGuiFaction = this.guiFactions[i]; break; } } } } } else { this.SelectedGuiFaction = null; } } } this.RefreshContent(); }
private void ConfirmAssignment(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes && this.selectedHero != null) { IGameService service = Services.GetService <IGameService>(); IPlayerControllerRepositoryService service2 = service.Game.Services.GetService <IPlayerControllerRepositoryService>(); OrderChangeHeroAssignment order = new OrderChangeHeroAssignment(this.Army.Empire.Index, this.selectedHero.GUID, this.Army.GUID); Ticket ticket; service2.ActivePlayerController.PostOrder(order, out ticket, new EventHandler <TicketRaisedEventArgs>(this.OnOrderResponse)); } this.selectedHero = null; }
private void DoCancelRequest(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes) { this.modified = false; base.GuiService.GetGuiPanel <MenuFactionScreen>().ShowWhenFinishedHiding(new object[] { this.empireIndex, this.givenFaction }); } }
private void OnConfirmDownloadModulesBeforeActivation(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Ok) { this.Hide(false); base.GuiService.Show(typeof(ActivateRuntimeModulesModalPanel), new object[] { this.GameSaveDescriptor.RuntimeModules, this.GameSaveDescriptor, this }); } }
private static void SteamMatchMaking_OnConfirmOpenActivationPanel(object sender, MessagePanelResultEventArgs e) { global::IGuiService service = Services.GetService <global::IGuiService>(); if (e.Result == MessagePanelResult.Ok && service != null) { service.Show(typeof(ActivateRuntimeModulesModalPanel), new object[] { ELCPUtilities.SelectedLobby.RuntimeConfiguration, ELCPUtilities.SelectedLobby.SteamIDLobby }); } ELCPUtilities.SelectedLobby = null; }
private void OnConfirmFileSaveOverwrite(object sender, MessagePanelResultEventArgs e) { MessagePanelResult result = e.Result; if (result == MessagePanelResult.Ok || result == MessagePanelResult.Yes) { string text = this.TextInputLabel.Text; string outputFileName = System.IO.Path.Combine(global::Application.GameSaveDirectory, string.Format("{0}.sav", text)); this.saving = UnityCoroutine.StartCoroutine(this, this.SaveGameAsync(text, outputFileName), new EventHandler <CoroutineExceptionEventArgs>(this.SaveGameAsync_CoroutineExceptionHandler)); if (this.saving.IsFinished) { this.saving = null; } } }
private void ConfirmAction(object sender, MessagePanelResultEventArgs e) { if (e.Result == MessagePanelResult.Yes && this.City != null) { this.DoRazeInfectedCity(); } this.ActionToogle.State = (this.GetCurrentConstructionRaze() != null); if (this.ActionToogle.State && !this.ModifierSector.IsStarted()) { this.ModifierSector.StartAnimation(); } else if (!this.ActionToogle.State && this.ModifierSector.IsStarted()) { this.ModifierSector.Reset(); } }