Skip to content

Commit

Permalink
Add enum to GUI translatable list
Browse files Browse the repository at this point in the history
Improve perf of GUI scrape by only making forms once, don't fully set up Main
Add method to get a list of translated Enum names
Adds translatability for size markings
Closes #4266
  • Loading branch information
kwsch committed Jun 4, 2024
1 parent 99a514b commit 093fca3
Show file tree
Hide file tree
Showing 36 changed files with 2,642 additions and 234 deletions.
1 change: 1 addition & 0 deletions PKHeX.Core/Legality/Formatting/LegalityCheckStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public static class LegalityCheckStrings
public static string L_XNickname { get; set; } = "Nickname";
public static string L_XKorean { get; set; } = "Korean";
public static string L_XKoreanNon { get; set; } = "Non-Korean";
public static string L_XLocation { get; set; } = "Location";
public static string L_XEnigmaBerry_0 { get; set; } = "{0} Berry";
public static string L_XMatches0_1 { get; set; } = "Matches: {0} {1}";
public static string L_XWurmpleEvo_0 { get; set; } = "Wurmple Evolution: {0}";
Expand Down
2 changes: 1 addition & 1 deletion PKHeX.Core/Legality/Formatting/LegalityFormatting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static void AddEncounterInfo(LegalityAnalysis la, List<string> lines)
// Location
var loc = enc.GetEncounterLocation();
if (!string.IsNullOrEmpty(loc))
lines.Add(string.Format(L_F0_1, "Location", loc));
lines.Add(string.Format(L_F0_1, L_XLocation, loc));

