Capitalise cursor properties.

This commit is contained in:
Paul Chote
2014-11-13 21:00:28 +13:00
committed by Paul Chote
parent 7c19f710b8
commit 380b0e1561
8 changed files with 601 additions and 570 deletions

View File

@@ -28,22 +28,22 @@ namespace OpenRA.Graphics
sprites = cache[cursorSrc];
var d = info.ToDictionary();
start = Exts.ParseIntegerInvariant(d["start"].Value);
start = Exts.ParseIntegerInvariant(d["Start"].Value);
this.palette = palette;
if ((d.ContainsKey("length") && d["length"].Value == "*") || (d.ContainsKey("end") && d["end"].Value == "*"))
if ((d.ContainsKey("Length") && d["Length"].Value == "*") || (d.ContainsKey("End") && d["End"].Value == "*"))
length = sprites.Length - start;
else if (d.ContainsKey("length"))
length = Exts.ParseIntegerInvariant(d["length"].Value);
else if (d.ContainsKey("end"))
length = Exts.ParseIntegerInvariant(d["end"].Value) - start;
else if (d.ContainsKey("Length"))
length = Exts.ParseIntegerInvariant(d["Length"].Value);
else if (d.ContainsKey("End"))
length = Exts.ParseIntegerInvariant(d["End"].Value) - start;
else
length = 1;
if (d.ContainsKey("x"))
Exts.TryParseIntegerInvariant(d["x"].Value, out Hotspot.X);
if (d.ContainsKey("y"))
Exts.TryParseIntegerInvariant(d["y"].Value, out Hotspot.Y);
if (d.ContainsKey("X"))
Exts.TryParseIntegerInvariant(d["X"].Value, out Hotspot.X);
if (d.ContainsKey("Y"))
Exts.TryParseIntegerInvariant(d["Y"].Value, out Hotspot.Y);
}
public Sprite GetSprite(int frame)

View File

@@ -62,6 +62,17 @@ namespace OpenRA.Mods.Common.UtilityCommands
file.WriteLine(yaml.WriteToString());
}
Console.WriteLine("Processing Cursors:");
foreach (var filename in Game.modData.Manifest.Cursors)
{
Console.WriteLine("\t" + filename);
var yaml = MiniYaml.FromFile(filename);
UpgradeRules.UpgradeCursors(engineDate, ref yaml, null, 0);
using (var file = new StreamWriter(filename))
file.WriteLine(yaml.WriteToString());
}
Console.WriteLine("Processing Maps:");
var maps = Game.modData.MapCache
.Where(m => m.Status == MapStatus.Available)

View File

@@ -1041,5 +1041,27 @@ namespace OpenRA.Mods.Common.UtilityCommands
nodes.AddRange(addNodes);
}
internal static void UpgradeCursors(int engineVersion, ref List<MiniYamlNode> nodes, MiniYamlNode parent, int depth)
{
foreach (var node in nodes)
{
if (engineVersion < 20141113 && depth == 3)
{
if (node.Key == "start")
node.Key = "Start";
else if (node.Key == "length")
node.Key = "Length";
else if (node.Key == "end")
node.Key = "End";
else if (node.Key == "x")
node.Key = "X";
else if (node.Key == "y")
node.Key = "Y";
}
UpgradeCursors(engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}
}
}

View File

