Skip to content

Commit

Permalink
Showing 5 changed files with 20 additions and 21 deletions.
Binary file modified GameData/RP-0/Plugins/RP0.dll
Binary file not shown.
13 changes: 7 additions & 6 deletions Source/Crew/FSGUI.cs
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ protected void nautListHeading()
GUILayout.BeginHorizontal();
try {
GUILayout.Label("", GUILayout.Width(24));
GUILayout.Label("Name", boldLabel, GUILayout.Width(96));
GUILayout.Label("Name", boldLabel, GUILayout.Width(144));
GUILayout.Label("Course", boldLabel, GUILayout.Width(96));
GUILayout.Label("Complete", boldLabel, GUILayout.Width(80));
GUILayout.Label("Retires NET", boldLabel, GUILayout.Width(80));
@@ -80,18 +80,18 @@ protected void nautListRow(tabs currentTab, ProtoCrewMember student)
try {
GUILayout.Label(String.Format("{0} {1}", student.trait.Substring(0, 1), student.experienceLevel), GUILayout.Width(24));
if (currentCourse == null && selectedCourse != null && (selectedForCourse || selectedCourse.MeetsStudentReqs(student))) {
if (toggleButton(student.name, selectedForCourse, GUILayout.Width(96))) {
if (toggleButton(student.name, selectedForCourse, GUILayout.Width(144))) {
if (selectedForCourse)
selectedCourse.RemoveStudent(student);
else
selectedCourse.AddStudent(student);
}
} else if (currentTab == tabs.Training) {
if (GUILayout.Button(student.name, GUILayout.Width(96))) {
if (GUILayout.Button(student.name, GUILayout.Width(144))) {
selectedNaut = student;
}
} else {
GUILayout.Label(student.name, GUILayout.Width(96));
GUILayout.Label(student.name, GUILayout.Width(144));
}
string course, complete, retires;
if (currentCourse == null) {
@@ -134,7 +134,8 @@ protected void nautListRow(tabs currentTab, ProtoCrewMember student)
private void summaryBody(tabs currentTab)
{
updateActiveMap();
nautListScroll = GUILayout.BeginScrollView(nautListScroll, GUILayout.Width(480), GUILayout.Height(144));
float scrollHeight = currentTab == tabs.Training ? 420 : 305;
nautListScroll = GUILayout.BeginScrollView(nautListScroll, GUILayout.Width(480), GUILayout.Height(scrollHeight));
try {
nautListHeading();
for (int i = 0; i < HighLogic.CurrentGame.CrewRoster.Count; i++)
@@ -158,7 +159,7 @@ public tabs summaryTab()

protected void courseSelector()
{
courseSelectorScroll = GUILayout.BeginScrollView(courseSelectorScroll, GUILayout.Width(480), GUILayout.Height(144));
courseSelectorScroll = GUILayout.BeginScrollView(courseSelectorScroll, GUILayout.Width(480), GUILayout.Height(430));
try {
foreach (CourseTemplate course in CrewHandler.Instance.OfferedCourses) {
if (GUILayout.Button(course.name))
10 changes: 5 additions & 5 deletions Source/Maintenance/MaintenanceGUI.cs
Original file line number Diff line number Diff line change
@@ -209,18 +209,18 @@ private void nautList()
{
GUILayout.BeginHorizontal();
try {
GUILayout.Space(40);
GUILayout.Label("Name", HighLogic.Skin.label, GUILayout.Width(120));
GUILayout.Space(20);
GUILayout.Label("Name", HighLogic.Skin.label, GUILayout.Width(144));
GUILayout.Label("Retires NET", HighLogic.Skin.label, GUILayout.Width(80));
} finally {
GUILayout.EndHorizontal();
}
foreach (string name in Crew.CrewHandler.Instance.kerbalRetireTimes.Keys) {
GUILayout.BeginHorizontal();
try {
GUILayout.Space(40);
GUILayout.Space(20);
double rt = Crew.CrewHandler.Instance.kerbalRetireTimes[name];
GUILayout.Label(name, HighLogic.Skin.label, GUILayout.Width(120));
GUILayout.Label(name, HighLogic.Skin.label, GUILayout.Width(144));
GUILayout.Label(Crew.CrewHandler.Instance.retirementEnabled ? KSPUtil.PrintDate(rt, false) : "(n/a)", HighLogic.Skin.label, GUILayout.Width(80));
} finally {
GUILayout.EndHorizontal();
@@ -248,7 +248,7 @@ public void astronautsTab()
} finally {
GUILayout.EndHorizontal();
}
nautListScroll = GUILayout.BeginScrollView(nautListScroll, GUILayout.Width(280), GUILayout.Height(144));
nautListScroll = GUILayout.BeginScrollView(nautListScroll, GUILayout.Width(280), GUILayout.Height(320));
try {
nautList();
} finally {
8 changes: 3 additions & 5 deletions Source/Tooling/ModuleToolingSSTUTank.cs
Original file line number Diff line number Diff line change
@@ -51,6 +51,8 @@ protected override void GetDimensions(out float diam, out float len)
* represent the different models and are multipliers on the Diameter for the Length of the tank. */
if (coreStr.Contains("MFT-A-") || coreStr.Contains("MFT-B-") || coreStr.Contains("MFT-C-") || coreStr.Contains("MFT-CF-"))
{
curLen = float(coreStr.replace('-','.')) * diam

if (coreStr.Contains("0-5")) { len = diam * 0.5f; }
else if (coreStr.Contains("1-0")) { len = diam; }
else if (coreStr.Contains("1-5")) { len = diam * 1.5f; }
@@ -67,11 +69,7 @@ protected override void GetDimensions(out float diam, out float len)
else if (coreStr.Contains("7-0")) { len = diam * 7.0f; }
else if (coreStr.Contains("7-5")) { len = diam * 7.5f; }
else if (coreStr.Contains("8-0")) { len = diam * 8.0f; }
else
{
Debug.LogError("[ModuleTooling]: Could not find SSTU size that was correct");
return;
}
else { len = diam * 0.25f; }
Debug.Log($"[RP1-ModuleTooling]: SSTU Tank Size: Diameter = {diam}, Length = {len}");
}
else
10 changes: 5 additions & 5 deletions Source/Tooling/ToolingGUI.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEngine;
using Smooth.Slinq;

@@ -16,7 +15,7 @@ private struct untooledPart {
private Vector2 toolingTypesScroll = new Vector2(), untooledTypesScroll = new Vector2();
private double deltaTime = 0d;
private const double UPDATEINTERVAL = 0.25d;
private static HashSet<untooledPart> untooledParts = new HashSet<untooledPart>();
private List<untooledPart> untooledParts = new List<untooledPart>();
public string currentToolingType;

private void MaybeUpdate()
@@ -94,7 +93,7 @@ public tabs toolingTab()
} finally {
GUILayout.EndHorizontal();
}
untooledTypesScroll = GUILayout.BeginScrollView(untooledTypesScroll, GUILayout.Height(144), GUILayout.Width(572));
untooledTypesScroll = GUILayout.BeginScrollView(untooledTypesScroll, GUILayout.Height(204), GUILayout.Width(572));
try {
foreach (untooledPart uP in untooledParts) {
GUILayout.BeginHorizontal();
@@ -113,7 +112,8 @@ public tabs toolingTab()
}
GUILayout.BeginHorizontal();
try {
GUILayout.Label("Total vessel cost if all parts are tooled: " + (EditorLogic.fetch.ship.GetShipCosts(out _, out _) - EditorLogic.fetch.ship.parts.Slinq().SelectMany(p => p.FindModulesImplementing<ModuleTooling>().Slinq()).Where(mt => !mt.IsUnlocked()).Select(mt => mt.GetModuleCost(mt.part.partInfo.cost, ModifierStagingSituation.CURRENT)).Sum()));
float toolAllCost = EditorLogic.fetch.ship.GetShipCosts(out _, out _) - EditorLogic.fetch.ship.parts.Slinq().SelectMany(p => p.FindModulesImplementing<ModuleTooling>().Slinq()).Where(mt => !mt.IsUnlocked()).Select(mt => mt.GetModuleCost(mt.part.partInfo.cost, ModifierStagingSituation.CURRENT)).Sum();
GUILayout.Label("Total vessel cost if all parts are tooled: " + toolAllCost.ToString("N0"));
} finally {
GUILayout.EndHorizontal();
}

0 comments on commit 36c8e9f

Please sign in to comment.