Skip to content

Commit

Permalink
Showing 3 changed files with 37 additions and 9 deletions.
Binary file modified GameData/RP-0/Plugins/RP0.dll
Binary file not shown.
44 changes: 36 additions & 8 deletions Source/LoadingScreenChanger.cs
Original file line number Diff line number Diff line change
@@ -10,10 +10,18 @@

namespace RP0
{
public class DummyLoadingSystem : LoadingSystem
{
public override bool IsReady()
{
return true;
}
}
[KSPAddon(KSPAddon.Startup.Instantly, true)]
class LoadingScreenChanger : MonoBehaviour
{
bool done = false;
protected bool done = false;

protected void Awake()
{
DontDestroyOnLoad(this);
@@ -29,9 +37,7 @@ protected void Update()

Debug.Log("[RP-0]: Replacing loading screens.");

LoadingScreen.LoadingScreenState state = LoadingScreen.Instance.Screens[1];
DatabaseLoaderTexture_DDS loader = new DatabaseLoaderTexture_DDS();
MethodInfo reader = typeof(DatabaseLoaderTexture_DDS).GetMethod("Read", BindingFlags.NonPublic | BindingFlags.Instance);
LoadingScreen.LoadingScreenState origState = LoadingScreen.Instance.Screens[1];

List<Texture2D> textures = new List<Texture2D>();
DirectoryInfo di = new DirectoryInfo(KSPUtil.ApplicationRootPath + "GameData/RP-0/PluginData/Screens");
@@ -52,13 +58,35 @@ protected void Update()
}
}
}
if (textures.Count > 0)
int tC = textures.Count;
float screenTime = Mathf.Round(240f / tC);
System.Random random = new System.Random();
if (tC > 0)
{
state.screens = textures.ToArray();
for (int i = tC - 1; i-- > 0;)
{
int idx = random.Next(0, textures.Count);
LoadingScreen.LoadingScreenState state = new LoadingScreen.LoadingScreenState();
state.fadeInTime = origState.fadeInTime;
state.fadeOutTime = origState.fadeOutTime;
state.displayTime = screenTime;
state.tips = origState.tips;
state.tipTime = origState.tipTime;
state.screens = new Texture2D[] { textures[idx] };

LoadingScreen.Instance.Screens.Add(state);

textures.RemoveAt(idx);

LoadingScreen.Instance.loaders.Add(LoadingScreen.Instance.gameObject.AddComponent<DummyLoadingSystem>());
}

origState.screens = new Texture2D[] { textures[0] };
origState.displayTime = 2400f;

LoadingScreen.Instance.Screens[LoadingScreen.Instance.Screens.Count - 1].displayTime = 2400f;

string msgStr = "[RP-0]: Loading screens replaced.";
foreach (Texture2D t in state.screens)
msgStr += "\n" + t.name;

Debug.Log(msgStr);
}
2 changes: 1 addition & 1 deletion Source/Maintenance/MaintenanceHandler.cs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ public class MaintenanceHandler : ScenarioModule
public int[] kctPadCounts = new int[10];

protected double facilityLevelCostMult = 0.00001d;
protected double kctBPMult = 1000000d;
protected double kctBPMult = 2740d;
protected double kctResearchMult = 50000000d / 86400d;
protected double nautYearlyUpkeepAdd = 5000d;
protected double nautYearlyUpkeepBase = 500d;

0 comments on commit e9bf432

Please sign in to comment.