@@ -1,181 +1,180 @@
Palettes:
Palettes:
cursor: cursor.pal
Cursors:
mouse2.shp: cursor
scroll-t:
start:1
Start: 1
scroll-tr:
start:2
Start: 2
scroll-r:
start:3
Start: 3
scroll-br:
start:4
Start: 4
scroll-b:
start:5
Start: 5
scroll-bl:
start:6
Start: 6
scroll-l:
start:7
Start: 7
scroll-tl:
start:8
Start: 8
scroll-t-blocked:
start:130
Start: 130
scroll-tr-blocked:
start:131
Start: 131
scroll-r-blocked:
start:132
Start: 132
scroll-br-blocked:
start:133
Start: 133
scroll-b-blocked:
start:134
Start: 134
scroll-bl-blocked:
start:135
Start: 135
scroll-l-blocked:
start:136
Start: 136
scroll-tl-blocked:
start:137
Start: 137
select:
start:12
length:6
Start: 12
Length: 6
default-minimap:
start:86
length:1
x: -16
y: -12
Start: 86
Length: 1
X: -16
Y: -12
generic-blocked:
start:9
Start: 9
generic-blocked-minimap:
start:27
Start: 27
attack:
start:18
length:8
Start: 18
Length: 8
attack-minimap:
start:140
length:8
Start: 140
Length: 8
harvest:
start:18
length:8
Start: 18
Length: 8
harvest-minimap:
start:140
length:8
Start: 140
Length: 8
enter:
start:119
length:3
Start: 119
Length: 3
enter-minimap:
start:148
length:3
Start: 148
Length: 3
c4:
start:122
length:3
Start: 122
Length: 3
c4-minimap:
start:127
length:3
Start: 127
Length: 3
# Cursors that need minimap variants
deploy:
start:53
length:9
Start: 53
Length: 9
repair:
start:29
length:24
Start: 29
Length: 24
repair-blocked:
start:126
length:1
Start: 126
Length: 1
sell:
start:62
length:24
Start: 62
Length: 24
sell-blocked:
start:125
length:1
Start: 125
Length: 1
ability:
start:88
length:8
Start: 88
Length: 8
nuke:
start:96
length:7
Start: 96
Length: 7
ioncannon:
start:103
length:16
Start: 103
Length: 16
sell-vehicle:
start:154
length:24
Start: 154
Length: 24
mouse3.shp: cursor
default:
start:0
x: -16
y: -12
Start: 0
X: -16
Y: -12
deploy-blocked:
start:1
length:1
Start: 1
Length: 1
mouse4.shp: cursor
move:
start:0
length:8
Start: 0
Length: 8
move-minimap:
start:8
length:4
Start: 8
Length: 4
move-rough:
start:0
length: 8
Start: 0
Length: 8
attackmove:
start:12
length:8
Start: 12
Length: 8
attackmove-minimap:
start:20
length:4
Start: 20
Length: 4
move-blocked:
start:24
length:1
Start: 24
Length: 1
move-blocked-minimap:
start:25
length:1
Start: 25
Length: 1
mouse5.shp: cursor
guard:
start:0
length:8
Start: 0
Length: 8
guard-minimap:
start:8
length:8
Start: 8
Length: 8
mouse6.shp: cursor
goldwrench:
start:0
length:3
Start: 0
Length: 3
goldwrench-minimap:
start:3
length:3
Start: 3
Length: 3
goldwrench-blocked:
start:6
length:1
Start: 6
Length: 1
goldwrench-blocked-minimap:
start:7
length:1
Start: 7
Length: 1
capture:
start:8
length:3
Start: 8
Length: 3
capture-minimap:
start:11
length:3
Start: 11
Length: 3
capture-blocked:
start:14
length:1
Start: 14
Length: 1
capture-blocked-minimap:
start:15
length:1
Start: 15
Length: 1
enter-blocked:
start:16
length:1
Start: 16
Length: 1
enter-blocked-minimap:
start:17
length:1
Start: 17
Length: 1
mouse7.shp: cursor
attackoutsiderange:
start:0
length:8
Start: 0
Length: 8
attackoutsiderange-minimap:
start:8
Start: 8

View File

