mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 04:23:12 +00:00
Show misc encounter details on hover
This commit is contained in:
parent
b71de0e1d9
commit
9e4f1d11cc
2 changed files with 17 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue