public SAV_PokedexSWSH(SAV8SWSH sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV8SWSH)(Origin = sav).Clone(); Dex = SAV.Blocks.Zukan; CL = new[] { CHK_L1, CHK_L2, CHK_L3, CHK_L4, CHK_L5, CHK_L6, CHK_L7, CHK_L8, CHK_L9 }; CHK = new[] { CLB_1, CLB_2, CLB_3, CLB_4 }; // Clear Listbox and ComboBox LB_Species.Items.Clear(); CB_Species.Items.Clear(); foreach (var c in CHK) { c.Items.Clear(); for (int j = 0; j < 63; j++) { c.Items.Add($"{j:00} - N/A"); } c.Items.Add("Gigantamax"); } // Fill List CB_Species.InitializeBinding(); var species = GameInfo.FilteredSources.Species.Where(z => Zukan8.DexLookup.ContainsKey(z.Value)).ToArray(); CB_Species.DataSource = new BindingSource(species, null); var Species = GameInfo.Strings.Species; var names = Zukan8.GetEntryNames(Species); foreach (var n in names) { LB_Species.Items.Add(n); } Loading = false; LB_Species.SelectedIndex = 0; CB_Species.KeyDown += WinFormsUtil.RemoveDropCB; CanSave = true; }
public SAV_HallOfFame(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV6)(Origin = sav).Clone(); Array.Copy(SAV.Data, SAV.HoF, data, 0, data.Length); //Copy HoF section of save into Data Setup(); editor_spec = new Control[] { GB_OT, GB_CurrentMoves, CB_Species, CB_HeldItem, TB_EC, TB_VN, CAL_MetDate, CHK_Nicknamed, CHK_Shiny, L_PartyNum, L_Victory, L_Shiny, L_Level, Label_TID, Label_Form, Label_Gender, Label_HeldItem, Label_OT, Label_TID, Label_SID, Label_Species, TB_Level, NUP_PartyIndex, Label_EncryptionConstant, Label_MetDate, }; LB_DataEntry.SelectedIndex = 0; NUP_PartyIndex_ValueChanged(null, EventArgs.Empty); try { TB_Nickname.Font = TB_OT.Font = FontUtil.GetPKXFont(11); } catch (Exception e) { WinFormsUtil.Alert("Font loading failed...", e.ToString()); } editing = true; }
public SAV_Pokedex4(SaveFile sav) { SAV = (SAV4)(Origin = sav).Clone(); InitializeComponent(); CL = new[] { CHK_L1, CHK_L2, CHK_L3, CHK_L5, CHK_L4, CHK_L6, }; // JPN,ENG,FRA,GER,ITA,SPA WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); editing = true; // Clear Listbox and ComboBox LB_Species.Items.Clear(); CB_Species.Items.Clear(); // Fill List CB_Species.DisplayMember = "Text"; CB_Species.ValueMember = "Value"; CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Skip(1).Where(id => id.Value <= SAV.MaxSpeciesID).ToList(), null); for (int i = 1; i < SAV.MaxSpeciesID + 1; i++) { LB_Species.Items.Add($"{i:000} - {GameInfo.Strings.specieslist[i]}"); } editing = false; LB_Species.SelectedIndex = 0; string[] dexMode = { "not given", "simple mode", "detect forms", "national dex", "other languages" }; if (SAV.HGSS) { dexMode = dexMode.Where((t, i) => i != 2).ToArray(); } foreach (string mode in dexMode) { CB_DexUpgraded.Items.Add(mode); } if (SAV.DexUpgraded < CB_DexUpgraded.Items.Count) { CB_DexUpgraded.SelectedIndex = SAV.DexUpgraded; } CB_Species.KeyDown += WinFormsUtil.RemoveDropCB; }
public Main() { string[] args = Environment.GetCommandLineArgs(); FormLoadInitialSettings(args, out bool showChangelog, out bool BAKprompt); InitializeComponent(); C_SAV.SetEditEnvironment(new SaveDataEditor <PictureBox>(new FakeSaveFile(), PKME_Tabs)); FormLoadAddEvents(); #if DEBUG // translation updater -- all controls are added at this point -- call translate now if (DevUtil.IsUpdatingTranslations) { WinFormsUtil.TranslateInterface(this, CurrentLanguage); // Translate the UI to language. } #endif FormInitializeSecond(); FormLoadCustomBackupPaths(); FormLoadInitialFiles(args); FormLoadCheckForUpdates(); FormLoadPlugins(); if (HaX) { PKMConverter.AllowIncompatibleConversion = true; WinFormsUtil.Alert(MsgProgramIllegalModeActive, MsgProgramIllegalModeBehave); } else if (showChangelog) { ShowAboutDialog(1); } if (BAKprompt && !Directory.Exists(BackupPath)) { PromptBackup(); } BringToFront(); WindowState = FormWindowState.Minimized; Show(); WindowState = FormWindowState.Normal; }
public SAV_SimplePokedex() { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.curlanguage); seen = new bool[SAV.MaxSpeciesID]; caught = new bool[SAV.MaxSpeciesID]; string[] spec = Util.getSpeciesList(Main.curlanguage); for (int i = 0; i < seen.Length; i++) { PKM tempPkm = new PK6(); tempPkm.Species = i + 1; seen[i] = SAV.getSeen(tempPkm); caught[i] = SAV.getCaught(tempPkm); CLB_Seen.Items.Add(spec[i + 1]); CLB_Caught.Items.Add(spec[i + 1]); CLB_Seen.SetItemChecked(i, seen[i]); CLB_Caught.SetItemChecked(i, caught[i]); } initialized = true; }
public SAV_SimplePokedex(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (Origin = sav).Clone(); seen = new bool[SAV.MaxSpeciesID]; caught = new bool[SAV.MaxSpeciesID]; string[] spec = Util.GetSpeciesList(Main.CurrentLanguage); for (int i = 0; i < seen.Length; i++) { int species = i + 1; seen[i] = SAV.GetSeen(species); caught[i] = SAV.GetCaught(species); CLB_Seen.Items.Add(spec[species]); CLB_Caught.Items.Add(spec[species]); CLB_Seen.SetItemChecked(i, seen[i]); CLB_Caught.SetItemChecked(i, caught[i]); } initialized = true; }
public SAV_Pokebean() { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.curlanguage); var colors = new[] { "Red", "Blue", "Light Blue", "Green", "Yellow", "Purple", "Orange" }; var beans = new List <string>(); foreach (var color in colors) { beans.Add($"{color} Bean"); } foreach (var color in colors) { beans.Add($"{color} Patterned Bean"); } beans.Add("Rainbow Bean"); beanlist = beans.ToArray(); Setup(); }
public KChart(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = sav; alolanOnly = SAV.Generation == 7 && DialogResult.Yes == WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Alolan Dex only?"); Array.Resize(ref species, SAV.Personal.TableLength); var AltForms = SAV.Personal.GetFormList(species, SAV.MaxSpeciesID); species = SAV.Personal.GetPersonalEntryList(AltForms, species, SAV.MaxSpeciesID, out baseForm, out formVal); DGV.Rows.Clear(); for (int i = 1; i < species.Length; i++) { PopEntry(i); } DGV.Sort(DGV.Columns[0], ListSortDirection.Ascending); }
public SAV_OPower(SAV6 sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); Origin = sav; Data = sav.OPowerData; Current = Types[0]; foreach (var z in Types) { CB_Type.Items.Add(z.ToString()); } CB_Type.SelectedIndex = 0; CHK_Master.Checked = Data.MasterFlag; LoadCurrent(); CB_Type.SelectedIndexChanged += (s, e) => { SaveCurrent(); LoadCurrent(); }; B_ClearAll.Click += (s, e) => { Data.ClearAll(); LoadCurrent(); }; B_GiveAll.Click += (s, e) => { Data.UnlockRegular(); LoadCurrent(); }; B_GiveAllMAX.Click += (s, e) => { Data.UnlockAll(); LoadCurrent(); }; }
public SAV_HoneyTree(SAV4Sinnoh sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV4Sinnoh)(Origin = sav).Clone(); Table = SAV switch { SAV4DP _ => HoneyTree.TableDP, SAV4Pt _ => HoneyTree.TablePt, _ => throw new Exception() }; // Get Munchlax tree for this savegame in screen MunchlaxTrees = SAV.GetMunchlaxTrees(); const string sep = "- "; L_Tree0.Text = string.Join(Environment.NewLine, MunchlaxTrees.Select(z => sep + CB_TreeList.Items[z])); CB_TreeList.SelectedIndex = 0; }
public SAV_BlockDump8(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV8SWSH)sav; var blocks = SAV.AllBlocks.Select((z, i) => new ComboItem($"{z.Key:X8} - {i:0000} {(z.Type.IsBoolean() ? "Bool" : z.Type.ToString())}", (int)z.Key)); CB_Key.InitializeBinding(); CB_Key.DataSource = blocks.ToArray(); var boolToggle = new[] { new ComboItem(nameof(SCTypeCode.Bool1), (int)SCTypeCode.Bool1), new ComboItem(nameof(SCTypeCode.Bool2), (int)SCTypeCode.Bool2), new ComboItem(nameof(SCTypeCode.Bool3), (int)SCTypeCode.Bool3), }; CB_TypeToggle.InitializeBinding(); CB_TypeToggle.DataSource = boolToggle; }
public SAV_Link6(SaveFile sav) { SAV = (SAV6)(Origin = sav).Clone(); InitializeComponent(); foreach (var cb in TAB_Items.Controls.OfType <ComboBox>()) { cb.DisplayMember = "Text"; cb.ValueMember = "Value"; cb.DataSource = new BindingSource(GameInfo.ItemDataSource.Where(item => item.Value <= SAV.MaxItemID).ToArray(), null); } WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); byte[] data = SAV.LinkBlock; if (data == null) { WinFormsUtil.Alert("Invalid save file / Link Information"); Close(); return; } data = data.Skip(0x1FF).Take(PL6.Size).ToArray(); LoadLinkData(data); }
public SAV_ZygardeCell(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV7)(Origin = sav).Clone(); // Constants @ 0x1C00 // Cell Data @ 0x1D8C // Use constants 0x18C/2 = 198 thru +95 ushort[] constants = SAV.EventConsts; ushort[] cells = constants.Skip(celloffset).Take(CellCount).ToArray(); int cellCount = constants[cellstotal]; int cellCollected = constants[cellscollected]; NUD_Cells.Value = cellCount; NUD_Collected.Value = cellCollected; var combo = dgv.Columns[2] as DataGridViewComboBoxColumn; foreach (string t in states) { combo.Items.Add(t); // add only the Names } // Populate Grid dgv.Rows.Add(CellCount); var locations = SAV.SM ? locationsSM : locationsUSUM; for (int i = 0; i < CellCount; i++) { if (cells[i] > 2) { throw new ArgumentException(); } dgv.Rows[i].Cells[0].Value = (i + 1).ToString(); dgv.Rows[i].Cells[1].Value = locations[i]; dgv.Rows[i].Cells[2].Value = states[cells[i]]; } }
public SAV_SuperTrain(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV6)(Origin = sav).Clone(); trba = GameInfo.Strings.trainingbags; trba[0] = "---"; STB = ((ISaveBlock6Main)SAV).SuperTrain; var ofs = STB.Offset; offsetTime = ofs + 0x08; offsetSpec = ofs + 0x188; offsetVal = ofs + 0x18A; string[] stages = GameInfo.Strings.trainingstage; listBox1.Items.Clear(); for (int i = 0; i < 32; i++) { listBox1.Items.Add($"{i+1:00} - {stages[i]}"); } Setup(); }
public BatchEditor(PKM pk, SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); pkm = pk; SAV = sav; DragDrop += TabMain_DragDrop; DragEnter += TabMain_DragEnter; CB_Format.Items.Clear(); CB_Format.Items.Add(MsgAny); foreach (Type t in BatchEditing.Types) { CB_Format.Items.Add(t.Name.ToLower()); } CB_Format.Items.Add(MsgAll); CB_Format.SelectedIndex = CB_Require.SelectedIndex = 0; toolTip1.SetToolTip(CB_Property, MsgBEToolTipPropName); toolTip2.SetToolTip(L_PropType, MsgBEToolTipPropType); toolTip3.SetToolTip(L_PropValue, MsgBEToolTipPropValue); }
public SAV_SecretBase(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV6AO)(Origin = sav).Clone(); abilitylist = GameInfo.Strings.abilitylist; SetupComboBoxes(); PopFavorite(); PopFavorite(); TB_FOT.Font = TB_FT1.Font = TB_FT2.Font = TB_FSay1.Font = TB_FSay2.Font = TB_FSay3.Font = TB_FSay4.Font = LB_Favorite.Font = FontUtil.GetPKXFont(); CB_Ability.InitializeBinding(); LB_Favorite.SelectedIndex = 0; MT_Flags.Text = SAV.Records.GetRecord(080).ToString(); // read counter; also present in the Secret Base data block var offset = GetSecretBaseOffset(0); objdata = LoadObjectArray(offset); pkmdata = LoadPKMData(0, offset); B_SAV2FAV(this, EventArgs.Empty); }
public MemoryAmie(PKM pk) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); pkm = pk; PrevCountries = new[] { CB_Country0, CB_Country1, CB_Country2, CB_Country3, CB_Country4 }; PrevRegions = new[] { CB_Region0, CB_Region1, CB_Region2, CB_Region3, CB_Region4, }; string[] arguments = L_Arguments.Text.Split(new[] { " ; " }, StringSplitOptions.None); TextArgs = new TextMarkup(arguments); foreach (ComboBox comboBox in PrevCountries) { comboBox.InitializeBinding(); Main.SetCountrySubRegion(comboBox, "countries"); } foreach (var region in PrevRegions) { region.InitializeBinding(); } GetLangStrings(); LoadFields(); }
public SAV_Inventory(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (Origin = sav).Clone(); itemlist = GameInfo.Strings.GetItemStrings(SAV.Generation, SAV.Version).ToArray(); for (int i = 0; i < itemlist.Length; i++) { if (string.IsNullOrEmpty(itemlist[i])) { itemlist[i] = $"(Item #{i:000})"; } } HasFreeSpace = SAV.Generation >= 7 && SAV is not SAV7b; HasNew = SAV.Generation >= 7; Pouches = SAV.Inventory; CreateBagViews(); LoadAllBags(); ChangeViewedPouch(0); }
public SAV_BlockDump8(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV8SWSH)sav; PG_BlockView.Size = RTB_Hex.Size; // Get an external source of names if available. var extra = GetExtraKeyNames(); Metadata = new SCBlockMetadata(SAV.Blocks, extra); CB_Key.InitializeBinding(); CB_Key.DataSource = Metadata.GetSortedBlockKeyList().ToArray(); ComboItem[] boolToggle = { new(nameof(SCTypeCode.Bool1), (int)SCTypeCode.Bool1), new(nameof(SCTypeCode.Bool2), (int)SCTypeCode.Bool2), new(nameof(SCTypeCode.Bool3), (int)SCTypeCode.Bool3), };
public BatchEditor(PKM pk, SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); pkmref = pk; SAV = sav; DragDrop += TabMain_DragDrop; DragEnter += TabMain_DragEnter; CB_Format.Items.Clear(); CB_Format.Items.Add("Any"); foreach (Type t in types) { CB_Format.Items.Add(t.Name.ToLower()); } CB_Format.Items.Add("All"); CB_Format.SelectedIndex = CB_Require.SelectedIndex = 0; new ToolTip().SetToolTip(CB_Property, "Property of a given PKM to modify."); new ToolTip().SetToolTip(L_PropType, "PropertyType of the currently loaded PKM in the main window."); new ToolTip().SetToolTip(L_PropValue, "PropertyValue of the currently loaded PKM in the main window."); }
public SAV_Inventory(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (Origin = sav).Clone(); itemlist = GameInfo.Strings.GetItemStrings(SAV.Generation, SAV.Version).ToArray(); for (int i = 0; i < itemlist.Length; i++) { if (itemlist[i]?.Length == 0) { itemlist[i] = $"(Item #{i:000})"; } } HasFreeSpace = SAV.Generation == 7; HasNew = CHK_NEW.Visible = SAV.Generation == 7; Pouches = SAV.Inventory; InitBags(); GetBags(); SwitchBag(null, null); // bag 0 }
public SAV_ZygardeCell(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV7)(Origin = sav).Clone(); // Constants @ 0x1C00 // Cell Data @ 0x1D8C // Use constants 0x18C/2 = 198 thru +95 ushort[] constants = SAV.GetAllEventWork(); var cells = constants.AsSpan(celloffset, CellCount); int cellCount = constants[cellstotal]; int cellCollected = constants[cellscollected]; NUD_Cells.Value = cellCount; NUD_Collected.Value = cellCollected; var combo = (DataGridViewComboBoxColumn)dgv.Columns[2]; combo.Items.AddRange(states); // add only the Names dgv.Columns[0].ValueType = typeof(int); // Populate Grid dgv.Rows.Add(CellCount); var locations = SAV is SAV7SM ? locationsSM : locationsUSUM; for (int i = 0; i < CellCount; i++) { if (cells[i] > 2) { throw new IndexOutOfRangeException("Unable to find cell index."); } dgv.Rows[i].Cells[0].Value = (i + 1); dgv.Rows[i].Cells[1].Value = locations[i]; dgv.Rows[i].Cells[2].Value = states[cells[i]]; } }
public SAV_EventFlags(SaveFile sav) { SAV = (Origin = sav).Clone(); InitializeComponent(); DragEnter += Main_DragEnter; DragDrop += Main_DragDrop; flags = SAV.EventFlags; Constants = SAV.EventConsts; CB_Stats.Items.Clear(); for (int i = 0; i < Constants.Length; i++) { CB_Stats.Items.Add(i.ToString()); } TLP_Flags.SuspendLayout(); TLP_Const.SuspendLayout(); TLP_Flags.Scroll += WinFormsUtil.PanelScroll; TLP_Const.Scroll += WinFormsUtil.PanelScroll; TLP_Flags.Controls.Clear(); TLP_Const.Controls.Clear(); AddFlagList(GetStringList("flags")); AddConstList(GetStringList("const")); TLP_Flags.ResumeLayout(); TLP_Const.ResumeLayout(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); Text = $"Event Flag Editor ({gamePrefix.ToUpper()})"; CB_Stats.SelectedIndex = 0; NUD_Flag.Maximum = flags.Length - 1; NUD_Flag.Text = "0"; }
public SAV_BoxLayout(SaveFile sav, int box) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (Origin = sav).Clone(); editing = true; if (!SAV.HasBoxWallpapers) { CB_BG.Visible = PAN_BG.Visible = false; } else if (!LoadWallpaperNames()) // Repopulate Wallpaper names { WinFormsUtil.Error("Box layout is not supported for this game.", "Please close the window."); } LoadBoxNames(); LoadFlags(); LoadUnlockedCount(); LB_BoxSelect.SelectedIndex = box; switch (SAV.Generation) { case 6: case 7: TB_BoxName.MaxLength = 14; break; case 8: TB_BoxName.MaxLength = 16; break; default: TB_BoxName.MaxLength = 8; break; } editing = false; }
public SAV_Trainer8b(SAV8BS sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV8BS)(Origin = sav).Clone(); Loading = true; if (Main.Unicode) { TB_OTName.Font = TB_Rival.Font = FontUtil.GetPKXFont(); } B_MaxCash.Click += (_, _) => MT_Money.Text = SAV.MaxMoney.ToString(); CB_Gender.Items.Clear(); CB_Gender.Items.AddRange(Main.GenderSymbols.Take(2).ToArray()); // m/f depending on unicode selection GetComboBoxes(); GetTextBoxes(); TrainerStats.LoadRecords(SAV, Records.RecordList_8b); Loading = false; }
public KChart(SaveFile sav) { InitializeComponent(); Icon = Properties.Resources.Icon; WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = sav; Array.Resize(ref species, SAV.Personal.TableLength); var AltForms = SAV.Personal.GetFormList(species, SAV.MaxSpeciesID); species = SAV.Personal.GetPersonalEntryList(AltForms, species, SAV.MaxSpeciesID, out baseForm, out formVal); DGV.Rows.Clear(); for (int i = 1; i < species.Length; i++) { PopEntry(i); } DGV.DoubleBuffered(true); DGV.Sort(DGV.Columns[0], ListSortDirection.Ascending); }
public SAV_HoneyTree() { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.curlanguage); if (SAV.DP) { Table = HoneyTree.TableDP; } else if (SAV.Pt) { Table = HoneyTree.TablePt; } // Get Munchlax tree for this savegame in screen MunchlaxTrees = SAV.MunchlaxTrees; const string sep = "- "; L_Tree0.Text = string.Join(Environment.NewLine, MunchlaxTrees.Select(z => sep + CB_TreeList.Items[z])); CB_TreeList.SelectedIndex = 0; }
public SAV_BoxList(SAVEditor p, SlotChangeManager m) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); // initialize boxes dynamically var sav = p.SAV; AddControls(p, m, sav); SetWindowDimensions(sav.BoxCount); AllowDrop = true; AddEvents(); CenterToParent(); Owner = p.ParentForm; FormClosing += (sender, e) => { foreach (var b in Boxes) { b.M.Boxes.Remove(b); } }; }
public SAV_Misc3() { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.curlanguage); if (SAV.FRLG || SAV.E) { readJoyful(); } else { tabControl1.Controls.Remove(TAB_Joyful); } if (SAV.E) { readFerry(); readBF(); } else { tabControl1.Controls.Remove(TAB_Ferry); tabControl1.Controls.Remove(TAB_BF); } if (SAV.FRLG) { TB_OTName.Text = PKX.getString3(SAV.Data, SAV.getBlockOffset(4) + 0xBCC, 8, SAV.Japanese); } else { TB_OTName.Visible = L_TrainerName.Visible = false; } NUD_BP.Value = Math.Min(NUD_BP.Maximum, SAV.BP); NUD_Coins.Value = Math.Min(NUD_Coins.Maximum, SAV.Coin); }
public TrashEditor(TextBoxBase TB_NN, byte[] raw, SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = sav; FinalString = TB_NN.Text; Raw = FinalBytes = raw; editing = true; if (raw != null) { AddTrashEditing(raw.Length); } var f = FontUtil.GetPKXFont(); AddCharEditing(f); TB_Text.MaxLength = TB_NN.MaxLength; TB_Text.Text = TB_NN.Text; TB_Text.Font = f; if (FLP_Characters.Controls.Count == 0) { FLP_Characters.Visible = false; FLP_Hex.Height *= 2; } else if (FLP_Hex.Controls.Count == 0) { FLP_Characters.Location = FLP_Hex.Location; FLP_Characters.Height *= 2; } editing = false; CenterToParent(); }