Show misc encounter details on hover

This commit is contained in:
Kurt 2021-03-07 12:35:26 -08:00
parent b71de0e1d9
commit 9e4f1d11cc
2 changed files with 17 additions and 8 deletions

View file

@ -400,6 +400,19 @@ namespace PKHeX.Core
lines.AddRange(outputLines.Select(chk => chk.Format(L_F0_1)));
lines.AddRange(br);
AddEncounterInfo(lines);
if (!Valid && Info.InvalidMatches != null)
{
lines.Add("Other match(es):");
lines.AddRange(Info.InvalidMatches.Select(z => $"{z.Encounter.LongName}: {z.Reason}"));
}
return GetLegalityReport() + string.Join(Environment.NewLine, lines);
}
public void AddEncounterInfo(List<string> lines)
{
lines.Add(string.Format(L_FEncounterType_0, EncounterName));
var loc = EncounterLocation;
if (!string.IsNullOrEmpty(loc))
@ -416,13 +429,6 @@ namespace PKHeX.Core
lines.Add(string.Format(L_FOriginSeed_0, pidiv.OriginSeed.ToString("X8")));
lines.Add(string.Format(L_FPIDType_0, pidiv.Type));
}
if (!Valid && Info.InvalidMatches != null)
{
lines.Add("Other match(es):");
lines.AddRange(Info.InvalidMatches.Select(z => $"{z.Encounter.LongName}: {z.Reason}"));
}
return GetLegalityReport() + string.Join(Environment.NewLine, lines);
}
}
}

View file

@ -20,7 +20,10 @@ namespace PKHeX.WinForms.Controls
return;
}
var text = ShowdownParsing.GetLocalizedPreviewText(pk, Settings.Default.Language);
ShowSet.SetToolTip(pb, text);
var la = new LegalityAnalysis(pk);
var result = new List<string>{ text, string.Empty };
la.AddEncounterInfo(result);
ShowSet.SetToolTip(pb, string.Join(Environment.NewLine, result));
}
public void Show(Control pb, IEncounterInfo enc)