mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 06:34:19 +00:00
Cleanup
This commit is contained in:
parent
6af17352c9
commit
aeb90d262c
12 changed files with 27 additions and 40 deletions
|
@ -168,10 +168,10 @@ namespace PKHeX.Core
|
|||
}
|
||||
}
|
||||
|
||||
Legal.MGDB_G4 = g4.ToArray();
|
||||
Legal.MGDB_G5 = g5.ToArray();
|
||||
Legal.MGDB_G6 = g6.ToArray();
|
||||
Legal.MGDB_G7 = g7.ToArray();
|
||||
MGDB_G4 = g4.ToArray();
|
||||
MGDB_G5 = g5.ToArray();
|
||||
MGDB_G6 = g6.ToArray();
|
||||
MGDB_G7 = g7.ToArray();
|
||||
}
|
||||
|
||||
private static EncounterStatic[] getStaticEncounters(GameVersion Game)
|
||||
|
@ -2272,7 +2272,6 @@ namespace PKHeX.Core
|
|||
if (DB == null)
|
||||
return validPGF;
|
||||
|
||||
// todo
|
||||
var vs = getValidPreEvolutions(pkm).ToArray();
|
||||
foreach (PGF wc in DB.OfType<PGF>().Where(wc => vs.Any(dl => dl.Species == wc.Species)))
|
||||
{
|
||||
|
|
|
@ -219,13 +219,13 @@ namespace PKHeX.Core
|
|||
public static readonly int[] Arceus_Plate = {303, 306, 304, 305, 309, 308, 310, 313, 298, 299, 301, 300, 307, 302, 311, 312, 644};
|
||||
public static readonly int[] Arceus_ZCrystal = {782, 785, 783, 784, 788, 787, 789, 792, 777, 778, 780, 779, 786, 781, 790, 791, 793};
|
||||
|
||||
internal static int[] BabyEvolutionWithMove =
|
||||
internal static readonly int[] BabyEvolutionWithMove =
|
||||
{
|
||||
122, // Mr. Mime (Mime Jr with Mimic)
|
||||
185, // Sudowoodo (Bonsly with Mimic)
|
||||
};
|
||||
|
||||
internal static int[] EvolutionWithMove =
|
||||
internal static readonly int[] EvolutionWithMove =
|
||||
{
|
||||
122, // Mr. Mime (Mime Jr with Mimic)
|
||||
185, // Sudowoodo (Bonsly with Mimic)
|
||||
|
@ -238,7 +238,7 @@ namespace PKHeX.Core
|
|||
763, // Tsareena (Steenee with Stomp)
|
||||
};
|
||||
|
||||
internal static int[] FairyMoves =
|
||||
internal static readonly int[] FairyMoves =
|
||||
{
|
||||
186, //Sweet Kiss
|
||||
204, //Charm
|
||||
|
|
|
@ -1213,8 +1213,8 @@ namespace PKHeX.Core
|
|||
}).ToArray()
|
||||
};
|
||||
|
||||
private static int[] TrophyDP = {035, 039, 052, 113, 133, 137, 173, 174, 183, 298, 311, 312, 351, 438, 439, 440}; // Porygon
|
||||
private static int[] TrophyPt = {035, 039, 052, 113, 133, 132, 173, 174, 183, 298, 311, 312, 351, 438, 439, 440}; // Ditto
|
||||
private static readonly int[] TrophyDP = {035, 039, 052, 113, 133, 137, 173, 174, 183, 298, 311, 312, 351, 438, 439, 440}; // Porygon
|
||||
private static readonly int[] TrophyPt = {035, 039, 052, 113, 133, 132, 173, 174, 183, 298, 311, 312, 351, 438, 439, 440}; // Ditto
|
||||
|
||||
private static readonly int[] DP_GreatMarshAlt_Species =
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
|
@ -211,6 +209,7 @@ namespace PKHeX.Core
|
|||
/// </summary>
|
||||
/// <param name="t">Type of the static class containing the desired strings.</param>
|
||||
/// <param name="languageFilePrefix">Prefix of the language file to use. Example: if the target is legality_en.txt, <paramref name="languageFilePrefix"/> should be "legality".</param>
|
||||
/// <param name="currentCultureCode">Culture information</param>
|
||||
private static void setLocalization(Type t, string languageFilePrefix, string currentCultureCode)
|
||||
{
|
||||
setLocalization(t, getStringList($"{languageFilePrefix}_{currentCultureCode}"));
|
||||
|
@ -221,6 +220,7 @@ namespace PKHeX.Core
|
|||
/// </summary>
|
||||
/// <param name="t">Type of the static class containing the desired strings.</param>
|
||||
/// <remarks>The values used to translate the given static class are retrieved from [TypeName]_[CurrentLangCode2].txt in the resource manager of PKHeX.Core.</remarks>
|
||||
/// <param name="currentCultureCode">Culture information</param>
|
||||
public static void setLocalization(Type t, string currentCultureCode)
|
||||
{
|
||||
setLocalization(t, t.Name, currentCultureCode);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace PKHeX.Core
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
|
|
|
@ -458,24 +458,24 @@ namespace PKHeX.WinForms
|
|||
}
|
||||
private void mainMenuUnicode(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.Unicode = unicode = Menu_Unicode.Checked;
|
||||
Settings.Default.Unicode = unicode = Menu_Unicode.Checked;
|
||||
updateUnicode();
|
||||
}
|
||||
private void mainMenuModifyDex(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.SetUpdateDex = SaveFile.SetUpdateDex = Menu_ModifyDex.Checked;
|
||||
Settings.Default.SetUpdateDex = SaveFile.SetUpdateDex = Menu_ModifyDex.Checked;
|
||||
}
|
||||
private void mainMenuModifyUnset(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.ModifyUnset = Menu_ModifyUnset.Checked;
|
||||
Settings.Default.ModifyUnset = Menu_ModifyUnset.Checked;
|
||||
}
|
||||
private void mainMenuModifyPKM(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.SetUpdatePKM = SaveFile.SetUpdatePKM = Menu_ModifyPKM.Checked;
|
||||
Settings.Default.SetUpdatePKM = SaveFile.SetUpdatePKM = Menu_ModifyPKM.Checked;
|
||||
}
|
||||
private void mainMenuFlagIllegal(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.FlagIllegal = Menu_FlagIllegal.Checked;
|
||||
Settings.Default.FlagIllegal = Menu_FlagIllegal.Checked;
|
||||
updateBoxViewers(all:true);
|
||||
setPKXBoxes();
|
||||
}
|
||||
|
@ -1391,7 +1391,7 @@ namespace PKHeX.WinForms
|
|||
curlanguage = GameInfo.lang_val[CB_MainLanguage.SelectedIndex];
|
||||
|
||||
// Set the culture (makes it easy to pass language to other forms)
|
||||
Properties.Settings.Default.Language = curlanguage;
|
||||
Settings.Default.Language = curlanguage;
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo(curlanguage.Substring(0, 2));
|
||||
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
|
||||
|
||||
|
@ -1741,7 +1741,7 @@ namespace PKHeX.WinForms
|
|||
}
|
||||
private void setMarkings()
|
||||
{
|
||||
Func<bool, double> getOpacity = b => b ? 1 : 0.175;
|
||||
double getOpacity(bool b) => b ? 1 : 0.175;
|
||||
PictureBox[] pba = { PB_Mark1, PB_Mark2, PB_Mark3, PB_Mark4, PB_Mark5, PB_Mark6 };
|
||||
for (int i = 0; i < pba.Length; i++)
|
||||
pba[i].Image = ImageUtil.ChangeOpacity(pba[i].InitialImage, getOpacity(pkm.Markings[i] != 0));
|
||||
|
@ -3285,7 +3285,7 @@ namespace PKHeX.WinForms
|
|||
return;
|
||||
}
|
||||
|
||||
try { Properties.Settings.Default.Save(); }
|
||||
try { Settings.Default.Save(); }
|
||||
catch (Exception x) { File.WriteAllLines("config error.txt", new[] { x.ToString() }); }
|
||||
}
|
||||
#endregion
|
||||
|
|
|
@ -30,10 +30,10 @@ namespace PKHeX.WinForms
|
|||
editing = false;
|
||||
LB_Species.SelectedIndex = 0;
|
||||
|
||||
string[] dexMode = new string[5] { "not given", "simple mode", "detect forms", "national dex", "other languages" };
|
||||
string[] dexMode = { "not given", "simple mode", "detect forms", "national dex", "other languages" };
|
||||
if (SAV.HGSS) dexMode = dexMode.Where((t, i) => i != 2).ToArray();
|
||||
for(int i = 0; i < dexMode.Length; i++)
|
||||
CB_DexUpgraded.Items.Add(dexMode[i]);
|
||||
foreach (string mode in dexMode)
|
||||
CB_DexUpgraded.Items.Add(mode);
|
||||
if (SAV.DexUpgraded < CB_DexUpgraded.Items.Count)
|
||||
CB_DexUpgraded.SelectedIndex = SAV.DexUpgraded;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ namespace PKHeX.WinForms
|
|||
private const string GENDERLESS = "Genderless";
|
||||
private const string MALE = "Male";
|
||||
private const string FEMALE = "Female";
|
||||
private static int[] DPLangSpecies = new int[14] { 23, 25, 54, 77, 120, 129, 202, 214, 215, 216, 228, 278, 287, 315 };
|
||||
private static readonly int[] DPLangSpecies = { 23, 25, 54, 77, 120, 129, 202, 214, 215, 216, 228, 278, 287, 315 };
|
||||
private void getEntry()
|
||||
{
|
||||
// Load Bools for the data
|
||||
|
@ -85,7 +85,7 @@ namespace PKHeX.WinForms
|
|||
int ofs = SAV.PokeDex + (bit >> 3) + 0x4;
|
||||
int FormOffset1 = SAV.PokeDex + 4 + brSize * 4 + 4;
|
||||
int PokeDexLanguageFlags = FormOffset1 + (SAV.HGSS ? 0x3C : 0x20);
|
||||
int l_ofs = !SAV.DP ? species : (1 + Array.IndexOf(DPLangSpecies, species));
|
||||
int l_ofs = !SAV.DP ? species : 1 + Array.IndexOf(DPLangSpecies, species);
|
||||
if (l_ofs > 0)
|
||||
{
|
||||
l_ofs += PokeDexLanguageFlags;
|
||||
|
@ -309,7 +309,7 @@ namespace PKHeX.WinForms
|
|||
{
|
||||
CHK_Caught.Checked = true;
|
||||
for (int j = 0; j < CL.Length; j++) // set SAV language (and others if Complete)
|
||||
CL[j].Checked = sender == mnuComplete || (mnuCaughtNone != sender && j == lang);
|
||||
CL[j].Checked = sender == mnuComplete || mnuCaughtNone != sender && j == lang;
|
||||
}
|
||||
else if (caughtN)
|
||||
CHK_Caught.Checked = false;
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using PKHeX.Core;
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ namespace PKHeX.WinForms
|
|||
string filename = pkx.FileName;
|
||||
|
||||
// Make File
|
||||
string newfile = Path.Combine(Path.GetTempPath(), Core.Util.CleanFileName(filename));
|
||||
string newfile = Path.Combine(Path.GetTempPath(), Util.CleanFileName(filename));
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(newfile, dragdata);
|
||||
|
|
|
@ -3,8 +3,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PKHeX.WinForms
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue