private void _buttonQuery_Click(object sender, RoutedEventArgs e) { var dialog = new SelectFromDialog(_gdb.GetMetaTable <int>(_sdb), _sdb, _tbId.Text); dialog.Owner = this; if (dialog.ShowDialog() == true) { _tbId.Text = dialog.Id; } }
public static void WeaponViewIdRepair(SdeDatabase sdb, BaseDb currentDb) { var itemDb = sdb.GetMetaTable <int>(ServerDbs.Items); var itemDb1 = sdb.GetDb <int>(ServerDbs.Items); var itemDb2 = sdb.GetDb <int>(ServerDbs.Items2); string error; Dictionary <int, string> dico; if (LuaHelper.GetIdToSpriteTable(itemDb2, LuaHelper.ViewIdTypes.Weapon, out dico, out error)) { } foreach (var tuple in itemDb1.Table.FastItems) { if (ItemParser.IsWeaponType(tuple)) { int viewId = tuple.GetIntNoThrow(ServerItemAttributes.ClassNumber); } } }
private void _autoAdd(bool full) { try { var itemDb = _gdb.GetMetaTable <int>(ServerDbs.Items); var citemDb = _gdb.GetDb <int>(ServerDbs.CItems); List <ReadableTuple <int> > headgears = itemDb.FastItems.Where(p => ItemParser.IsArmorType(p) && (p.GetIntNoThrow(ServerItemAttributes.Location) & 7937) != 0).OrderBy(p => p.GetIntNoThrow(ServerItemAttributes.ClassNumber)).ToList(); foreach (var sTuple in headgears) { var viewId = sTuple.GetIntNoThrow(ServerItemAttributes.ClassNumber); if (viewId == 0) { continue; } var cTuple = citemDb.Table.TryGetTuple(sTuple.Key); var item = _obItems.FirstOrDefault(p => p.Id == viewId); var accName = LuaHelper.LatinOnly(sTuple.GetValue <string>(ServerItemAttributes.AegisName)); if (cTuple == null) { if (item == null) { _obItems.Add(new AccessoryItemView(new AccessoryItem { Id = viewId, AccId = full ? "ACCESSORY_" + accName : null, Texture = "" })); } else { if (String.IsNullOrEmpty(item.Texture) && full) { item.Texture = accName; } if (String.IsNullOrEmpty(item.AccId) && full) { item.AccId = "ACCESSORY_" + accName; } } continue; } if (item == null) { _obItems.Add(new AccessoryItemView(new AccessoryItem { Id = viewId, AccId = full ? "ACCESSORY_" + accName : null, Texture = cTuple.GetValue <string>(ClientItemAttributes.IdentifiedResourceName) })); } else { if (String.IsNullOrEmpty(item.Texture)) { item.Texture = cTuple.GetValue <string>(ClientItemAttributes.IdentifiedResourceName); } if (String.IsNullOrEmpty(item.AccId) && full) { item.AccId = "ACCESSORY_" + accName; } } } if (_obItems.Count > 0) { _dataGrid.ScrollIntoView(_obItems.Last()); } } catch (Exception err) { ErrorHandler.HandleException(err); } }
private void _findTableErrors(List <ValidationErrorView> errors) { _validateItemDb(_database.GetMetaTable <int>(ServerDbs.Items), errors); _validateMobDb(_database.GetMetaTable <int>(ServerDbs.Mobs), errors); }