Skip to content

Commit

Permalink
Update 24.05.05
Browse files Browse the repository at this point in the history
Fix devutil text update
swap tox & poison icons, move picturebox to the right
add some Legality settings util functions
  • Loading branch information
kwsch committed May 6, 2024
1 parent 19951f1 commit 5af6678
Show file tree
Hide file tree
Showing 35 changed files with 366 additions and 140 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>24.03.26</Version>
<Version>24.05.05</Version>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>
<NeutralLanguage>en</NeutralLanguage>
Expand Down
15 changes: 15 additions & 0 deletions PKHeX.Core/Legality/Settings/LegalitySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,19 @@ public sealed class LegalitySettings
public NicknameSettings Nickname { get; set; } = new();
public TradebackSettings Tradeback { get; set; } = new();
public WordFilterSettings WordFilter { get; set; } = new();

/// <summary>
/// Adjusts the settings to disable all checks that reference the "current" save file.
/// </summary>
/// <remarks>Allows for quick disabling of others for use in unit tests.</remarks>
/// <param name="checkHOME">If false, disable HOME Transfer checks. Useful for checking migration logic.</param>
/// <param name="allowRNG">If true, allows special encounters to be nicknamed.</param>
public void SetCheckWithoutSaveFile(bool checkHOME = true, bool allowRNG = false)
{
Handler.CheckActiveHandler = false;
if (!checkHOME)
HOMETransfer.Disable();
if (allowRNG)
Nickname.Disable();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.ComponentModel;
using System.ComponentModel;

namespace PKHeX.Core;

Expand All @@ -10,4 +10,10 @@ public sealed class HOMETransferSettings

[LocalizedDescription("Severity to flag a Legality Check if Pokémon has a zero value for both Height and Weight.")]
public Severity ZeroHeightWeight { get; set; } = Severity.Fishy;

public void Disable()
{
HOMETransferTrackerNotPresent = Severity.Fishy;
ZeroHeightWeight = Severity.Fishy;
}
}
15 changes: 14 additions & 1 deletion PKHeX.Core/Legality/Settings/Specialized/HandlerRestrictions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed class HandlerSettings
}

