private string GetName() { string name = null; uint stringPtr = 0; switch (_toolType) { case ToolType.SpellFocus: WoWDb.DbTable t = StyxWoW.Db[ClientDb.SpellFocusObject]; WoWDb.Row r = t.GetRow(_index); stringPtr = r.GetField <uint>(1); break; case ToolType.AreaTable: t = StyxWoW.Db[ClientDb.AreaTable]; r = t.GetRow(_index); stringPtr = r.GetField <uint>(11); break; case ToolType.Item: name = Util.GetItemCacheName(_index); break; case ToolType.Totem: t = StyxWoW.Db[ClientDb.TotemCategory]; r = t.GetRow(_index); stringPtr = r.GetField <uint>(1); break; } if (stringPtr != 0) { name = ObjectManager.Wow.Read <string>(stringPtr); } return(name); }
private string GetName() { string name = Util.GetItemCacheName(Parent.ID); if (name == null) { // ok so it couldn't find the item in cache. since we're going to need to force a load // might as well do a framelock and try load all the items. IEnumerable <uint> ids = Parent.MasterList.Keys.Where(id => id != Parent.ID); using (new FrameLock()) { foreach (uint id in ids) { name = Util.GetItemCacheName(id); } } } return(name); }