Save current byaml text format to config to stay when reopened
This commit is contained in:
parent
f3b1d0e706
commit
d0b6d132c7
@ -59,7 +59,13 @@ namespace FirstPlugin
|
|||||||
xmlOldToolstrip = new STToolStipMenuItem("XML (Toolbox/Editorcore)", null, OnFormatChanged);
|
xmlOldToolstrip = new STToolStipMenuItem("XML (Toolbox/Editorcore)", null, OnFormatChanged);
|
||||||
xmlToolstrip = new STToolStipMenuItem("XML (YamlConv)", null, OnFormatChanged);
|
xmlToolstrip = new STToolStipMenuItem("XML (YamlConv)", null, OnFormatChanged);
|
||||||
yamlToolstrip = new STToolStipMenuItem("YAML", null, OnFormatChanged);
|
yamlToolstrip = new STToolStipMenuItem("YAML", null, OnFormatChanged);
|
||||||
yamlToolstrip.Checked = true;
|
|
||||||
|
if (Runtime.ByamlEditor.TextFormat == Runtime.ByamlTextFormat.YAML)
|
||||||
|
yamlToolstrip.Checked = true;
|
||||||
|
else if (Runtime.ByamlEditor.TextFormat == Runtime.ByamlTextFormat.XML_YamlConv)
|
||||||
|
xmlToolstrip.Checked = true;
|
||||||
|
else if (Runtime.ByamlEditor.TextFormat == Runtime.ByamlTextFormat.XML_EditorCore)
|
||||||
|
xmlOldToolstrip.Checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByamlEditor(System.Collections.IEnumerable by, bool _pathSupport, ushort _ver, ByteOrder defaultOrder = ByteOrder.LittleEndian, bool IsSaveDialog = false, BYAML byaml = null)
|
public ByamlEditor(System.Collections.IEnumerable by, bool _pathSupport, ushort _ver, ByteOrder defaultOrder = ByteOrder.LittleEndian, bool IsSaveDialog = false, BYAML byaml = null)
|
||||||
@ -135,6 +141,15 @@ namespace FirstPlugin
|
|||||||
var menu = sender as STToolStipMenuItem;
|
var menu = sender as STToolStipMenuItem;
|
||||||
menu.Checked = true;
|
menu.Checked = true;
|
||||||
|
|
||||||
|
if (yamlToolstrip.Checked)
|
||||||
|
Runtime.ByamlEditor.TextFormat = Runtime.ByamlTextFormat.YAML;
|
||||||
|
if (xmlToolstrip.Checked)
|
||||||
|
Runtime.ByamlEditor.TextFormat = Runtime.ByamlTextFormat.XML_YamlConv;
|
||||||
|
if (xmlOldToolstrip.Checked)
|
||||||
|
Runtime.ByamlEditor.TextFormat = Runtime.ByamlTextFormat.XML_EditorCore;
|
||||||
|
|
||||||
|
Toolbox.Library.Config.Save();
|
||||||
|
|
||||||
if (textEditor.GetText() != string.Empty) {
|
if (textEditor.GetText() != string.Empty) {
|
||||||
UpdateTextEditor();
|
UpdateTextEditor();
|
||||||
}
|
}
|
||||||
|
@ -298,6 +298,11 @@ namespace Toolbox.Library
|
|||||||
case "DumpShadersDEBUG":
|
case "DumpShadersDEBUG":
|
||||||
bool.TryParse(node.InnerText, out Runtime.DumpShadersDEBUG);
|
bool.TryParse(node.InnerText, out Runtime.DumpShadersDEBUG);
|
||||||
break;
|
break;
|
||||||
|
case "BymlTextFormat":
|
||||||
|
Runtime.ByamlTextFormat textFormat;
|
||||||
|
Enum.TryParse(node.InnerText, out textFormat);
|
||||||
|
Runtime.ByamlEditor.TextFormat = textFormat;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -406,6 +411,7 @@ namespace Toolbox.Library
|
|||||||
AppendResourceTableSettings(doc, mainNode);
|
AppendResourceTableSettings(doc, mainNode);
|
||||||
AppendDeveloperSettings(doc, mainNode);
|
AppendDeveloperSettings(doc, mainNode);
|
||||||
AppendLayoutEditorSettings(doc, mainNode);
|
AppendLayoutEditorSettings(doc, mainNode);
|
||||||
|
AppendByamlEditorSettings(doc, mainNode);
|
||||||
|
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
@ -489,6 +495,13 @@ namespace Toolbox.Library
|
|||||||
PathsNode.AppendChild(createNode(doc, "ProdKeys", Runtime.SwitchKeys.ProdKeys.ToString()));
|
PathsNode.AppendChild(createNode(doc, "ProdKeys", Runtime.SwitchKeys.ProdKeys.ToString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void AppendByamlEditorSettings(XmlDocument doc, XmlNode parentNode)
|
||||||
|
{
|
||||||
|
XmlNode PathsNode = doc.CreateElement("ByamlEditor");
|
||||||
|
parentNode.AppendChild(PathsNode);
|
||||||
|
PathsNode.AppendChild(createNode(doc, "BymlTextFormat", Runtime.ByamlEditor.TextFormat.ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
private static void AppenPBRSettings(XmlDocument doc, XmlNode parentNode)
|
private static void AppenPBRSettings(XmlDocument doc, XmlNode parentNode)
|
||||||
{
|
{
|
||||||
XmlNode SettingsNode = doc.CreateElement("PBR");
|
XmlNode SettingsNode = doc.CreateElement("PBR");
|
||||||
|
@ -70,6 +70,17 @@ namespace Toolbox.Library
|
|||||||
public static int FontSize = 12;
|
public static int FontSize = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ByamlEditor {
|
||||||
|
public static ByamlTextFormat TextFormat = ByamlTextFormat.YAML;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ByamlTextFormat
|
||||||
|
{
|
||||||
|
XML_EditorCore,
|
||||||
|
XML_YamlConv,
|
||||||
|
YAML,
|
||||||
|
}
|
||||||
|
|
||||||
public class MuuntEditor
|
public class MuuntEditor
|
||||||
{
|
{
|
||||||
public static bool Enable3DViewport = false;
|
public static bool Enable3DViewport = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user