-
Notifications
You must be signed in to change notification settings - Fork 95
/
SCAN_Color_Config.cs
91 lines (79 loc) · 2.35 KB
/
SCAN_Color_Config.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#region license
/*
* [Scientific Committee on Advanced Navigation]
* S.C.A.N. Satellite
*
* SCAN_Color_Config - serializable object that stores settings in an external file
*
* Copyright (c)2014 David Grandy <david.grandy@gmail.com>;
* Copyright (c)2014 technogeeky <technogeeky@gmail.com>;
* Copyright (c)2014 (Your Name Here) <your email here>; see LICENSE.txt for licensing details.
*/
#endregion
using System.Collections.Generic;
using SCANsat.SCAN_Data;
using SCANsat.SCAN_Platform;
using SCANsat.SCAN_Platform.Palettes;
using SCANsat.SCAN_Platform.Palettes.ColorBrewer;
using SCANsat.SCAN_Platform.Palettes.FixedColors;
using UnityEngine;
using palette = SCANsat.SCAN_UI.UI_Framework.SCANpalette;
namespace SCANsat
{
public class SCAN_Color_Config : SCAN_ConfigNodeStorage
{
[Persistent]
private float defaultMinHeightRange = -1000;
[Persistent]
private float defaultMaxHeightRange = 8000;
[Persistent]
private float rangeAboveMaxHeight = 10000;
[Persistent]
private float rangeBelowMinHeight = 10000;
[Persistent]
private string defaultPalette = "Default";
[Persistent]
private List<SCANterrainConfig> SCANsat_Altimetry = new List<SCANterrainConfig>();
[Persistent]
private List<SCANresourceGlobal> SCANsat_Resources = new List<SCANresourceGlobal>();
internal SCAN_Color_Config(string filepath, string node)
{
FilePath = filepath;
TopNodeName = filepath + "/" + node;
if (Load())
SCANUtil.SCANlog("Color File Loaded...");
}
public override void OnDecodeFromConfigNode()
{
SCANcontroller.setMasterTerrainNodes(SCANsat_Altimetry);
SCANcontroller.setMasterResourceNodes(SCANsat_Resources);
}
public override void OnEncodeToConfigNode()
{
SCANUtil.SCANlog("Saving SCANsat configuration file...");
SCANUtil.SCANlog("SCANcolors.cfg saved to ---> {0}", FilePath);
SCANsat_Altimetry = SCANcontroller.EncodeTerrainConfigs;
SCANsat_Resources = SCANcontroller.EncodeResourceConfigs;
}
public float DefaultMinHeightRange
{
get { return defaultMinHeightRange; }
}
public float DefaultMaxHeightRange
{
get { return defaultMaxHeightRange; }
}
public float RangeAboveMaxHeight
{
get { return rangeAboveMaxHeight; }
}
public float RangeBelowMinHeight
{
get { return rangeBelowMinHeight; }
}
public string DefaultPalette
{
get { return defaultPalette; }
}
}
}