Add setting to force large sprites for past gen

Causes the Other tab (daycare/gts/fused) to look wonky (not scaled), but I'm ok with that being a known flaw for now.
This commit is contained in:
Kurt
2020-04-13 09:52:25 -07:00
parent 49bdfa7f9d
commit bf47317dd1
4 changed files with 32 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ public static class SpriteUtil
{
public static readonly SpriteBuilder3040 SB17 = new SpriteBuilder3040();
public static readonly SpriteBuilder5668 SB8 = new SpriteBuilder5668();
public static SpriteBuilder Spriter { get; set; } = SB17;
public static SpriteBuilder Spriter { get; set; } = SB8;
public static Image GetBallSprite(int ball)
{
@@ -216,13 +216,25 @@ public static void GetSpriteGlow(Image baseSprite, byte blue, byte green, byte r
public static Image Sprite(this PKM pk, SaveFile sav, int box, int slot, bool flagIllegal = false)
=> GetSprite(pk, sav, box, slot, flagIllegal);
public static bool UseLargeAlways { get; set; } = true;
public static void Initialize(SaveFile sav)
{
var big = GameVersion.GG.Contains(sav.Version) || sav.Generation >= 8;
Spriter = big ? (SpriteBuilder)SB8 : SB17;
var s = GetSpriter(sav);
// gen3 specific sprites
Spriter.Initialize(sav);
s.Initialize(sav);
Spriter = s;
}
private static SpriteBuilder GetSpriter(SaveFile sav)
{
if (UseLargeAlways)
return SB8;
var big = GameVersion.GG.Contains(sav.Version) || sav.Generation >= 8;
return big ? (SpriteBuilder) SB8 : SB17;
}
}
}

View File

@@ -436,6 +436,7 @@ private void ReloadProgramSettings(Settings settings)
ParseSettings.AllowGen1Tradeback = settings.AllowGen1Tradeback;
ParseSettings.Gen8TransferTrackerNotPresent = settings.FlagMissingTracker ? Severity.Invalid : Severity.Fishy;
PKME_Tabs.HideSecretValues = C_SAV.HideSecretDetails = settings.HideSecretDetails;
SpriteUtil.UseLargeAlways = settings.UseLargeSprites;
}
private void MainMenuBoxLoad(object sender, EventArgs e)

View File

@@ -346,5 +346,17 @@ internal sealed partial class Settings : global::System.Configuration.Applicatio
this["ApplyNature"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool UseLargeSprites {
get {
return ((bool)(this["UseLargeSprites"]));
}
set {
this["UseLargeSprites"] = value;
}
}
}
}

View File

@@ -83,5 +83,8 @@
<Setting Name="ApplyNature" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="UseLargeSprites" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>