Skip to content

Commit

Permalink
Merge pull request #258 from DMagic1/dev
Browse files Browse the repository at this point in the history
Version 17.2
  • Loading branch information
DMagic1 authored Feb 22, 2017
2 parents ffe484a + 4f63f38 commit e812b34
Show file tree
Hide file tree
Showing 128 changed files with 5,845 additions and 3,609 deletions.
59 changes: 33 additions & 26 deletions SCANassets/Resources/SCANlocalization.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SCAN_Localization
settingsHelpStockToolbar = Use the stock toolbar.\nCan be used concurrently with the Blizzy78 Toolbar.
settingsHelpToolbarMenu = Use a pop-out menu for the stock toolbar to show all available windows.
settingsHelpMechJeb = The SCANsat zoom map target selection mode can be used to select a MechJeb landing site.
settingsHelpSlowMap = Enable this to reduce map generation speed.\nThis will save CPU resources and may reduce the performance impact\nof generating the small and/or big map.
settingsHelpResetWindows = Reset all window positions and scale.\nUse this in case a window has been dragged completely\noff screen or if any windows are not visible.
settingsHelpResetPlanetData = Resets all SCANsat data for the current celestial body.\nA confirmation window will open before activating.\nCannot be reversed.
settingsHelpResetAllData = Resets all SCANsat data for all celestial bodies.\nA confirmation window will open before activating.\nCannot be reversed.
Expand All @@ -28,42 +29,38 @@ SCAN_Localization
settingsHelpWindowScale = Adjust all SCANsat window scales.
settingsHelpFillPlanet = Fill in all SCANsat data for the current celestial body.
settingsHelpFillAll = Fill in all SCANsat data for all celestial bodies.
resourceSettingsHelpOverlayWindow = Open the planetary overlay map control window.
resourceSettingsHelpBiomeLock = Circumvents the requirement for stock surface biome scans.\nSCANsat displays will show the full accuracy for resource\nabundance with or without any surface biome scans.
resourceSettingsHelpInstant = By default, the stock M700 resource scanner's orbital survey will fill in all SCANsat resource maps.\nThis can be disabled, requiring standard SCANsat methods for all resource scanning.\nDisabled automatically when stock resource scanning is disabled.
resourceSettingsHelpNarrowBand = Numerous SCANsat functions require a Narrow-Band resource scanner on-board\nthe current vessel or in orbit of a celestial body for fully accurate resource abundance data.\nDisable this to circumvent these restrictions.
resourceSettingsHelpDisableStock = Disables all stock resource scanning functions.\nSCANsat scanning methods will be required for all resource data.\nReplaces several stock resource functions with SCANsat tools.\nThese include The right-click readouts, and the planetary overlay maps.
resourceSettingsHelpResetSCANsatResource = Resets all SCANsat resource data for the current celestial body. Other SCANsat data is not affected.\nA confirmation window will open before activating.\nCannot be reversed.
resourceSettingsHelpResetSCANsatResource = Resets all SCANsat resource data for the current celestial body.\nOther SCANsat data is not affected.\nA confirmation window will open before activating.\nCannot be reversed.
resourceSettingsHelpResetStockResource = Resets the stock resource scanning coverage for the current celestial body.\nA reload or scene change may be required for all changes to take effect.\nA confirmation window will open before activating.\nCannot be reversed.
resourceSettingsHelpOverlayInterpolation = Change the number of resource abundance measurements used in constructing\nthe planetary overlay and big map resource overlay.\nDecrease the value to increase the accuracy of the map.\nLower values will result in slower map generation.
resourceSettingsHelpOverlayHeight = Change the texture size (map width is 2XHeight) used in constructing\nthe planetary overlay and big map resource overlay.\nIncrease the value to increase the quality and accuracy of the map.\nHigher values will result in slower map generation.
resourceSettingsHelpOverlayBiomeHeight = Change the texture size (map width is 2XHeight) used in constructing\nthe planetary overlay biome map. Increase the value to increase\nthe quality and accuracy of the map.\nHigher values will result in slower map generation.
resourceSettingsHelpOverlayTransparency = Create a grey background for planetary overlay resource maps.\nUsed to make clear which sections of the celestial body\nhave been scanned but contain no resources.
resourceSettingsHelpScanThreshold = A threshold level used to apply the stock resource scan to a celestial body after scanning with SCANsat sensors.\nThis is useful when contracts or other addons require that a stock resource scan be performed.\nSet a value from 0-100 in the text box and click on the Set button.\nAll celestial bodies will be checked immediately; celestial bodies will also be checked upon loading or a scene change.\nA reload may be required for the changes to take effect.
resourceSettingsModuleManagerWarning = Warning:\nModule Manager is required for all SCANsat resource scanning
colorTerrainHelpMin = Defines the low altitude cutoff for the terrain color palette. Anything below this altitude will be shown with the lowest color.
colorTerrainHelpMax = Defines the high altitude cutoff for the terrain color palette. Anything above this altitude will be shown with the highest color.
colorTerrainHelpClampToggle = Used to define a cutoff between the low and high altitude values. This is particularly useful for ocean planets where it helps to define a sharp distinction between land and ocean.
colorTerrainHelpClamp = Defines the clamp altitude cutoff. Anything below the cutoff will be represented by the first two colors in the selected color palette. Anything above the cutoff will be represented with the remaining colors.
resourceSettingsHelpScanThreshold = A threshold level used to apply the stock resource scan to a celestial body after scanning with SCANsat sensors.\nThis is useful when contracts or other addons require that a stock resource scan be performed.\nSet a value from 0-100 in the text box and click on the Set button.\nAll celestial bodies will be checked immediately;\ncelestial bodies will also be checked upon loading or a scene change.\nA reload may be required for the changes to take effect.
colorTerrainHelpMin = Defines the low altitude cutoff for the terrain color palette.\nAnything below this altitude will be shown with the lowest color.
colorTerrainHelpMax = Defines the high altitude cutoff for the terrain color palette.\nAnything above this altitude will be shown with the highest color.
colorTerrainHelpClampToggle = Used to define a cutoff between the low and high altitude values.\nThis is particularly useful for ocean planets where it helps to\ndefine a sharp distinction between land and ocean.
colorTerrainHelpClamp = Defines the clamp altitude cutoff.\nAnything below the cutoff will be represented by the first two colors in the selected color palette.\nAnything above the cutoff will be represented with the remaining colors.
colorTerrainHelpReverse = Reverses the order of the currently\nselected color palette.
colorTerrainHelpDiscrete = Draws the map using only the specific colors defined by each palette, instead of smoothly interpolating between them.
colorTerrainHelpPaletteSize = Adjust the number of colors available in the currently selected color palette.
colorTerrainHelpDiscrete = Draws the map using only the specific colors defined by each palette,\ninstead of smoothly interpolating between them.
colorTerrainHelpPaletteSize = Adjust the number of colors available\nin the currently selected color palette.
colorBiomeHelpStock = Use the stock biome color scheme for\nSCANsat biome maps.
colorBiomeHelpWhiteBorder = Draw a white border between biomes. Does not apply to the planetary overlay biome maps.
colorBiomeHelpTransparency = Adjust the transparency of biome maps. Terrain elevation is shown behind the biome maps. Set to 0% to disable terrain drawing.
colorPickerHelpLow = The top color swatch shows the updated color selection for the low end of this color spectrum. The bottom color swatch shows the currently active color.
colorPickerHelpHigh = The top color swatch shows the updated color selection for the high end of this color spectrum. The bottom color swatch shows the currently active color.
colorPickerHelpValue = This slider adjusts the Value (in HSV color terms) or Brightness for the currently selected color.
colorResourceHelpFineControl = Activates Fine Control Mode where the sliders will only show values within 5% of the current selection.
colorResourceHelpMin = The low cutoff for resource concentration on the selected celestial body. Resource deposits at this level will be displayed using the low end of the current resource overlay color spectrum. Resource deposits below this value will not be shown.
colorResourceHelpMax = The high cutoff for resource concentration on the selected celestial body. Resource deposits above this value will be shown using the high end of the current resource overlay color spectrum.
colorResourceHelpTransparency = Defines the level of transparency for resource overlays. Increase to allow more of the underlying terrain, slope, or biome map to be visible. This also affect the transparency of resource deposits on the planetary overlay resource map.
colorResourceHelpApply = Applies the current values for the selected resource and celestial body only.
colorResourceHelpApplyAll = Applies the current values for the selected resource for all celestial bodies.
colorResourceHelpDefault = Reverts to the default values for the selected resource and celestial body only.
colorResourceHelpDefaultAll = Reverts to the default values for the selected resource for all celestial bodies.
colorHelpSaveToConfig = Save all color configuration values to the config file found in your SCANsat/Resources folder. These values serve as the defaults for new saves and for all Revert To Default buttons. Values do not need to be saved to the config file to be applied for this save file.
colorSlopeHelpCutoff = Adjust the cutoff level between the two selected slope color pairs.
colorBiomeHelpWhiteBorder = Draw a white border between biomes.\nDoes not apply to the planetary overlay biome maps.
colorBiomeHelpTransparency = Adjust the transparency of biome maps.\nTerrain elevation is shown behind the biome maps.\nSet to 0% to disable terrain drawing.
colorPickerHelpLow = The top color swatch shows the updated\ncolor selection for the low end of this color spectrum.\nThe bottom color swatch shows the currently active color.
colorPickerHelpHigh = The top color swatch shows the updated\ncolor selection for the high end of this color spectrum.\nThe bottom color swatch shows the currently active color.
colorResourceHelpMin = The low cutoff for resource concentration on the selected celestial body.\nResource deposits at this level will be displayed\nusing the low end of the current resource overlay color spectrum.\nResource deposits below this value will not be shown.
colorResourceHelpMax = The high cutoff for resource concentration on the selected celestial body.\nResource deposits above this value will be displayed\nusing the high end of the current resource overlay color spectrum.
colorResourceHelpTransparency = Defines the level of transparency for resource overlays.\nIncrease to allow more of the underlying terrain, slope, or biome map to be visible.\nThis also affect the transparency of resource deposits on the planetary overlay resource map.
colorResourceHelpApply = Applies the current values for the\nselected resource and celestial body only.
colorResourceHelpApplyAll = Applies the current values for the\nselected resource for all celestial bodies.
colorResourceHelpDefault = Reverts to the default values for the\nselected resource and celestial body only.
colorResourceHelpDefaultAll = Reverts to the default values for the\nselected resource for all celestial bodies.
colorHelpSaveToConfig = Save all color configuration values to\nthe config file found in your SCANsat/Resources folder.\nThese values serve as the defaults for new saves\nand for all Revert To Default buttons.\nValues do not need to be saved to the config file to be applied for this save file.
colorSlopeHelpCutoff = Adjust the cutoff level between\nthe two selected slope color pairs.
mainMapToggle = Main Map
bigMapToggle = Big Map
zoomMapToggle = Zoom Map
Expand All @@ -75,7 +72,7 @@ SCAN_Localization
mainMapMinimize = Show/Hide Vessel Info
mainMapStatus = Scanner Status Indicators
mainMapPercentage = Active Scanner Completion Percentage
bigMapRefresh = Map Refresh
bigMapRefresh = Map Refresh
bigMapColor = Map Color
bigMapGrid = Grid Overlay
bigMapOrbit = Orbit Overlay
Expand Down Expand Up @@ -103,6 +100,16 @@ SCAN_Localization
waypointSet = Create Waypoint
waypointCancel = Cancel Waypoint
waypointMechJeb = Set MechJeb Landing Target
waypointNameRefresh = Reset Waypoint
warningDataResetCurrent = Erase all map data for [0]?
warningDataResetAll = Erase map data for all celestial bodies?
warningSCANResourceResetCurrent = Erase SCANsat resource data for [0]?
warningSCANResourceResetAll = Erase SCANsat resource data for all celestial bodies?
warningStockResourceResetCurrent = Erase stock resource data for [0]?
warningStockResourceResetAll = Erase stock resource data for all celestial bodies?
warningStockResourceResetAll = Erase stock resource data for all celestial bodies?
warningModuleManagerResource = Warning\nModule Manager is required for all SCANsat resource scanning functions.
warningSaveToConfig = Overwrite existing config file on disk?
}
}
}
2 changes: 1 addition & 1 deletion SCANassets/SCANsat.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"MAJOR":1,
"MINOR":1,
"PATCH":7,
"BUILD":1
"BUILD":2
},
"KSP_VERSION":{
"MAJOR":1,
Expand Down
18 changes: 18 additions & 0 deletions SCANsat.Unity/HSVPicker/Enums/ColorValues.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using UnityEngine;

namespace SCANsat.Unity.HSVPicker.Enum
{
public enum ColorValues
{
R,
G,
B,
A,

Hue,
Saturation,
Value,

Hex
}
}
12 changes: 12 additions & 0 deletions SCANsat.Unity/HSVPicker/Events/ColorChangedEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using UnityEngine;
using System;
using UnityEngine.Events;

namespace SCANsat.Unity.HSVPicker.Events
{
[Serializable]
public class ColorChangedEvent : UnityEvent<Color>
{

}
}
10 changes: 10 additions & 0 deletions SCANsat.Unity/HSVPicker/Events/HSVChangedEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using UnityEngine;
using UnityEngine.Events;

namespace SCANsat.Unity.HSVPicker.Events
{
public class HSVChangedEvent : UnityEvent<float, float, float>
{

}
}
48 changes: 48 additions & 0 deletions SCANsat.Unity/HSVPicker/UI/ColorImage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

namespace SCANsat.Unity.HSVPicker.UI
{
[RequireComponent(typeof(Image))]
public class ColorImage : MonoBehaviour
{
public ColorPicker picker;
private bool _isActive;

private Image image;

public bool IsActive
{
get { return _isActive; }
set { _isActive = value; }
}

public Color CurrentColor
{
get { return image.color; }
}

private void Awake()
{
image = GetComponent<Image>();
picker.onValueChanged.AddListener(ColorChanged);
}

private void OnDestroy()
{
picker.onValueChanged.RemoveListener(ColorChanged);
}

private void ColorChanged(Color newColor)
{
if (_isActive)
image.color = newColor;
}

public void SetColor(Color newColor)
{
image.color = newColor;
}
}
}
76 changes: 76 additions & 0 deletions SCANsat.Unity/HSVPicker/UI/ColorInput.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using UnityEngine;
using UnityEngine.UI;
using System;
using SCANsat.Unity.HSVPicker.Enum;

namespace SCANsat.Unity.HSVPicker.UI
{
/// <summary>
/// Displays one of the color values of aColorPicker
/// </summary>
[RequireComponent(typeof(InputField))]
public class ColorInput : MonoBehaviour
{
public ColorPicker hsvpicker;

/// <summary>
/// Which value this slider can edit.
/// </summary>
public ColorValues type;

private InputField inputField;

private void Awake()
{
inputField = GetComponent<InputField>();

inputField.onValueChanged.AddListener(InputChanged);
}

private void OnDestroy()
{
inputField.onValueChanged.RemoveListener(InputChanged);
}

private void InputChanged(string input)
{
if (string.IsNullOrEmpty(input))
return;

float original = 0;

switch(type)
{
case ColorValues.R:
original = hsvpicker.R;
break;
case ColorValues.G:
original = hsvpicker.G;
break;
case ColorValues.B:
original = hsvpicker.B;
break;
}

float f = original;

if (!float.TryParse(input, out f))
return;

if (f < 0)
return;
else if (input.StartsWith("1."))
f = 1;
else if (f >= 1 && f <= 255)
{
f = Mathf.RoundToInt(f);

f /= 255;
}
else if (f > 255)
return;

hsvpicker.AssignColor(type, f);
}
}
}
89 changes: 89 additions & 0 deletions SCANsat.Unity/HSVPicker/UI/ColorLabel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using UnityEngine;
using UnityEngine.UI;
using System;
using SCANsat.Unity.HSVPicker.Enum;

namespace SCANsat.Unity.HSVPicker.UI
{
[RequireComponent(typeof(TextHandler))]
public class ColorLabel : MonoBehaviour
{
public ColorPicker picker;
public ColorValues type;

private TextHandler label;

private void Awake()
{
label = GetComponent<TextHandler>();
}

private void OnEnable()
{
if (Application.isPlaying && picker != null)
{
picker.onValueChanged.AddListener(ColorChanged);
picker.onHSVChanged.AddListener(HSVChanged);
}
}

private void OnDestroy()
{
if (picker != null)
{
picker.onValueChanged.RemoveListener(ColorChanged);
picker.onHSVChanged.RemoveListener(HSVChanged);
}
}

private void ColorChanged(Color color)
{
UpdateValue();
}

private void HSVChanged(float hue, float sateration, float value)
{
UpdateValue();
}

private void UpdateValue()
{
if (picker == null)
{
label.OnTextUpdate.Invoke("-");
}
else
{
float valueOne = 0;
float valueTwo = 0;
float valueThree = 0;


if (type == ColorValues.R)
{
valueOne = picker.GetValue(ColorValues.R) * 255;
valueTwo = picker.GetValue(ColorValues.G) * 255;
valueThree = picker.GetValue(ColorValues.B) * 255;

label.OnTextUpdate.Invoke(string.Format("{0:N0},{1:N0},{2:N0}", Mathf.FloorToInt(valueOne), Mathf.FloorToInt(valueTwo), Mathf.FloorToInt(valueThree)));
}
else if (type == ColorValues.Hue)
{
valueOne = picker.GetValue(ColorValues.Hue) * 360;
valueTwo = picker.GetValue(ColorValues.Saturation) * 255;
valueThree = picker.GetValue(ColorValues.Value) * 255;

label.OnTextUpdate.Invoke(string.Format("{0:N0},{1:N0},{2:N0}", Mathf.FloorToInt(valueOne), Mathf.FloorToInt(valueTwo), Mathf.FloorToInt(valueThree)));
}
else if (type == ColorValues.Hex)
{
valueOne = picker.GetValue(ColorValues.R) * 255;
valueTwo = picker.GetValue(ColorValues.G) * 255;
valueThree = picker.GetValue(ColorValues.B) * 255;

label.OnTextUpdate.Invoke(string.Format("#{0:X2}{1:X2}{2:X2}", Mathf.FloorToInt(valueOne), Mathf.FloorToInt(valueTwo), Mathf.FloorToInt(valueThree)));
}
}
}
}
}
Loading

0 comments on commit e812b34

Please sign in to comment.