private void CharacterDataToUI(PortraitData data) { data.LoadImages(WorkingDirectory); txtCharactersName.Text = data.Name; txtCharactersDisplayName.Text = data.DisplayName; fgpCharactersFGPalette.Data = data.ForegroundColorID; pltCharactersBGPalette.Data = data.BackgroundColor; picCharactersBG.Image = data.Background ?? new PalettedImage(new Bitmap(1, 1)); picCharactersBG.Palette = data.BackgroundColor; picCharactersFG.Image = data.Foreground ?? new PalettedImage(new Bitmap(1, 1)); picCharactersFG.Palette = BaseSpritePalettes[fgpCharactersFGPalette.Data]; fgpCharacterAccent.Data = data.AccentColor; nudPitch.Value = (decimal)data.Voice.Pitch; cmbVoiceType.SelectedIndex = (int)data.Voice.VoiceType; UpdateCharacterPreview(); CurrentFile = data.Name; Dirty = false; }
private void LoadPortrait(string name) { if (name.Contains("?")) { picPreviewSpeaker.BackgroundImage = null; picPreviewSpeaker.Image = null; return; } PortraitData portrait = Portraits.Find(a => a.Name == name); if (portrait == null) { picPreviewSpeaker.BackgroundImage = null; picPreviewSpeaker.Image = null; return; } portrait.LoadImages(WorkingDirectory); picPreviewSpeaker.BackgroundImage = portrait.Background.ToBitmap(portrait.BackgroundColor).Resize(2); picPreviewSpeaker.Image = portrait.Foreground.ToBitmap(BaseSpritePalettes[portrait.ForegroundColorID]).Resize(2); lblPreviewName.Text = portrait.DisplayName; }