public void Update() { string rawSpells = WowInterface.HookManager.GetSpells() .Replace(".799999237061", ""); // weird druid bug kekw try { Spells = JsonConvert.DeserializeObject <List <Spell> >(rawSpells).OrderBy(e => e.Name).ThenByDescending(e => e.Rank).ToList(); OnSpellBookUpdate?.Invoke(); } catch (Exception e) { AmeisenLogger.Instance.Log("CharacterManager", $"Failed to parse Spells JSON:\n{rawSpells}\n{e}", LogLevel.Error); } }
public void Update() { string rawSpells = WowInterface.HookManager.LuaGetSpells(); try { Spells = JsonConvert.DeserializeObject <List <Spell> >(rawSpells, JsonSerializerSettings) .OrderBy(e => e.Name) .ThenByDescending(e => e.Rank) .ToList(); OnSpellBookUpdate?.Invoke(); } catch (Exception e) { AmeisenLogger.I.Log("CharacterManager", $"Failed to parse Spells JSON:\n{rawSpells}\n{e}", LogLevel.Error); } }
public void Update() { string rawSpells = Wow.GetSpells(); try { Spells = JsonSerializer.Deserialize <List <Spell> >(rawSpells, new() { AllowTrailingCommas = true, NumberHandling = JsonNumberHandling.AllowReadingFromString }) .OrderBy(e => e.Name) .ThenByDescending(e => e.Rank) .ToList(); OnSpellBookUpdate?.Invoke(); } catch (Exception e) { AmeisenLogger.I.Log("CharacterManager", $"Failed to parse Spells JSON:\n{rawSpells}\n{e}", LogLevel.Error); } }