private void btnGpJumpBack_Click(object sender, EventArgs e) { try { btnGpJumpBack.Visible = false; if (RTC_StockpileManager.allBackupStates.Count == 0) { return; } StashKey sk = RTC_StockpileManager.allBackupStates.Pop(); if (sk != null) { sk.Run(); } RTC_GameProtection.Reset(); } finally { if (RTC_StockpileManager.allBackupStates.Count != 0) { btnGpJumpBack.Visible = true; } } }
private void btnLoadCorrupt_Click(object sender, EventArgs e) { BlastLayer bl = new BlastLayer(); foreach (var item in lbBlastLayer.Items) { BlastUnit bu = (item as BlastUnit); if (bu.IsEnabled) { bl.Layer.Add(bu); } } StashKey newSk = (StashKey)sk.Clone(); newSk.BlastLayer = (BlastLayer)bl.Clone(); GC.Collect(); GC.WaitForPendingFinalizers(); newSk.Run(); }