forked from jadaradix/dsgamemaker
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDEvent.cs
More file actions
113 lines (103 loc) · 3.42 KB
/
DEvent.cs
File metadata and controls
113 lines (103 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
namespace DS_Game_Maker
{
public partial class DEvent
{
public string MainClass;
public string SubClass;
public bool UseData;
private string OwnedBy;
public DEvent()
{
InitializeComponent();
}
private void DCancelButton_Click()
{
MainClass = "NoData";
SubClass = "NoData";
Close();
}
private void DEvent_Load(object sender, EventArgs e)
{
Dropper.Renderer = new clsMenuRenderer();
UseData = false;
}
public void EquateDropper()
{
Dropper.Items.Clear();
var NewItems = new List<string>();
switch (ScriptsLib.MainClassStringToType(MainClass))
{
case (byte)2:
case (byte)3:
case (byte)4:
{
NewItems.Add("A");
NewItems.Add("B");
NewItems.Add("X");
NewItems.Add("Y");
NewItems.Add("L");
NewItems.Add("R");
NewItems.Add("Up");
NewItems.Add("Down");
NewItems.Add("Left");
NewItems.Add("Right");
NewItems.Add("Start");
NewItems.Add("Select");
break;
}
case (byte)5:
{
NewItems.Add("New Press");
NewItems.Add("Double Press");
NewItems.Add("Held");
NewItems.Add("Released");
break;
}
case (byte)6:
{
foreach (string X_ in DSGMlib.GetXDSFilter("OBJECT "))
{
string X = X_;
X = X.Substring(7);
string ObjectName = X.Substring(0, X.IndexOf(","));
// If ObjectName = OwnedBy Then Continue For
NewItems.Add(ObjectName);
}
break;
}
}
foreach (string X in NewItems)
{
Dropper.Items.Add(X);
}
}
private void EventButtons_Click(object sender, EventArgs e)
{
MainClass = ((Button)sender).Text.Substring(6);
byte X = ScriptsLib.MainClassStringToType(MainClass);
if (X == 1 | X == 7)
{
SubClass = "NoData";
UseData = true;
Close();
return;
}
var PT = ((Button)sender).Location;
EquateDropper();
Dropper.Show((Control)sender, 0, ((Control)sender).Height + 2);
}
private void EventDropper_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
SubClass = e.ClickedItem.Text;
UseData = true;
Close();
}
private void DEvent_FormClosing(object sender, FormClosingEventArgs e)
{
// MainClass = "NoData";
// SubClass = "NoData";
}
private void DCancelButton_Click(object sender, EventArgs e) => DCancelButton_Click();
}
}