Skip to content

Commit

Permalink
Merge pull request #203 from net-lisias-kspu/pullrequests/upstream/20…
Browse files Browse the repository at this point in the history
…18-1016

Pullrequests/upstream/2018-1016
  • Loading branch information
BobPalmer authored Oct 20, 2018
2 parents 07d91f5 + d0ea141 commit 15e5a85
Show file tree
Hide file tree
Showing 36 changed files with 438 additions and 104 deletions.
5 changes: 5 additions & 0 deletions Firespitter/Firespitter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@
<Compile Include="wheel\FSwheelAlignment.cs" />
<Compile Include="wheel\WheelClass.cs" />
<Compile Include="wheel\WheelList.cs" />
<None Include="util\shaders\Nightvision.shader" />
<None Include="util\shaders\Unlit_Texture.shader" />
</ItemGroup>
<ItemGroup>
<None Include="Documentation.txt" />
</ItemGroup>
<ItemGroup>
<Folder Include="util\shaders\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
Expand Down
44 changes: 4 additions & 40 deletions Firespitter/cockpit/FScameraToTV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,11 @@ public class FScameraToTV : InternalModule
//Vector3 originalPosition = new Vector3();
Quaternion originalRotation = new Quaternion();

public static Material normal = new Material(
"Shader \"Unlit/Texture\" {" +
" Properties {" +
" _MainTex (\"MainTex\", 2D) = \"black\" {}" +
" }" +
" SubShader {" +
" Tags { \"RenderType\"=\"Opaque\" }" +
" LOD 100" +
" Pass {" +
" Lighting Off" +
" SetTexture [_MainTex] { combine texture }" +
" }" +
" }" +
"}"
);
// TODO: Compiler este Shader e usá-lo corretamente
public static Material normal = new Material(Shader.Find("Unlit/Texture") ?? Shader.Find("Standard"));

public static Material nightVision = new Material(
"Shader \"Nightvision\" {" +
" Properties {" +
" _MainTex (\"MainTex\", 2D) = \"white\" {}" +
" }" +
" SubShader {" +
//" Tags { \"RenderType\"=\"Opaque\" }"+ works
//" Tags { \"RenderType\"=\"Opaque\" }" +
//" Tags { \"LightMode\"=\"PixelOrNone\" }" + no
" Pass {" +
" Blend SrcColor DstColor" +
" SetTexture [_MainTex] {" +
" constantColor (0.5,0.7,0.5,0.5)" +
" combine constant + texture" +
" }" +
" }" +
" Pass {" +
" Blend SrcColor DstColor" +
" SetTexture [_MainTex] {" +
" combine texture * previous" +
" }" +
" }" +
" }" +
"} "
);
// TODO: Compiler este Shader e usá-lo corretamente
public static Material nightVision = new Material(Shader.Find("Nightvision") ?? Shader.Find("Standard"));