@@ -6,269 +6,268 @@ Palettes:
Cursors:
mouse.r8: mouse
scroll-t:
start:112
x: 24
y: 24
Start: 112
X: 24
Y: 24
scroll-tr:
start: 120
x: 24
y: 24
Start: 120
X: 24
Y: 24
scroll-r:
start: 128
x: 24
y: 24
Start: 128
X: 24
Y: 24
scroll-br:
start: 136
x: 24
y: 24
Start: 136
X: 24
Y: 24
scroll-b:
start:148
x: 24
y: 24
Start: 148
X: 24
Y: 24
scroll-bl:
start:156
x: 24
y: 24
Start: 156
X: 24
Y: 24
scroll-l:
start:164
x: 24
y: 24
Start: 164
X: 24
Y: 24
scroll-tl:
start:172
x: 24
y: 24
Start: 172
X: 24
Y: 24
scroll-t-blocked:
start:180
x: 24
y: 24
Start: 180
X: 24
Y: 24
scroll-tr-blocked:
start:188
x: 24
y: 24
Start: 188
X: 24
Y: 24
scroll-r-blocked:
start:196
x: 24
y: 24
Start: 196
X: 24
Y: 24
scroll-br-blocked:
start:204
x: 24
y: 24
Start: 204
X: 24
Y: 24
scroll-b-blocked:
start:212
x: 24
y: 24
Start: 212
X: 24
Y: 24
scroll-bl-blocked:
start:220
x: 24
y: 24
Start: 220
X: 24
Y: 24
scroll-l-blocked:
start:228
x: 24
y: 24
Start: 228
X: 24
Y: 24
scroll-tl-blocked:
start:236
x: 24
y: 24
Start: 236
X: 24
Y: 24
select:
start:40
length: 8
x: 24
y: 24
Start: 40
Length: 8
X: 24
Y: 24
default:
start:0
x: 24
y: 24
Start: 0
X: 24
Y: 24
default-minimap:
start:0
x: 24
y: 24
Start: 0
X: 24
Y: 24
generic-blocked:
start:24
x: 24
y: 24
Start: 24
X: 24
Y: 24
generic-blocked-minimap:
start:24
x: 24
y: 24
Start: 24
X: 24
Y: 24
move:
start:8
length: 8
x: 24
y: 24
Start: 8
Length: 8
X: 24
Y: 24
move-minimap:
start:48
length: 8
x: 24
y: 24
Start: 48
Length: 8
X: 24
Y: 24
move-blocked:
start:24
x: 24
y: 24
Start: 24
X: 24
Y: 24
move-blocked-minimap:
start:24
x: 24
y: 24
Start: 24
X: 24
Y: 24
attack:
start:16
length: 8
x: 24
y: 24
Start: 16
Length: 8
X: 24
Y: 24
attack-minimap:
start:16
length: 8
x: 24
y: 24
Start: 16
Length: 8
X: 24
Y: 24
attackoutsiderange:
start:16
length: 8
x: 24
y: 24
Start: 16
Length: 8
X: 24
Y: 24
attackoutsiderange-minimap:
start:16
length: 8
x: 24
y: 24
Start: 16
Length: 8
X: 24
Y: 24
attackmove:
start:16
length: 8
x: 24
y: 24
Start: 16
Length: 8
X: 24
Y: 24
attackmove-minimap:
start:16
length: 8
x: 24
y: 24
Start: 16
Length: 8
X: 24
Y: 24
harvest:
start:16
length: 8
x: 24
y: 24
Start: 16
Length: 8
X: 24
Y: 24
harvest-minimap:
start:203
length: 8
x: 24
y: 24
Start: 203
Length: 8
X: 24
Y: 24
enter:
start:32
length: 8
x: 24
y: 24
Start: 32
Length: 8
X: 24
Y: 24
enter-minimap:
start:32
length: 8
x: 24
y: 24
Start: 32
Length: 8
X: 24
Y: 24
enter-blocked:
start:104
length: 1
x: 24
y: 24
Start: 104
Length: 1
X: 24
Y: 24
enter-blocked-minimap:
start:104
x: 24
y: 24
Start: 104
X: 24
Y: 24
c4:
start:248
length: 8
x: 24
y: 24
Start: 248
Length: 8
X: 24
Y: 24
c4-minimap:
start:248
length: 8
x: 24
y: 24
Start: 248
Length: 8
X: 24
Y: 24
guard:
start:72
length: 8
x: 24
y: 24
Start: 72
Length: 8
X: 24
Y: 24
guard-minimap:
start:72
length: 8
x: 24
y: 24
Start: 72
Length: 8
X: 24
Y: 24
capture:
start:32
length: 8
x: 24
y: 24
Start: 32
Length: 8
X: 24
Y: 24
capture-minimap:
start:32
length: 8
x: 24
y: 24
Start: 32
Length: 8
X: 24
Y: 24
ability:
start:72
length: 8
x: 24
y: 24
Start: 72
Length: 8
X: 24
Y: 24
ability-minimap:
start:72
length: 8
x: 24
y: 24
Start: 72
Length: 8
X: 24
Y: 24
# Cursors that need minimap variants
deploy:
start:96
length: 8
x: 24
y: 24
Start: 96
Length: 8
X: 24
Y: 24
deploy-blocked:
start:104
length: 1
x: 24
y: 24
Start: 104
Length: 1
X: 24
Y: 24
nuke:
start:240
length: 8
x: 24
y: 24
Start: 240
Length: 8
X: 24
Y: 24
sell:
start:80
length: 8
x: 24
y: 24
Start: 80
Length: 8
X: 24
Y: 24
sell-blocked:
start:56
length: 1
x: 24
y: 24
Start: 56
Length: 1
X: 24
Y: 24
repair:
start:88
length: 8
x: 24
y: 24
Start: 88
Length: 8
X: 24
Y: 24
repair-blocked:
start:64
length: 1
x: 24
y: 24
Start: 64
Length: 1
X: 24
Y: 24
goldwrench:
start:88
length: 8
x: 24
y: 24
Start: 88
Length: 8
X: 24
Y: 24
goldwrench-blocked:
start:64
length: 1
x: 24
y: 24
Start: 64
Length: 1
X: 24
Y: 24
move-rough:
start:256
length: 8
x: 24
y: 24
Start: 256
Length: 8
X: 24
Y: 24
nopower.shp: mouse
powerdown-blocked:
start:0
length: 1
x: 12
y: 12
Start: 0
Length: 1
X: 12
Y: 12
powerdown:
start:1
length: 3
x: 12
y: 12
Start: 1
Length: 3
X: 12
Y: 12

