Skip to content

Commit

Permalink
Merge pull request #46 from henrybauer/editordisplay
Browse files Browse the repository at this point in the history
Allow discovery of logistics properties in editor
  • Loading branch information
BobPalmer committed Mar 15, 2016
2 parents d4faa2c + 0d741f8 commit 4a58d6c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1 deletion.
6 changes: 6 additions & 0 deletions USITools/USITools/Logistics/ModuleDistributedWarehouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@

namespace KolonyTools
{
[KSPModule("Distributed Warehouse")]
public class ModuleDistributedWarehouse : PartModule
{
[KSPField]
public float LogisticsRange = 2000f;

private double lastCheck;

public override string GetInfo()
{
return base.GetInfo() + "\nAutomatically levels resources with other Distributed Warehouses\n";
}

public void FixedUpdate()
{
if (!HighLogic.LoadedSceneIsFlight)
Expand Down
8 changes: 7 additions & 1 deletion USITools/USITools/Logistics/ModuleLogisticsConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@

namespace KolonyTools
{
[KSPModule("Logistics Consumer")]
public class ModuleLogisticsConsumer : PartModule
{
private double lastCheck;


public override string GetInfo()
{
return base.GetInfo() + "\nWill pull resources from nearby Logistics Distributors\n";
}

public void FixedUpdate()
{
if (!HighLogic.LoadedSceneIsFlight)
Expand Down
6 changes: 6 additions & 0 deletions USITools/USITools/Logistics/ModulePowerCoupler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
namespace KolonyTools
{
[KSPModule("Power Coupler")]
public class ModulePowerCoupler : PartModule
{
public override string GetInfo()
{
return base.GetInfo() + "\nWill consume power from a Power Distributor\n";
}

}
}
6 changes: 6 additions & 0 deletions USITools/USITools/Logistics/ModulePowerDistributor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
namespace KolonyTools
{
[KSPModule("Power Distributor")]
public class ModulePowerDistributor : PartModule
{
[KSPField]
public int PowerDistributionRange = 2000;

public override string GetInfo()
{
return base.GetInfo() + "\nWill distribute power to Power Couplers\n";
}
}
}
7 changes: 7 additions & 0 deletions USITools/USITools/Logistics/ModuleResourceDistributor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@

namespace KolonyTools
{
[KSPModule("Logistics Distributor")]
public class ModuleResourceDistributor : PartModule
{
[KSPField]
public int ResourceDistributionRange = 2000;

public override string GetInfo()
{
return base.GetInfo() + "\nWill distribute resources to nearby Logistics Consumers\n";
}

}
}
6 changes: 6 additions & 0 deletions USITools/USITools/Logistics/USI_ModuleResourceWarehouse.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace KolonyTools
{
[KSPModule("Resource Warehouse")]
public class USI_ModuleResourceWarehouse : PartModule
{
[KSPField(isPersistant = true)]
Expand All @@ -11,6 +12,11 @@ public void DisableTransfer()
ToggleTransfer(false);
}

public override string GetInfo()
{
return base.GetInfo() + "\nWarehouse full of resources\n";
}

[KSPEvent(guiName = "Enable Warehouse", active = true, guiActive = false)]
public void EnableTransfer()
{
Expand Down

0 comments on commit 4a58d6c

Please sign in to comment.