Skip to content

Commit

Permalink
Allow techRequired for CONFIGs
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanKell committed Jul 3, 2014
1 parent 29abbf8 commit 6273525
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions RealFuels/Readme_RF.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ AN OVERVIEW OF FUEL TYPES AND TECH LEVELS/ENGINE TYPES ARE BELOW THE CHANGELOG

==========
Changelog:
v6.4 \/
*Allow fuselages to hold life support resources
*Allow CONFIGs to have techRequired items (can limit available Engine Configs based on R&D nodes researched)
*Fix service modules to not start full when TACLS/ECLSS is installed

v6.3 \/
*Add Roxette's Spaceplane Plus support
*Fix HGR so engines are not modified (done via engine config sets instead)
Expand Down
14 changes: 11 additions & 3 deletions Source/ModularEngines.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1763,17 +1763,25 @@ public void SetThrust()
}
}

private bool CanConfig(ConfigNode config)
{
return (!config.HasValue("techRequired") || HighLogic.CurrentGame.Mode != Game.Modes.CAREER || ResearchAndDevelopment.GetTechnologyState(config.GetValue("techRequired")) == RDTech.State.Available);
}

private void engineManagerGUI(int WindowID)
{
foreach (ConfigNode node in configs)
{
GUILayout.BeginHorizontal();
if (node.GetValue("name").Equals(configuration))
GUILayout.Label("Current configuration: " + configuration);
else if (GUILayout.Button("Configure to " + node.GetValue("name")))
else if (CanConfig(node))
{
SetConfiguration(node.GetValue("name"));
UpdateSymmetryCounterparts();
if(GUILayout.Button("Configure to " + node.GetValue("name")))
{
SetConfiguration(node.GetValue("name"));
UpdateSymmetryCounterparts();
}
}
GUILayout.EndHorizontal();
}
Expand Down

0 comments on commit 6273525

Please sign in to comment.