View File

@@ -4,6 +4,6 @@
Cursors:
cursor.shp: cursor
default:
start:0
x: -4
y: -7
Start:0
X: -4
Y: -7

View File

@@ -1,180 +1,179 @@
Palettes:
Palettes:
cursor: cursor.pal
Cursors:
mouse.shp: cursor
scroll-t:
start:1
Start: 1
scroll-tr:
start:2
Start: 2
scroll-r:
start:3
Start: 3
scroll-br:
start:4
Start: 4
scroll-b:
start:5
Start: 5
scroll-bl:
start:6
Start: 6
scroll-l:
start:7
Start: 7
scroll-tl:
start:8
Start: 8
scroll-t-blocked:
start:124
Start: 124
scroll-tr-blocked:
start:125
Start: 125
scroll-r-blocked:
start:126
Start: 126
scroll-br-blocked:
start:127
Start: 127
scroll-b-blocked:
start:128
Start: 128
scroll-bl-blocked:
start:129
Start: 129
scroll-l-blocked:
start:130
Start: 130
scroll-tl-blocked:
start:131
Start: 131
select:
start:15
length: 6
Start: 15
Length: 6
default:
start:0
x: -16
y: -12
Start: 0
X: -16
Y: -12
default-minimap:
start:80
x: -16
y: -12
Start: 80
X: -16
Y: -12
generic-blocked:
start:9
Start: 9
generic-blocked-minimap:
start:33
Start: 33
move:
start:10
length: 4
Start: 10
Length: 4
move-minimap:
start:29
length: 4
Start: 29
Length: 4
move-rough:
start:10
length: 4
Start: 10
Length: 4
move-blocked:
start:14
Start: 14
move-blocked-minimap:
start:33
Start: 33
attack:
start:195
length: 8
Start: 195
Length: 8
attack-minimap:
start:203
length: 8
Start: 203
Length: 8
attackoutsiderange:
start:21
length: 8
Start: 21
Length: 8
attackoutsiderange-minimap:
start:134
length: 8
Start: 134
Length: 8
harvest:
start:21
length: 8
Start: 21
Length: 8
harvest-minimap:
start:134
length: 8
Start: 134
Length: 8
enter:
start:113
length: 3
Start: 113
Length: 3
enter-minimap:
start:139
length: 3
Start: 139
Length: 3
enter-blocked:
start:212
length: 1
Start: 212
Length: 1
enter-blocked-minimap:
start:33
Start: 33
c4:
start:116
length: 3
Start: 116
Length: 3
c4-minimap:
start:121
length: 3
Start: 121
Length: 3
guard:
start:147
length: 1
Start: 147
Length: 1
guard-minimap:
start:146
length: 1
Start: 146
Length: 1
capture:
start:164
length: 3
Start: 164
Length: 3
capture-minimap:
start:167
length: 3
Start: 167
Length: 3
heal:
start:160
length: 4
Start: 160
Length: 4
heal-minimap:
start:194
length: 1
Start: 194
Length: 1
ability:
start:82
length: 8
Start: 82
Length: 8
ability-minimap:
start:214
length: 8
Start: 214
Length: 8
# Cursors that need minimap variants
deploy:
start:59
length: 9
Start: 59
Length: 9
deploy-blocked:
start:211
length: 1
Start: 211
Length: 1
goldwrench:
start:170
length: 24
Start: 170
Length: 24
goldwrench-blocked:
start:213
length: 1
Start: 213
Length: 1
nuke:
start:90
length: 7
Start: 90
Length: 7
chrono-select:
start:97
length: 8
Start: 97
Length: 8
chrono-target:
start:105
length: 8
Start: 105
Length: 8
sell:
start:68
length: 12
Start: 68
Length: 12
sell-blocked:
start:119
length: 1
Start: 119
Length: 1
repair:
start:35
length: 24
Start: 35
Length: 24
repair-blocked:
start:120
length: 1
Start: 120
Length: 1
sell2:
start:148
length: 12
Start: 148
Length: 12
nopower.shp: cursor
powerdown-blocked:
start:0
length: 1
Start: 0
Length: 1
powerdown:
start:1
length: 3
Start: 1
Length: 3
attackmove.shp: cursor
attackmove:
start:0
length: 4
Start: 0
Length: 4
attackmove-minimap:
start:4
length: 4
Start: 4
Length: 4