// Version
if (enc.Generation <= 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L_XEnigmaBerry_0 = {0}BEERE
L_XHT = HT
L_XKorean = Korean
L_XKoreanNon = Non-Korean
L_XLocation = Location
L_XMatches0_1 = Matches: {0} {1}
L_XNickname = Nickname
L_XOT = OT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L_XEnigmaBerry_0 = {0} BERRY
L_XHT = HT
L_XKorean = Korean
L_XKoreanNon = Non-Korean
L_XLocation = Location
L_XMatches0_1 = Matches: {0} {1}
L_XNickname = Nickname
L_XOT = OT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L_XEnigmaBerry_0 = BAYA {0}
L_XHT = EE
L_XKorean = Coreano
L_XKoreanNon = No es coreano.
L_XLocation = Location
L_XMatches0_1 = Coinciden: {0} {1}
L_XNickname = Nickname
L_XOT = EO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L_XEnigmaBerry_0 = BAIE {0}
L_XHT = HT
L_XKorean = Coréen
L_XKoreanNon = Non-Coréen
L_XLocation = Location
L_XMatches0_1 = Correspondances : {0} {1}
L_XNickname = Nickname
L_XOT = DO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L_XEnigmaBerry_0 = BACCA{0}
L_XHT = HT
L_XKorean = Korean
L_XKoreanNon = Non-Korean
L_XLocation = Location
L_XMatches0_1 = Matches: {0} {1}
L_XNickname = Nickname
L_XOT = OT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L_XEnigmaBerry_0 = {0}のみ
L_XHT = 現在のトレーナー
L_XKorean = 韓国
L_XKoreanNon = 韓国以外
L_XLocation = Location
L_XMatches0_1 = 一致: {0} {1}
L_XNickname = Nickname
L_XOT = 元々のトレーナー
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L_XEnigmaBerry_0 = {0}열매
L_XHT = 소유했던 트레이너 (HT)
L_XKorean = 한국어 버전 포켓몬
L_XKoreanNon = 한국어 버전이 아닌 포켓몬
L_XLocation = Location
L_XMatches0_1 = 일치: {0} {1}
L_XNickname = Nickname
L_XOT = 어버이 (OT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L_XEnigmaBerry_0 = {0}果
L_XHT = 持有人
L_XKorean = 韩版
L_XKoreanNon = 非韩版
L_XLocation = Location
L_XMatches0_1 = 匹配: {0} {1}
L_XNickname = Nickname
L_XOT = 初训家
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L_XEnigmaBerry_0 = {0}果
L_XHT = 持有人
L_XKorean = 韓版
L_XKoreanNon = 非韓版
L_XLocation = Location
L_XMatches0_1 = 匹配: {0} {1}
L_XNickname = Nickname
L_XOT = 初訓家
Expand Down
26 changes: 13 additions & 13 deletions PKHeX.Core/Saves/Substructures/Gen5/FestaBlock5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,16 @@ public enum Funfest5Mission
SearchFor3Pokemon = 6,
TrainwithMartialArtists = 7,
Sparringwith10Trainers = 8,
B_GetRichQuick = 9,
W_TreasureHunting = 10,
B_ExcitingTrading = 11,
W_ExhilaratingTrading = 12,
GetRichQuickB = 9,
TreasureHuntingW = 10,
ExcitingTradingB = 11,
ExhilaratingTradingW = 12,
FindEmolga = 13,
WingsFallingontheDrawbridge = 14,
FindTreasures = 15,
MushroomsHideAndSeek = 16,
B_FindMysteriousOres = 17,
W_FindShiningOres = 18,
FindMysteriousOresB = 17,
FindShiningOresW = 18,
The2LostTreasures = 19,
BigHarvestofBerries = 20,
RingtheBell = 21,
Expand All @@ -198,15 +198,15 @@ public enum Funfest5Mission
PushtheLimitofYourMemory = 26,
FindRustlingGrass = 27,
FindShards = 28,
B_ForgottenLostItems = 29,
W_NotFoundLostItems = 30,
B_WhatistheBestPrice = 31,
W_WhatistheRealPrice = 32,
ForgottenLostItemsB = 29,
NotFoundLostItemsW = 30,
WhatistheBestPriceB = 31,
WhatistheRealPriceW = 32,
GivemetheItem = 33,
DoaGreatTradeUp = 34,
SearchHiddenGrottes = 35,
B_NoisyHiddenGrottes = 36,
W_QuietHiddenGrottes = 37,
SearchHiddenGrottoes = 35,
NoisyHiddenGrottoesB = 36,
QuietHiddenGrottoesW = 37,
FishingCompetition = 38,
MulchCollector = 39,
WhereareFlutteringHearts = 40,
Expand Down
122 changes: 61 additions & 61 deletions PKHeX.Core/Saves/Substructures/Gen5/PassPower5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,72 @@ namespace PKHeX.Core;
/// </summary>
public enum PassPower5
{
Encounter_Plus1 = 0,
Encounter_Plus2 = 1,
Encounter_Plus3 = 2,
Encounter_Negative1 = 3,
Encounter_Negative2 = 4,
Encounter_Negative3 = 5,
Hatching_Plus1 = 6,
Hatching_Plus2 = 7,
Hatching_Plus3 = 8,
Befriending_Plus1 = 9,
Befriending_Plus2 = 10,
Befriending_Plus3 = 11,
Bargain_Plus1 = 12,
Bargain_Plus2 = 13,
Bargain_Plus3 = 14,
HP_Plus1 = 15,
HP_Plus2 = 16,
HP_Plus3 = 17,
PP_Plus1 = 18,
PP_Plus2 = 19,
PP_Plus3 = 20,
EXP_Plus1 = 21,
EXP_Plus2 = 22,
EXP_Plus3 = 23,
EXP_Negative1 = 24,
EXP_Negative2 = 25,
EXP_Negative3 = 26,
PrizeMoney_Plus1 = 27,
PrizeMoney_Plus2 = 28,
PrizeMoney_Plus3 = 29,
Capture_Plus1 = 30,
Capture_Plus2 = 31,
Capture_Plus3 = 32,
EncounterPlus1 = 0,
EncounterPlus2 = 1,
EncounterPlus3 = 2,
EncounterNegative1 = 3,
EncounterNegative2 = 4,
EncounterNegative3 = 5,
HatchingPlus1 = 6,
HatchingPlus2 = 7,
HatchingPlus3 = 8,
BefriendingPlus1 = 9,
BefriendingPlus2 = 10,
BefriendingPlus3 = 11,
BargainPlus1 = 12,
BargainPlus2 = 13,
BargainPlus3 = 14,
HPPlus1 = 15,
HPPlus2 = 16,
HPPlus3 = 17,
PPPlus1 = 18,
PPPlus2 = 19,
PPPlus3 = 20,
EXPPlus1 = 21,
EXPPlus2 = 22,
EXPPlus3 = 23,
EXPNegative1 = 24,
EXPNegative2 = 25,
EXPNegative3 = 26,
PrizeMoneyPlus1 = 27,
PrizeMoneyPlus2 = 28,
PrizeMoneyPlus3 = 29,
CapturePlus1 = 30,
CapturePlus2 = 31,
CapturePlus3 = 32,

Hatching_S = 33,
Bargain_S = 34,
Befriending_S = 35,
EXP_S = 36,
PrizeMoney_S = 37,
Capture_S = 38,
HPFullRecovery_S = 39,
Hatch_MAX = 40,
Bargain_MAX = 41,
Befriending_MAX = 42,
EXP_MAX = 43,
PrizeMoney_MAX = 44,
Capture_MAX = 45,
HatchingS = 33,
BargainS = 34,
BefriendingS = 35,
EXPS = 36,
PrizeMoneyS = 37,
CaptureS = 38,
HPFullRecoveryS = 39,
HatchMAX = 40,
BargainMAX = 41,
BefriendingMAX = 42,
EXPMAX = 43,
PrizeMoneyMAX = 44,
CaptureMAX = 45,
// 46
// 47
None = 48,

// B2/W2
Search_Plus1 = 49,
Search_Plus2 = 50,
Search_Plus3 = 51,
HiddenGrotto_Plus1 = 52,
HiddenGrotto_Plus2 = 53,
HiddenGrotto_Plus3 = 54,
Charm_Plus1 = 55,
Charm_Plus2 = 56,
Charm_Plus3 = 57,
SearchPlus1 = 49,
SearchPlus2 = 50,
SearchPlus3 = 51,
HiddenGrottoPlus1 = 52,
HiddenGrottoPlus2 = 53,
HiddenGrottoPlus3 = 54,
CharmPlus1 = 55,
CharmPlus2 = 56,
CharmPlus3 = 57,

Search_S = 58,
Search_MAX = 59,
HiddenGrotto_S = 60,
HiddenGrotto_MAX = 61,
Charm_S = 62,
Charm_MAX = 63,
SearchS = 58,
SearchMAX = 59,
HiddenGrottoS = 60,
HiddenGrottoMAX = 61,
CharmS = 62,
CharmMAX = 63,
}
16 changes: 16 additions & 0 deletions PKHeX.Core/Saves/Substructures/Gen7/FestaFacility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,19 @@ public sealed class FestaFacility(Memory<byte> raw, int language)
_ => -1,
};
}