public void Start()
{
Expand Down
47 changes: 21 additions & 26 deletions Firespitter/control/FSmoveCraftAtLaunch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public class FSmoveCraftAtLaunch : PartModule
// Beach by Island: lat -1.53556797173857, long 287.956960620886, alt 1.56112247915007

[KSPField(isPersistant = true, guiActiveEditor=true)]
public float latitude = -0.039751f;
public float latitude = 0;
[KSPField(isPersistant = true, guiActiveEditor = true)]
public float longitude = 285.639486f;
public float longitude = 0;
[KSPField(isPersistant = true, guiActiveEditor = true)]
public float altitude = 1.6f;
public float altitude = 0;
[KSPField(isPersistant = true, guiActiveEditor = true), UI_FloatRange(minValue = -50f, maxValue = 50f, stepIncrement = 1f)]
public float altitudeShift = 0f;

Expand All @@ -51,6 +51,7 @@ public class FSmoveCraftAtLaunch : PartModule
PopupElement fileNameElement;
private string[] files;
private int selectedPositionNumber = -1;
private bool isDefaultPosition = false;
//public FSGUIPopup popup;
//private Transform boundsTransform;
//private Transform partPosition;
Expand Down Expand Up @@ -82,13 +83,14 @@ public void nextPositionEvent()
selectedPositionNumber++;
if (selectedPositionNumber > files.Length - 1)
selectedPositionNumber = -1;
if (selectedPositionNumber == -1)
this.isDefaultPosition = -1 == this.selectedPositionNumber;
if (this.isDefaultPosition)
{
selectedPositionName = string.Empty;
positionDisplayName = "Default";
latitude = -0.048589f;
longitude = 285.27609f;
altitude = 71.966535f;
this.latitude = 0;
this.longitude = 0;
this.altitude = 0;
}
else
{
Expand Down Expand Up @@ -179,16 +181,15 @@ public Vector3d calculateLaunchPosition()

public void tryMoveVessel()
{
if (vessel != null)
{
//Debug.Log("FSmoveCAL: moving vessel to: " + launchPosition);
vessel.SetPosition(calculateLaunchPosition(), true);
if (!vessel.GetComponent<Rigidbody>().isKinematic)
{
vessel.GetComponent<Rigidbody>().velocity = Vector3.zero;
vessel.GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
}
}
if (null == vessel) return;

//Debug.Log("FSmoveCAL: moving vessel to: " + this.positionDisplayName);
vessel.SetPosition(calculateLaunchPosition(), true);
if (!vessel.GetComponent<Rigidbody>().isKinematic)
{
vessel.GetComponent<Rigidbody>().velocity = Vector3.zero;
vessel.GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
}
}

public void fixCraftLock()
Expand All @@ -207,13 +208,10 @@ public void fixCraftLock()

public void Update() //TODO, check if this is the active vessel
{
if (this.hasLaunched) return;
if (this.isDefaultPosition) return;
if (!HighLogic.LoadedSceneIsFlight || !vessel.isActiveVessel) return;
if (selectedPositionName == string.Empty) return;




if (!hasLaunched)
{
//Debug.Log("FSmoveCraftAtLaunch: Launching vessel at " + positionDisplayName + ", lat " + latitude + ", long " + longitude + ", alt " + altitude);
// --------- TEMP DISABLING ----------
Expand All @@ -232,11 +230,8 @@ public void fixCraftLock()
{
timer -= Time.deltaTime;
tryMoveVessel();
//moveBounds();
}

}
}

}

public void OnGUI()
Expand Down
25 changes: 21 additions & 4 deletions Firespitter/engine/FS engine modules/FSengine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,8 @@ public override void OnStart(PartModule.StartState state)
{
getThrottleDelegate = getThrottle;
debug = new info.FSdebugMessages(debugMode, "FSengine");
//part.stackIcon.SetIcon(DefaultIcons.LIQUID_ENGINE);
part.stagingIcon = "LIQUID_ENGINE";
thrustTransforms = part.FindModelTransforms(thrustTransformName);

this.PopulateModelTransforms();

velocityCurve = Firespitter.Tools.stringToFloatCurve(velocityLimit);
atmosphericThrustCurve = Firespitter.Tools.stringToFloatCurve(atmosphericThrust);
Expand All @@ -276,8 +275,26 @@ public override void OnStart(PartModule.StartState state)
fillResourceList(resources);
}

private void PopulateModelTransforms()
{
//part.stackIcon.SetIcon(DefaultIcons.LIQUID_ENGINE);
part.stagingIcon = "LIQUID_ENGINE";
thrustTransforms = part.FindModelTransforms(thrustTransformName);
}

public virtual void FixedUpdate()
{
{
try
{
this.HandleFixedUpdate();
}
catch (NullReferenceException e)
{
this.PopulateModelTransforms();
}
}
private void HandleFixedUpdate()
{
if (!HighLogic.LoadedSceneIsFlight) return;

calculateFinalThrust();
Expand Down
23 changes: 23 additions & 0 deletions Firespitter/util/shaders/Nightvision.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Shader "Nightvision" {
Properties {
_MainTex ("MainTex", 2D) = "white" {}
}
SubShader {
// Tags { "RenderType"="Opaque" } -- works
Tags { "RenderType"="Opaque" }
// Tags { "LightMode"="PixelOrNone" } -- no
Pass {
Blend SrcColor DstColor
SetTexture [_MainTex] {
constantColor (0.5,0.7,0.5,0.5)" +
combine constant + texture
}
}
Pass {
Blend SrcColor DstColor
SetTexture [_MainTex] {
combine texture * previous
}
}
}
}
13 changes: 13 additions & 0 deletions Firespitter/util/shaders/Unlit_Texture.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Shader "Unlit/Texture" {
Properties {
_MainTex ("MainTex", 2D) = "black" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 100
Pass {
Lighting Off
SetTexture [_MainTex] { combine texture }
}
}
}
17 changes: 6 additions & 11 deletions Firespitter/wheel/FSwheelAlignment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,17 @@ public override void OnStart(PartModule.StartState state)
createTextures();

Debug.Log("create guideLine");

guideLine = part.gameObject.GetComponent<LineRenderer>();
if (guideLine == null)
guideLine = part.gameObject.AddComponent<LineRenderer>();
guideLine = part.gameObject.GetComponent<LineRenderer>() ?? part.gameObject.AddComponent<LineRenderer>();
guideLine.SetWidth(0.02f, 0.02f);
guideLine.material = new Material(Shader.Find("Unlit/Texture"));
guideLine.material.SetTexture("_MainTex", guideLineTex);
// TODO: A way to ressurrect lost Shaders.
guideLine.material = new Material(Shader.Find("Unlit/Texture") ?? Shader.Find("Standard"));
guideLine.material.SetTexture("_MainTex", guideLineTex);
guideLine.SetVertexCount(14);

Debug.Log("create wheelLine");

wheelLine = wheel.GetComponent<LineRenderer>();
if (wheelLine == null)
wheelLine = wheel.AddComponent<LineRenderer>();
wheelLine = wheel.GetComponent<LineRenderer>() ?? wheel.AddComponent<LineRenderer>();
wheelLine.SetWidth(0.02f, 0.02f);
wheelLine.material = new Material(Shader.Find("Unlit/Texture"));
wheelLine.material = new Material(Shader.Find("Unlit/Texture") ?? Shader.Find("Standard"));
wheelLine.material.SetTexture("_MainTex", wheelLineTex);
wheelLine.SetVertexCount(4);

Expand Down
121 changes: 121 additions & 0 deletions For release/Firespitter/CHANGE_LOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Firespitter :: Change Log

* 2018-0801 : 7.9.0.1 (Lisias) Unofficial
+ Moving PluginData back to <KSP_ROOT> where it belongs
+ Converting some WAV files from ADPCM to PCM, as Unity doesn't support this format.
+ Ressurecting the FSMoveCraftAtLaunch module (and the respective part, fsmovecraftgadget/FS3WL Water Launch System). #hurray :)
+ Dirty hack to prevent Null Pointer Exceptions on FSEngine at craft destroy or recovering.
+ Parts fixed (needs rebalancing however, IMHO):
- FSstrutConnectorWire/FS4SW Biplane wire strut connector (Legacy)
- FSstrutConnectorWood/FS4SD Biplane wooden beam connector(legacy)
- FSdropTank/FS3FD Fuel Drop Tank
+ Temporary hack to allow the plugin to work while I try to solve an issue with custom/missing shaders
* 2018-0326 7.9.0 (BobPalmer) for KSP 1.4.1
+ v7.9.0
+ KSP 1.4.1
* 2017-0528 7.6.0 (BobPalmer) for KSP 1.3
+ Merge pull request #185 from snjo/DEVELOP
+ Merge pull request #184 from snjo/master
* 2017-0105 7.5.1 (BobPalmer) for KSP 1.2.2
+ Added a screen message when EVA repainting
* 2016-1217 7.5.0 (BobPalmer) for KSP 1.2.2
+ No changelog provided
* 2016-1107 7.4.2 (BobPalmer) for KSP 1.2.1
+ Compile update, and some new options for ModuleAnimateGeneric from linuxgurugamer
* 2016-0911 7.4.1 (BobPalmer) for KSP 1.2
+ Recompile for KSP 1.2
+ Fixed biplane hatch
+ Converted textures to DDS
* 2016-0911 7.4.0 (BobPalmer) for KSP 1.2 PRE
+ Modder Preview - DLL Update
* 2016-0712 7.3.0 (BobPalmer) for KSP 1.1.3
+ Re-versioning
* 2016-0628 7.3 (BobPalmer) for KSP 1.1.3
+ Compatibility Update for KSP 1.1.3
* 2016-0514 7.2.4 (BobPalmer) for KSP 1.1.2
+ New biplane model and textures, old parts moved to legacy.
* 2016-0430 7.2.3 (BobPalmer) for KSP 1.1.2
+ Recompile for 1.1.2
* 2016-0416: 7.2.1 (BobPalmer) for KSP 1.1 (PRE)
+ Minor update to FuelSwitch for 1.1 compatibility
* 2016-0402: 7.2.0 (BobPalmer) for KSP 1.1 (PRE)
+ Merge pull request #143 from snjo/DEVELOP
+ Updates for KSP 1.1
* 2015-1109: 7.1.5 (BobPalmer) for KSP 1.0.5
+ This is a preliminary compatibility release for KSP 1.0.5 - please be sure to report any bugs/etc. in the forum thread.
+ Also includes a large number of config fixes fro Ruedii and khr15714n!
* 2015-0624: 7.1.4 (BobPalmer) for KSP 1.0.4
+ Version compatibility update. Also included a separate ZIP for plugin only.
+ Note that this is just a patch to change version checking to 1.0.4, I've not encountered any breaking changes, but as always, balance will need to be reviewed.
* 2015-0516: 7.1.3 (BobPalmer) for KSP 1.0.2
+ Wing and control surface fixes
* 2015-0511: 7.1.2 (BobPalmer) for KSP 1.0.2
+ Engine updates - should prevent propellers from blowing your wings off and taking them to space.
* 2015-0505: 7.1.1 (BobPalmer) for KSP 1.0.2
+ Fixed issues with various attachment nodes
* 2015-0504: 7.1 (BobPalmer) for KSP 1.0.2
+ KSP 1.0.2 Compatibility
+ (see 7.0.PRE2 below for additional notes)
* 2014-0901: 6.3.5 (snjo) for KSP 0.24.2
+ Plugin update for compatibility with various mods like B9
+ Some minor fixes to prices in cfg
+ Removed unneeded pngs, and optimized others.
* 2014-0714: 6.3.4 (snjo) for KSP 0.24.2
+ KSP 0.24.2 Compatibility
+ Module cost configurable in FSfuelSwitch
* 2014-0718: 6.3.3 (snjo) for KSP 0.24
+ KSP 0.24 Compatibility.
+ Lots of plugin features for upcoming version 7, and features used in other mods like B9
* 2014-0718: 7 Plugin (snjo) for KSP 0.23.5
+ v7plugin0.23.5
+ updated dll
* 2014-0619: 7.0 PRE2 (snjo) for KSP 0.23.5
+ Some parts moved to the Firespitter Legacy Parts Pack. Download that to keep using existing craft files.
+ Tweakable engines! Adjust the number of propeller blades, their length, and the engine size in the hangar!
+ Updated helicopter engine and tail rotors/fenestrons using aerodynamic blade lift, and a much improved hover code.
+ Modular fuel tanks. A single part with alternate texutres and fuel tanks. Toggle through the choices in the hangar. (oblong multi-tank and fuel drop tank)
+ Wheel alignment guides end the scourge of crooked gear placement. Press F2 to toggle guide lines.
+ New tail boom model added to the old tail boom (Switch model in hangar) (WIP, untextured)
+ A new engine module that supports atmospheric engines much better, separates engine start up time from throttle response, and allows for electric engines without the extra FScoolant resource.
+ Apache cockpit monitors are off by default to reduce lag. Click a button to turn them on.
+ Helicopter engines display a guide arrow to assist in putting them on the right way.
+ New texture switch, mesh switch and fuel tank switch modules allows for many varieties in a single part
+ Added optional Part Catalog icon from Kwirkilee
+ Added visual brake response to flight control pedals
+ Various bug fixes
* 2014-0531: 6.4 PRE1 (snjo) for KSP 0.23.5
+ Some parts moved to the Firespitter Legacy Parts Pack (not yet packaged)
+ Tweakable engines! Adjust the number of propeller blades, their length, and the engine size in the hangar!
+ New helicopter main rotor using aerodynamic lift on the blades and particle ground FX (currently constantly on)
+ Electric propeller and electric heli engine are using the new engine module, which trades some silly throttle bugs for new and exciting bugs
+ Modular fuel tanks. A single part with alternate texutres and fuel tanks. Toggle through the choices in the hangar. (oblong multi-tank and fuel drop tank)
+ Wheel alignment guides end the scourge of crooked gear placement. Press F2 to toggle guide lines.
+ A new engine module that supports atmospheric engines much better, separates engine start up time from throttle response, and allows for electric engines without the extra FScoolant resource.
+ Apache cockpit monitors are off by default to reduce lag. Click a button to turn them on.
+ Helicopter engines display a guide arrow to assist in putting them on the right way.
+ New texture switch, mesh switch and fuel tank switch modules allows for many varieties in a single part. Added normal-map-only support to tex switch.

WARNING: Note that some parts are still WIP, including some that have replaced parts moved to legacy. This release is not part complete, and should only be used by the very curious
* 2014-0531: Legacy Parts (snjo) for KSP 0.23.5
+ legacy
+ removed old craft
* 2014-0530: 6.3.1 (snjo) for KSP 0.23.5
+ Wheel alignment guides end the scourge of crooked gear placement. Press F2 to toggle guide lines.
* 2014-0522: Final 6.4 PRE1 (snjo) for KSP 0.23.5
+ Tweakable engines! Adjust the number of propeller blades, their length, and the engine size in the hangar!
+ Wheel alignment guides end the scourge of crooked gear placement. Press F2 to toggle guide lines.
+ A new engine module that supports atmospheric engines much better, separates engine start up time from throttle response, and allows for electric engines without the extra FScoolant resource.
* 2014-0506: Final 6.3 (snjo) for KSP 0.23.5
+ Oblong round noses, short and long
+ Oblong to 0.625m adapter
+ Helicopter landing pads by Justin Kerbice
+ Warning message on the Main Menu if you are using an incompatible KSP version
+ W.I.P. turboprop engine. This will see changes to performance, sound and looks
+ FSengineSounds: Implemented disengage, running, flameout sounds, fixed bugs.
+ FSwing: Made leading edge action name cfg editable for use in extending flaps etc.
+ FSwheel: supports altering retract animation speed in cfg
+ FSslowtato: key/action group based rotator module
+ FSmeshSwitch: swap meshes instead of textures for better memory conservation
* 2014-0406: Final 6.2 (snjo) for KSP 0.23.5
+ v6.2 is compiled for KSP v0.23.5 (The ARM mission pack)

Loading

0 comments on commit 15e5a85

Please sign in to comment.