Skip to content

Commit ea87951

Browse files
committed
Update for KSP 1.4.0
1 parent 7ce4665 commit ea87951

21 files changed

+53
-31
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ Known Issues
289289
Licence
290290
-------
291291

292-
Copyright © 2013-2016 Davorin Učakar, Ryan Bray, RangeMachine
292+
Copyright © 2013-2018 Davorin Učakar, Ryan Bray, RangeMachine
293293

294294
Permission is hereby granted, free of charge, to any person obtaining a
295295
copy of this software and associated documentation files (the "Software"),

Sources/Loader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
* Copyright © 2013 Ryan Bray
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a

Sources/Personaliser.cs

+26-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -529,7 +529,7 @@ private void personaliseKerbal(Component component, ProtoCrewMember kerbal, Part
529529
kerbalIVA.textureVeteran = newTexture;
530530
}
531531
break;
532-
532+
533533
case "helmet":
534534
case "mesh_female_kerbalAstronaut01_helmet":
535535
if (isEva)
@@ -562,7 +562,8 @@ private void personaliseKerbal(Component component, ProtoCrewMember kerbal, Part
562562
}
563563
break;
564564

565-
default: // Jetpack.
565+
default:
566+
// Jetpack.
566567
if (isEva)
567568
{
568569
smr.enabled = needsSuit;
@@ -583,11 +584,31 @@ private void personaliseKerbal(Component component, ProtoCrewMember kerbal, Part
583584
material.SetTexture(Util.BUMPMAP_PROPERTY, newNormalMap);
584585
}
585586
}
587+
588+
if (isEva)
589+
{
590+
foreach (Transform trans in component.GetComponentsInChildren<Transform>())
591+
{
592+
if (trans.name == "EVAparachute")
593+
{
594+
foreach (Renderer renderer in trans.GetComponentsInChildren<Renderer>(true))
595+
{
596+
if (!needsSuit)
597+
{
598+
renderer.transform.localPosition += Vector3.forward * 0.1f;
599+
renderer.transform.localPosition += Vector3.up * -0.03f;
600+
}
601+
else
602+
renderer.transform.localPosition = Vector3.zero;
603+
}
604+
}
605+
}
606+
}
586607
}
587608

588609
/**
589-
* Personalise Kerbals in an internal space of a vessel. Used by IvaModule.
590-
*/
610+
* Personalise Kerbals in an internal space of a vessel. Used by IvaModule.
611+
*/
591612

592613
public void personaliseIva(Kerbal kerbal)
593614
{

Sources/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
[assembly: AssemblyConfiguration("")]
66
[assembly: AssemblyCompany("")]
77
[assembly: AssemblyProduct("TextureReplacer")]
8-
[assembly: AssemblyCopyright("© 2013-2017 Davorin Učakar, Ryan Bray, RangeMachine")]
8+
[assembly: AssemblyCopyright("© 2013-2018 Davorin Učakar, Ryan Bray, RangeMachine")]
99
[assembly: AssemblyTrademark("")]
1010
[assembly: AssemblyCulture("")]
11-
[assembly: AssemblyVersion("2.6.0.0")]
11+
[assembly: AssemblyVersion("2.7.0.0")]
1212

13-
[assembly: KSPAssembly("Texture Replacer", 2, 6)]
13+
[assembly: KSPAssembly("Texture Replacer", 2, 7)]

Sources/Reflections.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -309,7 +309,7 @@ public void setReflectionType(Type type)
309309
material.shader = enableStatic ? visorShader : transparentSpecularShader;
310310

311311
///////////////////////////////////////////////////////////////////////////////////////////
312-
// In 1.2 visor texture some reason want load by default way
312+
// In 1.2 visor texture some reason dont want load by default way
313313
///////////////////////////////////////////////////////////////////////////////////////////
314314
Texture visorTex = GameDatabase.Instance.GetTexture(Util.DIR + "Default/EVAVisor", false);
315315

Sources/Replacer.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -58,6 +58,9 @@ private void replaceTextures()
5858
{
5959
foreach (Material material in Resources.FindObjectsOfTypeAll<Material>())
6060
{
61+
if (!material.HasProperty("_MainTex"))
62+
continue;
63+
6164
Texture texture = material.mainTexture;
6265

6366
if (texture == null || texture.name.Length == 0 || texture.name.StartsWith("Temp", StringComparison.Ordinal))
@@ -81,6 +84,9 @@ private void replaceTextures()
8184
}
8285
}
8386

87+
if (!material.HasProperty(Util.BUMPMAP_PROPERTY))
88+
continue;
89+
8490
Texture normalMap = material.GetTexture(Util.BUMPMAP_PROPERTY);
8591
if (normalMap == null)
8692
continue;

Sources/TRActivator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),

Sources/TRGui.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),

Sources/TRReflection.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),

Sources/TRScenario.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),

Sources/TextureReplacer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),

Sources/Util.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
2+
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),

Unity/Assets/Scenes.meta Unity/Assets/Editor.meta

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

Unity/Assets/Scripts/BuildBundles.cs Unity/Assets/Editor/Scripts/BuildBundles.cs

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public class BuildShaders
2424
[MenuItem("TextureReplacer/Build Shaders")]
2525
private static void BuildForAllPlatforms()
2626
{
27+
// Check directory
28+
if (!Directory.Exists("Bundles"))
29+
Directory.CreateDirectory("Bundles");
30+
2731
// Cleanup
2832
File.Delete("Bundles/DirectX.bundle");
2933
File.Delete("Bundles/OpenGL.bundle");

Unity/Assets/Scenes/Shaders.unity

-12.4 KB
Binary file not shown.

Unity/Assets/Scenes/Shaders.unity.meta

-8
This file was deleted.
38 Bytes
Binary file not shown.
11.9 KB
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
m_EditorVersion: 5.4.1f1
2-
m_StandardAssetsVersion: 0
1+
m_EditorVersion: 2017.1.3f1

0 commit comments

Comments
 (0)