public enum FestivalPlazaFacilityColor : byte
{
Red = 0,
Blue = 1,
Gold = 2,
Black = 3,
Purple = 4,
Yellow = 5,
Brown = 6,
Green = 7,
Orange = 8,
NavyBlue = 9,
Pink = 10,
White = 11,
}
18 changes: 9 additions & 9 deletions PKHeX.Core/Saves/Substructures/Gen7/PlayerSkinColor7.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace PKHeX.Core;
namespace PKHeX.Core;

public enum PlayerSkinColor7
{
M_Pale,
F_Pale,
M_Default,
F_Default,
M_Tan,
F_Tan,
M_Dark,
F_Dark,
PaleM = 0,
PaleF = 1,
DefaultM = 2,
DefaultF = 3,
TanM = 4,
TanF = 5,
DarkM = 6,
DarkF = 7,
}
32 changes: 16 additions & 16 deletions PKHeX.Core/Saves/Substructures/Gen7/Stamp7.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
namespace PKHeX.Core;
namespace PKHeX.Core;

public enum Stamp7
{
Official_Pokemon_Trainer,
Melemele_Trial_Completion,
Akala_Trial_Completion,
Ula_ula_Trial_Completion,
Poni_Trial_Completion,
Island_Challenge_Completion,
Melemele_Pokedex_Completion,
Akala_Pokedex_Completion,
Ula_ula_Pokedex_Completion,
Poni_Pokedex_Completion,
Alola_Pokedex_Completion,
_50_Consecutive_Single_Battle_Wins,
_50_Consecutive_Double_Battle_Wins,
_50_Consecutive_Multi_Battle_Wins,
Poke_Finder_Pro,
OfficialPokemonTrainer = 0,
MelemeleTrialCompletion = 1,
AkalaTrialCompletion = 2,
UlaulaTrialCompletion = 3,
PoniTrialCompletion = 4,
IslandChallengeCompletion = 5,
MelemelePokedexCompletion = 6,
AkalaPokedexCompletion = 7,
UlaulaPokedexCompletion = 8,
PoniPokedexCompletion = 9,
AlolaPokedexCompletion = 10,
ConsecutiveSingleBattleWins50 = 11,
ConsecutiveDoubleBattleWins50 = 12,
ConsecutiveMultiBattleWins50 = 13,
PokeFinderPro = 14,
}
2 changes: 1 addition & 1 deletion 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.

10 changes: 8 additions & 2 deletions PKHeX.WinForms/Controls/PKM Editor/SizeCP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ public SizeCP()
}

private readonly bool Initialized;
private static readonly string[] SizeClass = Enum.GetNames<PokeSize>();
private static readonly string[] SizeClassDetailed = Enum.GetNames<PokeSizeDetailed>();
private static string[] SizeClass = Enum.GetNames<PokeSize>();
private static string[] SizeClassDetailed = Enum.GetNames<PokeSizeDetailed>();

public static void ResetSizeLocalizations(string language)
{
SizeClass = WinFormsTranslator.GetEnumTranslation<PokeSize>(language);
SizeClassDetailed = WinFormsTranslator.GetEnumTranslation<PokeSizeDetailed>(language);
}

public void LoadPKM(PKM entity)
{
Expand Down
4 changes: 3 additions & 1 deletion PKHeX.WinForms/Controls/PKM Editor/StatusConditionView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ private void ClearStatus()
private void SetStatus(StatusCondition status)
{
PB_Status.Image = status.GetStatusSprite();
Hover.SetToolTip(PB_Status, $"Status Condition: {status}");

var text = WinFormsTranslator.TranslateEnum(status, Main.CurrentLanguage);
Hover.SetToolTip(PB_Status, $"Status Condition: {text}");
}

private void PB_Status_Click(object sender, EventArgs e)
Expand Down
Loading

0 comments on commit 093fca3

Please sign in to comment.