fix d2k cursors
- center by default (also works better for ra/cnc/ts)
This commit is contained in:
@@ -38,17 +38,17 @@ namespace OpenRA.Graphics
|
||||
cursors = new Dictionary<string, CursorSequence>();
|
||||
palettes = new Cache<string, PaletteReference>(CreatePaletteReference);
|
||||
var sequences = new MiniYaml(null, sequenceFiles.Select(s => MiniYaml.FromFile(s)).Aggregate(MiniYaml.MergeLiberal));
|
||||
int[] ShadowIndex = { };
|
||||
var shadowIndex = new int[] { };
|
||||
|
||||
if (sequences.NodesDict.ContainsKey("ShadowIndex"))
|
||||
{
|
||||
Array.Resize(ref ShadowIndex, ShadowIndex.Length + 1);
|
||||
int.TryParse(sequences.NodesDict["ShadowIndex"].Value, out ShadowIndex[ShadowIndex.Length - 1]);
|
||||
Array.Resize(ref shadowIndex, shadowIndex.Length + 1);
|
||||
int.TryParse(sequences.NodesDict["ShadowIndex"].Value, out shadowIndex[shadowIndex.Length - 1]);
|
||||
}
|
||||
|
||||
palette = new HardwarePalette();
|
||||
foreach (var p in sequences.NodesDict["Palettes"].Nodes)
|
||||
palette.AddPalette(p.Key, new Palette(FileSystem.Open(p.Value.Value), ShadowIndex), false);
|
||||
palette.AddPalette(p.Key, new Palette(FileSystem.Open(p.Value.Value), shadowIndex), false);
|
||||
|
||||
foreach (var s in sequences.NodesDict["Cursors"].Nodes)
|
||||
LoadSequencesForCursor(s.Key, s.Value);
|
||||
@@ -76,7 +76,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
renderer.SetPalette(palette);
|
||||
renderer.SpriteRenderer.DrawSprite(cursorSprite,
|
||||
lastMousePos - cursorSequence.Hotspot,
|
||||
lastMousePos - cursorSequence.Hotspot - (0.5f * cursorSprite.size).ToInt2(),
|
||||
palettes[cursorSequence.Palette],
|
||||
cursorSprite.size);
|
||||
}
|
||||
|
||||
@@ -44,9 +44,9 @@ namespace OpenRA.Graphics
|
||||
length = 1;
|
||||
|
||||
if (d.ContainsKey("x"))
|
||||
int.TryParse(d["x"].Value, out Hotspot.X );
|
||||
int.TryParse(d["x"].Value, out Hotspot.X);
|
||||
if (d.ContainsKey("y"))
|
||||
int.TryParse(d["y"].Value, out Hotspot.Y );
|
||||
int.TryParse(d["y"].Value, out Hotspot.Y);
|
||||
}
|
||||
|
||||
public Sprite GetSprite(int frame)
|
||||
|
||||
@@ -7,281 +7,173 @@ Cursors:
|
||||
mouse2: cursor
|
||||
scroll-t:
|
||||
start:1
|
||||
x:14
|
||||
y:-2
|
||||
scroll-tr:
|
||||
start:2
|
||||
x:14
|
||||
y:-2
|
||||
scroll-r:
|
||||
start:3
|
||||
x:28
|
||||
y:12
|
||||
scroll-br:
|
||||
start:4
|
||||
x:28
|
||||
y:22
|
||||
scroll-b:
|
||||
start:5
|
||||
x:14
|
||||
y:22
|
||||
scroll-bl:
|
||||
start:6
|
||||
x:-2
|
||||
y:22
|
||||
scroll-l:
|
||||
start:7
|
||||
x:-1
|
||||
y:13
|
||||
scroll-tl:
|
||||
start:8
|
||||
x:-2
|
||||
y:-2
|
||||
scroll-t-blocked:
|
||||
start:130
|
||||
x:14
|
||||
y:-2
|
||||
scroll-tr-blocked:
|
||||
start:131
|
||||
x:14
|
||||
y:-2
|
||||
scroll-r-blocked:
|
||||
start:132
|
||||
x:28
|
||||
y:12
|
||||
scroll-br-blocked:
|
||||
start:133
|
||||
x:28
|
||||
y:22
|
||||
scroll-b-blocked:
|
||||
start:134
|
||||
x:14
|
||||
y:22
|
||||
scroll-bl-blocked:
|
||||
start:135
|
||||
x:-2
|
||||
y:22
|
||||
scroll-l-blocked:
|
||||
start:136
|
||||
x:-1
|
||||
y:13
|
||||
scroll-tl-blocked:
|
||||
start:137
|
||||
x:-2
|
||||
y:-2
|
||||
select:
|
||||
start:12
|
||||
length:6
|
||||
x:12
|
||||
y:12
|
||||
|
||||
default:
|
||||
start:0
|
||||
x: -16
|
||||
y: -12
|
||||
default-minimap:
|
||||
start:86
|
||||
length:1
|
||||
x: -16
|
||||
y: -12
|
||||
generic-blocked:
|
||||
start:9
|
||||
x:12
|
||||
y:12
|
||||
generic-blocked-minimap:
|
||||
start:27
|
||||
x:12
|
||||
y:12
|
||||
attack:
|
||||
start:18
|
||||
length:8
|
||||
x:12
|
||||
y:12
|
||||
attack-minimap:
|
||||
start:140
|
||||
length:8
|
||||
x:12
|
||||
y:12
|
||||
harvest:
|
||||
start:18
|
||||
length:8
|
||||
x:12
|
||||
y:12
|
||||
harvest-minimap:
|
||||
start:140
|
||||
length:8
|
||||
x:12
|
||||
y:12
|
||||
enter:
|
||||
start:119
|
||||
length:3
|
||||
x:12
|
||||
y:12
|
||||
enter-minimap:
|
||||
start:148
|
||||
length:3
|
||||
x:12
|
||||
y:12
|
||||
c4:
|
||||
start:122
|
||||
length:3
|
||||
x:12
|
||||
y:12
|
||||
c4-minimap:
|
||||
start:127
|
||||
length:3
|
||||
x:12
|
||||
y:12
|
||||
guard:
|
||||
start:153
|
||||
length:1
|
||||
x:12
|
||||
y:12
|
||||
guard-minimap:
|
||||
start:152
|
||||
length:1
|
||||
x:12
|
||||
y:12
|
||||
|
||||
# Cursors that need minimap variants
|
||||
deploy:
|
||||
start:53
|
||||
length:9
|
||||
x:12
|
||||
y:12
|
||||
repair:
|
||||
start:29
|
||||
length:24
|
||||
x:12
|
||||
y:12
|
||||
repair-blocked:
|
||||
start:126
|
||||
length:1
|
||||
x:12
|
||||
y:12
|
||||
sell:
|
||||
start:62
|
||||
length:24
|
||||
x:12
|
||||
y:12
|
||||
sell-blocked:
|
||||
start:125
|
||||
length:1
|
||||
x:12
|
||||
y:12
|
||||
ability:
|
||||
start:88
|
||||
length:8
|
||||
x:12
|
||||
y:12
|
||||
nuke:
|
||||
start:96
|
||||
length:7
|
||||
x:12
|
||||
y:12
|
||||
ioncannon:
|
||||
start:103
|
||||
length:16
|
||||
x:12
|
||||
y:12
|
||||
sell-vehicle:
|
||||
start:154
|
||||
length:24
|
||||
x:12
|
||||
y:12
|
||||
|
||||
mouse4:cursor
|
||||
move:
|
||||
start:0
|
||||
length:8
|
||||
x:12
|
||||
y:12
|
||||
move-minimap:
|
||||
start:9
|
||||
length:4
|
||||
x:12
|
||||
y:12
|
||||
move-rough:
|
||||
start:0
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
|
||||
attackmove:cursor
|
||||
attackmove:
|
||||
start:0
|
||||
length:8
|
||||
x:12
|
||||
y:12
|
||||
attackmove-minimap:
|
||||
start:9
|
||||
length:4
|
||||
x:12
|
||||
y:12
|
||||
move-blocked:
|
||||
start:8
|
||||
x:12
|
||||
y:12
|
||||
move-blocked-minimap:
|
||||
start:13
|
||||
length:1
|
||||
x:12
|
||||
y:12
|
||||
|
||||
mouse3: cursor2
|
||||
enter-blocked:
|
||||
start:212
|
||||
length:1
|
||||
x:12
|
||||
y:12
|
||||
enter-blocked-minimap:
|
||||
start:33
|
||||
length:1
|
||||
capture:
|
||||
start:164
|
||||
length:3
|
||||
x:12
|
||||
y:12
|
||||
capture-minimap:
|
||||
start:167
|
||||
length:3
|
||||
x:12
|
||||
y:12
|
||||
heal:
|
||||
start:160
|
||||
length:4
|
||||
x:12
|
||||
y:12
|
||||
heal-minimap:
|
||||
start:194
|
||||
length:1
|
||||
x:12
|
||||
y:12
|
||||
ability-minimap:
|
||||
start:214
|
||||
length:8
|
||||
x:12
|
||||
y:12
|
||||
deploy-blocked:
|
||||
start:211
|
||||
length:1
|
||||
x:12
|
||||
y:12
|
||||
goldwrench:
|
||||
start:170
|
||||
length:24
|
||||
x:12
|
||||
y:12
|
||||
goldwrench-blocked:
|
||||
start:213
|
||||
length:1
|
||||
x:12
|
||||
y:12
|
||||
|
||||
nopower: cursor
|
||||
powerdown-blocked:
|
||||
start:0
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
powerdown:
|
||||
start:1
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
@@ -5,78 +5,48 @@ Cursors:
|
||||
mouse: cursor
|
||||
scroll-t:
|
||||
start:1
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-tr:
|
||||
start: 2
|
||||
x: 12
|
||||
y: 12
|
||||
start:2
|
||||
scroll-r:
|
||||
start: 3
|
||||
x: 12
|
||||
y: 12
|
||||
start:3
|
||||
scroll-br:
|
||||
start: 4
|
||||
x: 12
|
||||
y: 12
|
||||
start:4
|
||||
scroll-b:
|
||||
start:5
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-bl:
|
||||
start:6
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-l:
|
||||
start:7
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-tl:
|
||||
start:8
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-t-blocked:
|
||||
start:124
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-tr-blocked:
|
||||
start:125
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-r-blocked:
|
||||
start:126
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-br-blocked:
|
||||
start:127
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-b-blocked:
|
||||
start:128
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-bl-blocked:
|
||||
start:129
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-l-blocked:
|
||||
start:130
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-tl-blocked:
|
||||
start:131
|
||||
x: 12
|
||||
y: 12
|
||||
select:
|
||||
start:15
|
||||
length: 6
|
||||
x: 12
|
||||
y: 12
|
||||
|
||||
default:
|
||||
start:0
|
||||
x: -16
|
||||
y: -12
|
||||
default-minimap:
|
||||
start:80
|
||||
x: -16
|
||||
y: -12
|
||||
generic-blocked:
|
||||
start:9
|
||||
generic-blocked-minimap:
|
||||
@@ -84,181 +54,111 @@ Cursors:
|
||||
move:
|
||||
start:10
|
||||
length: 4
|
||||
x: 12
|
||||
y: 12
|
||||
move-minimap:
|
||||
start:29
|
||||
length: 4
|
||||
x: 12
|
||||
y: 12
|
||||
move-rough:
|
||||
start:10
|
||||
length: 4
|
||||
x: 12
|
||||
y: 12
|
||||
move-blocked:
|
||||
start:14
|
||||
x: 12
|
||||
y: 12
|
||||
move-blocked-minimap:
|
||||
start:33
|
||||
x: 12
|
||||
y: 12
|
||||
attack:
|
||||
start:195
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
attack-minimap:
|
||||
start:203
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
attackmove:
|
||||
start:21
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
attackmove-minimap:
|
||||
start:134
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
harvest:
|
||||
start:21
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
harvest-minimap:
|
||||
start:134
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
enter:
|
||||
start:113
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
enter-minimap:
|
||||
start:139
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
enter-blocked:
|
||||
start:212
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
enter-blocked-minimap:
|
||||
start:33
|
||||
c4:
|
||||
start:116
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
c4-minimap:
|
||||
start:121
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
guard:
|
||||
start:147
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
guard-minimap:
|
||||
start:146
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
capture:
|
||||
start:164
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
capture-minimap:
|
||||
start:167
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
heal:
|
||||
start:160
|
||||
length: 4
|
||||
x: 12
|
||||
y: 12
|
||||
heal-minimap:
|
||||
start:194
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
ability:
|
||||
start:82
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
ability-minimap:
|
||||
start:214
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
|
||||
# Cursors that need minimap variants
|
||||
deploy:
|
||||
start:59
|
||||
length: 9
|
||||
x: 12
|
||||
y: 12
|
||||
deploy-blocked:
|
||||
start:211
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
goldwrench:
|
||||
start:170
|
||||
length: 24
|
||||
x: 12
|
||||
y: 12
|
||||
goldwrench-blocked:
|
||||
start:213
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
nuke:
|
||||
start:90
|
||||
length: 7
|
||||
x: 12
|
||||
y: 12
|
||||
chrono-select:
|
||||
start:97
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
chrono-target:
|
||||
start:105
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
|
||||
sell:
|
||||
start:68
|
||||
length: 12
|
||||
x: 12
|
||||
y: 12
|
||||
sell-blocked:
|
||||
start:119
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
repair:
|
||||
start:35
|
||||
length: 24
|
||||
x: 12
|
||||
y: 12
|
||||
repair-blocked:
|
||||
start:120
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
sell2:
|
||||
start:148
|
||||
length: 12
|
||||
@@ -267,10 +167,6 @@ Cursors:
|
||||
powerdown-blocked:
|
||||
start:0
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
powerdown:
|
||||
start:1
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
@@ -5,77 +5,47 @@ Cursors:
|
||||
mouse: cursor
|
||||
scroll-t: #TODO
|
||||
start:1
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-tr: #TODO
|
||||
start: 2
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-r: #TODO
|
||||
start: 3
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-br: #TODO
|
||||
start: 4
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-b: #TODO
|
||||
start:5
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-bl: #TODO
|
||||
start:6
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-l: #TODO
|
||||
start:7
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-tl: #TODO
|
||||
start:8
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-t-blocked: #TODO
|
||||
start:124
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-tr-blocked: #TODO
|
||||
start:125
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-r-blocked: #TODO
|
||||
start:126
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-br-blocked: #TODO
|
||||
start:127
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-b-blocked: #TODO
|
||||
start:128
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-bl-blocked: #TODO
|
||||
start:129
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-l-blocked: #TODO
|
||||
start:130
|
||||
x: 12
|
||||
y: 12
|
||||
scroll-tl-blocked:#TODO
|
||||
start:131
|
||||
x: 12
|
||||
y: 12
|
||||
select:
|
||||
start:18
|
||||
length: 12
|
||||
x: 12
|
||||
y: 12
|
||||
default:
|
||||
start:0
|
||||
x: -26
|
||||
y: -20
|
||||
default-minimap:
|
||||
start:1
|
||||
x: -26
|
||||
y: -20
|
||||
generic-blocked:
|
||||
start:9
|
||||
generic-blocked-minimap:
|
||||
@@ -83,193 +53,117 @@ Cursors:
|
||||
move:
|
||||
start:31
|
||||
length: 10
|
||||
x: 12
|
||||
y: 12
|
||||
move-minimap:
|
||||
start:42
|
||||
length: 10
|
||||
x: 12
|
||||
y: 12
|
||||
move-rough:
|
||||
start:31
|
||||
length: 10
|
||||
x: 12
|
||||
y: 12
|
||||
move-blocked:
|
||||
start:41
|
||||
x: 12
|
||||
y: 12
|
||||
move-blocked-minimap:
|
||||
start:52
|
||||
x: 12
|
||||
y: 12
|
||||
attack:
|
||||
start: 31
|
||||
length: 10
|
||||
x: 12
|
||||
y: 12
|
||||
attack-blocked: # TODO: unused
|
||||
start: 32
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
attack-minimap:
|
||||
start: 42
|
||||
length: 10
|
||||
x: 12
|
||||
y: 12
|
||||
attackmove: #TODO
|
||||
start:21
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
attackmove-minimap: #TODO
|
||||
start:134
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
harvest: #TODO
|
||||
start:21
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
harvest-minimap: #TODO
|
||||
start:134
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
enter: #TODO
|
||||
start:113
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
enter-minimap: #TODO
|
||||
start:139
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
enter-blocked: #TODO
|
||||
start:212
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
enter-blocked-minimap: #TODO
|
||||
start:33
|
||||
c4: #TODO
|
||||
start:116
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
c4-minimap: #TODO
|
||||
start:121
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
guard: #TODO
|
||||
start:147
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
guard-minimap: #TODO
|
||||
start:146
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
capture: #TODO
|
||||
start:164
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
capture-minimap: #TODO
|
||||
start:167
|
||||
length: 3
|
||||
x: 12
|
||||
y: 12
|
||||
heal: #TODO
|
||||
start:160
|
||||
length: 4
|
||||
x: 12
|
||||
y: 12
|
||||
heal-minimap: #TODO
|
||||
start:194
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
ability: #TODO
|
||||
start:82
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
ability-minimap: #TODO
|
||||
start:214
|
||||
length: 8
|
||||
x: 12
|
||||
y: 12
|
||||
deploy:
|
||||
start:110
|
||||
length: 9
|
||||
x: 12
|
||||
y: 12
|
||||
deploy-blocked:
|
||||
start:119
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
undeploy: #TODO: unused
|
||||
start:120
|
||||
length: 9
|
||||
x: 12
|
||||
y: 12
|
||||
goldwrench: #TODO
|
||||
start:170
|
||||
length: 24
|
||||
x: 12
|
||||
y: 12
|
||||
goldwrench-blocked: #TODO
|
||||
start:213
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
nuke: #TODO
|
||||
start:90
|
||||
length: 7
|
||||
x: 12
|
||||
y: 12
|
||||
sell:
|
||||
start:129
|
||||
length: 10
|
||||
x: 12
|
||||
y: 12
|
||||
sell-minimap: #TODO: unused
|
||||
start:139
|
||||
length: 10
|
||||
x: 12
|
||||
y: 12
|
||||
sell-blocked:
|
||||
start:149
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
repair:
|
||||
start:170
|
||||
length: 20
|
||||
x: 12
|
||||
y: 12
|
||||
repair-blocked:
|
||||
start:190
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
sell2: #TODO ?
|
||||
start:148
|
||||
length: 12
|
||||
powerdown-blocked:
|
||||
start:345
|
||||
length: 1
|
||||
x: 12
|
||||
y: 12
|
||||
powerdown:
|
||||
start:329
|
||||
length: 15
|
||||
x: 12
|
||||
y: 12
|
||||
Reference in New Issue
Block a user