public void RefreshImage() { Image oldImage = outfiterImageBox.Image; outfiterImageBox.Image = outfit.GetImage(); if (oldImage != null) { oldImage.Dispose(); } outfiterCode.Text = outfit.ToString(); }
public void RefreshImage() { Image oldImage = outfiterImageBox.Image; outfiterImageBox.Image = outfit.GetImage(); if (oldImage != null) { oldImage.Dispose(); } }
private void outfiterButton_Click(object sender, EventArgs e) { int index = nameListBox.SelectedIndex; string code = outfiterCode.Text; SettingsManager.setSetting("HealthListImage" + index.ToString(), code); OutfiterOutfit outfit = new OutfiterOutfit(); outfit.FromString(code); playerImageBox.Image = outfit.GetImage(); }
private void refreshCenterImage() { string centerLocation = SettingsManager.getSettingString("PortraitCenterImage"); if (centerLocation == null) { return; } centerImageBox.Image = LoadImageFromPath(centerLocation); if (centerImageBox.Image == null) { OutfiterOutfit outfit = new OutfiterOutfit(); outfit.FromString(centerLocation); centerImageBox.Image = outfit.GetImage(); outfiterCode.Text = centerLocation; } }
public HealthList() { InitializeComponent(); this.BackColor = StyleManager.BlendTransparencyKey; this.TransparencyKey = StyleManager.BlendTransparencyKey; displayNames = SettingsManager.getSettingBool(GetHUD() + "DisplayNames"); displayIcons = SettingsManager.getSettingBool(GetHUD() + "DisplayIcons"); displayText = SettingsManager.getSettingBool(GetHUD() + "DisplayText"); healthBarHeight = SettingsManager.getSettingInt(GetHUD() + "Height"); playerBarHeight = displayNames ? healthBarHeight * 5 / 3 : healthBarHeight; List <string> names = SettingsManager.getSetting(GetHUD() + "PlayerNames"); int index = 0; foreach (string name in names) { if (name.Trim() == "") { continue; } string imagePath = SettingsManager.getSettingString(GetHUD() + "Image" + index.ToString()); Image image = null; if (imagePath != null) { try { image = Image.FromFile(imagePath); } catch { OutfiterOutfit outfit = new OutfiterOutfit(); outfit.FromString(imagePath); image = outfit.GetImage(); } } this.players.Add(new PlayerEntry { name = name, playerImage = image }); index++; } double opacity = SettingsManager.getSettingDouble(GetHUD() + "Opacity"); opacity = Math.Min(1, Math.Max(0, opacity)); this.Opacity = opacity; }
private void nameListBox_SelectedIndexChanged(object sender, EventArgs e) { if (MainForm.prevent_settings_update) { return; } string imagePath = SettingsManager.getSettingString("HealthListImage" + nameListBox.SelectedIndex); playerImageBox.Image = null; if (imagePath != null) { try { playerImageBox.Image = Image.FromFile(imagePath); } catch { OutfiterOutfit outfit = new OutfiterOutfit(); outfit.FromString(imagePath); playerImageBox.Image = outfit.GetImage(); outfiterCode.Text = imagePath; } } }
public override void LoadHUD() { pictureBox = new PictureBox(); pictureBox.Location = new Point(0, 0); pictureBox.Size = new Size(this.Width, this.Height); pictureBox.BackColor = StyleManager.TransparencyKey; this.Controls.Add(pictureBox); string centerLocation = SettingsManager.getSettingString("PortraitCenterImage"); if (centerLocation != null) { try { centerImage = Image.FromFile(centerLocation); } catch { OutfiterOutfit outfit = new OutfiterOutfit(); outfit.FromString(centerLocation); using (Image image = outfit.GetImage()) { using (Bitmap bitmap = new Bitmap(image)) { centerImage = bitmap.Clamp(); } } } } else { centerImage = null; } backgroundOffset = new Point(SettingsManager.getSettingInt("PortraitBackgroundXOffset"), SettingsManager.getSettingInt("PortraitBackgroundYOffset")); centerOffset = new Point(SettingsManager.getSettingInt("PortraitCenterXOffset"), SettingsManager.getSettingInt("PortraitCenterYOffset")); backgroundScale = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitBackgroundScale"))); centerScale = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitCenterScale"))); RefreshHUD(); }
public HealthList() { InitializeComponent(); this.BackColor = StyleManager.BlendTransparencyKey; this.TransparencyKey = StyleManager.BlendTransparencyKey; displayNames = SettingsManager.getSettingBool(GetHUD() + "DisplayNames"); displayIcons = SettingsManager.getSettingBool(GetHUD() + "DisplayIcons"); displayText = SettingsManager.getSettingBool(GetHUD() + "DisplayText"); healthBarHeight = SettingsManager.getSettingInt(GetHUD() + "Height"); playerBarHeight = displayNames ? healthBarHeight * 5 / 3 : healthBarHeight; List<string> names = SettingsManager.getSetting(GetHUD() + "PlayerNames"); int index = 0; foreach(string name in names) { if (name.Trim() == "") continue; string imagePath = SettingsManager.getSettingString(GetHUD() + "Image" + index.ToString()); Image image = null; if (imagePath != null) { try { image = Image.FromFile(imagePath); } catch { OutfiterOutfit outfit = new OutfiterOutfit(); outfit.FromString(imagePath); image = outfit.GetImage(); } } this.players.Add(new PlayerEntry { name = name, playerImage = image }); index++; } double opacity = SettingsManager.getSettingDouble(GetHUD() + "Opacity"); opacity = Math.Min(1, Math.Max(0, opacity)); this.Opacity = opacity; }
private void nameListBox_SelectedIndexChanged(object sender, EventArgs e) { if (MainForm.prevent_settings_update) return; string imagePath = SettingsManager.getSettingString("HealthListImage" + nameListBox.SelectedIndex); playerImageBox.Image = null; if (imagePath != null) { try { playerImageBox.Image = Image.FromFile(imagePath); } catch { OutfiterOutfit outfit = new OutfiterOutfit(); outfit.FromString(imagePath); playerImageBox.Image = outfit.GetImage(); outfiterCode.Text = imagePath; } } }
private void refreshCenterImage() { string centerLocation = SettingsManager.getSettingString("PortraitCenterImage"); if (centerLocation == null) return; centerImageBox.Image = LoadImageFromPath(centerLocation); if (centerImageBox.Image == null) { OutfiterOutfit outfit = new OutfiterOutfit(); outfit.FromString(centerLocation); centerImageBox.Image = outfit.GetImage(); outfiterCode.Text = centerLocation; } }
public override void LoadHUD() { pictureBox = new PictureBox(); pictureBox.Location = new Point(0, 0); pictureBox.Size = new Size(this.Width, this.Height); pictureBox.BackColor = StyleManager.TransparencyKey; this.Controls.Add(pictureBox); string centerLocation = SettingsManager.getSettingString("PortraitCenterImage"); if (centerLocation != null) { try { centerImage = Image.FromFile(centerLocation); } catch { OutfiterOutfit outfit = new OutfiterOutfit(); outfit.FromString(centerLocation); using(Image image = outfit.GetImage()) { using(Bitmap bitmap = new Bitmap(image)) { centerImage = bitmap.Clamp(); } } } } else { centerImage = null; } backgroundOffset = new Point(SettingsManager.getSettingInt("PortraitBackgroundXOffset"), SettingsManager.getSettingInt("PortraitBackgroundYOffset")); centerOffset = new Point(SettingsManager.getSettingInt("PortraitCenterXOffset"), SettingsManager.getSettingInt("PortraitCenterYOffset")); backgroundScale = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitBackgroundScale"))); centerScale = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitCenterScale"))); RefreshHUD(); }