mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-27 23:14:58 -05:00
@@ -4,6 +4,10 @@ public sealed class SoundSettings
|
||||
{
|
||||
[LocalizedDescription("Play Sound when loading a new Save File")]
|
||||
public bool PlaySoundSAVLoad { get; set; } = true;
|
||||
|
||||
[LocalizedDescription("Play Sound when popping up Legality Report")]
|
||||
public bool PlaySoundLegalityCheck { get; set; } = true;
|
||||
|
||||
[LocalizedDescription("Play Sound when performing any other action that would be reasonable to sound alert.")]
|
||||
public bool PlaySoundOther { get; set; } = true;
|
||||
}
|
||||
|
||||
@@ -11,35 +11,73 @@ namespace PKHeX.Drawing.PokeSprite;
|
||||
public static class TypeColor
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the color of a <see cref="MoveType"/>.
|
||||
/// Gets the color of a <see cref="MoveType"/>, based on mainline sprite colors.
|
||||
/// </summary>
|
||||
/// <param name="type">Type to get the color of.</param>
|
||||
/// <returns>Color of the type.</returns>
|
||||
/// <exception cref="ArgumentOutOfRangeException"></exception>
|
||||
public static Color GetTypeSpriteColor(byte type) => ((MoveType)type).GetTypeSpriteColor();
|
||||
public static Color GetTypeSpriteColor(byte type)
|
||||
=> ((MoveType)type).GetTypeSpriteColor();
|
||||
|
||||
public static Color GetTypeSpriteColor(this MoveType type) => type switch
|
||||
/// <summary>
|
||||
/// Gets the color of a <see cref="MoveType"/>, based on mainline sprite colors.
|
||||
/// </summary>
|
||||
/// <param name="type">Type to get the color of.</param>
|
||||
/// <returns>Color of the type.</returns>
|
||||
/// <exception cref="ArgumentOutOfRangeException"></exception>
|
||||
public static Color GetTypeSpriteColorChampions(byte type)
|
||||
=> ((MoveType)type).GetTypeSpriteColorChampions();
|
||||
|
||||
extension(MoveType type)
|
||||
{
|
||||
Normal => Color.FromArgb(159, 161, 159),
|
||||
Fighting => Color.FromArgb(255, 128, 000),
|
||||
Flying => Color.FromArgb(129, 185, 239),
|
||||
Poison => Color.FromArgb(143, 065, 203),
|
||||
Ground => Color.FromArgb(145, 081, 033),
|
||||
Rock => Color.FromArgb(175, 169, 129),
|
||||
Bug => Color.FromArgb(145, 161, 025),
|
||||
Ghost => Color.FromArgb(112, 065, 112),
|
||||
Steel => Color.FromArgb(096, 161, 184),
|
||||
Fire => Color.FromArgb(230, 040, 041),
|
||||
Water => Color.FromArgb(041, 128, 239),
|
||||
Grass => Color.FromArgb(063, 161, 041),
|
||||
Electric => Color.FromArgb(250, 192, 000),
|
||||
Psychic => Color.FromArgb(239, 065, 121),
|
||||
Ice => Color.FromArgb(063, 216, 255),
|
||||
Dragon => Color.FromArgb(080, 097, 225),
|
||||
Dark => Color.FromArgb(080, 065, 063),
|
||||
Fairy => Color.FromArgb(239, 113, 239),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
|
||||
};
|
||||
/// <inheritdoc cref="GetTypeSpriteColor(byte)"/>
|
||||
public Color GetTypeSpriteColor() => type switch
|
||||
{
|
||||
Normal => Color.FromArgb(159, 161, 159),
|
||||
Fighting => Color.FromArgb(255, 128, 000),
|
||||
Flying => Color.FromArgb(129, 185, 239),
|
||||
Poison => Color.FromArgb(143, 065, 203),
|
||||
Ground => Color.FromArgb(145, 081, 033),
|
||||
Rock => Color.FromArgb(175, 169, 129),
|
||||
Bug => Color.FromArgb(145, 161, 025),
|
||||
Ghost => Color.FromArgb(112, 065, 112),
|
||||
Steel => Color.FromArgb(096, 161, 184),
|
||||
Fire => Color.FromArgb(230, 040, 041),
|
||||
Water => Color.FromArgb(041, 128, 239),
|
||||
Grass => Color.FromArgb(063, 161, 041),
|
||||
Electric => Color.FromArgb(250, 192, 000),
|
||||
Psychic => Color.FromArgb(239, 065, 121),
|
||||
Ice => Color.FromArgb(063, 216, 255),
|
||||
Dragon => Color.FromArgb(080, 097, 225),
|
||||
Dark => Color.FromArgb(080, 065, 063),
|
||||
Fairy => Color.FromArgb(239, 113, 239),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
|
||||
};
|
||||
|
||||
/// <inheritdoc cref="GetTypeSpriteColorChampions(byte)"/>
|
||||
public Color GetTypeSpriteColorChampions() => type switch
|
||||
{
|
||||
Normal => Color.FromArgb(0x99, 0x99, 0x99),
|
||||
Fighting => Color.FromArgb(0xff, 0xa2, 0x02),
|
||||
Flying => Color.FromArgb(0x95, 0xc9, 0xff),
|
||||
Poison => Color.FromArgb(0x99, 0x4d, 0xcf),
|
||||
Ground => Color.FromArgb(0xab, 0x79, 0x39),
|
||||
Rock => Color.FromArgb(0xbc, 0xb8, 0x89),
|
||||
Bug => Color.FromArgb(0x9f, 0xa4, 0x24),
|
||||
Ghost => Color.FromArgb(0x6e, 0x45, 0x70),
|
||||
Steel => Color.FromArgb(0x6a, 0xae, 0xd3),
|
||||
Fire => Color.FromArgb(0xff, 0x61, 0x2c),
|
||||
Water => Color.FromArgb(0x29, 0x92, 0xff),
|
||||
Grass => Color.FromArgb(0x42, 0xbf, 0x24),
|
||||
Electric => Color.FromArgb(0xff, 0xdb, 0x00),
|
||||
Psychic => Color.FromArgb(0xff, 0x63, 0x7f),
|
||||
Ice => Color.FromArgb(0x42, 0xd8, 0xff),
|
||||
Dragon => Color.FromArgb(0x54, 0x62, 0xd6),
|
||||
Dark => Color.FromArgb(0x4f, 0x47, 0x47),
|
||||
Fairy => Color.FromArgb(0xff, 0xb1, 0xff),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Color to show for a <see cref="MoveType"/> of <see cref="TeraTypeUtil.Stellar"/>.
|
||||
|
||||
@@ -249,7 +249,7 @@ public bool EditsComplete
|
||||
if (ModifierKeys == (Keys.Control | Keys.Shift | Keys.Alt))
|
||||
return true; // Override
|
||||
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
WinFormsUtil.Exclamation();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,13 +373,13 @@ public void SeekNext(Func<PKM, bool> searchFilter, bool reverse = false)
|
||||
if (!SearchUtil.TrySeekNext(SAV, searchFilter, out var result, box, slot, reverse))
|
||||
{
|
||||
// Not found
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
WinFormsUtil.Exclamation();
|
||||
return;
|
||||
}
|
||||
CurrentBox = result.Box;
|
||||
BoxPokeGrid.Entries[result.Slot].Focus();
|
||||
_lastSearchResult = result;
|
||||
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ private void ClickView(object sender, EventArgs e)
|
||||
{
|
||||
var info = GetSenderInfo(sender);
|
||||
if (info.IsEmpty())
|
||||
{ System.Media.SystemSounds.Asterisk.Play(); return; }
|
||||
{ WinFormsUtil.Asterisk(); return; }
|
||||
|
||||
Manager.Hover.Stop();
|
||||
var pk = Editor.Slots.Get(info.Slot);
|
||||
@@ -80,7 +80,7 @@ private void ClickDelete(object sender, EventArgs e)
|
||||
{
|
||||
var info = GetSenderInfo(sender);
|
||||
if (info.IsEmpty())
|
||||
{ System.Media.SystemSounds.Asterisk.Play(); return; }
|
||||
{ WinFormsUtil.Asterisk(); return; }
|
||||
|
||||
var sav = info.View.SAV;
|
||||
var pk = sav.BlankPKM;
|
||||
|
||||
@@ -475,7 +475,7 @@ public void FinishBoxManipulation(string message, bool all, int count)
|
||||
if (!string.IsNullOrWhiteSpace(message))
|
||||
WinFormsUtil.Alert(message + $" ({count})");
|
||||
else
|
||||
SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void ClickBoxDouble(object sender, MouseEventArgs e)
|
||||
@@ -969,7 +969,7 @@ private void ClickVerifyStoredEntities(object sender, EventArgs e)
|
||||
var localization = LegalityLocalizationSet.GetLocalization(Main.CurrentLanguage);
|
||||
var msg = bulk.Report(localization);
|
||||
WinFormsUtil.SetClipboardText(msg);
|
||||
SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
// File I/O
|
||||
|
||||
@@ -142,7 +142,7 @@ public void DragDrop(object? sender, DragEventArgs e)
|
||||
var info = GetSlotInfo(pb);
|
||||
if (!info.CanWriteTo() || Drag.Info.Source?.CanWriteTo() == false)
|
||||
{
|
||||
SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
Drag.Reset();
|
||||
return;
|
||||
|
||||
@@ -373,6 +373,7 @@ private void ReloadProgramSettings(PKHeXSettings settings, bool skipCore = false
|
||||
}
|
||||
SpriteBuilder.LoadSettings(settings.Sprite);
|
||||
WinFormsUtil.AddSaveFileExtensions(settings.Backup.OtherSaveFileExtensions);
|
||||
WinFormsUtil.Quiet = !settings.Sounds.PlaySoundOther;
|
||||
}
|
||||
|
||||
private void MainMenuBoxLoad(object sender, EventArgs e)
|
||||
@@ -503,7 +504,7 @@ private void OpenQuick(string path)
|
||||
{
|
||||
if (!CanFocus)
|
||||
{
|
||||
SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
return;
|
||||
}
|
||||
OpenFromPath(path);
|
||||
@@ -1075,12 +1076,12 @@ private void ExportQRFromTabs()
|
||||
private void ClickLegality(object? sender, EventArgs e)
|
||||
{
|
||||
if (!PKME_Tabs.EditsComplete)
|
||||
{ SystemSounds.Hand.Play(); return; }
|
||||
{ WinFormsUtil.Hand();return; }
|
||||
|
||||
var pk = PreparePKM();
|
||||
|
||||
if (pk.Species == 0 || !pk.ChecksumValid)
|
||||
{ SystemSounds.Hand.Play(); return; }
|
||||
{ WinFormsUtil.Hand(); return; }
|
||||
|
||||
var la = new LegalityAnalysis(pk, C_SAV.SAV.Personal);
|
||||
PKME_Tabs.UpdateLegality(la);
|
||||
@@ -1132,7 +1133,7 @@ private void DisplayLegalityReport(LegalityAnalysis la)
|
||||
var enc = la.EncounterOriginal.GetTextLines(Settings.Display.ExportLegalityVerboseProperties);
|
||||
var msg = verboseReport + Environment.NewLine + Environment.NewLine + string.Join(Environment.NewLine, enc);
|
||||
WinFormsUtil.SetClipboardText(msg);
|
||||
SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
};
|
||||
page.Buttons.Add(clipboard);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ private void B_Export_Click(object sender, EventArgs e)
|
||||
int ctr = BoxExport.Export(SAV, folder, namer, settings);
|
||||
if (settings.Notify == BoxExportNofify.Silent)
|
||||
{
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,13 +108,13 @@ private void B_Search_Click(object? sender, EventArgs e)
|
||||
SearchFilter = UC_EntitySearch.GetFilter(RTB_Instructions.Text);
|
||||
SearchRequested?.Invoke(this, EventArgs.Empty);
|
||||
B_Next.Visible = B_Previous.Visible = true;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Reset_Click(object? sender, EventArgs e)
|
||||
{
|
||||
ForceReset();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Add_Click(object? sender, EventArgs e)
|
||||
|
||||
@@ -175,7 +175,7 @@ private void ClickView(object sender, EventArgs e)
|
||||
int index = PKXBOXES.IndexOf(pb);
|
||||
if (!GetShiftedIndex(ref index))
|
||||
{
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
WinFormsUtil.Exclamation();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ private void ClickDelete(object sender, EventArgs e)
|
||||
int index = PKXBOXES.IndexOf(pb);
|
||||
if (!GetShiftedIndex(ref index))
|
||||
{
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
WinFormsUtil.Exclamation();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ private void ClickDelete(object sender, EventArgs e)
|
||||
L_Count.Text = string.Format(Counter, Results.Count);
|
||||
slotSelected = -1;
|
||||
FillPKXBoxes(SCR_Box.Value);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void ClickSet(object sender, EventArgs e)
|
||||
@@ -296,7 +296,7 @@ private void ResetFilters(object sender, EventArgs e)
|
||||
RTB_Instructions.Clear();
|
||||
|
||||
if (sender != this)
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void GenerateDBReport(object sender, EventArgs e)
|
||||
@@ -534,7 +534,7 @@ private async void B_Search_Click(object sender, EventArgs e)
|
||||
WinFormsUtil.Alert(MsgDBSearchNone);
|
||||
}
|
||||
SetResults(results); // updates Count Label as well.
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_Search.Enabled = true;
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -133,13 +133,13 @@ private void PG_Criteria_PropertyValueChanged(object s, PropertyValueChangedEven
|
||||
private void CriteriaReset_Click(object? sender, EventArgs e)
|
||||
{
|
||||
UpdateCriteriaPropertyGrid(EncounterCriteria.Unrestricted);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void CriteriaFromTabs_Click(object? sender, EventArgs e)
|
||||
{
|
||||
UpdateCriteriaPropertyGrid(BuildCriteriaFromTabs());
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private EncounterCriteria BuildCriteriaFromTabs()
|
||||
@@ -211,13 +211,13 @@ private void ClickView(object sender, EventArgs e)
|
||||
int index = PKXBOXES.IndexOf(pb);
|
||||
if (index >= RES_MAX)
|
||||
{
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
WinFormsUtil.Exclamation();
|
||||
return;
|
||||
}
|
||||
index += SCR_Box.Value * RES_MIN;
|
||||
if (index >= Results.Count)
|
||||
{
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
WinFormsUtil.Exclamation();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ private void ResetFilters(object sender, EventArgs e)
|
||||
foreach (var chk in TypeFilters.Controls.OfType<CheckBox>())
|
||||
chk.Checked = true;
|
||||
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
@@ -482,7 +482,7 @@ private async void B_Search_Click(object sender, EventArgs e)
|
||||
WinFormsUtil.Alert(MsgDBSearchNone);
|
||||
|
||||
SetResults(results); // updates Count Label as well.
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_Search.Enabled = true;
|
||||
EncounterMovesetGenerator.ResetFilters();
|
||||
}
|
||||
|
||||
@@ -196,13 +196,13 @@ private int GetSenderIndex(object sender)
|
||||
int index = PKXBOXES.IndexOf(pb);
|
||||
if (index >= RES_MAX)
|
||||
{
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
WinFormsUtil.Exclamation();
|
||||
return -1;
|
||||
}
|
||||
index += SCR_Box.Value * RES_MIN;
|
||||
if (index >= Results.Count)
|
||||
{
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
WinFormsUtil.Exclamation();
|
||||
return -1;
|
||||
}
|
||||
return index;
|
||||
@@ -252,7 +252,7 @@ private void ResetFilters(object sender, EventArgs e)
|
||||
RTB_Instructions.Clear();
|
||||
|
||||
if (sender != this)
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void LoadDatabase()
|
||||
@@ -368,7 +368,7 @@ private void B_Search_Click(object sender, EventArgs e)
|
||||
WinFormsUtil.Alert(MsgDBSearchNone);
|
||||
|
||||
SetResults([..results]); // updates Count Label as well.
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void UpdateScroll(object sender, ScrollEventArgs e)
|
||||
|
||||
@@ -33,6 +33,6 @@ private void B_VirtualConsoleGSBall_Click(object sender, EventArgs e)
|
||||
// Can be moved between VC and GB era, and can be a quick way to enable the event on either.
|
||||
SAV.EnableGSBallMobileEvent();
|
||||
B_VirtualConsoleGSBall.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,6 +181,6 @@ private void B_ImportParty_Click(object sender, EventArgs e)
|
||||
}
|
||||
|
||||
UpdateSprite();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,12 +71,12 @@ private void B_Reset_Click(object sender, EventArgs e)
|
||||
{
|
||||
NUD_IDay.Value = NUD_IHour.Value = NUD_IMinute.Value = NUD_ISecond.Value = 0;
|
||||
NUD_EDay.Value = NUD_EHour.Value = NUD_EMinute.Value = NUD_ESecond.Value = 0;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_BerryFix_Click(object sender, EventArgs e)
|
||||
{
|
||||
NUD_EDay.Value = Math.Max((2 * 366) + 2, NUD_EDay.Value); // advance
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ private void B_UpdateTrainer_Click(object sender, EventArgs e)
|
||||
secret.RegistryStatus = CHK_Registered.Checked ? 1 : 0;
|
||||
LB_Bases.DisplayMember = null!;
|
||||
LB_Bases.DisplayMember = nameof(SecretBase3.OriginalTrainerName);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_UpdatePKM_Click(object sender, EventArgs e)
|
||||
@@ -226,7 +226,7 @@ private void B_UpdatePKM_Click(object sender, EventArgs e)
|
||||
pkm.Level = Convert.ToByte(NUD_Level.Value);
|
||||
pkm.EVAll = Convert.ToByte(NUD_EVs.Value);
|
||||
secret.Team = pkmteam; // save changes
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Cancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
@@ -28,21 +28,21 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.PokeGearUnlockAllCallers();
|
||||
RefreshList();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_GiveAllNoTrainers_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.PokeGearUnlockAllCallersNoTrainers();
|
||||
RefreshList();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_DeleteAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.PokeGearClearAllCallers();
|
||||
RefreshList();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void PG_Rolodex_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
|
||||
|
||||
@@ -264,7 +264,7 @@ private void ClickSet(object sender, EventArgs e)
|
||||
return;
|
||||
PKM pk = View.PreparePKM();
|
||||
if (pk.Species == 0)
|
||||
{ System.Media.SystemSounds.Asterisk.Play(); return; }
|
||||
{ WinFormsUtil.Asterisk(); return; }
|
||||
|
||||
var index = GetSenderIndex(sender);
|
||||
var sav = SAV;
|
||||
@@ -298,7 +298,7 @@ private void ClickDelete(object sender, EventArgs e)
|
||||
var index = GetSenderIndex(sender);
|
||||
var pk = CurrentPass.GetPartySlotAtIndex(index);
|
||||
if (pk.Species == 0)
|
||||
{ System.Media.SystemSounds.Asterisk.Play(); return; }
|
||||
{ WinFormsUtil.Asterisk(); return; }
|
||||
|
||||
SaveCurrent(CurrentPass);
|
||||
CurrentPass.DeletePartySlot(index);
|
||||
@@ -576,7 +576,7 @@ private void B_Import_Click(object sender, EventArgs e)
|
||||
data.CopyTo(CurrentPass.Data);
|
||||
|
||||
LoadCurrent(CurrentPass);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Export_Click(object sender, EventArgs e)
|
||||
@@ -611,7 +611,7 @@ private void SwapSlots(bool down)
|
||||
var other = index + (down ? 1 : -1);
|
||||
if ((uint)other >= LB_Passes.Items.Count)
|
||||
{
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
return;
|
||||
}
|
||||
SaveCurrent(CurrentPass);
|
||||
|
||||
@@ -281,7 +281,7 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
// foreach (CheckBox c in Apps) c.Checked = true;
|
||||
for (int i = 0; i < CLB_Poketch.Items.Count; i++)
|
||||
CLB_Poketch.SetItemChecked(i, true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void TAB_Poketch_DragEnter(object? sender, DragEventArgs? e)
|
||||
@@ -800,7 +800,7 @@ private void OnBAllSealsLegalOnClick(object sender, EventArgs e)
|
||||
{
|
||||
bool setUnreleasedIndexes = sender == B_AllSealsIllegal;
|
||||
SetAllSeals(setUnreleasedIndexes);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -872,7 +872,7 @@ private void OnBAllAccessoriesLegalOnClick(object sender, EventArgs e)
|
||||
{
|
||||
bool setUnreleasedIndexes = sender == B_AllAccessoriesIllegal;
|
||||
SetAllAccessories(setUnreleasedIndexes);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -946,7 +946,7 @@ private void OnBAllBackdropsLegalOnClick(object sender, EventArgs e)
|
||||
{
|
||||
bool setUnreleasedIndexes = sender == B_AllBackdropsIllegal;
|
||||
SetAllBackdrops(setUnreleasedIndexes);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ private void ModifyAll(object sender, EventArgs e)
|
||||
SAV.Dex.ModifyAll(i, args, lang);
|
||||
|
||||
GetEntry();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void CHK_Seen_CheckedChanged(object sender, EventArgs e)
|
||||
|
||||
@@ -163,7 +163,7 @@ private bool ImportFile(string extension, string name, int expectSize, out byte[
|
||||
if (data.Length == otherSize)
|
||||
Array.Resize(ref data, expectSize);
|
||||
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
LastImportedFile = ofd.FileName;
|
||||
return true;
|
||||
}
|
||||
@@ -233,7 +233,7 @@ private void B_ImportPNGCGear_Click(object sender, EventArgs e)
|
||||
PB_CGearBackground.Image = CGearImage.GetBitmap(bg); // regenerate rather than reuse input
|
||||
B_ExportCGB.Enabled = B_ExportPNG.Enabled = true;
|
||||
if (CheckResult<CGearBackground>(result, out msg))
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
else
|
||||
WinFormsUtil.Alert(msg);
|
||||
}
|
||||
|
||||
@@ -631,7 +631,7 @@ private void B_RandForest_Click(object sender, EventArgs e)
|
||||
ChangeArea(this, EventArgs.Empty); // refresh
|
||||
NUD_Unlocked.Value = 8;
|
||||
CHK_Area9.Checked = true;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private static List<ComboItem> GetGenderChoices(ushort species)
|
||||
@@ -922,7 +922,7 @@ private void B_ObtainAllMedals_Click(object sender, EventArgs e)
|
||||
{
|
||||
var now = EncounterDate.GetDateNDS();
|
||||
b2w2.Medals.ObtainAll(now, unread: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -988,6 +988,6 @@ private void B_UnlockAllProps_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.Musical.UnlockAllMusicalProps();
|
||||
B_UnlockAllProps.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
var language = (LanguageID)SAV.Language;
|
||||
Dex.GiveAll(species, ModifierKeys != Keys.Alt, ModifierKeys.HasFlag(Keys.Shift), language, ModifierKeys.HasFlag(Keys.Control));
|
||||
GetEntry(skipFormRepop: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Modify_Click(object sender, EventArgs e)
|
||||
@@ -262,7 +262,7 @@ private void ModifyAll(object sender, EventArgs e)
|
||||
if (sender == mnuCaughtAll || sender == mnuComplete)
|
||||
Dex.CaughtAll(language, allLanguages: ModifierKeys.HasFlag(Keys.Control));
|
||||
GetEntry(skipFormRepop: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void UpdateDisplayedForm(object sender, ItemCheckEventArgs e)
|
||||
@@ -299,6 +299,6 @@ private void ModifyAllForms(object sender, EventArgs e)
|
||||
else if (sender == mnuFormAll)
|
||||
Dex.SetFormsSeen(shinyToo: ModifierKeys.HasFlag(Keys.Shift));
|
||||
GetEntry(skipFormRepop: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ private void MoveBox(object sender, EventArgs e)
|
||||
editing = renamingBox = true;
|
||||
if (!MoveItem(dir))
|
||||
{
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
else if (!SAV.SwapBox(index, index + dir)) // valid but locked
|
||||
{
|
||||
|
||||
@@ -235,7 +235,7 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
var language = (LanguageID)SAV.Language;
|
||||
Zukan.GiveAll(species, ModifierKeys != Keys.Alt, ModifierKeys.HasFlag(Keys.Shift), language, ModifierKeys.HasFlag(Keys.Control));
|
||||
GetEntry(skipFormRepop: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
|
||||
if (Zukan.GetCaught(species) && Zukan.GetCountSeen(species) == 0)
|
||||
MT_Seen.Text = 1.ToString();
|
||||
@@ -273,7 +273,7 @@ private void ModifyAll(object sender, EventArgs e)
|
||||
if (sender == mnuCaughtAll || sender == mnuComplete)
|
||||
Zukan.CaughtAll(language, allLanguages: ModifierKeys.HasFlag(Keys.Control));
|
||||
GetEntry(skipFormRepop: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void UpdateDisplayedForm(object sender, ItemCheckEventArgs e)
|
||||
@@ -309,6 +309,6 @@ private void ModifyAllForms(object sender, EventArgs e)
|
||||
else if (sender == mnuFormAll)
|
||||
Zukan.SetFormsSeen(shinyToo: ModifierKeys.HasFlag(Keys.Shift));
|
||||
GetEntry(skipFormRepop: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
var language = (LanguageID)SAV.Language;
|
||||
Zukan.GiveAll(species, ModifierKeys != Keys.Alt, ModifierKeys.HasFlag(Keys.Shift), language, ModifierKeys.HasFlag(Keys.Control));
|
||||
GetEntry(skipFormRepop: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Modify_Click(object sender, EventArgs e)
|
||||
@@ -261,7 +261,7 @@ private void ModifyAll(object sender, EventArgs e)
|
||||
if (sender == mnuCaughtAll || sender == mnuComplete)
|
||||
Zukan.CaughtAll(language, allLanguages: ModifierKeys.HasFlag(Keys.Control));
|
||||
GetEntry(skipFormRepop: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void UpdateDisplayedForm(object sender, ItemCheckEventArgs e)
|
||||
@@ -298,6 +298,6 @@ private void ModifyAllForms(object sender, EventArgs e)
|
||||
else if (sender == mnuFormAll)
|
||||
Zukan.SetFormsSeen(shinyToo: ModifierKeys.HasFlag(Keys.Shift));
|
||||
GetEntry(skipFormRepop: true);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ private void B_Import_Click(object sender, EventArgs e)
|
||||
sb.Load(obj);
|
||||
ReloadSecretBaseList();
|
||||
LoadCurrent(sb);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Export_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -327,7 +327,7 @@ private void GiveAllAccessories(object sender, EventArgs e)
|
||||
if (SAV is SAV6XY xy)
|
||||
{
|
||||
xy.Blocks.Fashion.UnlockAllAccessories();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ private void B_Modify_Click(object sender, EventArgs e)
|
||||
Captured.SetAllTransferred((uint)NUD_SpeciesTransferred.Value, Dex);
|
||||
|
||||
GetEntry();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_SumTotal_Click(object sender, EventArgs e)
|
||||
@@ -131,7 +131,7 @@ private void B_SumTotal_Click(object sender, EventArgs e)
|
||||
SetEntry();
|
||||
NUD_TotalCaptured.Value = Captured.CalculateTotalCaptured();
|
||||
NUD_TotalTransferred.Value = Captured.CalculateTotalTransferred();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private static void ToggleMax(NumericUpDown nud) => nud.Value = (nud.Value != nud.Maximum) ? nud.Maximum : 0;
|
||||
|
||||
@@ -474,7 +474,7 @@ private void HexTextBox_TextChanged(object sender, EventArgs e)
|
||||
editing = true;
|
||||
((TextBox)sender).Text = t;
|
||||
editing = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
if (sender == TB_UsedFlags)
|
||||
{
|
||||
@@ -765,6 +765,6 @@ private void B_AgentGlass_Click(object sender, EventArgs e)
|
||||
return;
|
||||
SAV.Fashion.GiveAgentSunglasses();
|
||||
B_AgentGlass.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,14 +62,14 @@ private void B_All_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.ResortSave.FillBeans();
|
||||
LoadValues();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_None_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.ResortSave.ClearBeans();
|
||||
LoadValues();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Save_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -377,7 +377,7 @@ private void ModifyAll(object sender, EventArgs e)
|
||||
GetEntry();
|
||||
allModifying = false;
|
||||
LB_Species.SelectedIndex = 0;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void ClearAll(object sender)
|
||||
|
||||
@@ -298,7 +298,7 @@ private void ModifyAll(object sender, EventArgs e)
|
||||
allModifying = false;
|
||||
LB_Forms.Enabled = LB_Forms.Visible = true;
|
||||
LB_Species.SelectedIndex = 0;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void ClearAll(object sender)
|
||||
|
||||
@@ -552,7 +552,7 @@ private void B_Fashion_Click(object sender, EventArgs e)
|
||||
default:
|
||||
return;
|
||||
}
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private string? UpdateTip(int index)
|
||||
|
||||
@@ -191,7 +191,7 @@ private void B_ExportGoSummary_Click(object sender, EventArgs e)
|
||||
return;
|
||||
}
|
||||
WinFormsUtil.SetClipboardText(string.Join(Environment.NewLine, summary));
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_ExportGoFiles_Click(object sender, EventArgs e)
|
||||
@@ -296,7 +296,7 @@ private void B_ImportGoFiles_Click(object sender, EventArgs e)
|
||||
ctr++;
|
||||
}
|
||||
UpdateGoSummary((int)NUD_GoIndex.Value);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void NUD_GoIndex_ValueChanged(object sender, EventArgs e) => UpdateGoSummary((int)NUD_GoIndex.Value);
|
||||
@@ -321,7 +321,7 @@ private void B_DeleteAll_Click(object sender, EventArgs e)
|
||||
|
||||
Park.DeleteAll();
|
||||
UpdateGoSummary((int)NUD_GoIndex.Value);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_DeleteGo_Click(object sender, EventArgs e)
|
||||
@@ -331,19 +331,19 @@ private void B_DeleteGo_Click(object sender, EventArgs e)
|
||||
index = Math.Clamp(index, 0, max);
|
||||
Park[index] = new GP1();
|
||||
UpdateGoSummary((int)NUD_GoIndex.Value);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_AllTrainerTitles_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.Blocks.EventWork.UnlockAllTitleFlags();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_AllFashionItems_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.Blocks.FashionPlayer.UnlockAllAccessoriesPlayer();
|
||||
SAV.Blocks.FashionStarter.UnlockAllAccessoriesStarter();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
if (SAV is not SAV7USUM)
|
||||
NUD_CellsTotal.Value += added;
|
||||
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
#region locations -- lazy
|
||||
|
||||
@@ -48,56 +48,56 @@ private void SaveMain()
|
||||
private void B_Spiritomb_Click(object sender, EventArgs e)
|
||||
{
|
||||
Unlocker.UnlockSpiritomb();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_Spiritomb.Enabled = Unlocker.UnlockReadySpiritomb;
|
||||
}
|
||||
|
||||
private void B_Shaymin_Click(object sender, EventArgs e)
|
||||
{
|
||||
Unlocker.UnlockShaymin();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_Shaymin.Enabled = Unlocker.UnlockReadyShaymin;
|
||||
}
|
||||
|
||||
private void B_Darkrai_Click(object sender, EventArgs e)
|
||||
{
|
||||
Unlocker.UnlockDarkrai();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_Darkrai.Enabled = Unlocker.UnlockReadyDarkrai;
|
||||
}
|
||||
|
||||
private void B_Arceus_Click(object sender, EventArgs e)
|
||||
{
|
||||
Unlocker.UnlockArceus();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_Arceus.Enabled = Unlocker.UnlockReadyArceus;
|
||||
}
|
||||
|
||||
private void B_DialgaPalkia_Click(object sender, EventArgs e)
|
||||
{
|
||||
Unlocker.UnlockBoxLegend();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_DialgaPalkia.Enabled = Unlocker.UnlockReadyBoxLegend;
|
||||
}
|
||||
|
||||
private void B_Roamer_Click(object sender, EventArgs e)
|
||||
{
|
||||
Unlocker.RespawnRoamer();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_Roamer.Enabled = Unlocker.ResetReadyRoamerMesprit || Unlocker.ResetReadyRoamerCresselia;
|
||||
}
|
||||
|
||||
private void B_Zones_Click(object sender, EventArgs e)
|
||||
{
|
||||
Unlocker.UnlockZones();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_Zones.Enabled = false;
|
||||
}
|
||||
|
||||
private void B_DefeatEyecatch_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.BattleTrainer.DefeatAll();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_DefeatEyecatch.Enabled = false;
|
||||
B_RebattleEyecatch.Enabled = true;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ private void B_DefeatEyecatch_Click(object sender, EventArgs e)
|
||||
private void B_RebattleEyecatch_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.BattleTrainer.RebattleAll();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_RebattleEyecatch.Enabled = false;
|
||||
B_DefeatEyecatch.Enabled = true;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ private void B_RebattleEyecatch_Click(object sender, EventArgs e)
|
||||
private void B_Fashion_Click(object sender, EventArgs e)
|
||||
{
|
||||
Unlocker.UnlockFashion();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
B_Fashion.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ private void B_All_Click(object sender, EventArgs e)
|
||||
poffin.FlavorSpicy = poffin.FlavorBitter = poffin.FlavorDry = poffin.FlavorSour = poffin.FlavorSweet = 0xFF;
|
||||
}
|
||||
LoadItems(AllItems);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_None_Click(object sender, EventArgs e)
|
||||
@@ -220,7 +220,7 @@ private void B_None_Click(object sender, EventArgs e)
|
||||
foreach (var poffin in AllItems)
|
||||
poffin.ToNull();
|
||||
LoadItems(AllItems);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Save_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -182,7 +182,7 @@ private void ModifyAll(object sender, EventArgs e)
|
||||
Zukan.CompleteDex(ModifierKeys == Keys.Control);
|
||||
|
||||
GetEntry();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void ModifyAllForms(object sender, EventArgs e)
|
||||
|
||||
@@ -471,7 +471,7 @@ private void B_Report_Click(object sender, EventArgs e)
|
||||
GetEntry(lastIndex, lastForm);
|
||||
ResumeLayout();
|
||||
Editing = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_AdvancedResearch_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -200,7 +200,7 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
var species = Indexes[lastIndex].Species;
|
||||
Dex.SetDexEntryAll(species, shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(lastIndex);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ private void SeenNone(object sender, EventArgs e)
|
||||
{
|
||||
SetEntry(lastIndex);
|
||||
Dex.SeenNone();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(lastIndex);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ private void SeenAll(object sender, EventArgs e)
|
||||
SetEntry(lastIndex);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.SeenAll(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(lastIndex);
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ private void CaughtNone(object sender, EventArgs e)
|
||||
{
|
||||
SetEntry(lastIndex);
|
||||
Dex.CaughtNone();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(lastIndex);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ private void CaughtAll(object sender, EventArgs e)
|
||||
SetEntry(lastIndex);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.CaughtAll(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(lastIndex);
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ private void CompleteDex(object sender, EventArgs e)
|
||||
SetEntry(lastIndex);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.CompleteDex(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(lastIndex);
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ private void ChangeAllCounts(object sender, EventArgs e)
|
||||
{
|
||||
SetEntry(lastIndex);
|
||||
Dex.SetAllBattledCount((uint)NUD_Battled.Value);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(lastIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ private void B_All_Click(object sender, EventArgs e)
|
||||
cells[3].Value = total.ToString();
|
||||
cells[4].Value = true;
|
||||
}
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_None_Click(object sender, EventArgs e)
|
||||
@@ -148,7 +148,7 @@ private void B_None_Click(object sender, EventArgs e)
|
||||
cells[2].Value = cells[3].Value = 0.ToString();
|
||||
cells[4].Value = false;
|
||||
}
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Save_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -258,14 +258,14 @@ private void ChangeTitleScreenIndex(object sender, EventArgs e)
|
||||
private void B_CopyFromPartyToTrainerCard_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.Blocks.TrainerCard.SetPartyData();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
ChangeTrainerCardIndex(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void B_CopyFromPartyToTitleScreen_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.Blocks.TitleScreen.SetPartyData();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
ChangeTitleScreenIndex(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ private void B_Fashion_Click(object sender, EventArgs e)
|
||||
default:
|
||||
return;
|
||||
}
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void ResetAppearance()
|
||||
@@ -326,6 +326,6 @@ private void B_ResetAppearance_Click(object sender, EventArgs e)
|
||||
private void B_GetAllDiglett_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.UnlockAllDiglett();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ private void B_All_Click(object sender, EventArgs e)
|
||||
var item = AllItems[index];
|
||||
cells[3].Value = item.MaxValue.ToString();
|
||||
}
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_None_Click(object sender, EventArgs e)
|
||||
@@ -152,7 +152,7 @@ private void B_None_Click(object sender, EventArgs e)
|
||||
cells[4].Value = true;
|
||||
cells[5].Value = false;
|
||||
}
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Save_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -147,7 +147,7 @@ private void RandomizeAll(object sender, EventArgs e)
|
||||
Donuts.SetAllRandomLv3();
|
||||
ReloadDonutNames();
|
||||
GetEntry(lastIndex);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void CloneCurrent(object sender, EventArgs e)
|
||||
@@ -155,7 +155,7 @@ private void CloneCurrent(object sender, EventArgs e)
|
||||
SetEntry(lastIndex);
|
||||
Donuts.CloneAllFromIndex(lastIndex);
|
||||
ReloadDonutNames();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void ShinyAssortment(object sender, EventArgs e)
|
||||
@@ -163,7 +163,7 @@ private void ShinyAssortment(object sender, EventArgs e)
|
||||
Donuts.SetAllAsShinyTemplate();
|
||||
ReloadDonutNames();
|
||||
GetEntry(lastIndex);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void GenerateRandom(object sender, EventArgs e)
|
||||
@@ -178,7 +178,7 @@ internal void GenerateRandomDonuts(ReadOnlySpan<ulong> flavorOptions, int start,
|
||||
Donuts.SetRandomShinyTemplateRange(flavorOptions, start, end);
|
||||
ReloadDonutNames();
|
||||
GetEntry(lastIndex);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_Reset_Click(object sender, EventArgs e) => DonutEditor.Reset();
|
||||
@@ -193,7 +193,7 @@ private void B_ImportClick(object sender, EventArgs e)
|
||||
|
||||
DonutEditor.LoadDonut(current);
|
||||
DonutFlavorProfile.LoadFromDonut(current);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private static bool TryLoadDonut(Span<byte> data)
|
||||
@@ -241,7 +241,7 @@ private void DragoutDrop(object? sender, DragEventArgs? e)
|
||||
ImportDonutFromPath(data, files[0]);
|
||||
DonutEditor.LoadDonut(current);
|
||||
DonutFlavorProfile.LoadFromDonut(current);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
|
||||
Cursor = DefaultCursor;
|
||||
@@ -277,7 +277,7 @@ private void B_Export_Click(object sender, EventArgs e)
|
||||
foreach (var b in data)
|
||||
sb.Append($"{b:X2} ");
|
||||
Clipboard.SetText(sb.ToString().TrimEnd());
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ private void B_SetAllOwned_Click(object sender, EventArgs e)
|
||||
var current = GetEditor(TC_Features.SelectedTab!);
|
||||
current.SetAllOwned(state);
|
||||
}
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,7 +502,7 @@ public void SetAllOwned(bool state)
|
||||
FashionItem9a.ModifyAll(Block.Data, z => z.IsOwned = state);
|
||||
Load();
|
||||
Grid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void LoadItem(int index, FashionItem9a item)
|
||||
|
||||
@@ -319,7 +319,7 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
var species = GetSpecies(lastIndex);
|
||||
Dex.SetDexEntryAll(species, shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ private void SeenNone(object sender, EventArgs e)
|
||||
var species = GetSpecies(lastIndex);
|
||||
SetEntry(species);
|
||||
Dex.SeenNone();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ private void SeenAll(object sender, EventArgs e)
|
||||
SetEntry(species);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.SeenAll(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ private void CaughtNone(object sender, EventArgs e)
|
||||
var species = GetSpecies(lastIndex);
|
||||
SetEntry(species);
|
||||
Dex.CaughtNone();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ private void CaughtAll(object sender, EventArgs e)
|
||||
SetEntry(species);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.CaughtAll(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ private void CompleteDex(object sender, EventArgs e)
|
||||
SetEntry(species);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.CompleteDex(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
var species = GetSpecies(lastIndex);
|
||||
Dex.SetDexEntryAll(species, shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ private void SeenNone(object sender, EventArgs e)
|
||||
var species = GetSpecies(lastIndex);
|
||||
SetEntry(species);
|
||||
Dex.SeenNone();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ private void SeenAll(object sender, EventArgs e)
|
||||
SetEntry(species);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.SeenAll(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ private void CaughtNone(object sender, EventArgs e)
|
||||
var species = GetSpecies(lastIndex);
|
||||
SetEntry(species);
|
||||
Dex.CaughtNone();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ private void CaughtAll(object sender, EventArgs e)
|
||||
SetEntry(species);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.CaughtAll(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ private void CompleteDex(object sender, EventArgs e)
|
||||
SetEntry(species);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.CompleteDex(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ private void B_GiveAll_Click(object sender, EventArgs e)
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
var species = GetSpecies(lastIndex);
|
||||
Dex.SetDexEntryAll(species, shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ private void SeenNone(object sender, EventArgs e)
|
||||
var species = GetSpecies(lastIndex);
|
||||
SetEntry(species);
|
||||
Dex.SeenNone();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ private void SeenAll(object sender, EventArgs e)
|
||||
SetEntry(species);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.SeenAll(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ private void CaughtNone(object sender, EventArgs e)
|
||||
var species = GetSpecies(lastIndex);
|
||||
SetEntry(species);
|
||||
Dex.CaughtNone();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ private void CaughtAll(object sender, EventArgs e)
|
||||
SetEntry(species);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.CaughtAll(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ private void CompleteDex(object sender, EventArgs e)
|
||||
SetEntry(species);
|
||||
bool shiny = ModifierKeys == Keys.Shift;
|
||||
Dex.CompleteDex(shiny);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
GetEntry(species);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,6 @@ private void UpdateStringSeed(object? sender, EventArgs e)
|
||||
private void B_CopyToOthers_Click(object sender, EventArgs e)
|
||||
{
|
||||
Raids.Propagate(CB_Raid.SelectedIndex, seedToo: ModifierKeys == Keys.Shift);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ private void B_UnlockFlyLocations_Click(object sender, EventArgs e)
|
||||
block.ChangeBooleanType(SCTypeCode.Bool2);
|
||||
}
|
||||
B_UnlockFlyLocations.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private static ReadOnlySpan<uint> FlyHashes =>
|
||||
@@ -343,28 +343,28 @@ private void B_CollectAllStakes_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.CollectAllStakes();
|
||||
B_CollectAllStakes.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_UnlockTMRecipes_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.UnlockAllTMRecipes();
|
||||
B_UnlockTMRecipes.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_ActivateSnacksworthLegendaries_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.ActivateSnacksworthLegendaries();
|
||||
B_ActivateSnacksworthLegendaries.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_UnlockCoaches_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.UnlockAllCoaches();
|
||||
B_UnlockCoaches.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_UnlockBikeUpgrades_Click(object sender, EventArgs e)
|
||||
@@ -384,7 +384,7 @@ private void B_UnlockBikeUpgrades_Click(object sender, EventArgs e)
|
||||
if (accessor.TryGetBlock("FSYS_RIDE_FLIGHT_ENABLE", out var fly))
|
||||
fly.ChangeBooleanType(SCTypeCode.Bool2); // Base & DLC1 saves do not have this block
|
||||
B_UnlockBikeUpgrades.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
public static void IMG_Save(Image image, string name)
|
||||
@@ -405,7 +405,7 @@ public static void IMG_Save(Image image, string name)
|
||||
_ => ImageFormat.Png,
|
||||
};
|
||||
image.Save(path, format);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void P_CurrPhoto_Click(object sender, EventArgs e) => IMG_Save(P_CurrPhoto.Image!, "current_photo");
|
||||
@@ -417,13 +417,13 @@ private void B_UnlockClothing_Click(object sender, EventArgs e)
|
||||
var accessor = SAV.Accessor;
|
||||
PlayerFashionUnlock9.UnlockBase(accessor, SAV.Gender);
|
||||
B_UnlockClothing.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void B_UnlockThrowStyles_Click(object sender, EventArgs e)
|
||||
{
|
||||
SAV.UnlockAllThrowStyles();
|
||||
B_UnlockThrowStyles.Enabled = false;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ private void B_CollectScrews_Click(object sender, EventArgs e)
|
||||
if (ModifierKeys == (Keys.Alt | Keys.Control | Keys.Shift))
|
||||
{
|
||||
ColorfulScrew9a.SetAllScrews(SAV);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
var itemName = GameInfo.Strings.Item[ColorfulScrew9a.ColorfulScrewItemIndex];
|
||||
|
||||
@@ -46,7 +46,7 @@ private void AddEvents()
|
||||
DragDrop += (_, _) =>
|
||||
{
|
||||
Cursor = DefaultCursor;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public SAV_BoxViewer(SAVEditor p, SlotChangeManager m, int box)
|
||||
DragDrop += (_, _) =>
|
||||
{
|
||||
Cursor = DefaultCursor;
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
};
|
||||
Owner = p.ParentForm;
|
||||
Load += (_, _) => PositionRelativeToParent();
|
||||
|
||||
@@ -392,7 +392,7 @@ private void GiveAllItems(object sender, EventArgs e)
|
||||
}
|
||||
|
||||
ModifyPouch(CurrentPouch, p => p.GiveAllItems(Bag, items, (int)NUD_Count.Value));
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private static bool GetModifySettings(InventoryPouch pouch, out bool truncate, out bool shuffle)
|
||||
|
||||
@@ -432,7 +432,7 @@ private DialogResult ModifyHeldItem()
|
||||
var s = p.Select((pk, i) => ((sbyte)PKMNUDs[i].Value == entry) && ItemIsMail(pk.HeldItem) ? pk : null).ToArray();
|
||||
if (s.All(v => v is null))
|
||||
return ret;
|
||||
System.Media.SystemSounds.Question.Play();
|
||||
WinFormsUtil.Question();
|
||||
var msg = $"{s.Select((v, i) => v is null ? string.Empty : $"{Environment.NewLine} {PKMLabels[i].Text}: {PKMHeldItems[i].Text} -> {CB_MailType.Items[0]}").Aggregate($"Modify PKM's HeldItem?{Environment.NewLine}", (tmp, v) => $"{tmp}{v}")}{Environment.NewLine}{Environment.NewLine}Yes: Delete Mail & Modify PKM{Environment.NewLine}No: Delete Mail";
|
||||
ret = WinFormsUtil.Prompt(MessageBoxButtons.YesNoCancel, msg);
|
||||
if (ret != DialogResult.Yes)
|
||||
@@ -580,7 +580,7 @@ private void SwapSlots(ListBox lb, bool down)
|
||||
var otherIndex = index + (down ? 1 : -1);
|
||||
if ((uint)otherIndex >= lb.Items.Count)
|
||||
{
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -761,7 +761,7 @@ private void B_ModifyAll_Click(object sender, EventArgs e)
|
||||
foreach (var g in Album)
|
||||
g.GiftUsed = sender == B_UsedAll;
|
||||
SetGiftBoxes();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
WinFormsUtil.Asterisk();
|
||||
}
|
||||
|
||||
private void LB_Received_KeyDown(object sender, KeyEventArgs e)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -17,6 +18,19 @@ namespace PKHeX.WinForms;
|
||||
|
||||
public static class WinFormsUtil
|
||||
{
|
||||
internal static bool Quiet { get; set; }
|
||||
|
||||
private static void Sound(SystemSound sound)
|
||||
{
|
||||
if (!Quiet)
|
||||
sound.Play();
|
||||
}
|
||||
|
||||
internal static void Asterisk() => Sound(SystemSounds.Asterisk);
|
||||
internal static void Hand() => Sound(SystemSounds.Hand);
|
||||
internal static void Exclamation() => Sound(SystemSounds.Exclamation);
|
||||
internal static void Question() => Sound(SystemSounds.Question);
|
||||
|
||||
internal static void TranslateInterface(Control form, string lang) => form.TranslateInterface(lang);
|
||||
|
||||
extension(Control child)
|
||||
@@ -117,7 +131,7 @@ internal void HorizontallyCenter(Control parent)
|
||||
/// <returns>The <see cref="DialogResult"/> associated with the dialog.</returns>
|
||||
internal static DialogResult Error(string friendlyMessage, Exception exception)
|
||||
{
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
Exclamation();
|
||||
return ErrorWindow.ShowErrorDialog(friendlyMessage, exception, true);
|
||||
}
|
||||
|
||||
@@ -128,24 +142,21 @@ internal static DialogResult Error(string friendlyMessage, Exception exception)
|
||||
/// <returns>The <see cref="DialogResult"/> associated with the dialog.</returns>
|
||||
internal static DialogResult Error(params ReadOnlySpan<string?> lines)
|
||||
{
|
||||
System.Media.SystemSounds.Hand.Play();
|
||||
Hand();
|
||||
string msg = string.Join(Environment.NewLine + Environment.NewLine, lines);
|
||||
return MessageBox.Show(msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
internal static DialogResult Alert(params ReadOnlySpan<string?> lines) => Alert(true, lines);
|
||||
|
||||
internal static DialogResult Alert(bool sound, params ReadOnlySpan<string?> lines)
|
||||
internal static DialogResult Alert(params ReadOnlySpan<string?> lines)
|
||||
{
|
||||
if (sound)
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
Asterisk();
|
||||
string msg = string.Join(Environment.NewLine + Environment.NewLine, lines);
|
||||
return MessageBox.Show(msg, "Alert", MessageBoxButtons.OK, sound ? MessageBoxIcon.Information : MessageBoxIcon.None);
|
||||
return MessageBox.Show(msg, "Alert", MessageBoxButtons.OK, Quiet ? MessageBoxIcon.None : MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
internal static DialogResult Prompt(MessageBoxButtons btn, params ReadOnlySpan<string?> lines)
|
||||
{
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
Asterisk();
|
||||
string msg = string.Join(Environment.NewLine + Environment.NewLine, lines);
|
||||
return MessageBox.Show(msg, "Prompt", btn, MessageBoxIcon.Question);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user