Skip to content

Commit

Permalink
Merge pull request #658 from MOARdV/master
Browse files Browse the repository at this point in the history
RPM v0.30.0 for KSP 1.4.1
  • Loading branch information
MOARdV authored Mar 14, 2018
2 parents c112a4f + 6dd6c1f commit 2a0c6a0
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 139 deletions.
2 changes: 2 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Did you install using CKAN? I do not support CKAN installations. It has incorr

If that doesn't work, I strongly recommend you look at the [KSP forum post](http://forum.kerbalspaceprogram.com/index.php?/topic/83212-how-to-get-support-read-first/) on getting support for mods.

Did you install Module Manager? Module Manager is required, but it is not included.

### What about CKAN?

Due to problems I have had with incorrect CKAN configurations, I do not support CKAN installations. When KerbalStuff was around, it had an option to update CKAN automatically when I posted a new version, but that is the limit of my involvement with CKAN.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@ PROP
flashingDelay = 0.3
threshold = 0.5,1.1
}
}
}

8 changes: 4 additions & 4 deletions GameData/JSI/RasterPropMonitor/RasterPropMonitor.version
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
"DOWNLOAD": "https://github.com/Mihara/RasterPropMonitor/releases",
"VERSION": {
"MAJOR": 0,
"MINOR": 29,
"PATCH": 3
"MINOR": 30,
"PATCH": 0
},
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 3,
"MINOR": 4,
"PATCH": 1
},
"KSP_VERSION_MIN":
{
"MAJOR": 1,
"MINOR": 3,
"MINOR": 4,
"PATCH": 0
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ following prop packs to make something exceptional:
* [ASET Avionics](forum.kerbalspaceprogram.com/index.php?/topic/116479-ivaprops-aset-avionics-pack-v-10-for-the-modders-who-create-ivaã¢â‚¬â„¢s/) - primarily aircraft-oriented props.
* [ASET Props](forum.kerbalspaceprogram.com/index.php?/topic/116430-ivaprops-aset-props-pack-v13-for-the-modders-who-create-ivaã¢â‚¬â„¢s/) - a mix of spacecraft and spaceplane props, including several MFD designs as well as some classic NASA-style analog gauges.

**NOTE 2:** As of 28 May 2016, the ASET props and avionics packs *are* being updated. Until alexustas is ready to release them, there are links in the ASET Props thread to the current edition of those props packs.

## LINKS

See [the forum support thread](http://forum.kerbalspaceprogram.com/index.php?/topic/105821-105-rasterpropmonitor-still-putting-the-a-in-iva-v0240-10-november-2015/) for support.
Expand All @@ -106,7 +104,7 @@ Source code and full license information available at

## LICENSES

RasterPropMonitor plugin (C) 2013-2016 Mihara, MOARdV, and other contributors.
RasterPropMonitor plugin (C) 2013-2018 Mihara, MOARdV, and other contributors.

Code and shaders are licensed under GPLv3. You should have received a copy of this license
in this distribution package.
Expand Down
2 changes: 1 addition & 1 deletion RasterPropMonitor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,6 @@ Global
$36.inheritsSet = Mono
$36.inheritsScope = text/plain
$36.scope = text/plain
version = 0.29.3
version = 0.30.0
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ private void CreateLightCone()
lightConeRenderer = lightCone.AddComponent<LineRenderer>();
lightConeRenderer.useWorldSpace = true;
lightConeRenderer.material = lightConeMaterial;
lightConeRenderer.SetWidth(0.054f, endSpan);
lightConeRenderer.SetVertexCount(2);
lightConeRenderer.startWidth = 0.054f;
lightConeRenderer.endWidth=endSpan;
lightConeRenderer.positionCount =2;
lightConeRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
lightConeRenderer.receiveShadows = false;
lightConeRenderer.SetPosition(0, Vector3.zero);
Expand All @@ -200,7 +201,8 @@ private void ColorizeLightCone()
if (lightConeRenderer != null)
{
var newStart = Color32.Lerp(new Color32(0, 0, 255, 178), new Color32(255, 0, 0, 178), 1f / (maximum) * (current - 1));
lightConeRenderer.SetColors(newStart, new Color32(newStart.r, newStart.g, newStart.b, 0));
lightConeRenderer.startColor = newStart;
lightConeRenderer.endColor = new Color32(newStart.r, newStart.g, newStart.b, 0);
}
}

Expand Down
2 changes: 0 additions & 2 deletions RasterPropMonitor/Core/JSITextMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@ private void GenerateRichText()
meshFilter_.mesh.uv = uv;
meshFilter_.mesh.triangles = triangles;
meshFilter_.mesh.RecalculateNormals();
meshFilter_.mesh.Optimize();
// Can't hide mesh with (true), or we can't edit colors later.
meshFilter_.mesh.UploadMeshData(false);
}
Expand Down Expand Up @@ -782,7 +781,6 @@ private void GenerateText()
meshFilter_.mesh.uv = uv;
meshFilter_.mesh.triangles = triangles;
meshFilter_.mesh.RecalculateNormals();
meshFilter_.mesh.Optimize();
// Can't hide mesh with (true), or we can't edit colors later.
meshFilter_.mesh.UploadMeshData(false);
}
Expand Down
108 changes: 0 additions & 108 deletions RasterPropMonitor/Core/MonitorPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public bool IsActive
private enum BackgroundType
{
None,
Camera,
Texture,
Handler,
};
Expand All @@ -72,30 +71,19 @@ private enum BackgroundType
private readonly Texture2D overlayTexture, interlayTexture;
public readonly Color defaultColor;
private readonly BackgroundType background = BackgroundType.None;
private readonly float cameraFOV;
private readonly string camera;
private readonly FlyingCamera cameraObject;
private const float defaultFOV = 60f;
private readonly Texture2D backgroundTexture;
private readonly Func<int, int, string> pageHandlerMethod;
private readonly Func<RenderTexture, float, bool> backgroundHandlerMethod;
private readonly HandlerSupportMethods pageHandlerS, backgroundHandlerS;
private readonly RasterPropMonitor ourMonitor;
private readonly int screenWidth, screenHeight;
private readonly float cameraAspect;
private readonly int zoomUpButton, zoomDownButton;
private readonly float maxFOV, minFOV;
private readonly int zoomSteps;
private readonly float zoomSkip;
private int currentZoom;
private readonly bool showNoSignal;
private readonly bool simpleLockingPage;
private readonly List<string> disableSwitchingTo = new List<string>();
private readonly DefaultableDictionary<string, string> redirectPages = new DefaultableDictionary<string, string>(string.Empty);
private readonly DefaultableDictionary<int, int?> redirectGlobals = new DefaultableDictionary<int, int?>(null);
private readonly MonoBehaviour backgroundHandlerModule, pageHandlerModule;
private readonly float cameraFlickerChance;
private readonly int cameraFlickerRange;
private readonly List<string> techsRequired = new List<string>();
private readonly string fallbackPageName = string.Empty;

