private void Tag_Load(IndexEntry entry) { //Check if (entry == null) { return; } widgetPropertyGrid.SelectedObject = null; //Setup Text = $"HUD Editor - {entry.Filename}.{entry.Root}"; //Check if (hud != null) { hud.Dispose(); } hud = new HaloHud(entry, Map); foreach (var bitmap in hudBitmaps) { bitmap.Value.Dispose(); } hudBitmaps.Clear(); //Load Bitmaps foreach (var widget in hud.BitmapWidgets) { BitmapWidget_LoadBitmap(widget); } //Add widgetComboBox.BeginUpdate(); widgetComboBox.Items.Clear(); //Loop foreach (var widget in hud.BitmapWidgets) { widgetComboBox.Items.Add(widget); } //End widgetComboBox.EndUpdate(); //Select if (widgetComboBox.Items.Count > 0) { widgetComboBox.SelectedIndex = 0; } //Draw HudBox_DrawHud(); }
private void Tag_Reload() { //Check if (hud != null) { hud.Dispose(); } hud = new HaloHud(SelectedEntry, Map); foreach (var bitmap in hudBitmaps) { bitmap.Value.Dispose(); } hudBitmaps.Clear(); //Load Bitmaps foreach (var widget in hud.BitmapWidgets) { BitmapWidget_LoadBitmap(widget); } //Add widgetComboBox.BeginUpdate(); widgetComboBox.Items.Clear(); //Loop foreach (var widget in hud.BitmapWidgets) { widgetComboBox.Items.Add(widget); } //End widgetComboBox.EndUpdate(); //Select if (widgetComboBox.Items.Count > 0) { widgetComboBox.SelectedIndex = 0; } //Draw HudBox_DrawHud(); }