-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from BobPalmer/DEVELOP
Develop
- Loading branch information
Showing
8 changed files
with
956 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
"VERSION":{ | ||
"MAJOR":0, | ||
"MINOR":6, | ||
"PATCH":1, | ||
"PATCH":3, | ||
"BUILD":0 | ||
}, | ||
"KSP_VERSION":{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 30 additions & 2 deletions
32
USITools/USITools/Logistics/USI_ModuleResourceWarehouse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,35 @@ | ||
namespace KolonyTools | ||
{ | ||
public class USI_ModuleResourceWarehouse : PartModule | ||
{ | ||
|
||
{ | ||
[KSPField(isPersistant = true)] | ||
public bool transferEnabled = true; | ||
|
||
[KSPEvent(guiName = "Disable Warehouse", active = true, guiActive = true)] | ||
public void DisableTransfer() | ||
{ | ||
ToggleTransfer(false); | ||
} | ||
|
||
[KSPEvent(guiName = "Enable Warehouse", active = true, guiActive = false)] | ||
public void EnableTransfer() | ||
{ | ||
ToggleTransfer(true); | ||
} | ||
|
||
private void ToggleTransfer(bool state) | ||
{ | ||
transferEnabled = state; | ||
Events["DisableTransfer"].guiActive = state; | ||
Events["EnableTransfer"].guiActive = !state; | ||
MonoUtilities.RefreshContextWindows(part); | ||
} | ||
|
||
public override void OnStart(StartState state) | ||
{ | ||
Events["DisableTransfer"].guiActive = transferEnabled; | ||
Events["EnableTransfer"].guiActive = !transferEnabled; | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.