Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
2,529 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace SCANsat.Unity.Interfaces | ||
{ | ||
public interface ISCAN_Color | ||
{ | ||
string ResourcePlanet { get; set; } | ||
|
||
string ResourceCurrent { get; set; } | ||
|
||
string TerrainPlanet { get; set; } | ||
|
||
string TerrainPalette { get; set; } | ||
|
||
string TerrainPaletteStyle { get; set; } | ||
|
||
bool BiomeBigMapStockColor { get; set; } | ||
|
||
bool BiomeBigMapWhiteBoder { get; set; } | ||
|
||
bool BiomeSmallMapStockColor { get; set; } | ||
|
||
bool BiomeSmallMapWhiteBorder { get; set; } | ||
|
||
bool TerrainClampOn { get; set; } | ||
|
||
bool TerrainReverse { get; set; } | ||
|
||
bool TerrainDiscrete { get; set; } | ||
|
||
bool TerrainHasSize { get; } | ||
|
||
float BiomeTransparency { get; set; } | ||
|
||
float SlopeCutoff { get; set; } | ||
|
||
float ResourceMin { get; set; } | ||
|
||
float ResourceMax { get; set; } | ||
|
||
float ResourceTransparency { get; set; } | ||
|
||
float TerrainCurrentMin { get; set; } | ||
|
||
float TerrainGlobalMin { get; } | ||
|
||
float TerrainCurrentMax { get; set; } | ||
|
||
float TerrainGlobalMax { get; } | ||
|
||
float TerrainClamp { get; set; } | ||
|
||
int TerrainSize { get; set; } | ||
|
||
int TerrainSizeMin { get; } | ||
|
||
int TerrainSizeMax { get; } | ||
|
||
Color BiomeColorOne { get; } | ||
|
||
Color BiomeColorTwo { get; } | ||
|
||
Color SlopeColorOneLo { get; } | ||
|
||
Color SlopeColorOneHi { get; } | ||
|
||
Color SlopeColorTwoLo { get; } | ||
|
||
Color SlopeColorTwoHi { get; } | ||
|
||
Color ResourceColorOne { get; } | ||
|
||
Color ResourceColorTwo { get; } | ||
|
||
Texture2D TerrainPaletteOld { get; } | ||
|
||
Texture2D TerrainPaletteNew { get; } | ||
|
||
IList<KeyValuePair<string, Texture2D>> TerrainPalettes { get; } | ||
|
||
IList<string> Resources { get; } | ||
|
||
IList<string> CelestialBodies { get; } | ||
|
||
IList<string> PaletteStyleNames { get; } | ||
|
||
void BiomeApply(Color one, Color two); | ||
|
||
void BiomeDefault(); | ||
|
||
void SlopeApply(Color oneLow, Color oneHigh, Color twoLow, Color twoHigh); | ||
|
||
void SlopeDefault(); | ||
|
||
void ResourceApply(Color one, Color two); | ||
|
||
void ResourceApplyToAll(Color one, Color two); | ||
|
||
void ResourceDefault(); | ||
|
||
void ResourceDefaultToAll(); | ||
|
||
void ResourceSaveToConfig(Color one, Color two); | ||
|
||
void TerrainApply(); | ||
|
||
void TerrainDefault(); | ||
|
||
void TerrainSaveToConfig(); | ||
|
||
void Refresh(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
using SCANsat.Unity.HSVPicker.UI; | ||
|
||
namespace SCANsat.Unity | ||
{ | ||
public class SCAN_ColorPicker : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
private ColorImage m_ColorOne = null; | ||
[SerializeField] | ||
private ColorImage m_ColorTwo = null; | ||
[SerializeField] | ||
private Image m_OldColorOne = null; | ||
[SerializeField] | ||
private Image m_OldColorTwo = null; | ||
|
||
private ColorPicker picker; | ||
|
||
public Color GetColorOne | ||
{ | ||
get { return m_ColorOne.CurrentColor; } | ||
} | ||
|
||
public Color GetColorTwo | ||
{ | ||
get { return m_ColorTwo.CurrentColor; } | ||
} | ||
|
||
private void Awake() | ||
{ | ||
picker = GetComponent<ColorPicker>(); | ||
} | ||
|
||
public void Setup(Color one, Color two, bool reset) | ||
{ | ||
if (picker != null && reset) | ||
picker.CurrentColor = one; | ||
|
||
if (m_ColorOne != null) | ||
{ | ||
m_ColorOne.SetColor(one); | ||
|
||
if (reset) | ||
m_ColorOne.IsActive = true; | ||
} | ||
|
||
if (m_ColorTwo != null) | ||
m_ColorTwo.SetColor(two); | ||
|
||
if (m_OldColorOne != null) | ||
m_OldColorOne.color = one; | ||
|
||
if (m_OldColorTwo != null) | ||
m_OldColorTwo.color = two; | ||
} | ||
|
||
public void ColorOne(bool isOn) | ||
{ | ||
if (m_ColorOne == null) | ||
return; | ||
|
||
m_ColorOne.IsActive = isOn; | ||
|
||
if (isOn) | ||
picker.CurrentColor = m_ColorOne.CurrentColor; | ||
} | ||
|
||
public void ColorTwo(bool isOn) | ||
{ | ||
if (m_ColorTwo == null) | ||
return; | ||
|
||
m_ColorTwo.IsActive = isOn; | ||
|
||
if (isOn) | ||
picker.CurrentColor = m_ColorTwo.CurrentColor; | ||
} | ||
|
||
public void Apply() | ||
{ | ||
if (m_OldColorOne != null && m_ColorOne != null) | ||
m_OldColorOne.color = m_ColorOne.CurrentColor; | ||
|
||
if (m_OldColorTwo != null && m_ColorTwo != null) | ||
m_OldColorTwo.color = m_ColorTwo.CurrentColor; | ||
} | ||
} | ||
} |
Oops, something went wrong.