Skip to content

Commit

Permalink
More Kopernicus main menu workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
WazWaz committed Nov 18, 2016
1 parent 89a670a commit 1d4d9c8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Atmosphere/Clouds2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ internal Clouds2D CloneForMainMenu(GameObject mainMenuBody)
// will have cloned a body that already had clouds. Hide old clouds.
for (var c=0; c<mainMenuBody.transform.childCount; ++c) {
var child = mainMenuBody.transform.GetChild(c).gameObject;
if (child.name.StartsWith("EVE Clouds:") && child.name.EndsWith("(Clone)"))
if (child.name.StartsWith("EVE ") && child.name.EndsWith("(Clone)"))
child.SetActive(false);
}
}
Expand Down Expand Up @@ -164,7 +164,7 @@ internal void Apply(CelestialBody celestialBody, Transform scaledCelestialTransf

if (shadowMaterial != null)
{
ShadowProjectorGO = new GameObject("ShadowProjector");
ShadowProjectorGO = new GameObject("EVE ShadowProjector");
ShadowProjector = ShadowProjectorGO.AddComponent<Projector>();
ShadowProjector.nearClipPlane = 10;
ShadowProjector.fieldOfView = 60;
Expand Down
12 changes: 11 additions & 1 deletion CityLights/CityLightsObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,17 @@ private void ApplyToMainMenu()
scaledMat.SetTexture("_MainTex", r.material.GetTexture("_MainTex"));
Light sunlight = GameObject.FindObjectsOfType<Light>().Last(l => l.isActiveAndEnabled);
DeferredRenderer.Add(r.gameObject, scaledMat);


if (mainMenuBody.name.EndsWith("(Clone)")) {
// There is a race condition with Kopernicus. Sometimes, it
// will have cloned a body that already had clouds. Hide old clouds.
for (var c = 0; c < mainMenuBody.transform.childCount; ++c) {
var child = mainMenuBody.transform.GetChild(c).gameObject;
if (child.name.StartsWith("EVE City Lights") && child.name.EndsWith("(Clone)"))
child.SetActive(false);
}
}

ScaledCityComponent sc = r.gameObject.AddComponent<ScaledCityComponent>();
sc.Apply(scaledMat, sunlight);

Expand Down
3 changes: 2 additions & 1 deletion EveManager/GlobalEVEManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ private void OnGUI()
{
_mainWindowRect.width = 400;
_mainWindowRect.height = 720;
_mainWindowRect = GUI.Window(0x8100, _mainWindowRect, DrawMainWindow, "EVE Manager");
var versionInfo = Assembly.GetExecutingAssembly().GetName().Version.ToString();
_mainWindowRect = GUI.Window(0x8100, _mainWindowRect, DrawMainWindow, "EVE "+versionInfo+" Config Editor");
}
}

Expand Down

0 comments on commit 1d4d9c8

Please sign in to comment.