Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions Source/LoadingScreenChanger.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using UnityEngine;
using KSP;
using System.IO;
using System.Reflection;

namespace RP0
{
@@ -39,7 +36,6 @@ protected void Update()

try
{

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

LoadingScreen.LoadingScreenState origState = LoadingScreen.Instance.Screens[1];
@@ -65,11 +61,11 @@ protected void Update()
}
}
int tC = textures.Count;
//float screenTime = Mathf.Round(240f / (float)tC);
System.Random random = new System.Random();
if (tC > 0)
{
LoadingScreen.Instance.Screens[1].screens = textures.ToArray();
LoadingScreen.LoadingScreenState sc = LoadingScreen.Instance.Screens[1];
sc.screens = textures.ToArray();
sc.displayTime = 8; // Default value is 4 which causes the images to switch too quickly

string msgStr = "[RP-0]: Loading screens replaced.";

@@ -79,17 +75,10 @@ protected void Update()
{
Debug.LogError("[RP-0]: No screens found in RP-0/PluginData/Screens!");
}

// Try to jigger the unity random thing.

for (int i = (int)((new System.Random()).NextDouble() * 100d); i-- > 0;)
{
UnityEngine.Random.Range(0, 10);
}
}
catch (Exception e)
{
Debug.LogError("Patching failed: with error " + error + ", exception " + e);
Debug.LogError("[RP-0]: Patching failed: with error " + error + ", exception " + e);
}

GameObject.Destroy(this);
@@ -277,4 +266,4 @@ private static bool fourCCEquals(IList<byte> bytes, string s)
return bytes[0] == s[0] && bytes[1] == s[1] && bytes[2] == s[2] && bytes[3] == s[3];
}
}
}
}

0 comments on commit 24f0e14

Please sign in to comment.