private static void AxBySwapper() { ImGui.BulletText("Input Type:"); ImGui.SameLine(); if (ImGuiAddons.BeginComboFixed("##Current AxBy", FfxHelperMethods.AxByToName(SelectedFfxWindow.AxBy))) { if (FfxHelperMethods.AxByColorArray.Contains(SelectedFfxWindow.AxBy)) { foreach (string str in FfxHelperMethods.AxByColorArray) { bool selected = false; if (SelectedFfxWindow.AxBy == str) { selected = true; } if (ImGui.Selectable(FfxHelperMethods.AxByToName(str), selected) & str != SelectedFfxWindow.AxBy) { XElement axbyElement = SelectedFfxWindow.FfxPropertyEditorElement; if (str == "A19B7") { XElement templateXElement = DefParser.TemplateGetter("19", "7"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "19")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "7")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else if (str == "A35B11") { XElement templateXElement = DefParser.TemplateGetter("35", "11"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "35")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "11")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else if (str == "A67B19") { if (SelectedFfxWindow.AxBy == "A4163B35") { var actionListQuick = new List <Action>(); actionListQuick.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "67")); actionListQuick.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "19")); actionListQuick.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionListQuick)); return; } XElement templateXElement = DefParser.TemplateGetter("67", "19"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "67")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "19")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else if (str == "A99B27") { XElement templateXElement = DefParser.TemplateGetter("99", "27"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "99")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "27")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else if (str == "A4163B35") { if (SelectedFfxWindow.AxBy == "A67B19") { var actionListQuick = new List <Action>(); actionListQuick.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "4163")); actionListQuick.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "35")); actionListQuick.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionListQuick)); return; } XElement templateXElement = DefParser.TemplateGetter("4163", "35"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "4163")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "35")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } return; } } } else if (FfxHelperMethods.AxByScalarArray.Contains(SelectedFfxWindow.AxBy)) { foreach (string str in FfxHelperMethods.AxByScalarArray) { bool selected = false; if (SelectedFfxWindow.AxBy == str) { selected = true; } if (ImGui.Selectable(FfxHelperMethods.AxByToName(str), selected) & str != SelectedFfxWindow.AxBy) { XElement axbyElement = SelectedFfxWindow.FfxPropertyEditorElement; if (str == "A0B0") { XElement templateXElement = DefParser.TemplateGetter("0", "0"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "0")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "0")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else if (str == "A16B4") { XElement templateXElement = DefParser.TemplateGetter("16", "4"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "16")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "4")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else if (str == "A32B8") { XElement templateXElement = DefParser.TemplateGetter("32", "8"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "32")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "8")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else if (str == "A64B16") { XElement templateXElement = DefParser.TemplateGetter("64", "16"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "64")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "16")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else if (str == "A96B24") { XElement templateXElement = DefParser.TemplateGetter("96", "24"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "96")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "24")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else if (str == "A4160B32") { XElement templateXElement = DefParser.TemplateGetter("4160", "32"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "4160")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "32")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } return; } } } else { ImGui.Selectable(SelectedFfxWindow.AxBy, true); } ImGuiAddons.EndComboFixed(); } ImGui.SameLine(); if (ImGuiAddons.ButtonGradient("Flip C/S")) { XElement axbyElement = SelectedFfxWindow.FfxPropertyEditorElement; if (FfxHelperMethods.AxByColorArray.Contains(SelectedFfxWindow.AxBy)) { XElement templateXElement = DefParser.TemplateGetter("0", "0"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "0")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "0")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } else { XElement templateXElement = DefParser.TemplateGetter("19", "7"); if (templateXElement != null) { var actionList = new List <Action>(); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumA"), "19")); actionList.Add(new ModifyXAttributeString(axbyElement.Attribute("TypeEnumB"), "7")); actionList.Add(new XElementReplaceChildren(axbyElement, templateXElement)); actionList.Add(new ResetEditorSelection(SelectedFfxWindow)); SelectedFfxWindow.ActionManager.ExecuteAction(new CompoundAction(actionList)); } } } }