private void UpdateUIFromEntry(Database.Entry _Entry) { textBoxRelativePath.Text = _Entry != null ? _Entry.RelativePath : ""; textBoxFriendlyName.Text = _Entry != null ? _Entry.FriendlyName : ""; textBoxDescription.Text = _Entry != null ? _Entry.Description : ""; textBoxOverviewImage.Text = _Entry != null && _Entry.OverviewImageFileName != null ? _Entry.OverviewImageFileName.FullName : ""; panelOverviewImage.SourceImage = _Entry != null ? _Entry.OverviewImage : null; panelThumbnail.SourceImage = _Entry != null ? _Entry.Thumbnail : null; UpdateTagsUIFromEntry(_Entry); Database.Manifest M = _Entry != null ? _Entry.Manifest : null; if (M != null) { M.LoadTextures(); // Make sure textures are ready } panelSwatchMin.BackColor = M != null ? M.m_SwatchMin.Color : BackColor; panelSwatchMax.BackColor = M != null ? M.m_SwatchMax.Color : BackColor; panelSwatchAvg.BackColor = M != null ? M.m_SwatchAvg.Color : BackColor; Panel[] CustomSwatchPanels = new Panel[] { panelCS0, panelCS1, panelCS2, panelCS3, panelCS4, panelCS5, panelCS6, panelCS7, panelCS8, }; for (int i = 0; i < CustomSwatchPanels.Length; i++) { bool Available = M != null && i < M.m_CustomSwatches.Length; CustomSwatchPanels[i].BackColor = Available ? M.m_CustomSwatches[i].Color : BackColor; panelTexture.CustomSwatches[i] = Available ? new WMath.Vector4D(M.m_CustomSwatches[i].m_LocationTopLeft.x, M.m_CustomSwatches[i].m_LocationTopLeft.y, M.m_CustomSwatches[i].m_LocationBottomRight.x, M.m_CustomSwatches[i].m_LocationBottomRight.y) : null; } panelTexture.SourceImage = M != null ? M.m_Texture : null; }