add category headers in editor
This commit is contained in:
@@ -148,6 +148,23 @@ namespace OpenRA.Editor
|
||||
foreach (var tc in tileset.Templates.GroupBy(t => t.Value.Category))
|
||||
{
|
||||
var category = tc.Key ?? "(Uncategorized)";
|
||||
var categoryHeader = new Label
|
||||
{
|
||||
BackColor = SystemColors.Highlight,
|
||||
ForeColor = SystemColors.HighlightText,
|
||||
Text = category,
|
||||
AutoSize = false,
|
||||
Height = 24,
|
||||
TextAlign = ContentAlignment.MiddleLeft,
|
||||
Width = tilePalette.ClientSize.Width,
|
||||
};
|
||||
// hook this manually, anchoring inside FlowLayoutPanel is flaky.
|
||||
tilePalette.Resize += (_,e) => categoryHeader.Width = tilePalette.ClientSize.Width;
|
||||
|
||||
if (tilePalette.Controls.Count > 0)
|
||||
tilePalette.SetFlowBreak(
|
||||
tilePalette.Controls[tilePalette.Controls.Count - 1], true);
|
||||
tilePalette.Controls.Add(categoryHeader);
|
||||
|
||||
foreach( var t in tc )
|
||||
{
|
||||
|
||||
@@ -94,6 +94,7 @@ Templates:
|
||||
Id: 3
|
||||
Image: sh01
|
||||
Size: 4,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
3: Rock
|
||||
5: Clear
|
||||
@@ -110,6 +111,7 @@ Templates:
|
||||
Id: 4
|
||||
Image: sh02
|
||||
Size: 5,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
4: Clear
|
||||
8: Beach
|
||||
@@ -130,6 +132,7 @@ Templates:
|
||||
Id: 5
|
||||
Image: sh03
|
||||
Size: 3,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
2: Clear
|
||||
4: Beach
|
||||
@@ -144,6 +147,7 @@ Templates:
|
||||
Id: 6
|
||||
Image: sh04
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Beach
|
||||
@@ -158,6 +162,7 @@ Templates:
|
||||
Id: 7
|
||||
Image: sh05
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Rock
|
||||
@@ -172,6 +177,7 @@ Templates:
|
||||
Id: 8
|
||||
Image: sh06
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Beach
|
||||
@@ -186,6 +192,7 @@ Templates:
|
||||
Id: 9
|
||||
Image: sh07
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Beach
|
||||
@@ -200,6 +207,7 @@ Templates:
|
||||
Id: 10
|
||||
Image: sh08
|
||||
Size: 1,2
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Beach
|
||||
@@ -207,6 +215,7 @@ Templates:
|
||||
Id: 11
|
||||
Image: sh09
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Clear
|
||||
1: River
|
||||
@@ -221,6 +230,7 @@ Templates:
|
||||
Id: 12
|
||||
Image: sh10
|
||||
Size: 5,6
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Clear
|
||||
5: Beach
|
||||
@@ -241,6 +251,7 @@ Templates:
|
||||
Id: 13
|
||||
Image: sh11
|
||||
Size: 4,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Clear
|
||||
@@ -259,6 +270,7 @@ Templates:
|
||||
Id: 14
|
||||
Image: sh12
|
||||
Size: 3,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Clear
|
||||
@@ -275,6 +287,7 @@ Templates:
|
||||
Id: 15
|
||||
Image: sh13
|
||||
Size: 6,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Rock
|
||||
@@ -298,6 +311,7 @@ Templates:
|
||||
Id: 16
|
||||
Image: sh14
|
||||
Size: 4,4
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Beach
|
||||
@@ -315,6 +329,7 @@ Templates:
|
||||
Id: 17
|
||||
Image: sh15
|
||||
Size: 5,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Water
|
||||
@@ -330,6 +345,7 @@ Templates:
|
||||
Id: 18
|
||||
Image: sh16
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Beach
|
||||
@@ -344,6 +360,7 @@ Templates:
|
||||
Id: 19
|
||||
Image: sh17
|
||||
Size: 2,1
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Clear
|
||||
@@ -351,6 +368,7 @@ Templates:
|
||||
Id: 20
|
||||
Image: sh18
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Water
|
||||
@@ -365,6 +383,7 @@ Templates:
|
||||
Id: 21
|
||||
Image: sh19
|
||||
Size: 4,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
1: Water
|
||||
2: Beach
|
||||
@@ -385,6 +404,7 @@ Templates:
|
||||
Id: 22
|
||||
Image: sh20
|
||||
Size: 5,4
|
||||
Category: Beach
|
||||
Tiles:
|
||||
2: Water
|
||||
3: Beach
|
||||
@@ -403,6 +423,7 @@ Templates:
|
||||
Id: 23
|
||||
Image: sh21
|
||||
Size: 5,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
1: Water
|
||||
2: Beach
|
||||
@@ -419,6 +440,7 @@ Templates:
|
||||
Id: 24
|
||||
Image: sh22
|
||||
Size: 6,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
6: Water
|
||||
@@ -441,6 +463,7 @@ Templates:
|
||||
Id: 25
|
||||
Image: sh23
|
||||
Size: 5,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Water
|
||||
@@ -464,6 +487,7 @@ Templates:
|
||||
Id: 26
|
||||
Image: sh24
|
||||
Size: 3,4
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Water
|
||||
@@ -477,6 +501,7 @@ Templates:
|
||||
Id: 27
|
||||
Image: sh25
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Water
|
||||
@@ -491,6 +516,7 @@ Templates:
|
||||
Id: 28
|
||||
Image: sh26
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Water
|
||||
@@ -505,6 +531,7 @@ Templates:
|
||||
Id: 29
|
||||
Image: sh27
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Rock
|
||||
1: Rock
|
||||
@@ -519,6 +546,7 @@ Templates:
|
||||
Id: 30
|
||||
Image: sh28
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
1: Rock
|
||||
2: Rock
|
||||
@@ -532,6 +560,7 @@ Templates:
|
||||
Id: 31
|
||||
Image: sh29
|
||||
Size: 1,2
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Clear
|
||||
@@ -539,6 +568,7 @@ Templates:
|
||||
Id: 32
|
||||
Image: sh30
|
||||
Size: 3,2
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: River
|
||||
@@ -550,6 +580,7 @@ Templates:
|
||||
Id: 33
|
||||
Image: sh31
|
||||
Size: 6,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
3: Water
|
||||
4: Water
|
||||
@@ -577,6 +608,7 @@ Templates:
|
||||
Id: 34
|
||||
Image: sh32
|
||||
Size: 4,4
|
||||
Category: Beach
|
||||
Tiles:
|
||||
2: Water
|
||||
3: Water
|
||||
@@ -593,6 +625,7 @@ Templates:
|
||||
Id: 35
|
||||
Image: sh33
|
||||
Size: 3,4
|
||||
Category: Beach
|
||||
Tiles:
|
||||
1: Water
|
||||
2: Beach
|
||||
@@ -607,6 +640,7 @@ Templates:
|
||||
Id: 36
|
||||
Image: sh34
|
||||
Size: 6,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
3: Clear
|
||||
4: Beach
|
||||
@@ -628,6 +662,7 @@ Templates:
|
||||
Id: 37
|
||||
Image: sh35
|
||||
Size: 4,4
|
||||
Category: Beach
|
||||
Tiles:
|
||||
2: Beach
|
||||
3: Water
|
||||
@@ -644,6 +679,7 @@ Templates:
|
||||
Id: 38
|
||||
Image: sh36
|
||||
Size: 4,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
1: Beach
|
||||
2: Beach
|
||||
@@ -658,6 +694,7 @@ Templates:
|
||||
Id: 39
|
||||
Image: sh37
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
1: Beach
|
||||
2: Water
|
||||
@@ -671,6 +708,7 @@ Templates:
|
||||
Id: 40
|
||||
Image: sh38
|
||||
Size: 2,1
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Clear
|
||||
1: Beach
|
||||
@@ -678,6 +716,7 @@ Templates:
|
||||
Id: 41
|
||||
Image: sh39
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Rock
|
||||
1: Beach
|
||||
@@ -692,6 +731,7 @@ Templates:
|
||||
Id: 42
|
||||
Image: sh40
|
||||
Size: 5,5
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Clear
|
||||
1: Beach
|
||||
@@ -712,6 +752,7 @@ Templates:
|
||||
Id: 43
|
||||
Image: sh41
|
||||
Size: 4,4
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Water
|
||||
@@ -729,6 +770,7 @@ Templates:
|
||||
Id: 44
|
||||
Image: sh42
|
||||
Size: 4,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Beach
|
||||
@@ -743,6 +785,7 @@ Templates:
|
||||
Id: 45
|
||||
Image: sh43
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Beach
|
||||
@@ -757,6 +800,7 @@ Templates:
|
||||
Id: 46
|
||||
Image: sh44
|
||||
Size: 2,2
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Beach
|
||||
@@ -766,6 +810,7 @@ Templates:
|
||||
Id: 47
|
||||
Image: sh45
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Beach
|
||||
@@ -780,6 +825,7 @@ Templates:
|
||||
Id: 48
|
||||
Image: sh46
|
||||
Size: 2,2
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: River
|
||||
@@ -789,6 +835,7 @@ Templates:
|
||||
Id: 49
|
||||
Image: sh47
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
3: Beach
|
||||
@@ -800,6 +847,7 @@ Templates:
|
||||
Id: 50
|
||||
Image: sh48
|
||||
Size: 2,2
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Water
|
||||
@@ -809,6 +857,7 @@ Templates:
|
||||
Id: 51
|
||||
Image: sh49
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Water
|
||||
@@ -823,6 +872,7 @@ Templates:
|
||||
Id: 52
|
||||
Image: sh50
|
||||
Size: 2,2
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Beach
|
||||
@@ -832,6 +882,7 @@ Templates:
|
||||
Id: 53
|
||||
Image: sh51
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Clear
|
||||
1: Beach
|
||||
@@ -844,6 +895,7 @@ Templates:
|
||||
Id: 54
|
||||
Image: sh52
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
1: Clear
|
||||
2: Clear
|
||||
@@ -856,6 +908,7 @@ Templates:
|
||||
Id: 55
|
||||
Image: sh53
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Beach
|
||||
1: Clear
|
||||
@@ -869,6 +922,7 @@ Templates:
|
||||
Id: 56
|
||||
Image: sh54
|
||||
Size: 3,3
|
||||
Category: Beach
|
||||
Tiles:
|
||||
0: Water
|
||||
1: Beach
|
||||
@@ -880,12 +934,14 @@ Templates:
|
||||
Id: 57
|
||||
Image: sh55
|
||||
Size: 1,1
|
||||
Category: Debris
|
||||
Tiles:
|
||||
0: Rock
|
||||
Template@58:
|
||||
Id: 58
|
||||
Image: sh56
|
||||
Size: 2,1
|
||||
Category: Debris
|
||||
Tiles:
|
||||
0: Rock
|
||||
1: Rock
|
||||
|
||||
Reference in New Issue
Block a user