-
Notifications
You must be signed in to change notification settings - Fork 96
/
SCANlanguagePack.cs
261 lines (228 loc) · 15.6 KB
/
SCANlanguagePack.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
using System;
using System.Collections.Generic;
using System.Linq;
using SCANsat.SCAN_Platform;
using System.Text.RegularExpressions;
using System.Reflection;
namespace SCANsat.SCAN_UI.UI_Framework
{
public class SCANlanguagePack : SCAN_ConfigNodeStorage
{
[Persistent]
public bool activePack = true;
[Persistent]
public string language = "English (USA)";
//Settings Window Help Tooltips
[Persistent]
public string settingsHelpAnomalies = "Select the marker used to display\nanomalies on the map.";
[Persistent]
public string settingsHelpScanningToggle = "Toggle all SCANsat scanning.";
[Persistent]
public string settingsHelpBackground = "Toggle background scanning on\nselected celestial bodies.";
[Persistent]
public string settingsHelpTimeWarp = "Adjust the scanning frequency during TimeWarp.\nHigher settings result in fewer gaps in the maps but may have a performance impact at high TimeWarp.";
[Persistent]
public string settingsHelpGroundTracks = "Display a visible indicator of\nscanning activity in map mode.";
[Persistent]
public string settingsHelpGroundTracksActive = "The ground track indicator can be limited to only be displayed for the active vessel.";
[Persistent]
public string settingsHelpStockUIStyle = "Switch between stock KSP-style UI elements and Unity-style elements.";
[Persistent]
public string settingsHelpOverlayTooltips = "Displays tooltips for the current mouse position when a planetary overlay map is activated. These tooltips include The cursor coordinates, terrain height, slope, biome name, and resource abundance, depending on scanning coverage.";
[Persistent]
public string settingsHelpWindowTooltips = "Display tooltips on some map window buttons. These are primarily used to identify icon buttons.";
[Persistent]
public string settingsHelpStockToolbar = "Use the stock toolbar.\nOnly one stock button is available. Can be used concurrently with the Blizzy78 Toolbar.";
[Persistent]
public string settingsHelpToolbarMenu = "Use a pop-out menu for the stock toolbar to show all available windows.";
[Persistent]
public string settingsHelpMechJeb = "The SCANsat zoom map target selection mode can be used to select a MechJeb landing site.";
[Persistent]
public string settingsHelpResetWindows = "Reset all window positions. Use this in case a window has been dragged completely off screen or if any windows are not visible.";
[Persistent]
public string settingsHelpResetPlanetData = "Resets all SCANsat data for the current celestial body.\nA confirmation window will open before activating.\nCannot be reversed.";
[Persistent]
public string settingsHelpResetAllData = "Resets all SCANsat data for all celestial bodies. \nA confirmation window will open before activating.\nCannot be reversed.";
[Persistent]
public string settingsHelpVesselsSensorsPasses = "Information about the currently active SCANsat sensors. Vessels indicates the number of vessels with active sensors. Sensors indicates the total number of sensors; instruments with multiple sensor types count each individual sensor. Passes indicates the number of sensor updates performed per second.\nThis value is affected by the\nTimeWarp Resolution setting.";
[Persistent]
public string settingsHelpGreyScale = "Use a true grey-scale color spectrum for black-and-white SCANsat maps. Pixels on the altitude map will interpolate between black and white; the min and max terrain heights for each celestial body\ndefine the limits.";
[Persistent]
public string settingsHelpExportCSV = "Export a .csv file along with map texture when using the Export button on the big map. The file contains coordinates and the terrain height for each pixel. Pixels are labeled from left to right\nand from top to bottom.";
[Persistent]
public string settingsHelpSetMapWidth = "Enter an exact value for the SCANsat big map texture width. Values are limited to 550 - 8192 pixels wide. Press the Set button to apply the value.";
[Persistent]
public string settingsHelpWindowScale = "Adjust SCANsat window UI scale; scale is also affected by the stock master UI scale controls.";
[Persistent]
public string settingsHelpFillPlanet = "Fill in all SCANsat data for the current celestial body.";
[Persistent]
public string settingsHelpFillAll = "Fill in all SCANsat data for all celestial bodies.";
//Resource Settings Window Help Tooltips
[Persistent]
public string resourceSettingsHelpOverlayWindow = "Open the planetary overlay map control window.";
[Persistent]
public string resourceSettingsHelpBiomeLock = "Circumvents the requirement for stock surface biome scans. SCANsat displays will show the full accuracy for resource abundance with or without any surface biome scans.";
[Persistent]
public string resourceSettingsHelpInstant = "By default, the stock M700 resource scanner's orbital survey will fill in all SCANsat resource maps. This can be disabled, requiring standard SCANsat methods for all resource scanning. Disabled automatically when stock resource scanning is disabled.";
[Persistent]
public string resourceSettingsHelpNarrowBand = "Numerous SCANsat functions require a Narrow-Band resource scanner on-board the current vessel or in orbit of a celestial body for fully accurate resource abundance data.\nDisable this to circumvent these restrictions.";
[Persistent]
public string resourceSettingsHelpDisableStock = "Disables all stock resource scanning functions. SCANsat scanning methods will be required for all resource data. Replaces several stock resource functions with SCANsat tools. These include The right-click readouts, the high resolution narrow-band scanner map, and the planetary overlay maps.";
[Persistent]
public string 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.";
[Persistent]
public string resourceSettingsHelpResetStockResource = "Resets the stock resource scanning coverage for the current celestial body. A reload or scene change may be required for all changes to take effect.\nA confirmation window will open before activating.\nCannot be reversed.";
[Persistent]
public string resourceSettingsHelpOverlayInterpolation = "Change the number of resource abundance measurements used in constructing the planetary overlay and big map resource overlay. Decrease the value to increase the accuracy of the map. Lower values will result in slower map generation.";
[Persistent]
public string resourceSettingsHelpOverlayHeight = "Change the texture size (map width is 2XHeight) used in constructing the planetary overlay and big map resource overlay. Increase the value to increase the quality and accuracy of the map. Higher values will result in slower map generation.";
[Persistent]
public string resourceSettingsHelpOverlayBiomeHeight = "Change the texture size (map width is 2XHeight) used in constructing the planetary overlay biome map. Increase the value to increase the quality and accuracy of the map. Higher values will result in slower map generation.";
[Persistent]
public string resourceSettingsHelpOverlayTransparency = "Create a grey background for planetary overlay resource maps. Used to make clear which sections of the celestial body have been\nscanned but contain no resources.";
[Persistent]
public string resourceSettingsHelpScanThreshold = "A threshold level used to apply the stock resource scan to a celestial body after scanning with SCANsat sensors. This is useful when contracts or other addons require that a stock resource scan be performed. Set a value from 0-100 in the text box and click on the Set button. All celestial bodies will be checked immediately; celestial bodies will also be checked upon loading or a scene change. A reload may be required for the changes to take effect.";
[Persistent]
public string resourceSettingsModuleManagerWarning = "Warning:\nModule Manager is required for all SCANsat resource scanning";
//Color Config Window Help Tooltips
[Persistent]
public string colorTerrainHelpMin = "Defines the low altitude cutoff for the terrain color palette. Anything below this altitude will be shown with the lowest color.";
[Persistent]
public string colorTerrainHelpMax = "Defines the high altitude cutoff for the terrain color palette. Anything above this altitude will be shown with the highest color.";
[Persistent]
public string 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.";
[Persistent]
public string 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.";
[Persistent]
public string colorTerrainHelpReverse = "Reverses the order of the currently\nselected color palette.";
[Persistent]
public string colorTerrainHelpDiscrete = "Draws the map using only the specific colors defined by each palette, instead of smoothly interpolating between them.";
[Persistent]
public string colorTerrainHelpPaletteSize = "Adjust the number of colors available in the currently selected color palette.";
[Persistent]
public string colorBiomeHelpStock = "Use the stock biome color scheme for\nSCANsat biome maps.";
[Persistent]
public string colorBiomeHelpWhiteBorder = "Draw a white border between biomes. Does not apply to the planetary overlay biome maps.";
[Persistent]
public string colorBiomeHelpTransparency = "Adjust the transparency of biome maps. Terrain elevation is shown behind the biome maps. Set to 0% to disable terrain drawing.";
[Persistent]
public string 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.";
[Persistent]
public string 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.";
[Persistent]
public string colorPickerHelpValue = "This slider adjusts the Value (in HSV color terms) or Brightness for the currently selected color.";
[Persistent]
public string colorResourceHelpFineControl = "Activates Fine Control Mode where the sliders will only show values within 5% of the current selection.";
[Persistent]
public string 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.";
[Persistent]
public string 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.";
[Persistent]
public string 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.";
[Persistent]
public string colorResourceHelpApply = "Applies the current values for the selected resource and celestial body only.";
[Persistent]
public string colorResourceHelpApplyAll = "Applies the current values for the selected resource for all celestial bodies.";
[Persistent]
public string colorResourceHelpDefault = "Reverts to the default values for the selected resource and celestial body only.";
[Persistent]
public string colorResourceHelpDefaultAll = "Reverts to the default values for the selected resource for all celestial bodies.";
[Persistent]
public string 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.";
[Persistent]
public string colorSlopeHelpCutoff = "Adjust the cutoff level between the two selected slope color pairs.";
//Window toggle buttons
[Persistent]
public string mainMapToggle = "Main Map";
[Persistent]
public string bigMapToggle = "Big Map";
[Persistent]
public string zoomMapToggle = "Zoom Map";
[Persistent]
public string overlayToggle = "Planetary Overlay";
[Persistent]
public string instrumentsToggle = "Instruments Readout";
[Persistent]
public string settingsToggle = "Settings";
//Main Map tooltips
[Persistent]
public string mainMapColor = "Map Color";
[Persistent]
public string mainMapType = "Terrain/Biome Toggle";
[Persistent]
public string mainMapMinimize = "Show/Hide Vessel Info";
[Persistent]
public string mainMapStatus = "Scanner Status Indicators";
[Persistent]
public string mainMapPercentage = "Active Scanner Completion Percentage";
//Big Map tooltips
[Persistent]
public string bigMapRefresh = "Map Refresh";
[Persistent]
public string bigMapColor = "Map Color";
[Persistent]
public string bigMapGrid = "Grid Overlay";
[Persistent]
public string bigMapOrbit = "Orbit Overlay";
[Persistent]
public string bigMapWaypoints = "Waypoints";
[Persistent]
public string bigMapAnomaly = "Anomalies";
[Persistent]
public string bigMapFlags = "Flags";
[Persistent]
public string bigMapLegend = "Map Legend";
[Persistent]
public string bigMapResource = "Resource Overlay";
[Persistent]
public string bigMapExport = "Export Map To Disk";
//Overlay tooltips
[Persistent]
public string overlayRefresh = "Map Refresh";
//Instruments tooltips
[Persistent]
public string insNextResource = "Next Resource";
[Persistent]
public string insPreviousResource = "Previous Resource";
public override void OnDecodeFromConfigNode()
{
Regex openBracket = new Regex(@"\[(?=\d+:?\w?\d?\])");
Regex closeBraket = new Regex(@"(?<=\{\d+:?\w?\d?)\]");
Regex newLines = new Regex(@"\\n");
var stringFields = this.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public).Where(a => a.FieldType == typeof(string)).ToList();
for (int i = 0; i < stringFields.Count(); i++)
{
FieldInfo f = stringFields[i];
f.SetValue(this, openBracket.Replace((string)f.GetValue(this), "{"));
f.SetValue(this, closeBraket.Replace((string)f.GetValue(this), "}"));
f.SetValue(this, newLines.Replace((string)f.GetValue(this), Environment.NewLine));
}
}
public override void OnEncodeToConfigNode()
{
Regex openCurlyBracket = new Regex(@"\{(?=\d+:?\w?\d?\})");
Regex closeCurlyBraket = new Regex(@"(?<=\[\d+:?\w?\d?)\}");
Regex newLines = new Regex(@"\n");
var stringFields = this.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public).Where(a => a.FieldType == typeof(string)).ToList();
for (int i = 0; i < stringFields.Count(); i++)
{
FieldInfo f = stringFields[i];
f.SetValue(this, openCurlyBracket.Replace((string)f.GetValue(this), "["));
f.SetValue(this, closeCurlyBraket.Replace((string)f.GetValue(this), "]"));
f.SetValue(this, newLines.Replace((string)f.GetValue(this), @"\n"));
}
}
public string GetStringWithName(string title)
{
var stringFields = this.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public).Where(a => a.FieldType == typeof(string)).ToList();
for (int i = stringFields.Count - 1; i >= 0; i--)
{
FieldInfo f = stringFields[i];
if (f.Name != title)
continue;
return (string)f.GetValue(this);
}
return "";
}
}
}