Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions GameData/DistantObject/Localization/en-us.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Localization
{
en-us
{
#DistantObject_title = Distant Object Enhancement\u0020
//Flare Rendering
#DistantObject_FlareRendering = Flare Rendering
#DistantObject_flaresEnabled = Enable Flares
#DistantObject_showNames = Show names on mouseover
#DistantObject_FlareSaturation = Flare Saturation
#DistantObject_FlareSize = Flare Size
#DistantObject_FlareBrightness = Flare Brightness
#DistantObject_ignoreDebrisFlare = Show Debris Flares
#DistantObject_debrisBrightness = Debris Brightness

//Distant Vessel
#DistantObject_DistantVessel = Distant Vessel
#DistantObject_renderVessels = Distant Vessel Rendering
#DistantObject_maxDistance = Max Distance to Render
#DistantObject_renderMode0 = Render All Unloaded Vessels
#DistantObject_renderMode1 = Render Targeted Vessel Only
#DistantObject_ignoreDebris = Ignore Debris

//Skybox Brightness
#DistantObject_SkyboxBrightness = Skybox Brightness
#DistantObject_changeSkybox = Dynamic Sky Dimming
#DistantObject_MaximumSkyBrightness = Maximum Sky Brightness

//Misc
#DistantObject_debugMode = Debug Mode
#DistantObject_useAppLauncher = Use KSP AppLauncher (may require restart)
#DistantObject_onlyInSpaceCenter = Show AppLauncher only in Space Center
#DistantObject_useToolbar = Use Blizzy's Toolbar (may require restart)

//Buttons
#DistantObject_Reset = Reset To Default
#DistantObject_Apply = Apply
}
}
45 changes: 23 additions & 22 deletions Source-Code/SettingsGui.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using UnityEngine;
using KSP.UI.Screens;
using KSP.Localization;

