-
Notifications
You must be signed in to change notification settings - Fork 0
/
TemplatePicker.cs
180 lines (175 loc) · 3.57 KB
/
TemplatePicker.cs
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
namespace FFRMapEditorMono
{
public enum Templates
{
ConeriaCastle = 0,
TempleOfFiend,
Pravoka,
Elfland,
NorthWestCastle,
Melmond,
CrescentLake,
Volcano,
Ordeals,
Onrac,
Gaia,
MirageTower,
Lefein,
Caravan,
DockVertical,
DockHorizontal
}
public class TemplatePicker : OptionPicker
{
public byte[,] CurrentTemplate { get => templates[lastSelection]; }
public TemplatePicker(Texture2D _window, Texture2D _selector, SpriteFont _font)
{
optionsWindow = _window;
optionSelector = _selector;
optionFont = _font;
Position = new Vector2(64, 0);
zoom = 1.0f;
optionsRows = 2;
optionsColumns = 8;
optionsSize = 32;
Show = false;
lastSelection = 0x00;
options = templatesNames.Select((t, i) => (t,
new List<EditorTask>() {
new EditorTask() { Type = EditorTasks.TemplatesUpdate, Value = i },
new EditorTask() { Type = EditorTasks.WindowsClose, Value = 10 } },
new List<EditorTask>() {
new EditorTask() { Type = EditorTasks.TemplatesUpdate, Value = i } }
)).ToList();
placedOptions = new();
unplacedOptions = new();
showPlaced = false;
SetOptionTextLength();
}
private List<string> templatesNames = new()
{
"Coneria Castle",
"Temple of Fiends",
"Pravoka",
"Elfland",
"Northwest Castle",
"Melmond",
"Crescent Lake",
"Volcano",
"Castle of Ordeals",
"Onrac",
"Gaia",
"Mirage Tower",
"Lefein",
"Caravan",
"Dock (Vertical)",
"Dock (Horizontal",
};
private List<byte[,]> templates = new()
{
new byte[,]
{
{ 0x00, 0x00, 0x09, 0x0A, 0x00, 0x00 },
{ 0x00, 0x2C, 0x19, 0x1A, 0x2E, 0x00 },
{ 0x3B, 0x3C, 0x01, 0x02, 0x3E, 0x3F },
{ 0x4B, 0x49, 0x3D, 0x3D, 0x49, 0x4F },
{ 0x5B, 0x49, 0x3D, 0x3D, 0x49, 0x5F },
{ 0x6B, 0x49, 0x3D, 0x3D, 0x49, 0x6F },
{ 0x7B, 0x7D, 0x3D, 0x3D, 0x7E, 0x7F },
},
new byte[,]
{
{ 0x00, 0x47, 0x48, 0x00 },
{ 0x56, 0x57, 0x58, 0x59 },
},
new byte[,]
{
{ 0x00, 0x2C, 0x2D, 0x2E, 0x00 },
{ 0x3B, 0x3C, 0x4A, 0x3E, 0x3F },
{ 0x4B, 0x4A, 0x3D, 0x4A, 0x4F },
{ 0x5C, 0x7D, 0x3D, 0x7E, 0x5E },
},
new byte[,]
{
{ 0x00, 0x0B, 0x0C, 0x00 },
{ 0x4C, 0x1B, 0x1C, 0x04C},
{ 0x4C, 0x00, 0x00, 0x04C},
},
new byte[,]
{
{ 0x09, 0x0A },
{ 0x29, 0x2A },
},
new byte[,]
{
{ 0x4D, 0x00 },
{ 0x4D, 0x4D },
},
new byte[,]
{
{ 0x00, 0x2C, 0x2D, 0x2E, 0x00 },
{ 0x3B, 0x3C, 0x3D, 0x3E, 0x3F },
{ 0x4B, 0x3D, 0x4E, 0x4E, 0x4F },
{ 0x5B, 0x4E, 0x3D, 0x4E, 0x5F },
{ 0x6B, 0x4E, 0x3D, 0x3D, 0x6F },
{ 0x7B, 0x7D, 0x3D, 0x7E, 0x7F },
},
new byte[,]
{
{ 0x64, 0x65 },
{ 0x74, 0x75 },
},
new byte[,]
{
{ 0x0B, 0x0C },
{ 0x38, 0x39 },
},
new byte[,]
{
{ 0x5D, 0x5D },
{ 0x5D, 0x5D },
},
new byte[,]
{
{ 0x00, 0x5A, 0x5A },
{ 0x5A, 0x5A, 0x00 },
},
new byte[,]
{
{ 0x0D, 0x45 },
{ 0x1D, 0x1E },
},
new byte[,]
{
{ 0x00, 0x2C, 0x2D, 0x2E, 0x00 },
{ 0x3B, 0x3C, 0x6D, 0x3E, 0x3F },
{ 0x4B, 0x6D, 0x6D, 0x6D, 0x4F },
{ 0x5C, 0x7D, 0x3D, 0x7E, 0x5E },
},
new byte[,]
{
{ 0x00, 0x42, 0x43 },
{ 0x42, 0x36, 0x53 },
{ 0x52, 0x53, 0x00 },
},
new byte[,]
{
{ 0x77, 0x78 },
{ 0x1F, 0x17 },
{ 0x1F, 0x17 },
},
new byte[,]
{
{ 0x77, 0x78, 0x78 },
{ 0x1F, 0x17, 0x17 },
},
};
}
}