private void LoadPreset(LayoutPreset preset) { if (!preset.Load()) { Dialog_Alert.Open(Lang.Get("Dialog_Config.Tab.Content.Preset.Invalid", preset.Name)); return; } Dialog_Alert.Open(Lang.Get("Dialog_Config.Tab.Content.Preset.Loaded", preset.Name)); RefreshEditor(); }
private static void TryLoadPreset(ExternalMod mod, string id) { if (!mod.IsActive) { Dialog_Alert.Open(Lang.Get("Dialog_Config.Tab.Content.Layout.Preset.Invalid", mod.Name)); return; } HudLayout.LoadPreset(id); Dialog_Alert.Open(Lang.Get("Dialog_Config.Tab.Content.Layout.Preset.Loaded", mod.Name)); }
private void Save() { var xe = new XElement(LayoutPreset.RootElementName); xe.Add(new XAttribute(LayoutPreset.VersionAttributeName, Mod.Version)); if (_includeDocked) { xe.Add(HudLayout.Docked.ToXml(HudLayout.DockedElementName, _includeHeight ? Theme.InspectPaneHeight.Value : -1, _includeWidth ? Theme.InspectPaneTabWidth.Value : -1, _includeTabs ? Theme.InspectPaneMinTabs.Value : -1)); } if (_includeFloating) { xe.Add(HudLayout.Floating.ToXml(HudLayout.FloatingElementName, _includeHeight ? Theme.HudHeight.Value : -1, _includeWidth ? Theme.HudWidth.Value : -1)); } Persistent.SaveLayoutPreset(_name, xe); LayoutPreset.RefreshUserPresets(); Dialog_Alert.Open(Lang.Get("Alert.Saved", _name)); Close(); }
private void LoadDefaultPreset() { HudLayout.LoadDefaultAndSave(); Dialog_Alert.Open(Lang.Get("Dialog_Config.Tab.Content.Preset.DefaultLoaded")); RefreshEditor(); }
private void ConfirmSetToDefault() => Dialog_Alert.Open(Lang.Get("Alert.SetToDefault"), Dialog_Alert.Buttons.YesNo, SetToDefault);
private void ConfirmDelete() => Dialog_Alert.Open(Lang.Get("Alert.ConfirmDelete", _selected.Name), Dialog_Alert.Buttons.YesNo, Delete);
private static void LoadDefaultPreset() { HudLayout.LoadDefault(); Dialog_Alert.Open(Lang.Get("Dialog_Config.Tab.Content.Layout.Preset.DefaultLoaded")); }