namespace DistantObject
{
Expand Down Expand Up @@ -202,49 +203,49 @@ private void mainGUI(int windowID)
GUILayout.EndHorizontal();

//--- Flare Rendering --------------------------------------------
GUILayout.BeginVertical("Flare Rendering", new GUIStyle(GUI.skin.window));
GUILayout.BeginVertical(Localizer.Format("#DistantObject_FlareRendering"), new GUIStyle(GUI.skin.window));//"Flare Rendering"
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
flaresEnabled = GUILayout.Toggle(flaresEnabled, "Enable Flares");
flaresEnabled = GUILayout.Toggle(flaresEnabled, Localizer.Format("#DistantObject_flaresEnabled"));//"Enable Flares"
GUILayout.EndHorizontal();

if (flaresEnabled)
{
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
showNames = GUILayout.Toggle(showNames, "Show names on mouseover");
showNames = GUILayout.Toggle(showNames, Localizer.Format("#DistantObject_showNames"));//"Show names on mouseover"
GUILayout.EndHorizontal();

GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
GUILayout.Label("Flare Saturation");
GUILayout.Label(Localizer.Format("#DistantObject_FlareSaturation"));//"Flare Saturation"
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
flareSaturation = GUILayout.HorizontalSlider(flareSaturation, 0f, 1f, GUILayout.Width(220));
GUILayout.Label(string.Format("{0:0}", 100 * flareSaturation) + "%");
GUILayout.EndHorizontal();

GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
GUILayout.Label("Flare Size");
GUILayout.Label(Localizer.Format("#DistantObject_FlareSize"));//"Flare Size"
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
flareSize = GUILayout.HorizontalSlider(flareSize, 0.5f, 1.5f, GUILayout.Width(220));
GUILayout.Label(string.Format("{0:0}", 100 * flareSize) + "%");
GUILayout.EndHorizontal();

GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
GUILayout.Label("Flare Brightness");
GUILayout.Label(Localizer.Format("#DistantObject_FlareBrightness"));//"Flare Brightness"
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
flareBrightness = GUILayout.HorizontalSlider(flareBrightness, 0.0f, 1.0f, GUILayout.Width(220));
GUILayout.Label(string.Format("{0:0}", 100 * flareBrightness) + "%");
GUILayout.EndHorizontal();

GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
ignoreDebrisFlare = !GUILayout.Toggle(!ignoreDebrisFlare, "Show Debris Flares");
ignoreDebrisFlare = !GUILayout.Toggle(!ignoreDebrisFlare, Localizer.Format("#DistantObject_ignoreDebrisFlare"));//"Show Debris Flares"
GUILayout.EndHorizontal();

if (!ignoreDebrisFlare)
{
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
GUILayout.Label("Debris Brightness");
GUILayout.Label(Localizer.Format("#DistantObject_debrisBrightness"));//"Debris Brightness"
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
debrisBrightness = GUILayout.HorizontalSlider(debrisBrightness, 0f, 1f, GUILayout.Width(220));
Expand All @@ -259,24 +260,24 @@ private void mainGUI(int windowID)
GUILayout.EndHorizontal();

//--- Vessel Rendering -------------------------------------------
GUILayout.BeginVertical("Distant Vessel", new GUIStyle(GUI.skin.window));
GUILayout.BeginVertical(Localizer.Format("#DistantObject_DistantVessel"), new GUIStyle(GUI.skin.window));//"Distant Vessel"

GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
renderVessels = GUILayout.Toggle(renderVessels, "Distant Vessel Rendering");
renderVessels = GUILayout.Toggle(renderVessels, Localizer.Format("#DistantObject_renderVessels"));//"Distant Vessel Rendering"
GUILayout.EndHorizontal();

if (renderVessels)
{
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
GUILayout.Label("Max Distance to Render");
GUILayout.Label(Localizer.Format("#DistantObject_maxDistance"));//"Max Distance to Render"
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
maxDistance = GUILayout.HorizontalSlider(maxDistance, 2500f, 750000f, GUILayout.Width(200));
GUILayout.Label(string.Format("{0:0}", maxDistance) + "m");
GUILayout.EndHorizontal();

GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
if (GUILayout.Button(renderMode == 0 ? "Render All Unloaded Vessels" : "Render Targeted Vessel Only"))
if (GUILayout.Button(renderMode == 0 ? Localizer.Format("#DistantObject_renderMode0") : Localizer.Format("#DistantObject_renderMode1")))//"Render All Unloaded Vessels" : "Render Targeted Vessel Only"
{
if (renderMode == 0)
{
Expand All @@ -292,7 +293,7 @@ private void mainGUI(int windowID)
if (renderMode == 1)
{
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
ignoreDebris = GUILayout.Toggle(ignoreDebris, "Ignore Debris");
ignoreDebris = GUILayout.Toggle(ignoreDebris, Localizer.Format("#DistantObject_ignoreDebris"));//"Ignore Debris"
GUILayout.EndHorizontal();
}
}
Expand All @@ -303,14 +304,14 @@ private void mainGUI(int windowID)
GUILayout.EndHorizontal();

//--- Skybox Brightness ------------------------------------------
GUILayout.BeginVertical("Skybox Dimming", new GUIStyle(GUI.skin.window));
GUILayout.BeginVertical(Localizer.Format("#DistantObject_SkyboxBrightness"), new GUIStyle(GUI.skin.window));//"Skybox Dimming"
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));

changeSkybox = GUILayout.Toggle(changeSkybox, "Dynamic Sky Dimming");
changeSkybox = GUILayout.Toggle(changeSkybox, Localizer.Format("#DistantObject_changeSkybox"));//"Dynamic Sky Dimming"
GUILayout.EndHorizontal();

GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
GUILayout.Label("Maximum Sky Brightness");
GUILayout.Label(Localizer.Format("#DistantObject_MaximumSkyBrightness"));//"Maximum Sky Brightness"
GUILayout.EndHorizontal();

GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
Expand All @@ -325,24 +326,24 @@ private void mainGUI(int windowID)

//--- Misc. ------------------------------------------------------
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
debugMode = GUILayout.Toggle(debugMode, "Debug Mode");
debugMode = GUILayout.Toggle(debugMode, Localizer.Format("#DistantObject_debugMode"));//"Debug Mode"
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
useAppLauncher = GUILayout.Toggle(useAppLauncher, "Use KSP AppLauncher (may require restart)");
useAppLauncher = GUILayout.Toggle(useAppLauncher, Localizer.Format("#DistantObject_useAppLauncher"));//"Use KSP AppLauncher (may require restart)"
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
onlyInSpaceCenter = GUILayout.Toggle(onlyInSpaceCenter, "Show AppLauncher only in Space Center");
onlyInSpaceCenter = GUILayout.Toggle(onlyInSpaceCenter, Localizer.Format("#DistantObject_onlyInSpaceCenter"));//"Show AppLauncher only in Space Center"
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
useToolbar = GUILayout.Toggle(useToolbar, "Use Blizzy's Toolbar (may require restart)");
useToolbar = GUILayout.Toggle(useToolbar, Localizer.Format("#DistantObject_useToolbar"));//"Use Blizzy's Toolbar (may require restart)"
GUILayout.EndHorizontal();
if (useAppLauncher == false && useToolbar == false)
{
useAppLauncher = true;
}

GUILayout.BeginHorizontal(GUILayout.ExpandHeight(false));
if (GUILayout.Button("Reset To Default"))
if (GUILayout.Button(Localizer.Format("#DistantObject_Reset")))//"Reset To Default"
{
Reset();
}
Expand All @@ -351,7 +352,7 @@ private void mainGUI(int windowID)
GUILayout.BeginHorizontal(GUILayout.ExpandHeight(false));
GUIStyle styleApply = new GUIStyle(GUI.skin.button);
styleApply.fontSize = styleApply.fontSize + 2;
if (GUILayout.Button("Apply", GUILayout.Height(50)))
if (GUILayout.Button(Localizer.Format("#DistantObject_Apply"), GUILayout.Height(50)))//"Apply"
{
ApplySettings();
}
Expand Down
3 changes: 2 additions & 1 deletion Source-Code/Utils.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Reflection;
using UnityEngine;
using KSP.Localization;

namespace DistantObject
{
Expand Down Expand Up @@ -82,7 +83,7 @@ static public string DistantObject
{
Version version = Assembly.GetExecutingAssembly().GetName().Version;

_DistantObject = "Distant Object Enhancement v" + version.Major + "." + version.Minor + "." + version.Build;
_DistantObject = Localizer.Format("#DistantObject_title") +"v" + version.Major + "." + version.Minor + "." + version.Build;//"Distant Object Enhancement "
}

return _DistantObject;
Expand Down