View File

@@ -1,175 +1,176 @@
Palettes:
Palettes:
cursor: mousepal.pal
Cursors:
mouse.shp: cursor
scroll-t: #TODO
start: 2
scroll-tr: #TODO
start: 3
scroll-r: #TODO
start: 4
scroll-br: #TODO
start: 5
scroll-b: #TODO
start: 6
scroll-bl: #TODO
start: 7
scroll-l: #TODO
start: 8
scroll-tl: #TODO
start: 9
scroll-t-blocked: #TODO
start: 10
scroll-tr-blocked: #TODO
start: 11
scroll-r-blocked: #TODO
start: 12
scroll-br-blocked: #TODO
start: 13
scroll-b-blocked: #TODO
start: 14
scroll-bl-blocked: #TODO
start: 15
scroll-l-blocked: #TODO
start: 16
scroll-tl-blocked: #TODO
start: 17
scroll-t:
Start: 2
scroll-tr:
Start: 3
scroll-r:
Start: 4
scroll-br:
Start: 5
scroll-b:
Start: 6
scroll-bl:
Start: 7
scroll-l:
Start: 8
scroll-tl:
Start: 9
scroll-t-blocked:
Start: 10
scroll-tr-blocked:
Start: 11
scroll-r-blocked:
Start: 12
scroll-br-blocked:
Start: 13
scroll-b-blocked:
Start: 14
scroll-bl-blocked:
Start: 15
scroll-l-blocked:
Start: 16
scroll-tl-blocked:
Start: 17
select:
start:18
length: 12
Start: 18
Length: 12
default:
start:0
x: -26
y: -20
Start: 0
X: -26
Y: -20
default-minimap:
start:1
x: -26
y: -20
Start: 1
X: -26
Y: -20
generic-blocked:
start:9
Start: 9
generic-blocked-minimap:
start:52
Start: 52
move:
start:31
length: 10
Start: 31
Length: 10
move-minimap:
start:42
length: 10
Start: 42
Length: 10
move-rough:
start:31
length: 10
Start: 31
Length: 10
move-blocked:
start:41
Start: 41
move-blocked-minimap:
start:52
Start: 52
attack:
start: 53
length: 5
Start: 53
Length: 5
attack-blocked: # TODO: unused
start: 41
length: 1
Start: 41
Length: 1
attack-minimap:
start: 63
length: 5
Start: 63
Length: 5
attackoutsiderange:
start: 58
length: 5
Start: 58
Length: 5
attackoutsiderange-minimap:
start: 63
length: 5
attackmove: #TODO
start: 58
length: 5
attackmove-minimap: #TODO
start:68
length: 5
harvest: #TODO
start:53
length: 5
harvest-minimap: #TODO
start:134
length: 8
Start: 63
Length: 5
attackmove:
Start: 58
Length: 5
attackmove-minimap:
Start: 68
Length: 5
harvest:
Start: 53
Length: 5
harvest-minimap:
Start: 134
Length: 8
enter:
start: 89
length: 10
Start: 89
Length: 10
enter-minimap:
start: 100
length: 10
Start: 100
Length: 10
enter-blocked:
start: 99
length: 1
enter-blocked-minimap: #TODO
start:33
Start: 99
Length: 1
enter-blocked-minimap:
Start: 33
c4:
start: 309
length: 10
c4-minimap: #TODO
start:121
length: 3
Start: 309
Length: 10
c4-minimap:
Start: 121
Length: 3
guard:
start: 68
length: 5
Start: 68
Length: 5
guard-minimap:
start: 73
length: 5
Start: 73
Length: 5
capture:
start: 89
length: 10
Start: 89
Length: 10
capture-minimap:
start: 100
length: 10
Start: 100
Length: 10
heal:
start: 346
length: 10
heal-minimap: #TODO
start:194
length: 1
Start: 346
Length: 10
heal-minimap:
Start: 194
Length: 1
ability:
start: 78
length: 10
ability-minimap: #TODO
start:214
length: 8
Start: 78
Length: 10
ability-minimap:
Start: 214
Length: 8
deploy:
start: 110
length: 9
Start: 110
Length: 9
deploy-blocked:
start: 119
length: 1
Start: 119
Length: 1
undeploy: #TODO: unused
start:120
length: 9
goldwrench: #TODO
start:170
length: 24
Start: 120
Length: 9
goldwrench:
Start: 170
Length: 24
goldwrench-blocked: #TODO
start:213
length: 1
nuke: #TODO
start:90
length: 7
Start: 213
Length: 1
nuke:
Start: 90
Length: 7
sell:
start:129
length: 10
Start: 129
Length: 10
sell-minimap: #TODO: unused
start:139
length: 10
Start: 139
Length: 10
sell-blocked:
start:149
length: 1
Start: 149
Length: 1
repair:
start:170
length: 20
Start: 170
Length: 20
repair-blocked:
start:190
length: 1
Start: 190
Length: 1
sell2:
start:139
length: 10
Start: 139
Length: 10
powerdown-blocked:
start:345
length: 1
Start: 345
Length: 1
powerdown:
start:329
length: 15
Start: 329
Length: 15