Skip to content

Commit 1d27516

Browse files
Jayden CosgroveJayden Cosgrove
authored andcommitted
> Added Loop/Random buttons to loopable menu options
> Fixed Some of the Looping Jank
1 parent 357eed0 commit 1d27516

13 files changed

+182
-68
lines changed

32Stuff/TrainerBool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private void CheckBox_Main_CheckedChanged_1(object sender, EventArgs e)
5050

5151
public void AttemptShuffle()
5252
{
53-
SetValue(!CheckBox_Main.Checked);
53+
// SetValue(!CheckBox_Main.Checked);
5454
}
5555
}
5656

32Stuff/TrainerColourPicker.Designer.cs

Lines changed: 52 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

32Stuff/TrainerColourPicker.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace UI32
1212
{
13-
public partial class TrainerColourPicker : UserControl, ITrainerUI<byte>
13+
public partial class tableLayoutPanel1 : UserControl, ITrainerUI<byte>
1414
{
1515

1616
public int butSize = 25;
@@ -29,11 +29,11 @@ public ButtonColourData(CheckBox button, ColourData<T> colourData)
2929
}
3030
}
3131

32-
public TrainerColourPicker(string name, ColourData<byte>[] colours)
32+
public tableLayoutPanel1(string name, ColourData<byte>[] colours)
3333
{
3434
InitializeComponent();
3535

36-
label1.Text = name;
36+
label2.Text = name;
3737

3838

3939

@@ -44,9 +44,11 @@ public TrainerColourPicker(string name, ColourData<byte>[] colours)
4444
butt.BackColor = cdata.colour;
4545

4646
butt.Width = butt.Height = butSize;
47+
butt.FlatAppearance.BorderSize = 10;
48+
4749

4850
buttons.Add(new ButtonColourData<byte>(butt, cdata));
49-
51+
5052
butt.Click += new EventHandler((sender, eventArgs) => OnButtonClick(sender, eventArgs, butt, cdata));
5153
flowLayoutPanel1.Controls.Add(butt);
5254
}
@@ -85,6 +87,7 @@ public byte GetValue()
8587
ButtonColourData<byte> butt;
8688
public void SetValue(byte value)
8789
{
90+
current.value = value;
8891
butt = buttons.FirstOrDefault(b => b.colourData.value == value);
8992
SetSelected();
9093

@@ -93,11 +96,16 @@ public void SetValue(byte value)
9396

9497
public void AttemptShuffle()
9598
{
99+
if (!LoopBox.Checked) return;
100+
96101
int index = buttons.IndexOf(butt);
97102
index++;
98103
index %= buttons.Count();
99-
SetValue(buttons[index].colourData.value);
104+
var value = buttons[index].colourData.value;
100105

106+
SetValue(value);
107+
SetSelected();
108+
onValueChanged.Invoke(value);
101109
}
102110

103111
public struct ColourData<T>

32Stuff/TrainerEnumButton.Designer.cs

Lines changed: 49 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

32Stuff/TrainerEnumButton.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public partial class TrainerEnumButton : UserControl, ITrainerUI<byte>
2020
public TrainerEnumButton(string title, params ValueStringPair[] values)
2121
{
2222
InitializeComponent();
23-
Label_title.Text = title;
23+
label1.Text = title;
2424

2525
buttons = new SortedList <byte, MyButton>();
2626

@@ -81,7 +81,9 @@ public void SetValue(byte value)
8181

8282
public void AttemptShuffle()
8383
{
84-
int index = buttons.IndexOfKey(value) + 1;
84+
if (!LoopBox.Checked) return;
85+
86+
int index = buttons.IndexOfKey(value) + 1;
8587
index %= buttons.Count();
8688

8789
byte newValue = buttons.Keys[index];

32Stuff/TrainerEnumButtonArray.Designer.cs

Lines changed: 8 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

32Stuff/TrainerEnumButtonArray.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public void OnButtonPress (byte value)
6969

7070
public void AttemptShuffle()
7171
{
72+
if (!LoopBox.Checked) return;
73+
7274
int index =buttons.IndexOfKey(theValue) + 1;
7375
index %= buttons.Count();
7476

@@ -133,7 +135,6 @@ public void CreateButtons()
133135
ButtonArray buttonArray = new ButtonArray(title);
134136
collection.Add(buttonArray);
135137

136-
Console.WriteLine("Adding Button Array: " + title);
137138

138139
foreach (var item in nodes)
139140
{
@@ -145,7 +146,7 @@ public void CreateButtons()
145146
MyButton butt = new MyButton();
146147
butt.Text = title;
147148

148-
Console.WriteLine("Adding New Button: "+ title + " v: " + value );
149+
149150

150151
collection.Add(butt);
151152

32Stuff/TrainerNumeric.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private void numericUpDown1_KeyPress(object sender, KeyPressEventArgs e)
6161

6262
private void numericUpDown1_VisibleChanged(object sender, EventArgs e)
6363
{
64-
// Console.WriteLine(numericUpDown1.Value);
64+
6565
}
6666

6767
public void AttemptShuffle()

0 commit comments

Comments
 (0)