public void UpdateSummaryForm()
{
int minheight, maxheight;
ClearControlList(summaryControls, out minheight, out maxheight);
int y = maxheight < 0 ? 30 : minheight;
PictureBox loot = CreateSummaryLabel("Loot value (gp)", totalValue.ToString("N0"), x, ref y, StyleManager.ItemGoldColor, summaryControls);
tooltip.SetToolTip(loot, String.Format("Average gold for these creature kills: {0} gold.", averageValue.ToString("N0")));
CreateSummaryLabel("Exp gained", HuntManager.activeHunt.totalExp.ToString("N0"), x, ref y, StyleManager.NotificationTextColor, summaryControls);
CreateSummaryLabel("Time", LootDropForm.TimeToString((long)HuntManager.activeHunt.totalTime), x, ref y, StyleManager.NotificationTextColor, summaryControls);
CreateSummaryLabel("Supplies used (gp)", totalWaste.ToString("N0"), x, ref y, StyleManager.WasteColor, summaryControls);
long profit = totalValue - totalWaste;
CreateSummaryLabel(profit > 0 ? "Profit (gp)" : "Waste (gp)", profit.ToString("N0"), x, ref y, profit > 0 ? StyleManager.ItemGoldColor : StyleManager.WasteColor, summaryControls);
if (ScanningManager.lastResults != null)
{
CreateSummaryLabel("Exp/hour", ScanningManager.lastResults.expPerHour.ToString("N0"), x, ref y, StyleManager.NotificationTextColor, summaryControls);
}
if (MemoryReader.experience >= 0)
{
long baseExperience = ExperienceBar.GetExperience(MemoryReader.level - 1);
long exp = MemoryReader.experience - baseExperience;
long maxExp = ExperienceBar.GetExperience(MemoryReader.level) - baseExperience;
double percentage = ((double)exp) / ((double)maxExp);
if (percentage >= 0 && percentage <= 1)
{
var levelBar = CreateSummaryBar("Level", String.Format("{0:0.}%", percentage * 100), percentage, x, ref y, StyleManager.NotificationTextColor, StyleManager.SummaryExperienceColor, summaryControls);
tooltip.SetToolTip(levelBar, String.Format("Experience to level up: {0}", (maxExp - exp).ToString("N0")));
}
}
}