Kurt
2022-09-17 01:16:11 -07:00
parent fddddcba28
commit d33b97bf67
10 changed files with 11 additions and 11 deletions

View File

@@ -727,7 +727,7 @@ private void CHK_Continue_CheckedChanged(object sender, EventArgs e)
private void ChangeSpecies(object sender, EventArgs e)
{
species = (ushort)CB_Species.SelectedValue;
species = (ushort)WinFormsUtil.GetIndex(CB_Species);
if (editing)
return;
editing = true;

View File

@@ -57,7 +57,7 @@ private void ChangeCBSpecies(object sender, EventArgs e)
SetEntry();
editing = true;
species = (ushort)CB_Species.SelectedValue;
species = (ushort)WinFormsUtil.GetIndex(CB_Species);
LB_Species.SelectedIndex = species - 1; // Since we don't allow index0 in combobox, everything is shifted by 1
LB_Species.TopIndex = LB_Species.SelectedIndex;
GetEntry();

View File

@@ -207,7 +207,7 @@ private void SaveMain()
for (int i = 0; i < cbr.Length; i++)
{
int c = SAV.Data[ofsRoamer + 0x2E + i];
var d = (int)cbr[i].SelectedValue;
var d = (ushort)WinFormsUtil.GetIndex(cbr[i]);
if (c == d)
continue;

View File

@@ -47,7 +47,7 @@ private void ChangeCBSpecies(object sender, EventArgs e)
SetEntry();
editing = true;
species = (ushort)CB_Species.SelectedValue;
species = (ushort)WinFormsUtil.GetIndex(CB_Species);
LB_Species.SelectedIndex = species - 1; // Since we don't allow index0 in combobox, everything is shifted by 1
LB_Species.TopIndex = LB_Species.SelectedIndex;
GetEntry();

View File

@@ -50,7 +50,7 @@ private void ChangeCBSpecies(object sender, EventArgs e)
SetEntry();
editing = true;
species = (ushort)CB_Species.SelectedValue;
species = (ushort)WinFormsUtil.GetIndex(CB_Species);
LB_Species.SelectedIndex = species - 1; // Since we don't allow index0 in combobox, everything is shifted by 1
LB_Species.TopIndex = LB_Species.SelectedIndex;
GetEntry();

View File

@@ -50,7 +50,7 @@ private void ChangeCBSpecies(object sender, EventArgs e)
SetEntry();
editing = true;
species = (ushort)CB_Species.SelectedValue;
species = (ushort)WinFormsUtil.GetIndex(CB_Species);
LB_Species.SelectedIndex = species - 1; // Since we don't allow index0 in combobox, everything is shifted by 1
LB_Species.TopIndex = LB_Species.SelectedIndex;
GetEntry();

View File

@@ -66,7 +66,7 @@ private void ChangeCBSpecies(object sender, EventArgs e)
SetEntry();
editing = true;
currentSpecies = (ushort)CB_Species.SelectedValue;
currentSpecies = (ushort)WinFormsUtil.GetIndex(CB_Species);
LB_Species.SelectedIndex = currentSpecies - 1; // Since we don't allow index0 in combobox, everything is shifted by 1
LB_Species.TopIndex = LB_Species.SelectedIndex;
if (!allModifying) FillLBForms();

View File

@@ -53,7 +53,7 @@ private void ChangeCBSpecies(object sender, EventArgs e)
SetEntry();
editing = true;
currentSpecies = (ushort)CB_Species.SelectedValue;
currentSpecies = (ushort)WinFormsUtil.GetIndex(CB_Species);
LB_Species.SelectedIndex = currentSpecies - 1; // Since we don't allow index0 in combobox, everything is shifted by 1
LB_Species.TopIndex = LB_Species.SelectedIndex;
if (!allModifying) FillLBForms();

View File

@@ -46,7 +46,7 @@ private void ChangeCBSpecies(object sender, EventArgs e)
SetEntry();
editing = true;
species = (ushort)CB_Species.SelectedValue;
species = (ushort)WinFormsUtil.GetIndex(CB_Species);
LB_Species.SelectedIndex = species - 1; // Since we don't allow index0 in combobox, everything is shifted by 1
LB_Species.TopIndex = LB_Species.SelectedIndex;
GetEntry();

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
@@ -142,7 +142,7 @@ private void LoadWork(IEnumerable<EventVarGroup> editorWork)
{
if (editing)
return;
var value = (int) cb.SelectedValue;
var value = WinFormsUtil.GetIndex(cb);
editing = true;
var match = f.Options.FirstOrDefault(z => z.Value == value);
nud.Enabled = match?.Custom == true;