public SingleItemEditor(Item item) { InitializeComponent(); this.TranslateInterface(GameInfo.CurrentLanguage); // disassociate from original reference Item = item.ToBytesClass().ToClass <Item>(); ItemEditor.Initialize(GameInfo.Strings.ItemDataSource); ItemEditor.LoadItem(Item); }
public PlayerItemEditor(IReadOnlyList<T> array, int width, int height, bool sysbot = false) { InitializeComponent(); this.TranslateInterface(GameInfo.CurrentLanguage); Items = array; var Editor = ItemGrid = new ItemGridEditor(ItemEditor, Items) {Dock = DockStyle.Fill}; Editor.InitializeGrid(width, height); PAN_Items.Controls.Add(Editor); ItemEditor.Initialize(GameInfo.Strings.ItemDataSource); Editor.LoadItems(); DialogResult = DialogResult.Cancel; LoadItems = () => Editor.LoadItems(); B_Inject.Visible = sysbot; }
public PlayerItemEditor(IReadOnlyList <T> array, int width, int height, int sysbot = 0) { InitializeComponent(); Items = array; var Editor = new ItemGridEditor(ItemEditor, Items) { Dock = DockStyle.Fill }; Editor.InitializeGrid(width, height); PAN_Items.Controls.Add(Editor); ItemEditor.Initialize(GameInfo.Strings.ItemDataSource); Editor.LoadItems(); DialogResult = DialogResult.Cancel; LoadItems = () => Editor.LoadItems(); B_Inject.Visible = (SysBotLength = sysbot) > 0; }
public PlayerItemEditor(IReadOnlyList <T> array, int width, int height) { InitializeComponent(); Items = array; var items = GameInfo.Strings.itemlist.ToArray(); var set = new HashSet <string>(); for (int i = 0; i < items.Length; i++) { var item = items[i]; if (string.IsNullOrEmpty(item)) { items[i] = $"(Item #{i:000})"; } else if (set.Contains(item)) { items[i] += $" (#{i:000})"; } else { set.Add(item); } } var Editor = new ItemGridEditor(ItemEditor, Items, items) { Dock = DockStyle.Fill }; Editor.InitializeGrid(width, height); PAN_Items.Controls.Add(Editor); ItemEditor.Initialize(items); Editor.LoadItems(); DialogResult = DialogResult.Cancel; LoadItems = () => Editor.LoadItems(); }