using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Automation; using Microsoft.UI.Xaml.Automation.Peers; using Microsoft.UI.Xaml.Automation.Provider; using Microsoft.UI.Xaml.Controls; using Newtonsoft.Json.Linq; using Windows.Foundation; namespace XFEWarframe.Desktop.Editing; internal static class EquipmentEditorVerification { internal static async Task VerifyExaltedAsync(Page page, EquipmentEditorView view, Func grantMod, Func> current, Action goBack, bool live) { const string glory = "/Lotus/Powersuits/Choir/ChoirEruptWeapon"; const string jade = "/Lotus/Powersuits/Choir/Abilities/ChoirEruptAbility"; const string hornet = "/Lotus/Upgrades/Mods/Pistol/WeaponDamageAmountMod"; await GameAssetImageVerification.VerifyAsync(view); await grantMod(); var model = view.Model!; await model.RefreshCommand.ExecuteAsync(null); await VerifySuitModdingAsync(page, view); var ability = model.Actions.Single(x => x.Key == "ability.multiple.2"); foreach (var field in ability.Fields) field.Value = new JValue(field.Key == "ability4" ? jade : ""); await model.SaveCommand.ExecuteAsync(ability); if (model.HasMessage || model.Related.All(x => x.Type != glory)) throw new InvalidOperationException("A transplanted weapon is absent from the host editor: " + model.Message); view.Selector.SelectedItem = view.Selector.Items.Single(x => ((EquipmentTab)x.Tag).Key == "exalted"); page.UpdateLayout(); await Task.Delay(150); var button = DialogVerification.Children