|
|
|
|
@@ -93,7 +93,7 @@ namespace Barotrauma
|
|
|
|
|
|
|
|
|
|
foreach (ContentPackage contentPackage in ContentPackage.List)
|
|
|
|
|
{
|
|
|
|
|
var tickBox = new GUITickBox(new RectTransform(new Vector2(1.0f, 0.067f), contentPackageList.Content.RectTransform, minSize: new Point(0, 15)), contentPackage.Name)
|
|
|
|
|
var tickBox = new GUITickBox(new RectTransform(new Vector2(0.05f, 0.05f), contentPackageList.Content.RectTransform, minSize: new Point(32, 32)), contentPackage.Name)
|
|
|
|
|
{
|
|
|
|
|
UserData = contentPackage,
|
|
|
|
|
OnSelected = SelectContentPackage,
|
|
|
|
|
@@ -118,8 +118,8 @@ namespace Barotrauma
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
new GUITextBlock(new RectTransform(new Vector2(0.92f, 0.05f), generalLayoutGroup.RectTransform), TextManager.Get("Language"));
|
|
|
|
|
var languageDD = new GUIDropDown(new RectTransform(new Vector2(0.92f, 0.05f), generalLayoutGroup.RectTransform));
|
|
|
|
|
new GUITextBlock(new RectTransform(new Vector2(0.95f, 0.045f), generalLayoutGroup.RectTransform), TextManager.Get("Language"));
|
|
|
|
|
var languageDD = new GUIDropDown(new RectTransform(new Vector2(0.95f, 0.045f), generalLayoutGroup.RectTransform));
|
|
|
|
|
foreach (string language in TextManager.AvailableLanguages)
|
|
|
|
|
{
|
|
|
|
|
languageDD.AddItem(TextManager.Get("Language." + language), language);
|
|
|
|
|
@@ -238,7 +238,7 @@ namespace Barotrauma
|
|
|
|
|
return true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GUITickBox vsyncTickBox = new GUITickBox(new RectTransform(new Vector2(1.0f, 0.05f), leftColumn.RectTransform), TextManager.Get("EnableVSync"))
|
|
|
|
|
GUITickBox vsyncTickBox = new GUITickBox(new RectTransform(new Point(32, 32), leftColumn.RectTransform), TextManager.Get("EnableVSync"))
|
|
|
|
|
{
|
|
|
|
|
ToolTip = TextManager.Get("EnableVSyncToolTip"),
|
|
|
|
|
OnSelected = (GUITickBox box) =>
|
|
|
|
|
@@ -307,7 +307,7 @@ namespace Barotrauma
|
|
|
|
|
};
|
|
|
|
|
lightScrollBar.OnMoved(lightScrollBar, lightScrollBar.BarScroll);
|
|
|
|
|
|
|
|
|
|
new GUITickBox(new RectTransform(new Vector2(1.0f, 0.05f), rightColumn.RectTransform), TextManager.Get("SpecularLighting"))
|
|
|
|
|
new GUITickBox(new RectTransform(new Point(32, 32), rightColumn.RectTransform), TextManager.Get("SpecularLighting"))
|
|
|
|
|
{
|
|
|
|
|
ToolTip = TextManager.Get("SpecularLightingToolTip"),
|
|
|
|
|
Selected = SpecularityEnabled,
|
|
|
|
|
@@ -319,7 +319,7 @@ namespace Barotrauma
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
new GUITickBox(new RectTransform(new Vector2(1.0f, 0.05f), rightColumn.RectTransform), TextManager.Get("ChromaticAberration"))
|
|
|
|
|
new GUITickBox(new RectTransform(new Point(32, 32), rightColumn.RectTransform), TextManager.Get("ChromaticAberration"))
|
|
|
|
|
{
|
|
|
|
|
ToolTip = TextManager.Get("ChromaticAberrationToolTip"),
|
|
|
|
|
Selected = ChromaticAberrationEnabled,
|
|
|
|
|
@@ -369,11 +369,11 @@ namespace Barotrauma
|
|
|
|
|
|
|
|
|
|
var audioSliders = new GUILayoutGroup(new RectTransform(new Vector2(0.95f, 0.4f), tabs[(int)Tab.Audio].RectTransform, Anchor.TopCenter)
|
|
|
|
|
{ RelativeOffset = new Vector2(0.0f, 0.02f) })
|
|
|
|
|
{ RelativeSpacing = 0.01f, Stretch = true };
|
|
|
|
|
{ RelativeSpacing = 0.01f };
|
|
|
|
|
|
|
|
|
|
GUITextBlock soundVolumeText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.2f), audioSliders.RectTransform), TextManager.Get("SoundVolume"));
|
|
|
|
|
GUIScrollBar soundScrollBar = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.2f), audioSliders.RectTransform),
|
|
|
|
|
barSize: 0.1f)
|
|
|
|
|
GUITextBlock soundVolumeText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform), TextManager.Get("SoundVolume"));
|
|
|
|
|
GUIScrollBar soundScrollBar = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform),
|
|
|
|
|
barSize: 0.05f)
|
|
|
|
|
{
|
|
|
|
|
UserData = soundVolumeText,
|
|
|
|
|
BarScroll = SoundVolume,
|
|
|
|
|
@@ -387,9 +387,9 @@ namespace Barotrauma
|
|
|
|
|
};
|
|
|
|
|
soundScrollBar.OnMoved(soundScrollBar, soundScrollBar.BarScroll);
|
|
|
|
|
|
|
|
|
|
GUITextBlock musicVolumeText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.18f), audioSliders.RectTransform), TextManager.Get("MusicVolume"));
|
|
|
|
|
GUIScrollBar musicScrollBar = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.18f), audioSliders.RectTransform),
|
|
|
|
|
barSize: 0.1f)
|
|
|
|
|
GUITextBlock musicVolumeText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform), TextManager.Get("MusicVolume"));
|
|
|
|
|
GUIScrollBar musicScrollBar = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform),
|
|
|
|
|
barSize: 0.05f)
|
|
|
|
|
{
|
|
|
|
|
UserData = musicVolumeText,
|
|
|
|
|
BarScroll = MusicVolume,
|
|
|
|
|
@@ -403,9 +403,9 @@ namespace Barotrauma
|
|
|
|
|
};
|
|
|
|
|
musicScrollBar.OnMoved(musicScrollBar, musicScrollBar.BarScroll);
|
|
|
|
|
|
|
|
|
|
GUITextBlock voiceChatVolumeText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.18f), audioSliders.RectTransform), TextManager.Get("VoiceChatVolume"));
|
|
|
|
|
GUIScrollBar voiceChatScrollBar = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.18f), audioSliders.RectTransform),
|
|
|
|
|
barSize: 0.1f)
|
|
|
|
|
GUITextBlock voiceChatVolumeText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform), TextManager.Get("VoiceChatVolume"));
|
|
|
|
|
GUIScrollBar voiceChatScrollBar = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform),
|
|
|
|
|
barSize: 0.05f)
|
|
|
|
|
{
|
|
|
|
|
UserData = voiceChatVolumeText,
|
|
|
|
|
BarScroll = VoiceChatVolume,
|
|
|
|
|
@@ -419,7 +419,7 @@ namespace Barotrauma
|
|
|
|
|
};
|
|
|
|
|
voiceChatScrollBar.OnMoved(voiceChatScrollBar, voiceChatScrollBar.BarScroll);
|
|
|
|
|
|
|
|
|
|
GUITickBox muteOnFocusLostBox = new GUITickBox(new RectTransform(new Vector2(0.95f, 0.15f), audioSliders.RectTransform), TextManager.Get("MuteOnFocusLost"));
|
|
|
|
|
GUITickBox muteOnFocusLostBox = new GUITickBox(new RectTransform(new Point(32, 32), audioSliders.RectTransform), TextManager.Get("MuteOnFocusLost"));
|
|
|
|
|
muteOnFocusLostBox.Selected = MuteOnFocusLost;
|
|
|
|
|
muteOnFocusLostBox.ToolTip = TextManager.Get("MuteOnFocusLostToolTip");
|
|
|
|
|
muteOnFocusLostBox.OnSelected = (tickBox) =>
|
|
|
|
|
@@ -429,14 +429,11 @@ namespace Barotrauma
|
|
|
|
|
return true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var voiceSettings = new GUILayoutGroup(new RectTransform(new Vector2(0.95f, 0.5f), tabs[(int)Tab.Audio].RectTransform, Anchor.BottomCenter)
|
|
|
|
|
{ RelativeOffset = new Vector2(0.0f, 0.04f) })
|
|
|
|
|
{ RelativeSpacing = 0.01f, Stretch = true };
|
|
|
|
|
//var voiceSettings = new GUILayoutGroup(new RectTransform(new Vector2(0.95f, 0.5f), tabs[(int)Tab.Audio].RectTransform, Anchor.BottomCenter)
|
|
|
|
|
// { RelativeOffset = new Vector2(0.0f, 0.04f) })
|
|
|
|
|
// { RelativeSpacing = 0.01f };
|
|
|
|
|
|
|
|
|
|
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), voiceSettings.RectTransform), TextManager.Get("VoiceChat"));
|
|
|
|
|
|
|
|
|
|
//spacing
|
|
|
|
|
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.2f), rightColumn.RectTransform), style: null);
|
|
|
|
|
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform), TextManager.Get("VoiceChat"));
|
|
|
|
|
|
|
|
|
|
IList<string> deviceNames = Alc.GetString((IntPtr)null, AlcGetStringList.CaptureDeviceSpecifier);
|
|
|
|
|
foreach (string name in deviceNames)
|
|
|
|
|
@@ -446,7 +443,7 @@ namespace Barotrauma
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(VoiceCaptureDevice)) VoiceCaptureDevice = deviceNames[0];
|
|
|
|
|
#if (!OSX)
|
|
|
|
|
var deviceList = new GUIDropDown(new RectTransform(new Vector2(1.0f, 0.2f), voiceSettings.RectTransform), VoiceCaptureDevice, deviceNames.Count);
|
|
|
|
|
var deviceList = new GUIDropDown(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform), VoiceCaptureDevice, deviceNames.Count);
|
|
|
|
|
foreach (string name in deviceNames)
|
|
|
|
|
{
|
|
|
|
|
deviceList.AddItem(name, name);
|
|
|
|
|
@@ -460,13 +457,13 @@ namespace Barotrauma
|
|
|
|
|
return true;
|
|
|
|
|
};
|
|
|
|
|
#else
|
|
|
|
|
var suavemente = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.2f), voiceSettings.RectTransform), TextManager.Get("CurrentDevice") + ": " + VoiceCaptureDevice)
|
|
|
|
|
var suavemente = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform), TextManager.Get("CurrentDevice") + ": " + VoiceCaptureDevice)
|
|
|
|
|
{
|
|
|
|
|
ToolTip = TextManager.Get("CurrentDeviceToolTip.OSX"),
|
|
|
|
|
TextAlignment = Alignment.CenterX
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
new GUIButton(new RectTransform(new Vector2(1.0f, 0.25f), voiceSettings.RectTransform), TextManager.Get("RefreshDefaultDevice"))
|
|
|
|
|
new GUIButton(new RectTransform(new Vector2(1.0f, 0.25f), audioSliders.RectTransform), TextManager.Get("RefreshDefaultDevice"))
|
|
|
|
|
{
|
|
|
|
|
ToolTip = TextManager.Get("RefreshDefaultDeviceToolTip"),
|
|
|
|
|
OnClicked = (bt, userdata) =>
|
|
|
|
|
@@ -482,17 +479,16 @@ namespace Barotrauma
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
#endif
|
|
|
|
|
var radioButtonFrame = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.6f), voiceSettings.RectTransform))
|
|
|
|
|
var radioButtonFrame = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.6f), audioSliders.RectTransform))
|
|
|
|
|
{
|
|
|
|
|
Stretch = true,
|
|
|
|
|
RelativeSpacing = 0.05f
|
|
|
|
|
RelativeSpacing = 0.01f
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GUIRadioButtonGroup voiceMode = new GUIRadioButtonGroup();
|
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
|
|
{
|
|
|
|
|
string langStr = "VoiceMode." + ((VoiceMode)i).ToString();
|
|
|
|
|
var tick = new GUITickBox(new RectTransform(new Vector2(1.0f, 0.33f), radioButtonFrame.RectTransform), TextManager.Get(langStr))
|
|
|
|
|
var tick = new GUITickBox(new RectTransform(new Point(32, 32), radioButtonFrame.RectTransform), TextManager.Get(langStr))
|
|
|
|
|
{
|
|
|
|
|
ToolTip = TextManager.Get(langStr + "ToolTip")
|
|
|
|
|
};
|
|
|
|
|
@@ -500,9 +496,9 @@ namespace Barotrauma
|
|
|
|
|
voiceMode.AddRadioButton((VoiceMode)i, tick);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var micVolumeText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.18f), voiceSettings.RectTransform), TextManager.Get("MicrophoneVolume"));
|
|
|
|
|
var micVolumeSlider = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.18f), voiceSettings.RectTransform),
|
|
|
|
|
barSize: 0.1f)
|
|
|
|
|
var micVolumeText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform), TextManager.Get("MicrophoneVolume"));
|
|
|
|
|
var micVolumeSlider = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.1f), audioSliders.RectTransform),
|
|
|
|
|
barSize: 0.05f)
|
|
|
|
|
{
|
|
|
|
|
UserData = micVolumeText,
|
|
|
|
|
BarScroll = (float)Math.Sqrt(MathUtils.InverseLerp(0.2f, 5.0f, MicrophoneVolume)),
|
|
|
|
|
@@ -518,9 +514,9 @@ namespace Barotrauma
|
|
|
|
|
};
|
|
|
|
|
micVolumeSlider.OnMoved(micVolumeSlider, micVolumeSlider.BarScroll);
|
|
|
|
|
|
|
|
|
|
var voiceInputContainer = new GUILayoutGroup(new RectTransform(new Vector2(0.5f, 0.2f), voiceSettings.RectTransform, Anchor.BottomCenter));
|
|
|
|
|
new GUITextBlock(new RectTransform(new Vector2(0.6f, 1.0f), voiceInputContainer.RectTransform), TextManager.Get("InputType.Voice") + ": ");
|
|
|
|
|
var voiceKeyBox = new GUITextBox(new RectTransform(new Vector2(0.4f, 1.0f), voiceInputContainer.RectTransform, Anchor.TopRight),
|
|
|
|
|
var voiceInputContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 1.0f), audioSliders.RectTransform, Anchor.BottomCenter));
|
|
|
|
|
new GUITextBlock(new RectTransform(new Vector2(0.6f, 0.1f), voiceInputContainer.RectTransform), TextManager.Get("InputType.Voice") + ": ");
|
|
|
|
|
var voiceKeyBox = new GUITextBox(new RectTransform(new Vector2(0.4f, 0.1f), voiceInputContainer.RectTransform, Anchor.TopRight),
|
|
|
|
|
text: keyMapping[(int)InputType.Voice].ToString())
|
|
|
|
|
{
|
|
|
|
|
UserData = InputType.Voice
|
|
|
|
|
@@ -528,22 +524,22 @@ namespace Barotrauma
|
|
|
|
|
voiceKeyBox.OnSelected += KeyBoxSelected;
|
|
|
|
|
voiceKeyBox.SelectedColor = Color.Gold * 0.3f;
|
|
|
|
|
|
|
|
|
|
var voiceActivityGroup = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.3f), voiceSettings.RectTransform));
|
|
|
|
|
GUITextBlock noiseGateText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.5f), voiceActivityGroup.RectTransform), TextManager.Get("NoiseGateThreshold"))
|
|
|
|
|
var voiceActivityGroup = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 1.0f), audioSliders.RectTransform));
|
|
|
|
|
GUITextBlock noiseGateText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), voiceActivityGroup.RectTransform), TextManager.Get("NoiseGateThreshold"))
|
|
|
|
|
{
|
|
|
|
|
TextGetter = () =>
|
|
|
|
|
{
|
|
|
|
|
return TextManager.Get("NoiseGateThreshold") + " " + ((int)NoiseGateThreshold).ToString() + " dB";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var dbMeter = new GUIProgressBar(new RectTransform(new Vector2(1.0f, 0.5f), voiceActivityGroup.RectTransform), 0.0f, Color.Lime);
|
|
|
|
|
var dbMeter = new GUIProgressBar(new RectTransform(new Vector2(1.0f, 0.1f), voiceActivityGroup.RectTransform), 0.0f, Color.Lime);
|
|
|
|
|
dbMeter.ProgressGetter = () =>
|
|
|
|
|
{
|
|
|
|
|
if (VoipCapture.Instance == null) return 0.0f;
|
|
|
|
|
dbMeter.Color = VoipCapture.Instance.LastdB > NoiseGateThreshold ? Color.Lime : Color.Orange; //TODO: i'm a filthy hack
|
|
|
|
|
return ((float)VoipCapture.Instance.LastdB + 100.0f) / 100.0f;
|
|
|
|
|
};
|
|
|
|
|
var noiseGateSlider = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 1.0f), dbMeter.RectTransform, Anchor.Center), color: Color.White, barSize: 0.03f);
|
|
|
|
|
var noiseGateSlider = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.1f), dbMeter.RectTransform, Anchor.Center), color: Color.White, barSize: 0.03f);
|
|
|
|
|
noiseGateSlider.Frame.Visible = false;
|
|
|
|
|
noiseGateSlider.Step = 0.01f;
|
|
|
|
|
noiseGateSlider.Range = new Vector2(-100.0f, 0.0f);
|
|
|
|
|
@@ -599,14 +595,12 @@ namespace Barotrauma
|
|
|
|
|
voiceMode.Selected = VoiceSetting;
|
|
|
|
|
|
|
|
|
|
/// Controls tab -------------------------------------------------------------
|
|
|
|
|
var controlsLayoutGroup = new GUILayoutGroup(new RectTransform(new Vector2(0.95f, 0.95f), tabs[(int)Tab.Controls].RectTransform, Anchor.Center)
|
|
|
|
|
{ RelativeOffset = new Vector2(0.0f, 0.0f) })
|
|
|
|
|
{ RelativeSpacing = 0.01f, Stretch = true };
|
|
|
|
|
var controlsLayoutGroup = new GUILayoutGroup(new RectTransform(new Vector2(0.95f, 0.95f), tabs[(int)Tab.Controls].RectTransform, Anchor.Center))
|
|
|
|
|
{ RelativeSpacing = 0.01f };
|
|
|
|
|
|
|
|
|
|
var inputFrame = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.8f), controlsLayoutGroup.RectTransform))
|
|
|
|
|
{
|
|
|
|
|
Stretch = true
|
|
|
|
|
};
|
|
|
|
|
{ Stretch = true };
|
|
|
|
|
|
|
|
|
|
var inputNames = Enum.GetValues(typeof(InputType));
|
|
|
|
|
for (int i = 0; i < inputNames.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
@@ -623,7 +617,7 @@ namespace Barotrauma
|
|
|
|
|
}
|
|
|
|
|
GUITextBlock aimAssistText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.05f), controlsLayoutGroup.RectTransform), TextManager.Get("AimAssist"));
|
|
|
|
|
GUIScrollBar aimAssistSlider = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.05f), controlsLayoutGroup.RectTransform),
|
|
|
|
|
barSize: 0.1f)
|
|
|
|
|
barSize: 0.05f)
|
|
|
|
|
{
|
|
|
|
|
UserData = aimAssistText,
|
|
|
|
|
BarScroll = MathUtils.InverseLerp(0.0f, 5.0f, AimAssistAmount),
|
|
|
|
|
|