[TypeConverter(typeof(ExpandableObjectConverter))]
public sealed record HandlerRestrictions
public sealed class HandlerRestrictions
{
public bool AllowHandleOTGen6 { get; set; }
public bool AllowHandleOTGen7 { get; set; }
Expand All @@ -25,6 +25,19 @@ public sealed record HandlerRestrictions
public bool AllowHandleOTGen8b { get; set; }
public bool AllowHandleOTGen9 { get; set; }

public void Disable() => SetAllTo(true);

public void SetAllTo(bool value)
{
AllowHandleOTGen6 = value;
AllowHandleOTGen7 = value;
AllowHandleOTGen7b = value;
AllowHandleOTGen8 = value;
AllowHandleOTGen8a = value;
AllowHandleOTGen8b = value;
AllowHandleOTGen9 = value;
}

public bool GetCanOTHandle(EntityContext encContext) => encContext switch
{
EntityContext.Gen6 => AllowHandleOTGen6,
Expand Down
36 changes: 35 additions & 1 deletion PKHeX.Core/Legality/Settings/Specialized/NicknameRestriction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace PKHeX.Core;

[TypeConverter(typeof(ExpandableObjectConverter))]
public sealed record NicknameSettings
public sealed class NicknameSettings
{
[LocalizedDescription("Severity to flag a Legality Check if Pokémon has a Nickname matching another Species.")]
public Severity NicknamedAnotherSpecies { get; set; } = Severity.Fishy;
Expand Down Expand Up @@ -41,6 +41,28 @@ public sealed record NicknameSettings
[LocalizedDescription("Nickname rules for Generation 9.")]
public NicknameRestriction Nickname9 { get; set; } = new();

public void Disable()
{
var nick = new NicknameRestriction();
nick.Disable();
SetAllTo(nick);
}

public void SetAllTo(NicknameRestriction all)
{
Nickname12.CopyFrom(all);
Nickname3.CopyFrom(all);
Nickname4.CopyFrom(all);
Nickname5.CopyFrom(all);
Nickname6.CopyFrom(all);
Nickname7.CopyFrom(all);
Nickname7b.CopyFrom(all);
Nickname8.CopyFrom(all);
Nickname8a.CopyFrom(all);
Nickname8b.CopyFrom(all);
Nickname9.CopyFrom(all);
}

public Severity NicknamedMysteryGift(EntityContext encContext) => encContext switch
{
EntityContext.Gen1 => Nickname12.NicknamedMysteryGift,
Expand Down Expand Up @@ -84,4 +106,16 @@ public sealed record NicknameRestriction

[LocalizedDescription("Severity to flag a Legality Check if it is a nicknamed Mystery Gift the player cannot normally nickname.")]
public Severity NicknamedMysteryGift { get; set; } = Severity.Invalid;

public void CopyFrom(NicknameRestriction other)
{
NicknamedTrade = other.NicknamedTrade;
NicknamedMysteryGift = other.NicknamedMysteryGift;
}

public void Disable()
{
NicknamedTrade = Severity.Fishy;
NicknamedMysteryGift = Severity.Fishy;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,3 @@ LTransferPIDECEquals = 性格値は暗号化定数と同じにする必要があ
LTransferPIDECXor = 暗号化定数と色違い性格値が一致します。
LTransferTrackerMissing = HOME Trackerが見つかりません。
LTransferTrackerShouldBeZero = HOME Trackerを0にしてください。

Binary file modified PKHeX.Core/Resources/legality/mgdb/wc9.pkl
Binary file not shown.
Binary file modified PKHeX.Core/Resources/legality/wild/encounter_go_home.pkl
Binary file not shown.
Binary file modified PKHeX.Core/Resources/legality/wild/encounter_go_lgpe.pkl
Binary file not shown.
2 changes: 0 additions & 2 deletions PKHeX.Core/Saves/SAV6AO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ private void Initialize()
JPEG = 0x67C00;
}

/// <summary> Offset of the Contest data block. </summary>

#region Blocks
public override IReadOnlyList<BlockInfo> AllBlocks => Blocks.BlockInfo;
public override MyItem6AO Items => Blocks.Items;
Expand Down
2 changes: 0 additions & 2 deletions PKHeX.Core/Saves/Substructures/Gen6/HallOfFame6.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ public Span<byte> GetEntry(int index)
public uint GetInsertIndex(out uint clear)
{
// Check for empty slots (where player hasn't yet registered enough Fame clears)
clear = 0;
for (uint i = 0; i < Entries; i++)
{
var entry = GetEntry((int)i);
var vnd = new HallFame6Index(entry[^4..]);
if (!vnd.HasData)
return clear = i;
clear = vnd.ClearIndex;
}

// No empty slots, return the last slot.
Expand Down
Binary file modified PKHeX.Drawing.PokeSprite/Resources/img/Status/sickpoison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PKHeX.Drawing.PokeSprite/Resources/img/Status/sicktoxic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions PKHeX.WinForms/Controls/PKM Editor/StatusConditionView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,27 @@ public void LoadStoredValues()
if (pk is null || Loading)
return;
Loading = true;
var status = pk.Status_Condition;
SetStatus((StatusCondition)status);
if (!pk.PartyStatsPresent)
ClearStatus();
else if (pk.Stat_HPCurrent == 0)
SetFaint();
else
SetStatus((StatusCondition)(pk.Status_Condition & 0xFF));
Loading = false;
}

private void SetFaint()
{
PB_Status.Image = Drawing.PokeSprite.Properties.Resources.sickfaint;
Hover.RemoveAll();
}

private void ClearStatus()
{
PB_Status.Image = null;
Hover.RemoveAll();
}

private void SetStatus(StatusCondition status)
{
PB_Status.Image = status.GetStatusSprite();
Expand Down
16 changes: 15 additions & 1 deletion PKHeX.WinForms/Resources/text/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
PKHeX - By Kaphotics
http://projectpokemon.org/pkhex/

24/03/26 - New Update:
24/05/05 - New Update:
- Legality: Added Regulation G.
- Added: Entity editor can now modify battle-Status effects (Burn, Paralyze, etc). Click the bottom right corner of the window for the GUI.
- Added: Gen5 trainer records can now be edited via Misc editor. Not documented well, but exposes the values for editing.
- Added: Gen1-3 games now detect language/version based on the save file name. If not detected, can be overridden via settings before loading.
- Added: Gen1 can now show an Entity's gender if enabled via settings, using Gen2 IV gender determination logic.
- Fixed: Gen7 Chinese species names now write correctly.
- Fixed: Gen6 OR/AS DexNav count read/write fixed.
- Fixed: Gen3 trash bytes now reference the Entity for translating the string, rather than the save file.
- Fixed: Gen2 Box Names now read/write ligatures correctly.
- Fixed: Gen1/2 box data now retains empty slot data instead of reformatting into empty box lists (glitching friendly).
- Changed: Legality settings have been extracted to a more easily customized settings object.
- Changed: Translations updated for Chinese & Japanese. Thanks @ppllouf & @902PM !

24/03/26 - New Update: (139375) [8676873]
- Legality:
- - Fixed: Handled some edge cases with latest release RNG Frame checks for Gen4.
- - Added: Verification for Gen3 CHANNEL and MYSTRY seed patterns.
Expand Down
40 changes: 27 additions & 13 deletions PKHeX.WinForms/Resources/text/lang_de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,22 @@ LocalizedDescription.CheckWordFilter=Überprüft Spitznamen und Trainer Namen na
LocalizedDescription.CurrentHandlerMismatch=Schweregrad mit dem der aktuelle Besitzer eines Pokémons in der Legalitäts Analyse geprüft wird.
LocalizedDescription.DefaultBoxExportNamer=Selected File namer to use for box exports for the GUI, if multiple are available.
LocalizedDescription.DisableScalingDpi=Disables the GUI scaling based on Dpi on program startup, falling back to font scaling.
LocalizedDescription.DisableWordFilterPastGen=Disables the Word Filter check for formats prior to 3DS-era.
LocalizedDescription.Female=Female gender color.
LocalizedDescription.FilterUnavailableSpecies=Versteckt nicht erhältliche Pokémon, wenn diese nicht in den Spielstand importiert werden können.
LocalizedDescription.FlagIllegal=Illegale Pokémon in den Boxen markieren
LocalizedDescription.FocusBorderDeflate=Focus border indentation for custom drawn image controls.
LocalizedDescription.ForceHaXOnLaunch=HaX Modus beim Programmstart erzwingen
LocalizedDescription.Gen7TransferStarPID=Kennzeichnet in der Legalitäts Analyse, wenn ein Gen 1/2 Pokémon eine Stern Shiny PID besitzt.
LocalizedDescription.Gen8MemoryMissingHT=Schweregrad der Legalitäts Analyse wenn die Gen 8 Erinnerung des Besitzers fehlt.
LocalizedDescription.Gen8TransferTrackerNotPresent=Kennzeichnet in der Legalitäts Analyse, wenn der HOME Tracker fehlt.
LocalizedDescription.GlowFinal=Hovering over a PKM color 2.
LocalizedDescription.GlowInitial=Hovering over a PKM color 1.
LocalizedDescription.HiddenPowerOnChangeMaxPower=Wenn der Kraftreserve Typ geändert wird, ändere die DVs auf den höchst möglichen Wert, um die best mögliche Stärke zu erhalten. Sonst werden die originalen DVs nur leicht abgeändert.
LocalizedDescription.HideEvent8Contains=Verstecke Event Variablen Namen, welche die unten stehenden, durch Komma getrennten, Zeichenfolgen enthalten. Entfernt Event Variablen aus der Benutzeroberfläche, die den Benutzer nicht interessieren.
LocalizedDescription.HideEventTypeBelow=Verstecke Event Variablen unter diesem Event Typ Wert. Entfernt Event Variablen aus der Benutzeroberfläche, die den Benutzer nicht interessieren.
LocalizedDescription.HideSAVDetails=Verstecke Spielstand Details in Programmtitel
LocalizedDescription.HideSecretDetails=Verstecke persönliche Details im Editor
LocalizedDescription.HOMETransferTrackerNotPresent=Severity to flag a Legality Check if the HOME Tracker is Missing
LocalizedDescription.HOMETransferTrackerNotPresent=Kennzeichnet in der Legalitäts Analyse, wenn der HOME Tracker fehlt.
LocalizedDescription.HoverSlotGlowEdges=Zeige Glanz bei Berührung
LocalizedDescription.HoverSlotPlayCry=Spiele PKM Ruf bei Berührung
LocalizedDescription.HoverSlotShowEncounter=Show Encounter Info in on Hover
Expand All @@ -139,21 +139,37 @@ LocalizedDescription.MarkBlue=Blue colored marking.
LocalizedDescription.MarkDefault=Default colored marking.
LocalizedDescription.MarkPink=Pink colored marking.
LocalizedDescription.ModifyUnset=Benachrichtigung über nicht gesetzte Änderungen.
LocalizedDescription.Nickname12=Nickname rules for Generation 1 and 2.
LocalizedDescription.Nickname3=Nickname rules for Generation 3.
LocalizedDescription.Nickname4=Nickname rules for Generation 4.
LocalizedDescription.Nickname5=Nickname rules for Generation 5.
LocalizedDescription.Nickname6=Nickname rules for Generation 6.
LocalizedDescription.Nickname7=Nickname rules for Generation 7.
LocalizedDescription.Nickname7b=Nickname rules for Generation 7b.
LocalizedDescription.Nickname8=Nickname rules for Generation 8.
LocalizedDescription.Nickname8a=Nickname rules for Generation 8a.
LocalizedDescription.Nickname8b=Nickname rules for Generation 8b.
LocalizedDescription.Nickname9=Nickname rules for Generation 9.
LocalizedDescription.NicknamedAnotherSpecies=Kennzeichnet in der Legalitäts Analyse, wenn das Pokémon einen Spitznamen hat, der der Spezies eines anderen Pokémon entspricht.
LocalizedDescription.NicknamedMysteryGift=Kennzeichnet in der Legalitäts Analyse, wenn es sich um ein Geschenk mit Spitznamen handelt, welches der Spieler nicht umbenennen kann.
LocalizedDescription.NicknamedTrade=Kennzeichnet in der Legalitäts Analyse, wenn es sich um ein ertauschtes Pokémon mit Spitznamen handelt, welches der Spieler nicht umbenennen kann.
LocalizedDescription.OtherBackupPaths=Liste aller weiteren Verzeichnisse, in denen nach Spielständen gesucht wird.
LocalizedDescription.OtherSaveFileExtensions=Spielstand Dateiendung (ohne Punkt), welche von PKHeX auch erkannt werden sollen.
LocalizedDescription.OverrideGen1=Gen1: If unable to detect a language or version for a save file, use these instead.
LocalizedDescription.OverrideGen2=Gen2: If unable to detect a language or version for a save file, use these instead.
LocalizedDescription.OverrideGen3FRLG=Gen3 FR/LG: If unable to detect a language or version for a save file, use these instead.
LocalizedDescription.OverrideGen3RS=Gen3 R/S: If unable to detect a language or version for a save file, use these instead.
LocalizedDescription.PathBlockKeyList=Ordner, welcher Dateien mit Block Hash-Namen enthält. Wenn eine spezifische Datei nicht existiert, werden nur Namen geladen, welche im Programmcode enthalten sind.
LocalizedDescription.PlaySoundLegalityCheck=Ton beim Pop-Up der Legalitäts Analyse abspielen.
LocalizedDescription.PlaySoundSAVLoad=Ton beim Öffnen eines Spielstands abspielen.
LocalizedDescription.PluginLoadMethod=Läd Plugins aus dem "plugins" Ordner, falls dieser existiert. Versuche LoadFile um Fehler beim Laden zu reduzieren.
LocalizedDescription.PreviewCursorShift=Show a Glow effect around the PKM on Hover
LocalizedDescription.PreviewShowPaste=Show Showdown Paste in special Preview on Hover
LocalizedDescription.RecentlyLoadedMaxCount=Amount of recently loaded save files to remember.
LocalizedDescription.RetainMetDateTransfer45=Retain the Met Date when transferring from Generation 4 to Generation 5.
LocalizedDescription.ReturnNoneIfEmptySearch=Überspringt die Suche, wenn vergessen wurde ein Pokémon / Attacken in die Suchkriterien einzugeben.
LocalizedDescription.RNGFrameNotFound=Zeigt in der Legalitäts Analyse an, wenn der RNG Frame Check keine Übereinstimmung findet.
LocalizedDescription.RNGFrameNotFound3=Severity to flag a Legality Check if the RNG Frame Checking logic does not find a match for Generation 3 encounters.
LocalizedDescription.RNGFrameNotFound4=Severity to flag a Legality Check if the RNG Frame Checking logic does not find a match for Generation 4 encounters.
LocalizedDescription.RNGFrameNotFound3=Zeigt in der Legalitäts Analyse an, wenn der RNG Frame Check keine Übereinstimmung findet.
LocalizedDescription.RNGFrameNotFound4=Zeigt in der Legalitäts Analyse an, wenn der RNG Frame Check keine Übereinstimmung findet.
LocalizedDescription.SearchBackups=Suche beim Laden der PKM Datenbank auch in den Backup Spielständen.
LocalizedDescription.SearchExtraSaves=Durchsuche beim Laden der PKM Datenbank auch Backup Verzeichnisse.
LocalizedDescription.SearchExtraSavesDeep=Durchsuche beim Laden der PKM Datenbank auch Unterverzeichmisse der Backup Verzeichnisse.
Expand All @@ -172,7 +188,9 @@ LocalizedDescription.ShowEncounterOpacityBackground=Deckkraft des Hintergrunds d
LocalizedDescription.ShowEncounterOpacityStripe=Deckkraft der Begegnungs Typen Streifen Schicht.
LocalizedDescription.ShowEncounterThicknessStripe=Anzahl der Pixel des farbigen Streifens der Begegnungs Typen.
LocalizedDescription.ShowExperiencePercent=Zeige einen dünnen Streifen, der den Level-Up Fortschritt darstellt.
LocalizedDescription.ShowGenderGen1=When showing a Generation 1 format entity, show the gender it would have if transferred to other generations.
LocalizedDescription.ShowLegalBallsFirst=Zeige in der Ball Auswahl legale Bälle zuerst und illegale Bälle darunter an.
LocalizedDescription.ShowStatusCondition=When showing an entity, show any stored Status Condition (Sleep/Burn/etc) it may have.
LocalizedDescription.ShowTeraOpacityBackground=Deckkraft des Tera Typ Hintergrunds.
LocalizedDescription.ShowTeraOpacityStripe=Deckkraft der Tery Typ Streifens.
LocalizedDescription.ShowTeraThicknessStripe=Anzahl der Pixel des farbigen Streifens der Tera Typen..
Expand Down Expand Up @@ -899,7 +917,6 @@ SAV_Misc5.B_ImportFC=Import Data
SAV_Misc5.B_ObtainAllMedals=Obtain All Medals
SAV_Misc5.B_RandForest=Alle Areale zufällig
SAV_Misc5.B_Save=Speichern
SAV_Misc5.B_UnlockAllMusicalProps=Alle Musical Accessoires
SAV_Misc5.B_UnlockAllProps=Unlock All Props
SAV_Misc5.CHK_Area9=Areal 9 erreichbar:
SAV_Misc5.CHK_FMNew=NEU
Expand Down Expand Up @@ -945,14 +962,17 @@ SAV_Misc5.L_FMParticipated=Teilnehmer
SAV_Misc5.L_FMTopScore=High Score
SAV_Misc5.L_FMUnlocked=Freigeschaltet
SAV_Misc5.L_Form=Form:
SAV_Misc5.L_Gender=Gender:
SAV_Misc5.L_Move=Attacke:
SAV_Misc5.L_MultiFriends=Freunde
SAV_Misc5.L_MultiFriendsPast=Vergangen
SAV_Misc5.L_MultiFriendsRecord=Rekord
SAV_Misc5.L_MultiNPC=NPC
SAV_Misc5.L_MultiNpcPast=Vergangen
SAV_Misc5.L_MultiNpcRecord=Rekord
SAV_Misc5.L_Record16=Record:
SAV_Misc5.L_Record16V=Value:
SAV_Misc5.L_Record32=Record:
SAV_Misc5.L_Record32V=Value:
SAV_Misc5.L_Roamer641=Boreos
SAV_Misc5.L_Roamer642=Voltolos
SAV_Misc5.L_RoamStatus=Roam status
Expand Down Expand Up @@ -1014,15 +1034,9 @@ SAV_MysteryGiftDB.Tab_General=Allgemein
SAV_OPower.B_Cancel=Abbr.
SAV_OPower.B_ClearAll=Alle leeren
SAV_OPower.B_GiveAll=Alle geben
SAV_OPower.B_GiveAllMAX=Alle MAX
SAV_OPower.B_Save=OK
SAV_OPower.CHK_Master=??? Flag
SAV_OPower.CHK_MAX=MAX
SAV_OPower.CHK_S=S
SAV_OPower.GB_Battle=Battle
SAV_OPower.GB_Field=Field
SAV_OPower.L_Points=Points:
SAV_OPower.L_Type=Typ:
SAV_Poffin8b.B_All=Alle
SAV_Poffin8b.B_Cancel=Abbr.
SAV_Poffin8b.B_None=Keine
Expand Down
Loading

0 comments on commit 5af6678

Please sign in to comment.