private void DisplayInfo(TPFTexInfo tex)
{
try
{
PCCsCheckListBox.Items.Clear();
}
catch
{
// Irrelevent
}
string message = "";
FirstHalfInfoState(true);
// KFreon: Display top info
if (tex.isExternal)
message = "External file\n\nPath: " + tex.FilePath + "\\" + tex.FileName;
else
message = tex.zippy.Description;
GeneralInfoRTB.Text = message;
// KFreon: Disappear stuff if unnecessary
SecondHalfInfoState(!AnalyseButton.Enabled && !CancelButton.Visible && !tex.isDef);
if (tex.isDef)
{
FirstHalfInfoState(false);
return;
}
GotoInvalidButton.Visible = !AnalyseButton.Enabled && LoadedTexes.Where(ter => !ter.isDef && !ter.Valid).Count() > 1;
GotoDupButton.Visible = tex.TreeDuplicates.Count != 0;
PromoteButton.Visible = tex.ThumbInd == -1;
InstallSingleButton.Visible = !AnalyseButton.Enabled && !tex.isDef;
// KFreon: Tree details
TreeMipsEntry.Text = (tex.ExpectedMips == 0 ? "¯\\_(ツ)_/¯" : tex.ExpectedMips.ToString());
TreeFormatEntry.Text = (tex.ExpectedFormat == ImageEngineFormat.Unknown) ? "¯\\_(ツ)_/¯" : tex.ExpectedFormat.ToString().Replace("DDS_", "");
// KFreon: Display main info
TPFFormatEntry.Text = tex.Format.ToString().Replace("DDS_", "");
HashTextBox.Text = (tex.Hash == 0) ? "Unknown" : KFreonLib.Textures.Methods.FormatTexmodHashAsString(tex.Hash);
TPFMipsEntry.Text = tex.NumMips.ToString();
ImageSizeEntry.Text = tex.Width + "x" + tex.Height;
// KFreon: Set resethash button visibility
if (!CancelButton.Visible)
ResetHashButton.Visible = (tex.isDef) ? false : (tex.Hash != tex.OriginalHash);
// KFreon: Deal with duplicates
if (tex.TreeDuplicates.Count != 0)
{
DisappearDuplicatesBox(false);
DuplicatesTextBox.Text = "TREE DUPLICATES:" + Environment.NewLine;
for (int i = 0; i < tex.TreeDuplicates.Count; i++)
DuplicatesTextBox.Text += LoadedTexes[tex.TreeDuplicates[i]].TexName + Environment.NewLine;
}
else
DisappearDuplicatesBox(true);
// KFreon: Do PCC stuff
PreventPCC = true;
// KFreon: Show pccs
if (tex.TexName != null && !tex.isDef)
{
int count = 0;
foreach (string file in tex.OriginalFiles)
{
string displaystring = tex.DisplayString(file);
string filedisp = tex.GetFileFromDisplay(file);
PCCsCheckListBox.Items.Add(displaystring);
bool isChecked = true;
if (!tex.Files.Contains(filedisp))
isChecked = false;
PCCsCheckListBox.Items[count++].Checked = isChecked;
}
/*PCCsCheckListBox.SuspendLayout();
PCCsCheckListBox.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.ColumnContent);
PCCsCheckListBox.ResumeLayout();*/
}
PCCsCheckListBox.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
PreventPCC = false;
}