mirror of
https://github.com/Manu098vm/Switch-Gift-Data-Manager.git
synced 2026-08-19 17:36:46 -05:00
Properly handle TID/SID methods on both the WinForm and ConsoleApp projects
This commit is contained in:
@@ -204,6 +204,7 @@ public partial class MainWindow : Form
|
||||
var list = GetCurrentList();
|
||||
var wcid = UInt16.Parse(TxtWCID.Text);
|
||||
var repeatable = ChkRepeatable.Checked;
|
||||
var isBefore201 = cmbRedemptionMethod.SelectedIndex == 0;
|
||||
|
||||
if (wcid != list.GetWCID(ListBoxWC.SelectedIndex))
|
||||
{
|
||||
@@ -228,6 +229,12 @@ public partial class MainWindow : Form
|
||||
list.SetIsRepeatable(ListBoxWC.SelectedIndex, repeatable);
|
||||
BtnApply.Enabled = false;
|
||||
}
|
||||
|
||||
if (list.GetRequiresMethodSelection(ListBoxWC.SelectedIndex))
|
||||
{
|
||||
list.SetIsBefore201(ListBoxWC.SelectedIndex, isBefore201);
|
||||
BtnApply.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnRemove_Click(object sender, EventArgs e)
|
||||
@@ -305,19 +312,22 @@ public partial class MainWindow : Form
|
||||
|
||||
private void CmbRedemptionMethod_IndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
int newIndex = cmbRedemptionMethod.SelectedIndex;
|
||||
if (newIndex != cmbRedemptionMethod.Tag as int?)
|
||||
if (CurrentGame is Games.SCVI)
|
||||
{
|
||||
if (CurrentGame is Games.SCVI)
|
||||
var list = GetCurrentList();
|
||||
if (list.GetRequiresMethodSelection(ListBoxWC.SelectedIndex))
|
||||
{
|
||||
var list = GetCurrentList();
|
||||
list.SetTIDSID(ListBoxWC.SelectedIndex, newIndex == 1);
|
||||
var newValue = cmbRedemptionMethod.SelectedIndex == 0;
|
||||
var oldValue = list.GetIsBefore201(ListBoxWC.SelectedIndex);
|
||||
|
||||
if (newValue != oldValue)
|
||||
BtnApply.Enabled = true;
|
||||
else
|
||||
BtnApply.Enabled = false;
|
||||
}
|
||||
cmbRedemptionMethod.Tag = newIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ToolTipWcid_Draw(object sender, DrawToolTipEventArgs e)
|
||||
{
|
||||
Point screenPosition = ListBox.MousePosition;
|
||||
@@ -387,8 +397,13 @@ public partial class MainWindow : Form
|
||||
|
||||
TxtWCID.Text = content.ElementAt(0);
|
||||
ChkRepeatable.Checked = list.GetIsRepeatable(index);
|
||||
|
||||
cmbRedemptionMethod.Visible = cmbRedemptionMethod.Enabled = lblRedemptionMethod.Visible
|
||||
= lblRedemptionMethod.Enabled = list.GetRequiresMethodSelection(index);
|
||||
|
||||
if (cmbRedemptionMethod.Enabled)
|
||||
cmbRedemptionMethod.SelectedIndex = list.GetIsBefore201(index) ? 0 : 1;
|
||||
|
||||
EnableContent();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user