Add more parse settings

allows consumers to tweak debatable settings
This commit is contained in:
Kurt 2018-10-06 13:43:05 -07:00
parent 66faa43e03
commit dc839333b7
3 changed files with 11 additions and 12 deletions

View file

@ -47,7 +47,7 @@ namespace PKHeX.Core
}
if (!info.FrameMatches && info.EncounterMatch is EncounterSlot && pkm.Version != (int)GameVersion.CXD) // if false, all valid RNG frame matches have already been consumed
info.Parse.Add(new CheckResult(Severity.Fishy, LEncConditionBadRNGFrame, CheckIdentifier.PID)); // todo for further confirmation
info.Parse.Add(new CheckResult(ParseSettings.RNGFrameNotFound, LEncConditionBadRNGFrame, CheckIdentifier.PID)); // todo for further confirmation
if (!info.PIDIVMatches) // if false, all valid PIDIV matches have already been consumed
info.Parse.Add(new CheckResult(Severity.Invalid, LPIDTypeMismatch, CheckIdentifier.PID));

View file

@ -34,7 +34,7 @@ namespace PKHeX.Core
else if (EncounterMatch is MysteryGift m)
{
if (pkm.IsNicknamed && !m.IsEgg)
data.AddLine(Get(LEncGiftNicknamed, Severity.Fishy));
data.AddLine(Get(LEncGiftNicknamed, ParseSettings.NicknamedMysteryGift));
}
if (EncounterMatch is EncounterTrade)
@ -409,10 +409,11 @@ namespace PKHeX.Core
var pkm = data.pkm;
var EncounterMatch = data.EncounterOriginal;
if (!IsNicknameMatch(nick, pkm, EncounterMatch)) // trades that are not nicknamed (but are present in a table with others being named)
data.AddLine(GetInvalid(LEncTradeChangedNickname, CheckIdentifier.Nickname));
else
data.AddLine(GetValid(LEncTradeUnchanged, CheckIdentifier.Nickname));
// trades that are not nicknamed (but are present in a table with others being named)
var result = IsNicknameMatch(nick, pkm, EncounterMatch)
? GetValid(LEncTradeUnchanged, CheckIdentifier.Nickname)
: Get(LEncTradeChangedNickname, ParseSettings.NicknamedTrade, CheckIdentifier.Nickname);
data.AddLine(result);
if (OT != pkm.OT_Name)
data.AddLine(GetInvalid(LEncTradeChangedOT, CheckIdentifier.Trainer));

View file

@ -19,6 +19,10 @@
/// </summary>
public static bool AllowGen1Tradeback { get; set; }
public static Severity NicknamedTrade { get; set; } = Severity.Invalid;
public static Severity NicknamedMysteryGift { get; set; } = Severity.Fishy;
public static Severity RNGFrameNotFound { get; set; } = Severity.Fishy;
/// <summary>
/// Checks to see if Crystal is available to visit/originate from.
/// </summary>
@ -42,12 +46,6 @@
/// <returns>True if Crystal data is allowed</returns>
public static bool AllowGen2MoveReminder(PKM pkm) => !pkm.Korean && AllowGBCartEra;
/// <summary>
/// Savegame is Japanese
/// </summary>
/// <remarks>Useful for checking the origin of EBerry data.</remarks>
internal static bool SavegameJapanese => ActiveTrainer.Language == 1;
internal static bool IsFromActiveTrainer(PKM pkm) => ActiveTrainer.IsFromTrainer(pkm);
public static bool InitFromSaveFileData(SaveFile sav)