more support power stuff
This commit is contained in:
@@ -710,6 +710,10 @@ namespace OpenRa.Game
|
|||||||
chromeRenderer.DrawSprite(specialBinSprite, new float2(0,14), PaletteType.Chrome);
|
chromeRenderer.DrawSprite(specialBinSprite, new float2(0,14), PaletteType.Chrome);
|
||||||
chromeRenderer.Flush();
|
chromeRenderer.Flush();
|
||||||
var y = 24;
|
var y = 24;
|
||||||
|
|
||||||
|
string tooltipItem = null;
|
||||||
|
int2 tooltipPos = int2.Zero;
|
||||||
|
|
||||||
foreach (var sp in Game.LocalPlayer.SupportPowers)
|
foreach (var sp in Game.LocalPlayer.SupportPowers)
|
||||||
{
|
{
|
||||||
var image = spsprites[sp.Key];
|
var image = spsprites[sp.Key];
|
||||||
@@ -733,11 +737,50 @@ namespace OpenRa.Game
|
|||||||
PaletteType.Chrome);
|
PaletteType.Chrome);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var rect = new Rectangle(5, y, 64, 48);
|
||||||
|
if (rect.Contains(lastMousePos.ToPoint()))
|
||||||
|
{
|
||||||
|
tooltipItem = sp.Key;
|
||||||
|
tooltipPos = drawPos.ToInt2() + new int2(72, 0) - Game.viewport.Location.ToInt2();
|
||||||
|
}
|
||||||
|
|
||||||
y += 51;
|
y += 51;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildPaletteRenderer.Flush();
|
buildPaletteRenderer.Flush();
|
||||||
|
|
||||||
|
if (tooltipItem != null)
|
||||||
|
DrawSupportPowerTooltip(tooltipItem, tooltipPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
string FormatTime(int ticks)
|
||||||
|
{
|
||||||
|
var seconds = ticks / 25;
|
||||||
|
var minutes = seconds / 60;
|
||||||
|
|
||||||
|
return "{0}:{1}".F(minutes, seconds % 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawSupportPowerTooltip(string sp, int2 pos)
|
||||||
|
{
|
||||||
|
chromeRenderer.DrawSprite(tooltipSprite, pos, PaletteType.Chrome);
|
||||||
|
chromeRenderer.Flush();
|
||||||
|
|
||||||
|
var info = Rules.SupportPowerInfo[sp];
|
||||||
|
|
||||||
|
pos += new int2(5, 5);
|
||||||
|
|
||||||
|
renderer.DrawText2(info.Description, pos, Color.White);
|
||||||
|
|
||||||
|
var timer = "Charge Time: {0}".F(FormatTime(Game.LocalPlayer.SupportPowers[sp].RemainingTime));
|
||||||
|
DrawRightAligned(timer, pos + new int2((int)tooltipSprite.size.X - 10, 0), Color.White);
|
||||||
|
|
||||||
|
if (info.LongDesc != null)
|
||||||
|
{
|
||||||
|
pos += new int2(0, 25);
|
||||||
|
renderer.DrawText(info.LongDesc.Replace("\\n", "\n"), pos, Color.White);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,5 +44,9 @@ namespace OpenRa.Game
|
|||||||
if (RemainingTime > 0) --RemainingTime;
|
if (RemainingTime > 0) --RemainingTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Activate()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -826,7 +826,7 @@ InvulnerabilityPower
|
|||||||
[ParadropPower] ; comes free with first AFLD
|
[ParadropPower] ; comes free with first AFLD
|
||||||
ChargeTime=7
|
ChargeTime=7
|
||||||
Description=Paratroopers
|
Description=Paratroopers
|
||||||
LongDesc=A Badger drops a squad of Riflemen anywhere on the map
|
LongDesc=A Badger drops a squad of Riflemen \nanywhere on the map
|
||||||
Prerequisite=AFLD
|
Prerequisite=AFLD
|
||||||
TechLevel=5
|
TechLevel=5
|
||||||
Image=pinficon
|
Image=pinficon
|
||||||
@@ -844,7 +844,7 @@ GivenAuto=no
|
|||||||
[SonarPulsePower] ; picked up in a crate, or by spy -> spen/syrd
|
[SonarPulsePower] ; picked up in a crate, or by spy -> spen/syrd
|
||||||
ChargeTime=10
|
ChargeTime=10
|
||||||
Description=Sonar Pulse
|
Description=Sonar Pulse
|
||||||
LongDesc=Reveals all submarines on the map for a short time.
|
LongDesc=Reveals all submarines on the map for a \nshort time.
|
||||||
OneShot=yes
|
OneShot=yes
|
||||||
Powered=no
|
Powered=no
|
||||||
Image=sonricon
|
Image=sonricon
|
||||||
@@ -854,7 +854,7 @@ GivenAuto=no
|
|||||||
[ChronoshiftPower] ; free with Chronosphere... sortof the point.
|
[ChronoshiftPower] ; free with Chronosphere... sortof the point.
|
||||||
ChargeTime=7
|
ChargeTime=7
|
||||||
Description=Chronoshift
|
Description=Chronoshift
|
||||||
LongDesc=Temporarily teleports a vehicle across the map.
|
LongDesc=Temporarily teleports a vehicle across \nthe map.
|
||||||
Prerequisite=PDOX
|
Prerequisite=PDOX
|
||||||
Image=warpicon
|
Image=warpicon
|
||||||
TechLevel=12
|
TechLevel=12
|
||||||
@@ -887,7 +887,7 @@ TechLevel=12
|
|||||||
[InvulnerabilityPower] ; the point of IRON
|
[InvulnerabilityPower] ; the point of IRON
|
||||||
ChargeTime=11
|
ChargeTime=11
|
||||||
Description=Invulnerability
|
Description=Invulnerability
|
||||||
LongDesc=Makes a single unit invulnerable for a short time.
|
LongDesc=Makes a single unit invulnerable for a \nshort time.
|
||||||
Image=infxicon
|
Image=infxicon
|
||||||
Prerequisite=IRON
|
Prerequisite=IRON
|
||||||
TechLevel=12
|
TechLevel=12
|
||||||
Reference in New Issue
Block a user