Expand Down Expand Up @@ -199,7 +187,6 @@ public MonitorPage(int idNum, ConfigNode node, RasterPropMonitor thatMonitor)
screenWidth = ourMonitor.screenWidth;
screenHeight = ourMonitor.screenHeight;
cameraAspect = ourMonitor.cameraAspect;
cameraObject = thatMonitor.cameraStructure;
defaultColor = ourMonitor.defaultFontTintValue;
screenXMin = 0;
screenYMin = 0;
Expand Down Expand Up @@ -384,46 +371,6 @@ public MonitorPage(int idNum, ConfigNode node, RasterPropMonitor thatMonitor)
}
}

if (background == BackgroundType.None)
{
if (node.HasValue("cameraTransform"))
{
JUtil.LogInfo(this, "WARNING: 'cameraTransform' in a PAGE node is deprecated, and the functionality will be removed in a future RPM release. Please use a JSISteerableCamera background handler instead.");
isMutable = true;
background = BackgroundType.Camera;
camera = node.GetValue("cameraTransform");
cameraFOV = defaultFOV;

cameraFlickerChance = node.GetFloat("flickerChance") ?? 0;
cameraFlickerRange = node.GetInt("flickerRange") ?? 0;

if (node.HasValue("fov"))
{
float fov;
cameraFOV = float.TryParse(node.GetValue("fov"), out fov) ? fov : defaultFOV;
}
else if (node.HasValue("zoomFov") && node.HasValue("zoomButtons"))
{
Vector3 zoomFov = ConfigNode.ParseVector3(node.GetValue("zoomFov"));
Vector2 zoomButtons = ConfigNode.ParseVector2(node.GetValue("zoomButtons"));
if ((int)zoomFov.z != 0 && ((int)zoomButtons.x != (int)zoomButtons.y))
{
maxFOV = Math.Max(zoomFov.x, zoomFov.y);
minFOV = Math.Min(zoomFov.x, zoomFov.y);
zoomSteps = (int)zoomFov.z;
zoomUpButton = (int)zoomButtons.x;
zoomDownButton = (int)zoomButtons.y;
zoomSkip = (maxFOV - minFOV) / zoomSteps;
currentZoom = 0;
cameraFOV = maxFOV;
}
else
{
JUtil.LogMessage(ourMonitor, "Ignored invalid camera zoom settings on page {0}.", pageNumber);
}
}
}
}
if (background == BackgroundType.None)
{
if (node.HasValue("textureURL"))
Expand Down Expand Up @@ -634,25 +581,9 @@ private static MethodInfo InstantiateHandler(ConfigNode node, RasterPropMonitor
return null;
}

private float ComputeFOV()
{
if (zoomSteps == 0)
{
return cameraFOV;
}
else
{
return maxFOV - zoomSkip * currentZoom;
}
}

public void Active(bool state)
{
isActive = state;
if (state)
{
cameraObject.PointCamera(camera, ComputeFOV());
}
if (pageHandlerS.activate != null)
{
pageHandlerS.activate(state, pageNumber);
Expand All @@ -661,14 +592,6 @@ public void Active(bool state)
{
backgroundHandlerS.activate(state, pageNumber);
}
if (cameraFlickerChance > 0)
{
cameraObject.SetFlicker(cameraFlickerChance, cameraFlickerRange);
}
else
{
cameraObject.SetFlicker(0, 0);
}
}

public bool GlobalButtonClick(int buttonID)
Expand All @@ -689,27 +612,6 @@ public bool GlobalButtonClick(int buttonID)
backgroundHandlerS.buttonClick(buttonID);
actionTaken = true;
}
else if (zoomSteps > 0)
{
actionTaken = true;
if (buttonID == zoomUpButton)
{
currentZoom--;
}
if (buttonID == zoomDownButton)
{
currentZoom++;
}
if (currentZoom < 0)
{
currentZoom = 0;
}
if (currentZoom > zoomSteps)
{
currentZoom = zoomSteps;
}
cameraObject.FOV = ComputeFOV();
}
return actionTaken;
}

