Skip to content

Commit 83c4871

Browse files
authored
Add Selector + MQ map support
2 parents 95a6f05 + e954e1d commit 83c4871

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+48844
-1737
lines changed

Canvas.cs

Lines changed: 666 additions & 0 deletions
Large diffs are not rendered by default.

Content/Content.mgcb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@
7373
/processorParam:TextureFormat=Color
7474
/build:domainsicons.png
7575

76+
#begin ffmq_resizetool.png
77+
/importer:TextureImporter
78+
/processor:TextureProcessor
79+
/processorParam:ColorKeyColor=255,0,255,255
80+
/processorParam:ColorKeyEnabled=True
81+
/processorParam:GenerateMipmaps=False
82+
/processorParam:PremultiplyAlpha=True
83+
/processorParam:ResizeToPowerOfTwo=False
84+
/processorParam:MakeSquare=False
85+
/processorParam:TextureFormat=Color
86+
/build:ffmq_resizetool.png
87+
7688
#begin File.spritefont
7789
/importer:FontDescriptionImporter
7890
/processor:FontDescriptionProcessor
@@ -104,6 +116,18 @@
104116
/processorParam:TextureFormat=Color
105117
/build:maptiles.png
106118

119+
#begin pixel.png
120+
/importer:TextureImporter
121+
/processor:TextureProcessor
122+
/processorParam:ColorKeyColor=255,0,255,255
123+
/processorParam:ColorKeyEnabled=True
124+
/processorParam:GenerateMipmaps=False
125+
/processorParam:PremultiplyAlpha=True
126+
/processorParam:ResizeToPowerOfTwo=False
127+
/processorParam:MakeSquare=False
128+
/processorParam:TextureFormat=Color
129+
/build:pixel.png
130+
107131
#begin placingicons.png
108132
/importer:TextureImporter
109133
/processor:TextureProcessor

Content/ffmq_resizetool.png

1.42 KB
Loading

Content/pixel.png

140 Bytes
Loading

Content/tools.png

90 Bytes
Loading

EditorTasks.cs

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,95 @@ public enum EditorTasks
9090
UpdateGridsize,
9191
TogglePositionIndicator,
9292

93+
// Mystic Quest Specific Tasks
94+
ReloadPicker,
95+
ToggleLayer,
96+
ToggleDrawingLayer,
97+
ToggleInfoBox,
98+
99+
ResizeMap,
100+
ResizeToggle,
101+
ResizeUpdateSelection,
102+
103+
SelectorSetTool,
104+
PasterSetTool,
105+
RestoreTool,
106+
107+
InfoBoxUpdateLayer,
108+
InfoBoxUpdateCoordinates,
109+
110+
Undo,
111+
Redo,
112+
Copy,
113+
Paste,
114+
115+
93116

94117
}
95118

96-
public struct EditorTask
119+
public class EditorTask
97120
{
98121
public EditorTasks Type { get; set; }
99122
public int Value { get; set; }
123+
124+
public EditorTask(EditorTasks type, int value = 0)
125+
{
126+
Type = type;
127+
Value = value;
128+
}
129+
}
130+
131+
public class TaskManager
132+
{
133+
private List<EditorTask> tasks;
134+
135+
public TaskManager()
136+
{
137+
tasks = new();
138+
}
139+
public void Add(EditorTask task)
140+
{
141+
tasks.Add(task);
142+
}
143+
public void Add(EditorTasks task)
144+
{
145+
tasks.Add(new EditorTask(task));
146+
}
147+
public void AddRange(List<EditorTask> tasklist)
148+
{
149+
tasks.AddRange(tasklist);
150+
}
151+
public void Prune(EditorTasks task)
152+
{
153+
tasks.RemoveAll(t => t.Type == task);
154+
}
155+
public bool Pop(EditorTasks type, out EditorTask task)
156+
{
157+
int resultIndex = tasks.FindIndex(t => t.Type == type);
158+
if (resultIndex < 0)
159+
{
160+
task = null;
161+
return false;
162+
}
163+
else
164+
{
165+
task = tasks[resultIndex];
166+
tasks.RemoveAt(resultIndex);
167+
return true;
168+
}
169+
}
170+
public bool Pop(EditorTasks type)
171+
{
172+
int resultIndex = tasks.FindIndex(t => t.Type == type);
173+
if (resultIndex < 0)
174+
{
175+
return false;
176+
}
177+
else
178+
{
179+
tasks.RemoveAt(resultIndex);
180+
return true;
181+
}
182+
}
100183
}
101184
}

0 commit comments

Comments
 (0)