Implement WithDecorationCarryable.
This commit is contained in:
@@ -97,6 +97,7 @@
|
||||
<Compile Include="UtilityCommands\D2kMapImporter.cs" />
|
||||
<Compile Include="UtilityCommands\ImportD2kMapCommand.cs" />
|
||||
<Compile Include="Traits\Render\WithAttackOverlay.cs" />
|
||||
<Compile Include="Traits\Render\WithDecorationCarryable.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
|
||||
38
OpenRA.Mods.D2k/Traits/Render/WithDecorationCarryable.cs
Normal file
38
OpenRA.Mods.D2k/Traits/Render/WithDecorationCarryable.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.D2k.Traits
|
||||
{
|
||||
[Desc("Displays a sprite when the carryable actor is waiting for pickup.")]
|
||||
public class WithDecorationCarryableInfo : WithDecorationInfo, Requires<CarryableInfo>
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new WithDecorationCarryable(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithDecorationCarryable : WithDecoration
|
||||
{
|
||||
readonly Carryable carryable;
|
||||
|
||||
public WithDecorationCarryable(Actor self, WithDecorationCarryableInfo info)
|
||||
: base(self, info)
|
||||
{
|
||||
carryable = self.Trait<Carryable>();
|
||||
}
|
||||
|
||||
public override bool ShouldRender(Actor self)
|
||||
{
|
||||
return carryable.Reserved;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,10 @@ harvester:
|
||||
SearchFromProcRadius: 24
|
||||
SearchFromOrderRadius: 12
|
||||
Carryable:
|
||||
WithDecorationCarryable:
|
||||
Image: pips
|
||||
Sequence: pickup-indicator
|
||||
Offset: -12, -12
|
||||
Health:
|
||||
HP: 1000
|
||||
Armor:
|
||||
|
||||
@@ -112,6 +112,8 @@ pips:
|
||||
groups: DATA.R8
|
||||
Start: 17
|
||||
Length: 10
|
||||
pickup-indicator: DATA.R8
|
||||
Start: 112
|
||||
tag-primary: DATA.R8
|
||||
Start: 110
|
||||
pip-empty: DATA.R8
|
||||
|
||||
Reference in New Issue
Block a user