Expand Down Expand Up @@ -742,16 +644,6 @@ public void RenderBackground(RenderTexture screen)
case BackgroundType.None:
GL.Clear(true, true, ourMonitor.emptyColorValue);
break;
case BackgroundType.Camera:
GL.Clear(true, true, ourMonitor.emptyColorValue);
if (!cameraObject.Render(screen, 0.0f, 0.0f))
{
if (ourMonitor.noSignalTexture != null)
{
Graphics.DrawTexture(new Rect(0, 0, screen.width, screen.height), ourMonitor.noSignalTexture);
}
}
break;
case BackgroundType.Texture:
//call clear before redraw of textures
GL.Clear(true, true, ourMonitor.emptyColorValue);
Expand Down
5 changes: 0 additions & 5 deletions RasterPropMonitor/Core/RasterPropMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ public class RasterPropMonitor : InternalModule
public bool doScreenshots = true;
[KSPField]
public bool oneshot = false;
// This needs to be public so that pages can point it.
public FlyingCamera cameraStructure;
// Internal stuff.
private TextRenderer textRenderer;
private RenderTexture screenTexture;
Expand Down Expand Up @@ -188,9 +186,6 @@ public void Start()
noSignalTexture = GameDatabase.Instance.GetTexture(noSignalTextureURL.EnforceSlashes(), false);
}

// Create camera instance...
cameraStructure = new FlyingCamera(part, cameraAspect);

// The neat trick. IConfigNode doesn't work. No amount of kicking got it to work.
// Well, we don't need it. GameDatabase, gimme config nodes for all props!
foreach (ConfigNode node in GameDatabase.Instance.GetConfigNodes("PROP"))
Expand Down
3 changes: 0 additions & 3 deletions RasterPropMonitor/Core/TextRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ internal void Bake()
}

mesh.triangles = indices;

//mesh.RecalculateBounds();
mesh.Optimize();
}

internal void Clear()
Expand Down
24 changes: 15 additions & 9 deletions RasterPropMonitor/Core/UtilityFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ internal static GameObject CreateSimplePlane(string name, Vector2 vectorSize, Re
};

mesh.RecalculateBounds();
mesh.Optimize();

meshFilter.mesh = mesh;

Expand Down Expand Up @@ -1692,11 +1691,11 @@ private void LoadAssets()
String shaderAssetBundleName = "rasterpropmonitor";
if (Application.platform == RuntimePlatform.WindowsPlayer)
{
shaderAssetBundleName += "-win";
shaderAssetBundleName += "-windows";
}
else if (Application.platform == RuntimePlatform.LinuxPlayer)
{
shaderAssetBundleName += "-lin";
shaderAssetBundleName += "-linux";
}
else if (Application.platform == RuntimePlatform.OSXPlayer)
{
Expand Down Expand Up @@ -1998,16 +1997,23 @@ private IEnumerator LoadRasterPropMonitorValues()
if (colorConfig[defIdx].HasValue("name") && colorConfig[defIdx].HasValue("color"))
{
string name = "COLOR_" + (colorConfig[defIdx].GetValue("name").Trim());
Color32 color = ConfigNode.ParseColor32(colorConfig[defIdx].GetValue("color").Trim());
if (JUtil.globalColors.ContainsKey(name))
try
{
JUtil.globalColors[name] = color;
Color32 color = ConfigNode.ParseColor32(colorConfig[defIdx].GetValue("color").Trim());
if (JUtil.globalColors.ContainsKey(name))
{
JUtil.globalColors[name] = color;
}
else
{
JUtil.globalColors.Add(name, color);
}
JUtil.LogMessage(this, "I know {0} = {1}", name, color);
}
else
catch(Exception e)
{
JUtil.globalColors.Add(name, color);
JUtil.LogErrorMessage(this, "Error parsing color {0}: {1}", colorConfig[defIdx].GetValue("name").Trim(), e);
}
JUtil.LogMessage(this, "I know {0} = {1}", name, color);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
// Revision number is altered automatically.
[assembly: AssemblyVersion("0.29.3.*")]
[assembly: AssemblyVersion("0.30.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down

0 comments on commit 2a0c6a0

Please sign in to comment.