Added debug cheat button to grow map resources.
This commit is contained in:
1
AUTHORS
1
AUTHORS
@@ -56,6 +56,7 @@ Also thanks to:
|
||||
* Olaf van der Spek
|
||||
* Paolo Chiodi (paolochiodi)
|
||||
* Paul Dovydaitis (pdovy)
|
||||
* Pizzaoverhead
|
||||
* Psydev
|
||||
* Raymond Martineau (mart0258)
|
||||
* Reaperrr
|
||||
|
||||
@@ -9,6 +9,7 @@ NEW:
|
||||
Added an Extras submenu for miscellaneous game extras.
|
||||
Engineers can now regain control over husks.
|
||||
A player's units, and allied units, now move out of the way when blocking production facilities.
|
||||
Added cheat button to grow map resources.
|
||||
Dune 2000:
|
||||
Added the Atreides grenadier from the 1.06 patch.
|
||||
Added randomized tiles for Sand and Rock terrain.
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace OpenRA.Traits
|
||||
public class DeveloperModeInfo : ITraitInfo
|
||||
{
|
||||
public int Cash = 20000;
|
||||
public int ResourceGrowth = 100;
|
||||
public bool FastBuild = false;
|
||||
public bool FastCharge = false;
|
||||
public bool DisableShroud = false;
|
||||
@@ -79,6 +80,15 @@ namespace OpenRA.Traits
|
||||
self.Trait<PlayerResources>().GiveCash(Info.Cash);
|
||||
break;
|
||||
}
|
||||
case "DevGrowResources":
|
||||
{
|
||||
foreach (var a in self.World.ActorsWithTrait<ISeedableResource>())
|
||||
{
|
||||
for (var i = 0; i < Info.ResourceGrowth; i++)
|
||||
a.Trait.Seed(a.Actor);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "DevShroudDisable":
|
||||
{
|
||||
DisableShroud ^= true;
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace OpenRA.Traits
|
||||
public interface INotifyOwnerChanged { void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner); }
|
||||
public interface INotifyCapture { void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner); }
|
||||
public interface INotifyHarvest { void Harvested(Actor self, ResourceType resource); }
|
||||
public interface ISeedableResource { void Seed(Actor self); }
|
||||
|
||||
public interface IAcceptInfiltrator { void OnInfiltrate(Actor self, Actor infiltrator); }
|
||||
public interface IDemolishable
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA
|
||||
public readonly int AnimationInterval = 750;
|
||||
}
|
||||
|
||||
class SeedsResource : ITick
|
||||
class SeedsResource : ITick, ISeedableResource
|
||||
{
|
||||
int ticks;
|
||||
int animationTicks;
|
||||
@@ -32,6 +32,20 @@ namespace OpenRA.Mods.RA
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if (--ticks <= 0)
|
||||
{
|
||||
Seed(self);
|
||||
ticks = self.Info.Traits.Get<SeedsResourceInfo>().Interval;
|
||||
}
|
||||
|
||||
if (--animationTicks <= 0)
|
||||
{
|
||||
var info = self.Info.Traits.Get<SeedsResourceInfo>();
|
||||
self.Trait<RenderBuilding>().PlayCustomAnim(self, "active");
|
||||
animationTicks = info.AnimationInterval;
|
||||
}
|
||||
}
|
||||
|
||||
public void Seed(Actor self)
|
||||
{
|
||||
var info = self.Info.Traits.Get<SeedsResourceInfo>();
|
||||
var resourceType = self.World.WorldActor
|
||||
@@ -53,15 +67,6 @@ namespace OpenRA.Mods.RA
|
||||
|| (resLayer.GetResource(cell.Value) == null && resLayer.AllowResourceAt(resourceType, cell.Value))))
|
||||
resLayer.AddResource(resourceType, cell.Value, 1);
|
||||
|
||||
ticks = info.Interval;
|
||||
}
|
||||
|
||||
if (--animationTicks <= 0)
|
||||
{
|
||||
var info = self.Info.Traits.Get<SeedsResourceInfo>();
|
||||
self.Trait<RenderBuilding>().PlayCustomAnim(self, "active");
|
||||
animationTicks = info.AnimationInterval;
|
||||
}
|
||||
}
|
||||
|
||||
static IEnumerable<CPos> RandomWalk(CPos p, Thirdparty.Random r)
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
cashButton.OnClick = () =>
|
||||
world.IssueOrder(new Order("DevGiveCash", world.LocalPlayer.PlayerActor, false));
|
||||
|
||||
var growResourcesButton = widget.GetOrNull<ButtonWidget>("GROW_RESOURCES");
|
||||
if (growResourcesButton != null)
|
||||
growResourcesButton.OnClick = () =>
|
||||
world.IssueOrder(new Order("DevGrowResources", world.LocalPlayer.PlayerActor, false));
|
||||
|
||||
var fastBuildCheckbox = widget.GetOrNull<CheckboxWidget>("INSTANT_BUILD");
|
||||
if (fastBuildCheckbox != null)
|
||||
{
|
||||
|
||||
@@ -64,53 +64,59 @@ Container@CHEATS_PANEL:
|
||||
Font:Regular
|
||||
Text:Disable Shroud & Fog
|
||||
Button@GIVE_CASH:
|
||||
X:20
|
||||
Y:155
|
||||
X:90
|
||||
Y:145
|
||||
Width:140
|
||||
Height:35
|
||||
Text:Give $20,000
|
||||
Button@GROW_RESOURCES:
|
||||
X:271
|
||||
Y:145
|
||||
Width:140
|
||||
Height:35
|
||||
Text:Grow Resources
|
||||
Button@GIVE_EXPLORATION:
|
||||
X:186
|
||||
Y:155
|
||||
X:90
|
||||
Y:195
|
||||
Width:140
|
||||
Height:35
|
||||
Text:Clear Shroud
|
||||
Button@RESET_EXPLORATION:
|
||||
X:352
|
||||
Y:155
|
||||
X:271
|
||||
Y:195
|
||||
Width:140
|
||||
Height:35
|
||||
Text:Reset Shroud
|
||||
Label@VISUALIZATIONS_TITLE:
|
||||
Y:215
|
||||
Y:255
|
||||
Font:Bold
|
||||
Text:Visualizations
|
||||
Align:Center
|
||||
Width:PARENT_RIGHT
|
||||
Checkbox@SHOW_UNIT_PATHS:
|
||||
X:45
|
||||
Y:235
|
||||
Y:285
|
||||
Width:200
|
||||
Height:20
|
||||
Font:Regular
|
||||
Text:Show Unit Paths
|
||||
Checkbox@SHOW_ASTAR:
|
||||
X:45
|
||||
Y:265
|
||||
Y:315
|
||||
Height:20
|
||||
Width:200
|
||||
Font:Regular
|
||||
Text:Show A* Cost
|
||||
Checkbox@SHOW_COMBATOVERLAY:
|
||||
X:290
|
||||
Y:235
|
||||
Y:285
|
||||
Height:20
|
||||
Width:200
|
||||
Font:Regular
|
||||
Text:Show Combat Geometry
|
||||
Checkbox@SHOW_GEOMETRY:
|
||||
X:290
|
||||
Y:265
|
||||
Y:315
|
||||
Height:20
|
||||
Width:200
|
||||
Font:Regular
|
||||
|
||||
@@ -2,7 +2,7 @@ Container@INGAME_MENU_PANEL:
|
||||
X:(WINDOW_RIGHT - WIDTH)/2
|
||||
Y:(WINDOW_BOTTOM - HEIGHT)/2
|
||||
Width:512
|
||||
Height:320
|
||||
Height:370
|
||||
Children:
|
||||
Button@OBJECTIVES_BUTTON:
|
||||
Y:PARENT_BOTTOM - 1
|
||||
|
||||
@@ -10,8 +10,8 @@ Container@CONQUEST_OBJECTIVES:
|
||||
Contrast:true
|
||||
Align:Center
|
||||
Background@bg:
|
||||
Width:512
|
||||
Height:320
|
||||
Width:PARENT_RIGHT
|
||||
Height:PARENT_BOTTOM
|
||||
Background:panel-black
|
||||
Children:
|
||||
Label@PRIMARY:
|
||||
@@ -80,7 +80,7 @@ Container@CONQUEST_OBJECTIVES:
|
||||
X:15
|
||||
Y:105
|
||||
Width:482
|
||||
Height:200
|
||||
Height:250
|
||||
ItemSpacing:5
|
||||
Children:
|
||||
Container@PLAYER_TEMPLATE:
|
||||
|
||||
@@ -41,10 +41,17 @@ Background@CHEATS_PANEL:
|
||||
Button@GIVE_CASH:
|
||||
X:30
|
||||
Y:140
|
||||
Width:150
|
||||
Width:135
|
||||
Height:20
|
||||
Text: Give $20000 Cash
|
||||
Height:25
|
||||
Button@GROW_RESOURCES:
|
||||
X:185
|
||||
Y:140
|
||||
Width:135
|
||||
Height:20
|
||||
Text: Grow Resources
|
||||
Height:25
|
||||
Checkbox@INSTANT_BUILD:
|
||||
X:30
|
||||
Y:170
|
||||
|
||||
Reference in New Issue
Block a user