protected override bool CanDoNext() { if (!base.CanDoNext()) { return(false); } if (this.curScen == null) { return(false); } if (!Page_ScenarioEditor.CheckAllPartsCompatible(this.curScen)) { return(false); } Page_SelectScenario.BeginScenarioConfiguration(this.curScen, this); return(true); }
protected override bool CanDoNext() { bool result; if (!base.CanDoNext()) { result = false; } else if (this.curScen == null) { result = false; } else if (!Page_ScenarioEditor.CheckAllPartsCompatible(this.curScen)) { result = false; } else { Page_SelectScenario.BeginScenarioConfiguration(this.curScen, this); result = true; } return(result); }
private void DoConfigControls(Rect rect) { Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.ColumnWidth = 200f; listing_Standard.Begin(rect); if (listing_Standard.ButtonText("Load".Translate(), null)) { Find.WindowStack.Add(new Dialog_ScenarioList_Load(delegate(Scenario loadedScen) { this.curScen = loadedScen; this.seedIsValid = false; })); } if (listing_Standard.ButtonText("Save".Translate(), null) && Page_ScenarioEditor.CheckAllPartsCompatible(this.curScen)) { Find.WindowStack.Add(new Dialog_ScenarioList_Save(this.curScen)); } if (listing_Standard.ButtonText("RandomizeSeed".Translate(), null)) { SoundDefOf.TickTiny.PlayOneShotOnCamera(null); this.RandomizeSeedAndScenario(); this.seedIsValid = true; } if (this.seedIsValid) { listing_Standard.Label("Seed".Translate().CapitalizeFirst(), -1f); string a = listing_Standard.TextEntry(this.seed, 1); if (a != this.seed) { this.seed = a; this.curScen = ScenarioMaker.GenerateNewRandomScenario(this.seed); } } else { listing_Standard.Gap((float)(Text.LineHeight + Text.LineHeight + 2.0)); } listing_Standard.CheckboxLabeled("EditMode".Translate().CapitalizeFirst(), ref this.editMode, (string)null); if (this.editMode) { this.seedIsValid = false; if (listing_Standard.ButtonText("AddPart".Translate(), null)) { this.OpenAddScenPartMenu(); } if (SteamManager.Initialized && (this.curScen.Category == ScenarioCategory.CustomLocal || this.curScen.Category == ScenarioCategory.SteamWorkshop) && listing_Standard.ButtonText(Workshop.UploadButtonLabel(this.curScen.GetPublishedFileId()), null) && Page_ScenarioEditor.CheckAllPartsCompatible(this.curScen)) { AcceptanceReport acceptanceReport = this.curScen.TryUploadReport(); if (!acceptanceReport.Accepted) { Messages.Message(acceptanceReport.Reason, MessageTypeDefOf.RejectInput); } else { SoundDefOf.TickHigh.PlayOneShotOnCamera(null); Find.WindowStack.Add(Dialog_MessageBox.CreateConfirmation("ConfirmSteamWorkshopUpload".Translate(), delegate { SoundDefOf.TickHigh.PlayOneShotOnCamera(null); Find.WindowStack.Add(Dialog_MessageBox.CreateConfirmation("ConfirmContentAuthor".Translate(), delegate { SoundDefOf.TickHigh.PlayOneShotOnCamera(null); Workshop.Upload(this.curScen); }, true, null)); }, true, null)); } } } listing_Standard.End(); }