Skip to content

Commit

Permalink
Merge pull request #1 from tjakubo2/master
Browse files Browse the repository at this point in the history
Bugfix, smooth tracking, manual direction adjust playing nice
  • Loading branch information
linuxgurugamer committed Jan 25, 2022
2 parents 2d5bada + 46f4e99 commit 2a12097
Show file tree
Hide file tree
Showing 8 changed files with 247 additions and 272 deletions.
6 changes: 6 additions & 0 deletions Changelog.txt
@@ -1,5 +1,11 @@
Changelog

0.2.2.3
Tracking is now smooth with an andjustable speed slider
Replaced manual direction controls with simple pitch/yaw sliders
Added a toggle to either return to "resting" position or keep orientation when target is lost
Fixed color not properly restoring after loading a save

0.0.2.2
Added AssemblyFileVersion
Updated version file for 1.12
Expand Down
27 changes: 1 addition & 26 deletions GameData/TrackingLights/Parts/LaunchPadLamp/LaunchPadLamp.cfg
Expand Up @@ -26,7 +26,7 @@ PART
PhysicsSignificance = 1
bulkheadProfiles = srf,size1

tags = moar (more bulb candle dark flash (lamp (light shine spot torch
tags = light lamp spot track follow bulb shine torch

MODULE
{
Expand All @@ -39,31 +39,6 @@ PART
animationName = emissive
useResources = true
}

MODULE
{
name = ModuleAnimateGeneric
animationName = lamptilt
startEventGUIName = Tilt Up
endEventGUIName = Tilt down
actionGUIName = Toggle Tilt
allowDeployLimit = true /// the lines below this allow positioning of the lamp
revClampDirection = false
revClampSpeed = true
revClampPercent = true
}
MODULE
{
name = ModuleAnimateGeneric
animationName = lamprotate
startEventGUIName = Turn Clockwise
endEventGUIName = Turn AntiClock
actionGUIName = Toggle Turn
allowDeployLimit = true /// the lines below this allow positioning of the lamp
revClampDirection = false
revClampSpeed = true
revClampPercent = true
}
MODULE
{
name = ModuleLightTracker
Expand Down
26 changes: 1 addition & 25 deletions GameData/TrackingLights/Parts/MTS/MTS.cfg
Expand Up @@ -24,7 +24,7 @@ PART
maxTemp = 2000 // = 3200
PhysicsSignificance = 1
bulkheadProfiles = srf
tags = track moar (more bulb candle dark flash (lamp (light shine spot torch
tags = light lamp spot track follow bulb shine torch

MODULE
{
Expand All @@ -38,30 +38,6 @@ PART
useResources = true
}
MODULE
{
name = ModuleAnimateGeneric
animationName = lamptilt
startEventGUIName = Tilt Up
endEventGUIName = Tilt down
actionGUIName = Toggle Tilt
allowDeployLimit = true /// the lines below this allow positioning of the lamp
revClampDirection = false
revClampSpeed = true
revClampPercent = true
}
MODULE
{
name = ModuleAnimateGeneric
animationName = lamprotate
startEventGUIName = Turn Clockwise
endEventGUIName = Turn AntiClock
actionGUIName = Toggle Turn
allowDeployLimit = true /// the lines below this allow positioning of the lamp
revClampDirection = false
revClampSpeed = true
revClampPercent = true
}
MODULE
{
name = ModuleLightTracker
}
Expand Down
27 changes: 1 addition & 26 deletions Gamedata/TrackingLights/Parts/LaunchPadLamp/LaunchPadLamp.cfg
Expand Up @@ -26,7 +26,7 @@ PART
PhysicsSignificance = 1
bulkheadProfiles = srf,size1

tags = moar (more bulb candle dark flash (lamp (light shine spot torch
tags = light lamp spot track follow bulb shine torch

MODULE
{
Expand All @@ -39,31 +39,6 @@ PART
animationName = emissive
useResources = true
}

MODULE
{
name = ModuleAnimateGeneric
animationName = lamptilt
startEventGUIName = Tilt Up
endEventGUIName = Tilt down
actionGUIName = Toggle Tilt
allowDeployLimit = true /// the lines below this allow positioning of the lamp
revClampDirection = false
revClampSpeed = true
revClampPercent = true
}
MODULE
{
name = ModuleAnimateGeneric
animationName = lamprotate
startEventGUIName = Turn Clockwise
endEventGUIName = Turn AntiClock
actionGUIName = Toggle Turn
allowDeployLimit = true /// the lines below this allow positioning of the lamp
revClampDirection = false
revClampSpeed = true
revClampPercent = true
}
MODULE
{
name = ModuleLightTracker
Expand Down
26 changes: 1 addition & 25 deletions Gamedata/TrackingLights/Parts/MTS/MTS.cfg
Expand Up @@ -24,7 +24,7 @@ PART
maxTemp = 2000 // = 3200
PhysicsSignificance = 1
bulkheadProfiles = srf
tags = track moar (more bulb candle dark flash (lamp (light shine spot torch
tags = light lamp spot track follow bulb shine torch

MODULE
{
Expand All @@ -38,30 +38,6 @@ PART
useResources = true
}
MODULE
{
name = ModuleAnimateGeneric
animationName = lamptilt
startEventGUIName = Tilt Up
endEventGUIName = Tilt down
actionGUIName = Toggle Tilt
allowDeployLimit = true /// the lines below this allow positioning of the lamp
revClampDirection = false
revClampSpeed = true
revClampPercent = true
}
MODULE
{
name = ModuleAnimateGeneric
animationName = lamprotate
startEventGUIName = Turn Clockwise
endEventGUIName = Turn AntiClock
actionGUIName = Toggle Turn
allowDeployLimit = true /// the lines below this allow positioning of the lamp
revClampDirection = false
revClampSpeed = true
revClampPercent = true
}
MODULE
{
name = ModuleLightTracker
}
Expand Down
34 changes: 34 additions & 0 deletions LightTracker/Helpers.cs
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LightTracker
{
public static class Extensions
{
public static T Next<T>(this T value) where T : struct
{
if (!typeof(T).IsEnum)
throw new ArgumentException($"Argument {typeof(T).FullName} is not an Enum");

var enumValues = value.GetType().GetEnumValues();

var nextIndex = Array.IndexOf(enumValues, value) + 1;
if (nextIndex >= enumValues.Length)
nextIndex = 0;

return (T) enumValues.GetValue(nextIndex);
}
}
}

namespace LightTracker.Attributes
{
// Attrib for props that require an update to underlying Unity light
class LightPropertyAttribute : Attribute
{
public LightPropertyAttribute() { }
}
}
1 change: 1 addition & 0 deletions LightTracker/LightTracker.csproj
Expand Up @@ -55,6 +55,7 @@
<Compile Include="InstallChecker.cs" />
<Compile Include="ModuleLightTracker.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Helpers.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="AssemblyVersion.tt">
Expand Down

0 comments on commit 2a12097

Please sign in to comment.