Skip to content

Commit

Permalink
Update for KSP 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RangeMachine committed Mar 7, 2018
1 parent 7ce4665 commit ea87951
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -289,7 +289,7 @@ Known Issues
Licence
-------

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

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/Loader.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
* Copyright © 2013 Ryan Bray
*
* Permission is hereby granted, free of charge, to any person obtaining a
Expand Down
31 changes: 26 additions & 5 deletions Sources/Personaliser.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -529,7 +529,7 @@ private void personaliseKerbal(Component component, ProtoCrewMember kerbal, Part
kerbalIVA.textureVeteran = newTexture;
}
break;

case "helmet":
case "mesh_female_kerbalAstronaut01_helmet":
if (isEva)
Expand Down Expand Up @@ -562,7 +562,8 @@ private void personaliseKerbal(Component component, ProtoCrewMember kerbal, Part
}
break;

default: // Jetpack.
default:
// Jetpack.
if (isEva)
{
smr.enabled = needsSuit;
Expand All @@ -583,11 +584,31 @@ private void personaliseKerbal(Component component, ProtoCrewMember kerbal, Part
material.SetTexture(Util.BUMPMAP_PROPERTY, newNormalMap);
}
}

if (isEva)
{
foreach (Transform trans in component.GetComponentsInChildren<Transform>())
{
if (trans.name == "EVAparachute")
{
foreach (Renderer renderer in trans.GetComponentsInChildren<Renderer>(true))
{
if (!needsSuit)
{
renderer.transform.localPosition += Vector3.forward * 0.1f;
renderer.transform.localPosition += Vector3.up * -0.03f;
}
else
renderer.transform.localPosition = Vector3.zero;
}
}
}
}
}

/**
* Personalise Kerbals in an internal space of a vessel. Used by IvaModule.
*/
* Personalise Kerbals in an internal space of a vessel. Used by IvaModule.
*/

public void personaliseIva(Kerbal kerbal)
{
Expand Down
6 changes: 3 additions & 3 deletions Sources/Properties/AssemblyInfo.cs
Expand Up @@ -5,9 +5,9 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TextureReplacer")]
[assembly: AssemblyCopyright("© 2013-2017 Davorin Učakar, Ryan Bray, RangeMachine")]
[assembly: AssemblyCopyright("© 2013-2018 Davorin Učakar, Ryan Bray, RangeMachine")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("2.6.0.0")]
[assembly: AssemblyVersion("2.7.0.0")]

[assembly: KSPAssembly("Texture Replacer", 2, 6)]
[assembly: KSPAssembly("Texture Replacer", 2, 7)]
4 changes: 2 additions & 2 deletions Sources/Reflections.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -309,7 +309,7 @@ public void setReflectionType(Type type)
material.shader = enableStatic ? visorShader : transparentSpecularShader;

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

Expand Down
8 changes: 7 additions & 1 deletion Sources/Replacer.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -58,6 +58,9 @@ private void replaceTextures()
{
foreach (Material material in Resources.FindObjectsOfTypeAll<Material>())
{
if (!material.HasProperty("_MainTex"))
continue;

Texture texture = material.mainTexture;

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

if (!material.HasProperty(Util.BUMPMAP_PROPERTY))
continue;

Texture normalMap = material.GetTexture(Util.BUMPMAP_PROPERTY);
if (normalMap == null)
continue;
Expand Down
2 changes: 1 addition & 1 deletion Sources/TRActivator.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/TRGui.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/TRReflection.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/TRScenario.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/TextureReplacer.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/Util.cs
@@ -1,5 +1,5 @@
/*
* Copyright © 2013-2016 Davorin Učakar, RangeMachine
* Copyright © 2013-2018 Davorin Učakar, RangeMachine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down
4 changes: 2 additions & 2 deletions Unity/Assets/Scenes.meta → Unity/Assets/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Expand Up @@ -24,6 +24,10 @@ public class BuildShaders
[MenuItem("TextureReplacer/Build Shaders")]
private static void BuildForAllPlatforms()
{
// Check directory
if (!Directory.Exists("Bundles"))
Directory.CreateDirectory("Bundles");

// Cleanup
File.Delete("Bundles/DirectX.bundle");
File.Delete("Bundles/OpenGL.bundle");
Expand Down
File renamed without changes.
Binary file removed Unity/Assets/Scenes/Shaders.unity
Binary file not shown.
8 changes: 0 additions & 8 deletions Unity/Assets/Scenes/Shaders.unity.meta

This file was deleted.

Binary file modified Unity/ProjectSettings/GraphicsSettings.asset
Binary file not shown.
Binary file modified Unity/ProjectSettings/ProjectSettings.asset
Binary file not shown.
3 changes: 1 addition & 2 deletions Unity/ProjectSettings/ProjectVersion.txt
@@ -1,2 +1 @@
m_EditorVersion: 5.4.1f1
m_StandardAssetsVersion: 0
m_EditorVersion: 2017.1.3f1

0 comments on commit ea87951

Please sign in to comment.