Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KSP-RO/RP-1
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: be9fa2b1560e
Choose a base ref
...
head repository: KSP-RO/RP-1
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 97603435d458
Choose a head ref
  • 6 commits
  • 4 files changed
  • 2 contributors

Commits on Aug 13, 2017

  1. New training UI. Still a work in progress

    Missing features:
    * Remove/Cancel active courses
    * View skills (i.e. completed-course rewards) of a single 'naut
      - this will probably involve a separate Astronauts tab
      - and will also display expiry dates for each reward
    * 'back' button on Courses tab after selecting a course
    ec429 committed Aug 13, 2017
    Copy the full SHA
    3efff95 View commit details

Commits on Aug 14, 2017

  1. More work on the Training UI

    Supports removing a student from an active course (or, if the course has a
     seatMin requirement, cancelling the course entirely).
    Allows to return to the course list by clicking the Courses tab after
     selecting a course.
    Adds a tab for information on a single 'naut's training, reached by clicking
     the 'naut's name in the Summary tab.
    ec429 committed Aug 14, 2017
    Copy the full SHA
    df4f68b View commit details
  2. Move nautList to MaintenanceWindow

    It doesn't need to be in CrewHandler now that kerbalRetireTimes is public.
    ec429 committed Aug 14, 2017
    Copy the full SHA
    5a326b1 View commit details
  3. Do not display MaintenanceWindow by default

    There's no button in Sandbox or Science games, so no way to dismiss it.
    ec429 committed Aug 14, 2017
    Copy the full SHA
    8f3cdf8 View commit details
  4. Rebuilt RP0.dll

    ec429 committed Aug 14, 2017
    Copy the full SHA
    56bcadd View commit details
  5. Merge branch 'maintUI' of git://github.com/ec429/RP-0 into Developmental

    Conflicts:
    	GameData/RP-0/Plugins/RP0.dll
    NathanKell committed Aug 14, 2017
    Copy the full SHA
    9760343 View commit details
Showing with 307 additions and 194 deletions.
  1. +18 −0 Source/Crew/ActiveCourse.cs
  2. +2 −26 Source/Crew/CrewHandler.cs
  3. +262 −166 Source/Crew/FSGUI.cs
  4. +25 −2 Source/Maintenance/MaintenanceWindow.cs
18 changes: 18 additions & 0 deletions Source/Crew/ActiveCourse.cs
Original file line number Diff line number Diff line change
@@ -134,6 +134,7 @@ public void RemoveStudent(ProtoCrewMember student)
{
UnityEngine.Debug.Log("[FS] Kerbal removed from in-progress class!");
//TODO: Assign partial rewards, based on what the REWARD nodes think
student.inactive = false;
}
}
}
@@ -142,6 +143,23 @@ public void RemoveStudent(string student)
RemoveStudent(HighLogic.CurrentGame.CrewRoster[student]);
}

public double GetTime()
{
return GetTime(Students);
}

/* Returns time at which this course will complete */
public double CompletionTime()
{
double start, length;
if (Started)
start = startTime;
else
start = Planetarium.GetUniversalTime();
length = GetTime();
return start + length;
}

public bool ProgressTime(double curT)
{
if (!Started)
28 changes: 2 additions & 26 deletions Source/Crew/CrewHandler.cs
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ public void Save(ConfigNode node)

public CrewHandlerSettings settings = new CrewHandlerSettings();

protected Dictionary<string, double> kerbalRetireTimes = new Dictionary<string, double>();
public Dictionary<string, double> kerbalRetireTimes = new Dictionary<string, double>();

protected HashSet<string> retirees = new HashSet<string>();

@@ -674,7 +674,7 @@ protected void FixTooltip(KSP.UI.CrewListItem cli)
}
}

protected string GetTrainingString(ProtoCrewMember pcm)
public string GetTrainingString(ProtoCrewMember pcm)
{
HashSet<string> expiredProfs = new HashSet<string>();
bool found = false;
@@ -732,30 +732,6 @@ protected double GetExpiration(string pcmName, FlightLog.Entry ent)
return 0d;
}

/* UI: display list of retirement NET dates. Called from MaintenanceWindow */
public void nautList()
{
GUILayout.BeginHorizontal();
try {
GUILayout.Space(40);
GUILayout.Label("Name", HighLogic.Skin.label, GUILayout.Width(120));
GUILayout.Label("Retires NET", HighLogic.Skin.label, GUILayout.Width(80));
} finally {
GUILayout.EndHorizontal();
}
foreach (string name in kerbalRetireTimes.Keys) {
GUILayout.BeginHorizontal();
try {
GUILayout.Space(40);
double rt = kerbalRetireTimes[name];
GUILayout.Label(name, HighLogic.Skin.label, GUILayout.Width(120));
GUILayout.Label(KSPUtil.PrintDate(rt, false), HighLogic.Skin.label, GUILayout.Width(80));
} finally {
GUILayout.EndHorizontal();
}
}
}

protected void FindAllCourseConfigs()
{
CourseTemplates.Clear();
Loading