|
@@ -48,27 +48,6 @@
|
|
|
|
|
|
function OptionsMenuSettingsList::onAdd(%this)
|
|
function OptionsMenuSettingsList::onAdd(%this)
|
|
{
|
|
{
|
|
- %yesNoList = "No\tYes";
|
|
|
|
- %onOffList = "Off\tOn";
|
|
|
|
- %highMedLow = "Low\tMedium\tHigh";
|
|
|
|
- %anisoFilter = "Off\t4\t8\t16";
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Shadow Quality", "High\tMedium\tLow\tNone", false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Soft Shadow Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Mesh Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Texture Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Terrain Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Decal Lifetime", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Ground Cover Density", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Shader Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Anisotropic Filtering", %anisoFilter, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", "4\t2\t1\tOff", false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Refresh Rate", "75\t60\t30", false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Parallax", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Water Reflections", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("SSAO", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Depth of Field", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Vignette", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Light Rays", %onOffList, false, "", -1, -30);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function OptionsMenu::onWake(%this)
|
|
function OptionsMenu::onWake(%this)
|
|
@@ -95,13 +74,30 @@ function OptionsButtonHolder::refresh(%this)
|
|
GamepadButtonsGui.setButton(1, "RB", "", "Next Tab", "OptionsMenu.nextTab();", true);
|
|
GamepadButtonsGui.setButton(1, "RB", "", "Next Tab", "OptionsMenu.nextTab();", true);
|
|
GamepadButtonsGui.setButton(2, "Start", "Enter", "Apply", "OptionsMenu.apply();");
|
|
GamepadButtonsGui.setButton(2, "Start", "Enter", "Apply", "OptionsMenu.apply();");
|
|
GamepadButtonsGui.setButton(3, "B", "Esc", "Back", "OptionsMenu.backOut();");
|
|
GamepadButtonsGui.setButton(3, "B", "Esc", "Back", "OptionsMenu.backOut();");
|
|
- GamepadButtonsGui.setButton(7, "Back", "R", "Reset", "OptionsMenu.backOut();");
|
|
|
|
|
|
+ GamepadButtonsGui.setButton(7, "Back", "R", "Reset", "OptionsMenu.resetToDefaults();");
|
|
|
|
|
|
GamepadButtonsGui.refreshButtons();
|
|
GamepadButtonsGui.refreshButtons();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function OptionsMenu::apply(%this)
|
|
|
|
+{
|
|
|
|
+ if(%this.pageTabIndex == 0)
|
|
|
|
+ {
|
|
|
|
+ %this.applyDisplaySettings();
|
|
|
|
+ }
|
|
|
|
+ else if(%this.pageTabIndex == 1)
|
|
|
|
+ {
|
|
|
|
+ %this.applyGraphicsSettings();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
function OptionsMenuSettingsList::onChange(%this)
|
|
function OptionsMenuSettingsList::onChange(%this)
|
|
{
|
|
{
|
|
|
|
+ %optionName = %this.getRowLabel(%this.getSelectedRow());
|
|
|
|
+ %tooltipText = %this.getTooltip(%this.getSelectedRow());
|
|
|
|
+
|
|
|
|
+ OptionName.setText(%optionName);
|
|
|
|
+ OptionDescription.setText(%tooltipText);
|
|
return;
|
|
return;
|
|
|
|
|
|
OptionsMenuSettingsList.clearOptions();
|
|
OptionsMenuSettingsList.clearOptions();
|
|
@@ -128,6 +124,8 @@ function OptionsMenuSettingsList::onChange(%this)
|
|
{
|
|
{
|
|
OptionsMenuList.populateGamepadSettingsList();
|
|
OptionsMenuList.populateGamepadSettingsList();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function OptionsMenu::prevTab(%this)
|
|
function OptionsMenu::prevTab(%this)
|
|
@@ -171,69 +169,57 @@ function OptionsMenu::populateDisplaySettingsList(%this)
|
|
%this.pageTabIndex = 0;
|
|
%this.pageTabIndex = 0;
|
|
OptionsMenuSettingsList.clearRows();
|
|
OptionsMenuSettingsList.clearRows();
|
|
|
|
|
|
|
|
+ OptionName.setText("");
|
|
|
|
+ OptionDescription.setText("");
|
|
|
|
+
|
|
%resolutionList = getScreenResolutionList();
|
|
%resolutionList = getScreenResolutionList();
|
|
- //OptionsMenuSettingsList.addOptionsRow("Resolution", %yesNoList, false, "", 0, -15);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Resolution", %resolutionList, false, "screenResolutionOptionChanged", -1, -30);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function _makePrettyResString( %resString, %giveAspectRation )
|
|
|
|
-{
|
|
|
|
- %width = getWord( %resString, $WORD::RES_X );
|
|
|
|
- %height = getWord( %resString, $WORD::RES_Y );
|
|
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Display API", "D3D11\tOpenGL", false, "", -1, -30, true, "The display API used for rendering.", getDisplayDeviceInformation());
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Resolution", %resolutionList, false, "screenResolutionOptionChanged", -1, -30, true, "Resolution of the game window", _makePrettyResString( $pref::Video::mode ));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Fullscreen", "No\tYes", false, "", -1, -30, true, "", convertBoolToYesNo($pref::Video::FullScreen));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("VSync", "No\tYes", false, "", -1, -30, true, "", convertBoolToYesNo(!$pref::Video::disableVerticalSync));
|
|
|
|
|
|
- %aspect = %width / %height;
|
|
|
|
- %aspect = mRound( %aspect * 100 ) * 0.01;
|
|
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Refresh Rate", "30\t60\t75", false, "", -1, -30, true, "", $pref::Video::RefreshRate);
|
|
|
|
|
|
- switch$( %aspect )
|
|
|
|
- {
|
|
|
|
- case "1.33":
|
|
|
|
- %aspect = "4:3";
|
|
|
|
- case "1.78":
|
|
|
|
- %aspect = "16:9";
|
|
|
|
- default:
|
|
|
|
- %aspect = "";
|
|
|
|
- }
|
|
|
|
|
|
+ //move to gameplay tab
|
|
|
|
+ OptionsMenuSettingsList.addSliderRow("Field of View", 75, 5, "65 100", "", -1, -30);
|
|
|
|
|
|
- %outRes = %width @ " x " @ %height;
|
|
|
|
- if ( %giveAspectRation && %aspect !$= "" )
|
|
|
|
- %outRes = %outRes @ " (" @ %aspect @ ")";
|
|
|
|
-
|
|
|
|
- return %outRes;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function getScreenResolutionList()
|
|
|
|
-{
|
|
|
|
- %returnsList = "";
|
|
|
|
|
|
+ OptionsMenuSettingsList.addSliderRow("Brightness", 0.5, 0.1, "0 1", "", -1, -30);
|
|
|
|
+ OptionsMenuSettingsList.addSliderRow("Contrast", 0.5, 0.1, "0 1", "", -1, -30);
|
|
|
|
|
|
- %resCount = Canvas.getModeCount();
|
|
|
|
- for (%i = 0; %i < %resCount; %i++)
|
|
|
|
|
|
+ OptionsMenuSettingsList.refresh();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function OptionsMenu::applyDisplaySettings(%this)
|
|
|
|
+{
|
|
|
|
+ %newAdapter = GraphicsMenuDriver.getText();
|
|
|
|
+ %numAdapters = GFXInit::getAdapterCount();
|
|
|
|
+ %newDevice = $pref::Video::displayDevice;
|
|
|
|
+
|
|
|
|
+ for( %i = 0; %i < %numAdapters; %i ++ )
|
|
|
|
+ {
|
|
|
|
+ if( GFXInit::getAdapterName( %i ) $= %newAdapter )
|
|
|
|
+ {
|
|
|
|
+ %newDevice = GFXInit::getAdapterType( %i );
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Change the device.
|
|
|
|
+ if ( %newDevice !$= $pref::Video::displayDevice )
|
|
{
|
|
{
|
|
- %testResString = Canvas.getMode( %i );
|
|
|
|
- %testRes = _makePrettyResString( %testResString );
|
|
|
|
-
|
|
|
|
- //sanitize
|
|
|
|
- %found = false;
|
|
|
|
- %retCount = getTokenCount(%returnsList, "\t");
|
|
|
|
- for (%x = 0; %x < %retCount; %x++)
|
|
|
|
- {
|
|
|
|
- %existingEntry = getToken(%returnsList, "\t", %x);
|
|
|
|
- if(%existingEntry $= %testRes)
|
|
|
|
- {
|
|
|
|
- %found = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(%found)
|
|
|
|
- continue;
|
|
|
|
-
|
|
|
|
- if(%i != 0)
|
|
|
|
- %returnsList = %returnsList @ "\t" @ %testRes;
|
|
|
|
- else
|
|
|
|
- %returnsList = %testRes;
|
|
|
|
|
|
+ if ( %testNeedApply )
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ $pref::Video::displayDevice = %newDevice;
|
|
|
|
+ if( %newAdapter !$= getDisplayDeviceInformation() )
|
|
|
|
+ MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." );
|
|
}
|
|
}
|
|
|
|
|
|
- return %returnsList;
|
|
|
|
|
|
+ updateDisplaySettings();
|
|
|
|
+
|
|
|
|
+ echo("Exporting client prefs");
|
|
|
|
+ %prefPath = getPrefpath();
|
|
|
|
+ export("$pref::*", %prefPath @ "/clientPrefs.cs", false);
|
|
}
|
|
}
|
|
|
|
|
|
function screenResolutionOptionChanged()
|
|
function screenResolutionOptionChanged()
|
|
@@ -246,27 +232,124 @@ function OptionsMenu::populateGraphicsSettingsList(%this)
|
|
%this.pageTabIndex = 1;
|
|
%this.pageTabIndex = 1;
|
|
OptionsMenuSettingsList.clearRows();
|
|
OptionsMenuSettingsList.clearRows();
|
|
|
|
|
|
|
|
+ OptionName.setText("");
|
|
|
|
+ OptionDescription.setText("");
|
|
|
|
+
|
|
%yesNoList = "No\tYes";
|
|
%yesNoList = "No\tYes";
|
|
%onOffList = "Off\tOn";
|
|
%onOffList = "Off\tOn";
|
|
%highMedLow = "Low\tMedium\tHigh";
|
|
%highMedLow = "Low\tMedium\tHigh";
|
|
%anisoFilter = "Off\t4\t8\t16";
|
|
%anisoFilter = "Off\t4\t8\t16";
|
|
- OptionsMenuSettingsList.addOptionRow("Shadow Quality", "High\tMedium\tLow\tNone", false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Soft Shadow Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Mesh Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Texture Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Terrain Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Decal Lifetime", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Ground Cover Density", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Shader Quality", %highMedLow, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Anisotropic Filtering", %anisoFilter, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", "4\t2\t1\tOff", false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Refresh Rate", "75\t60\t30", false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Parallax", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Water Reflections", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("SSAO", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Depth of Field", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Vignette", %onOffList, false, "", -1, -30);
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Light Rays", %onOffList, false, "", -1, -30);
|
|
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Shadow Quality", getQualityLevels(ShadowQualityList), false, "", -1, -30, true, "Shadow revolution quality", getCurrentQualityLevel(ShadowQualityList));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Soft Shadow Quality", getQualityLevels(SoftShadowList), false, "", -1, -30, true, "Amount of softening applied to shadowmaps", getCurrentQualityLevel(SoftShadowList));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Mesh Quality", getQualityLevels(MeshQualityGroup), false, "", -1, -30, true, "Fidelity of rendering of mesh objects", getCurrentQualityLevel(MeshQualityGroup));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Texture Quality", getQualityLevels(TextureQualityGroup), false, "", -1, -30, true, "Fidelity of textures", getCurrentQualityLevel(TextureQualityGroup));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Terrain Quality", getQualityLevels(TerrainQualityGroup), false, "", -1, -30, true, "Quality level of terrain objects", getCurrentQualityLevel(TerrainQualityGroup));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Decal Lifetime", getQualityLevels(DecalLifetimeGroup), false, "", -1, -30, true, "How long decals are rendered", getCurrentQualityLevel(DecalLifetimeGroup));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Ground Cover Density", getQualityLevels(GroundCoverDensityGroup), false, "", -1, -30, true, "Density of ground cover items, such as grass", getCurrentQualityLevel(GroundCoverDensityGroup));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Shader Quality", getQualityLevels(ShaderQualityGroup), false, "", -1, -30, true, "Dictates the overall shader quality level, adjusting what features are enabled.", getCurrentQualityLevel(ShaderQualityGroup));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Anisotropic Filtering", %anisoFilter, false, "", -1, -30, true, "Amount of Anisotropic Filtering on textures, which dictates their sharpness at a distance", $pref::Video::defaultAnisotropy);
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", "4\t2\t1\tOff", false, "", -1, -30, true, "Amount of Post-Processing Anti-Aliasing applied to rendering", $pref::Video::AA);
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Parallax", %onOffList, false, "", -1, -30, true, "Whether the surface parallax shader effect is enabled", convertBoolToOnOff(!$pref::Video::disableParallaxMapping));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Water Reflections", %onOffList, false, "", -1, -30, true, "Whether water reflections are enabled", convertBoolToOnOff(!$pref::Water::disableTrueReflections));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("SSAO", %onOffList, false, "", -1, -30, true, "Whether Screen-Space Ambient Occlusion is enabled", convertBoolToOnOff($pref::PostFX::EnableSSAO));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Depth of Field", %onOffList, false, "", -1, -30, true, "Whether the Depth of Field effect is enabled", convertBoolToOnOff($pref::PostFX::EnableDOF));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Vignette", %onOffList, false, "", -1, -30, true, "Whether the vignette effect is enabled", convertBoolToOnOff($pref::PostFX::EnableVignette));
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Light Rays", %onOffList, false, "", -1, -30, true, "Whether the light rays effect is enabled", convertBoolToOnOff($pref::PostFX::EnableLightRays));
|
|
|
|
+
|
|
|
|
+ OptionsMenuSettingsList.refresh();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function OptionsMenu::applyGraphicsSettings(%this)
|
|
|
|
+{
|
|
|
|
+ ShadowQualityList.applySetting(OptionsMenuSettingsList.getCurrentOption(0));
|
|
|
|
+ SoftShadowList.applySetting(OptionsMenuSettingsList.getCurrentOption(1));
|
|
|
|
+
|
|
|
|
+ MeshQualityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(2));
|
|
|
|
+ TextureQualityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(3));
|
|
|
|
+ TerrainQualityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(4));
|
|
|
|
+ DecalLifetimeGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(5));
|
|
|
|
+ GroundCoverDensityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(6));
|
|
|
|
+ ShaderQualityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(7));
|
|
|
|
+
|
|
|
|
+ //Update Textures
|
|
|
|
+ reloadTextures();
|
|
|
|
+
|
|
|
|
+ //Update lighting
|
|
|
|
+ // Set the light manager. This should do nothing
|
|
|
|
+ // if its already set or if its not compatible.
|
|
|
|
+ //setLightManager( $pref::lightManager );
|
|
|
|
+
|
|
|
|
+ $pref::PostFX::EnableSSAO = convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(12));
|
|
|
|
+ $pref::PostFX::EnableDOF = convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(13));
|
|
|
|
+ $pref::PostFX::EnableVignette = convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(14));
|
|
|
|
+ $pref::PostFX::EnableLightRays = convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(15));
|
|
|
|
+
|
|
|
|
+ PostFXManager.settingsEffectSetEnabled("SSAO", $pref::PostFX::EnableSSAO);
|
|
|
|
+ PostFXManager.settingsEffectSetEnabled("DOF", $pref::PostFX::EnableDOF);
|
|
|
|
+ PostFXManager.settingsEffectSetEnabled("LightRays", $pref::PostFX::EnableLightRays);
|
|
|
|
+ PostFXManager.settingsEffectSetEnabled("Vignette", $pref::PostFX::EnableVignette);
|
|
|
|
+
|
|
|
|
+ $pref::Video::disableParallaxMapping = !convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(10));
|
|
|
|
+
|
|
|
|
+ //water reflections
|
|
|
|
+ $pref::Water::disableTrueReflections = !convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(11));
|
|
|
|
+
|
|
|
|
+ // Check the anisotropic filtering.
|
|
|
|
+ %level = OptionsMenuSettingsList.getCurrentOption(8);
|
|
|
|
+ if ( %level != $pref::Video::defaultAnisotropy )
|
|
|
|
+ {
|
|
|
|
+ if ( %testNeedApply )
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ $pref::Video::defaultAnisotropy = %level;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ updateDisplaySettings();
|
|
|
|
+
|
|
|
|
+ echo("Exporting client prefs");
|
|
|
|
+ %prefPath = getPrefpath();
|
|
|
|
+ export("$pref::*", %prefPath @ "/clientPrefs.cs", false);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function updateDisplaySettings()
|
|
|
|
+{
|
|
|
|
+ //Update the display settings now
|
|
|
|
+ $pref::Video::Resolution = getWords( Canvas.getMode( GraphicsMenuResolution.getSelected() ), $WORD::RES_X, $WORD::RES_Y );
|
|
|
|
+ %newBpp = 32; // ... its not 1997 anymore.
|
|
|
|
+ $pref::Video::FullScreen = GraphicsMenuFullScreen.isStateOn() ? "true" : "false";
|
|
|
|
+ $pref::Video::RefreshRate = GraphicsMenuRefreshRate.getSelected();
|
|
|
|
+ $pref::Video::disableVerticalSync = !GraphicsMenuVSync.isStateOn();
|
|
|
|
+ $pref::Video::AA = GraphicsMenuAA.getSelected();
|
|
|
|
+
|
|
|
|
+ if ( %newFullScreen $= "false" )
|
|
|
|
+ {
|
|
|
|
+ // If we're in windowed mode switch the fullscreen check
|
|
|
|
+ // if the resolution is bigger than the desktop.
|
|
|
|
+ %deskRes = getDesktopResolution();
|
|
|
|
+ %deskResX = getWord(%deskRes, $WORD::RES_X);
|
|
|
|
+ %deskResY = getWord(%deskRes, $WORD::RES_Y);
|
|
|
|
+ if ( getWord( %newRes, $WORD::RES_X ) > %deskResX ||
|
|
|
|
+ getWord( %newRes, $WORD::RES_Y ) > %deskResY )
|
|
|
|
+ {
|
|
|
|
+ $pref::Video::FullScreen = "true";
|
|
|
|
+ GraphicsMenuFullScreen.setStateOn( true );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Build the final mode string.
|
|
|
|
+ %newMode = $pref::Video::Resolution SPC $pref::Video::FullScreen SPC %newBpp SPC $pref::Video::RefreshRate SPC $pref::Video::AA;
|
|
|
|
+
|
|
|
|
+ // Change the video mode.
|
|
|
|
+ if ( %newMode !$= $pref::Video::mode ||
|
|
|
|
+ %newVsync != $pref::Video::disableVerticalSync )
|
|
|
|
+ {
|
|
|
|
+ if ( %testNeedApply )
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ $pref::Video::mode = %newMode;
|
|
|
|
+ $pref::Video::disableVerticalSync = %newVsync;
|
|
|
|
+ configureCanvas();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function OptionsMenu::populateAudioSettingsList(%this)
|
|
function OptionsMenu::populateAudioSettingsList(%this)
|
|
@@ -274,8 +357,56 @@ function OptionsMenu::populateAudioSettingsList(%this)
|
|
%this.pageTabIndex = 2;
|
|
%this.pageTabIndex = 2;
|
|
OptionsMenuSettingsList.clearRows();
|
|
OptionsMenuSettingsList.clearRows();
|
|
|
|
|
|
|
|
+ OptionName.setText("");
|
|
|
|
+ OptionDescription.setText("");
|
|
|
|
+
|
|
|
|
+ %buffer = sfxGetAvailableDevices();
|
|
|
|
+ %count = getRecordCount( %buffer );
|
|
|
|
+ %audioDriverList = "";
|
|
|
|
+
|
|
|
|
+ for(%i = 0; %i < %count; %i++)
|
|
|
|
+ {
|
|
|
|
+ %record = getRecord(%buffer, %i);
|
|
|
|
+ %provider = getField(%record, 0);
|
|
|
|
+
|
|
|
|
+ if(%i == 0)
|
|
|
|
+ %audioDriverList = %provider;
|
|
|
|
+ else
|
|
|
|
+ %audioDriverList = %audioDriverList @ "\t" @ %provider;
|
|
|
|
+ }
|
|
|
|
+
|
|
%yesNoList = "Yes\tNo";
|
|
%yesNoList = "Yes\tNo";
|
|
- OptionsMenuSettingsList.addOptionRow("Audio Device", %yesNoList, false, "", -1, -15);
|
|
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Audio Driver", %audioDriverList, false, "", -1, -15, true, "", $pref::SFX::provider);
|
|
|
|
+ OptionsMenuSettingsList.addOptionRow("Audio Device", %yesNoList, false, "", -1, -15, true, "");
|
|
|
|
+
|
|
|
|
+ OptionsMenuSettingsList.addSliderRow("Master Volume", $pref::SFX::masterVolume, 0.1, "0 1", "", -1, -30);
|
|
|
|
+ OptionsMenuSettingsList.addSliderRow("GUI Volume", $pref::SFX::channelVolume[ $GuiAudioType], 0.1, "0 1", "", -1, -30);
|
|
|
|
+ OptionsMenuSettingsList.addSliderRow("Effects Volume", $pref::SFX::channelVolume[ $SimAudioType ], 0.1, "0 1", "", -1, -30);
|
|
|
|
+ OptionsMenuSettingsList.addSliderRow("Music Volume", $pref::SFX::channelVolume[ $MusicAudioType ], 0.1, "0 1", "", -1, -30);
|
|
|
|
+
|
|
|
|
+ OptionsMenuSettingsList.refresh();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function OptionsMenu::applyAudioSettings(%this)
|
|
|
|
+{
|
|
|
|
+ sfxSetMasterVolume( $pref::SFX::masterVolume );
|
|
|
|
+
|
|
|
|
+ sfxSetChannelVolume( $GuiAudioType, $pref::SFX::channelVolume[ $GuiAudioType ] );
|
|
|
|
+ sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ $SimAudioType ] );
|
|
|
|
+ sfxSetChannelVolume( $MusicAudioType, $pref::SFX::channelVolume[ $MusicAudioType ] );
|
|
|
|
+
|
|
|
|
+ if ( !sfxCreateDevice( $pref::SFX::provider,
|
|
|
|
+ $pref::SFX::device,
|
|
|
|
+ $pref::SFX::useHardware,
|
|
|
|
+ -1 ) )
|
|
|
|
+ error( "Unable to create SFX device: " @ $pref::SFX::provider
|
|
|
|
+ SPC $pref::SFX::device
|
|
|
|
+ SPC $pref::SFX::useHardware );
|
|
|
|
+
|
|
|
|
+ if( !isObject( $AudioTestHandle ) )
|
|
|
|
+ {
|
|
|
|
+ sfxPlay(menuButtonPressed);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function OptionsMenu::populateKeyboardMouseSettingsList(%this)
|
|
function OptionsMenu::populateKeyboardMouseSettingsList(%this)
|
|
@@ -283,13 +414,23 @@ function OptionsMenu::populateKeyboardMouseSettingsList(%this)
|
|
%this.pageTabIndex = 3;
|
|
%this.pageTabIndex = 3;
|
|
OptionsMenuSettingsList.clearRows();
|
|
OptionsMenuSettingsList.clearRows();
|
|
|
|
|
|
- OptionsMenuSettingsList.addOptionRow("Forward", "W", false, "", -1, -15);
|
|
|
|
|
|
+ OptionName.setText("");
|
|
|
|
+ OptionDescription.setText("");
|
|
|
|
+
|
|
|
|
+ OptionsMenuSettingsList.addKeybindRow("Forward", getButtonBitmap("Keyboard", "W"), "doKeyRemap", -1, -15, true, "Forward butaaaahn");
|
|
|
|
+
|
|
|
|
+ OptionsMenuSettingsList.refresh();
|
|
}
|
|
}
|
|
|
|
|
|
function OptionsMenu::populateGamepadSettingsList(%this)
|
|
function OptionsMenu::populateGamepadSettingsList(%this)
|
|
{
|
|
{
|
|
%this.pageTabIndex = 4;
|
|
%this.pageTabIndex = 4;
|
|
OptionsMenuSettingsList.clearRows();
|
|
OptionsMenuSettingsList.clearRows();
|
|
|
|
+
|
|
|
|
+ OptionName.setText("");
|
|
|
|
+ OptionDescription.setText("");
|
|
|
|
+
|
|
|
|
+ OptionsMenuSettingsList.refresh();
|
|
}
|
|
}
|
|
|
|
|
|
function OptionsMenuList::activateRow(%this)
|
|
function OptionsMenuList::activateRow(%this)
|
|
@@ -297,78 +438,6 @@ function OptionsMenuList::activateRow(%this)
|
|
OptionsMenuSettingsList.setFirstResponder();
|
|
OptionsMenuSettingsList.setFirstResponder();
|
|
}
|
|
}
|
|
|
|
|
|
-function OptionsMenuList::backOut(%this)
|
|
|
|
-{
|
|
|
|
- OptionsMenuList.setFirstResponder();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function OptionsMenuOKButton::onClick(%this)
|
|
|
|
-{
|
|
|
|
- //save the settings and then back out
|
|
|
|
- eval(OptionsMenu.currentMenu@"::apply();");
|
|
|
|
- OptionsMenu.backOut();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-function OptionsMenuSettingsList::backOut(%this)
|
|
|
|
-{
|
|
|
|
- OptionsMenuList.setFirstResponder();
|
|
|
|
-}
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-
|
|
|
|
-function OptionsMenuCancelButton::onClick(%this)
|
|
|
|
-{
|
|
|
|
- //we don't save, so just back out of the menu
|
|
|
|
- OptionsMenu.backOut();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function OptionsMenuDefaultsButton::onClick(%this)
|
|
|
|
-{
|
|
|
|
- //we don't save, so go straight to backing out of the menu
|
|
|
|
- eval(OptionsMenu.currentMenu@"::applyDefaults();");
|
|
|
|
- OptionsMenu.backOut();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function ControlsSettingsMenuButton::onClick(%this)
|
|
|
|
-{
|
|
|
|
- OptionsMain.hidden = true;
|
|
|
|
- ControlsMenu.hidden = false;
|
|
|
|
-
|
|
|
|
- KeyboardControlPanel.hidden = false;
|
|
|
|
- MouseControlPanel.hidden = true;
|
|
|
|
-
|
|
|
|
- ControlsMenu.reload();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function GraphicsSettingsMenuButton::onClick(%this)
|
|
|
|
-{
|
|
|
|
- OptionsMain.hidden = true;
|
|
|
|
- GraphicsMenu.hidden = false;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function CameraSettingsMenuButton::onClick(%this)
|
|
|
|
-{
|
|
|
|
- OptionsMain.hidden = true;
|
|
|
|
- CameraMenu.hidden = false;
|
|
|
|
-
|
|
|
|
- CameraMenu.loadSettings();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function AudioSettingsMenuButton::onClick(%this)
|
|
|
|
-{
|
|
|
|
- OptionsMain.hidden = true;
|
|
|
|
- AudioMenu.hidden = false;
|
|
|
|
- AudioMenu.loadSettings();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function ScreenBrSettingsMenuButton::onClick(%this)
|
|
|
|
-{
|
|
|
|
- OptionsMain.hidden = true;
|
|
|
|
- ScreenBrightnessMenu.hidden = false;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
function OptionsMenu::backOut(%this)
|
|
function OptionsMenu::backOut(%this)
|
|
{
|
|
{
|
|
//save the settings and then back out
|
|
//save the settings and then back out
|
|
@@ -391,217 +460,26 @@ function OptionsMenu::backOut(%this)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-function OptionsMenu::addSettingOption(%this, %arrayTarget, %optionName, %defaultValue, %settingsGroup, %targetVar)
|
|
|
|
-{
|
|
|
|
- %option = TAMLRead("data/ui/guis/graphicsMenuSettingsCtrl.taml");
|
|
|
|
-
|
|
|
|
- if(!isMethod(%settingsGroup, "get") || !isMethod(%settingsGroup, "set"))
|
|
|
|
- {
|
|
|
|
- error("OptionsMenu::addSettingsOption - unrecognized settings group of: " @ %settingsGroup @ ". Did not have proper getter/setter");
|
|
|
|
- return "";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- %option-->nameText.text = %optionName;
|
|
|
|
- %option-->SettingText.text = eval(%settingsGroup@"::"@"get();");
|
|
|
|
- %option.qualitySettingGroup = %settingsGroup;
|
|
|
|
- %option.targetVar = %targetVar;
|
|
|
|
-
|
|
|
|
- %arrayTarget.add(%option);
|
|
|
|
-
|
|
|
|
- return %option;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function OptionsMenu::addSliderOption(%this, %arrayTarget, %optionName, %variable, %range, %ticks, %value, %class)
|
|
|
|
-{
|
|
|
|
- %option = TAMLRead("data/ui/guis/graphicsMenuSettingsSlider.taml");
|
|
|
|
-
|
|
|
|
- %option-->nameText.text = %optionName;
|
|
|
|
-
|
|
|
|
- %arrayTarget.add(%option);
|
|
|
|
-
|
|
|
|
- if(%range !$= "")
|
|
|
|
- {
|
|
|
|
- %option-->slider.range = %range;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(%ticks !$= "")
|
|
|
|
- {
|
|
|
|
- %option-->slider.ticks = %ticks;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(%variable !$= "")
|
|
|
|
- {
|
|
|
|
- %option-->slider.variable = %variable;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(%value !$= "")
|
|
|
|
- {
|
|
|
|
- %option-->slider.setValue(%value);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(%class !$= "")
|
|
|
|
- {
|
|
|
|
- %option-->slider.className = %class;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- %option-->slider.className = OptionsMenuSlider;
|
|
|
|
-
|
|
|
|
- %option-->slider.snap = true;
|
|
|
|
-
|
|
|
|
- %option-->slider.onValueSet();
|
|
|
|
-
|
|
|
|
- return %option;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function OptionsMenuSlider::onMouseDragged(%this)
|
|
|
|
-{
|
|
|
|
- %this.onValueSet();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function OptionsMenuSlider::onValueSet(%this)
|
|
|
|
-{
|
|
|
|
- %this.getParent().getParent()-->valueText.setText(mRound(%this.value * 10));
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function FOVOptionSlider::onMouseDragged(%this)
|
|
|
|
-{
|
|
|
|
- %this.onValueSet();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function FOVOptionSlider::onValueSet(%this)
|
|
|
|
-{
|
|
|
|
- %this.getParent().getParent()-->valueText.setText(mRound(%this.value));
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//
|
|
|
|
-function OptionsMenuForwardSetting::onClick(%this)
|
|
|
|
|
|
+function convertOptionToBool(%val)
|
|
{
|
|
{
|
|
- //we need to advance through the value list, unless it's the end, in which case we do nothing
|
|
|
|
- echo("Move forward in the list!");
|
|
|
|
-
|
|
|
|
- %settingCtrl = %this.getParent();
|
|
|
|
- %settingsList = eval(%settingCtrl.qualitySettingGroup@"::getList();");
|
|
|
|
- %settingsListCount = getTokenCount(%settingsList, ",");
|
|
|
|
- %currentSetting = %settingCtrl-->SettingText.text;
|
|
|
|
-
|
|
|
|
- //We consider 'custom' to be the defacto end of the list. The only way back is to go lower
|
|
|
|
- if(%currentSetting $= "Custom")
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- %currentSettingIdx = OptionsMenu.getCurrentIndexFromSetting(%settingCtrl);
|
|
|
|
-
|
|
|
|
- if(%currentSettingIdx != %settingsListCount-1)
|
|
|
|
- {
|
|
|
|
- %currentSettingIdx++;
|
|
|
|
-
|
|
|
|
- //advance by one
|
|
|
|
- %newSetting = getToken(%settingsList, ",", %currentSettingIdx);
|
|
|
|
- eval(%settingCtrl.qualitySettingGroup@"::set(\""@%newSetting@"\");");
|
|
|
|
- %settingCtrl-->SettingText.setText( %newSetting );
|
|
|
|
-
|
|
|
|
- if(%currentSettingIdx == %settingsListCount)
|
|
|
|
- {
|
|
|
|
- //if we hit the end of the list, disable the forward button
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function OptionsMenuBackSetting::onClick(%this)
|
|
|
|
-{
|
|
|
|
- //we need to advance through the value list, unless it's the end, in which case we do nothing
|
|
|
|
- echo("Move back in the list!");
|
|
|
|
-
|
|
|
|
- %settingCtrl = %this.getParent();
|
|
|
|
- %settingsList = eval(%settingCtrl.qualitySettingGroup@"::getList();");
|
|
|
|
- %settingsListCount = getTokenCount(%settingsList, ",");
|
|
|
|
- %currentSetting = %settingCtrl-->SettingText.text;
|
|
|
|
-
|
|
|
|
- %currentSettingIdx = OptionsMenu.getCurrentIndexFromSetting(%settingCtrl);
|
|
|
|
-
|
|
|
|
- if(%currentSettingIdx != 0)
|
|
|
|
- {
|
|
|
|
- %currentSettingIdx--;
|
|
|
|
-
|
|
|
|
- //advance by one
|
|
|
|
- %newSetting = getToken(%settingsList, ",", %currentSettingIdx);
|
|
|
|
- eval(%settingCtrl.qualitySettingGroup@"::set(\""@%newSetting@"\");");
|
|
|
|
- %settingCtrl-->SettingText.setText( %newSetting );
|
|
|
|
-
|
|
|
|
- if(%currentSettingIdx == %settingsListCount)
|
|
|
|
- {
|
|
|
|
- //if we hit the end of the list, disable the forward button
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function OptionsMenu::getCurrentIndexFromSetting(%this, %settingCtrl)
|
|
|
|
-{
|
|
|
|
- %settingsList = eval(%settingCtrl.qualitySettingGroup@"::getList();");
|
|
|
|
- %settingsListCount = getTokenCount(%settingsList, ",");
|
|
|
|
- %currentSetting = %settingCtrl-->SettingText.text;
|
|
|
|
-
|
|
|
|
- for ( %i=0; %i < %settingsListCount; %i++ )
|
|
|
|
- {
|
|
|
|
- %level = getToken(%settingsList, ",", %i);
|
|
|
|
-
|
|
|
|
- //find our current level
|
|
|
|
- if(%currentSetting $= %level)
|
|
|
|
- {
|
|
|
|
- return %i;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return -1;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// =============================================================================
|
|
|
|
-// CAMERA MENU
|
|
|
|
-// =============================================================================
|
|
|
|
-function CameraMenu::onWake(%this)
|
|
|
|
-{
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function CameraMenu::apply(%this)
|
|
|
|
-{
|
|
|
|
- setFOV($pref::Player::defaultFov);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function CameraMenu::loadSettings(%this)
|
|
|
|
-{
|
|
|
|
- CameraMenuOptionsArray.clear();
|
|
|
|
-
|
|
|
|
- %option = OptionsMenu.addSettingOption(CameraMenuOptionsArray);
|
|
|
|
- %option-->nameText.setText("Invert Vertical");
|
|
|
|
- %option.qualitySettingGroup = InvertVerticalMouse;
|
|
|
|
- %option.init();
|
|
|
|
-
|
|
|
|
- %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::VertMouseSensitivity", $pref::Input::VertMouseSensitivity);
|
|
|
|
- %option-->nameText.setText("Vertical Sensitivity");
|
|
|
|
-
|
|
|
|
- %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::HorzMouseSensitivity", $pref::Input::HorzMouseSensitivity);
|
|
|
|
- %option-->nameText.setText("Horizontal Sensitivity");
|
|
|
|
-
|
|
|
|
- %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::ZoomVertMouseSensitivity", $pref::Input::ZoomVertMouseSensitivity);
|
|
|
|
- %option-->nameText.setText("Zoom Vertical Sensitivity");
|
|
|
|
-
|
|
|
|
- %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::ZoomHorzMouseSensitivity", $pref::Input::ZoomHorzMouseSensitivity);
|
|
|
|
- %option-->nameText.setText("Zoom Horizontal Sensitivity");
|
|
|
|
-
|
|
|
|
- %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "65 90", 25, "$pref::Player::defaultFov", $pref::Player::defaultFov, FOVOptionSlider);
|
|
|
|
- %option-->nameText.setText("Field of View");
|
|
|
|
-
|
|
|
|
- CameraMenuOptionsArray.refresh();
|
|
|
|
|
|
+ if(%val $= "yes" || %val $= "on")
|
|
|
|
+ return 1;
|
|
|
|
+ else
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-function CameraMenuOKButton::onClick(%this)
|
|
|
|
|
|
+function convertBoolToYesNo(%val)
|
|
{
|
|
{
|
|
- //save the settings and then back out
|
|
|
|
- CameraMenu.apply();
|
|
|
|
- OptionsMenu.backOut();
|
|
|
|
|
|
+ if(%val == 1)
|
|
|
|
+ return "Yes";
|
|
|
|
+ else
|
|
|
|
+ return "No";
|
|
}
|
|
}
|
|
|
|
|
|
-function CameraMenuDefaultsButton::onClick(%this)
|
|
|
|
|
|
+function convertBoolToOnOff(%val)
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ if(%val == 1)
|
|
|
|
+ return "On";
|
|
|
|
+ else
|
|
|
|
+ return "Off";
|
|
}
|
|
}
|