public async void TrashButton_Click() { PopupResult popResult = await MenuManager.LaunchPopupAsync(PopupType.OKCancel, $"Destroying {trait.Name} will remove it from all minis. Proceed?"); if (popResult == PopupResult.OK) { MiniCollection.RemoveTraitFromAllMinis(trait); Trait.RemoveTrait(trait); monitor.PopulateGrid(); } }
static public void Initialize() { if (initialized) { return; } initialized = true; Utils.Initialize(); ImageUtils.Initialize(); MiniCollection.Initialize(); Trait.Initialize(); MenuManager.Initialize(); Loader.Initialize(); PopupMonitor.Initialize(); }
public async void IncludeToggle_Click() { if (toggling) { return; // this method may call itself, btu should only run once } toggling = true; // set to false after method is complete, to prevent multiple calls // if IncludeAll, trait is true but toggle just turned off // if !IncludeAll, trait is false but toggle just turned on PopupResult popResult; string message = trait.IncludeAll ? "Disabling this does not remove it on existing minis." : "Enabling this will include the trait on any Mini that does not yet have it yet."; popResult = await MenuManager.LaunchPopupAsync(PopupType.OKCancel, message); // result handling now done asyncronously, in-method if (popResult == PopupResult.OK) { // carry the toggle change to the trait trait.IncludeAll = includeToggle.isOn; // if the change turned on IncludeAll, add the trait to all minis if (trait.IncludeAll) { MiniCollection.AddTraitToAllMinis(trait); } } else { // Cancel: remove the toggle, leave IncludeAll as-is includeToggle.isOn = trait.IncludeAll; } toggling = false; }
internal NormalCollection(MiniCollection left, ImmutableCollection <MiniCollection> middle, MiniCollection right) { m_left = left; m_middle = middle; m_right = right; }
// SetPanel() does not need overwriting public void NewButton_Click() { MiniCollection.NewMini(); // later replace PopulateGrid with AddToGrid monitor.PopulateGrid(true); // include ScrollToEnd() }