mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Overhauled keybind remap part of options menu
Fix audio options menu so it correctly save and applies settings
This commit is contained in:
parent
69089e1ee2
commit
11f0ec2c0f
13 changed files with 1230 additions and 662 deletions
|
|
@ -69,6 +69,9 @@ function CoreModule::onCreate(%this)
|
|||
ModuleDatabase.scanModules( "tools", false );
|
||||
ModuleDatabase.LoadGroup( "Tools" );
|
||||
}
|
||||
|
||||
//This is used to build the remap keybind sets for the different actionMaps.
|
||||
$RemapCount = 0;
|
||||
}
|
||||
|
||||
function CoreModule::onDestroy(%this)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ function Core_Rendering::onCreate(%this)
|
|||
|
||||
$pref::ReflectionProbes::BakeResolution = ProjectSettings.value("Rendering/ProbeCaptureResolution", "64");
|
||||
|
||||
exec("./scripts/graphicsOptions.cs");
|
||||
exec("./scripts/renderManager.cs");
|
||||
exec("./scripts/gfxData/clouds.cs");
|
||||
exec("./scripts/gfxData/commonMaterialData.cs");
|
||||
|
|
@ -42,7 +43,7 @@ function Core_Rendering::initClient(%this)
|
|||
|
||||
//Autodetect settings if it's our first time
|
||||
if($pref::Video::autoDetect)
|
||||
GraphicsMenu.Autodetect();
|
||||
AutodetectGraphics();
|
||||
|
||||
postFXInit();
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,757 @@
|
|||
function GraphicsQualityLevel::isCurrent( %this )
|
||||
{
|
||||
// Test each pref to see if the current value
|
||||
// equals our stored value.
|
||||
|
||||
for ( %i=0; %i < %this.count(); %i++ )
|
||||
{
|
||||
%pref = %this.getKey( %i );
|
||||
%value = %this.getValue( %i );
|
||||
|
||||
if ( getVariable( %pref ) !$= %value )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function GraphicsQualityLevel::apply( %this )
|
||||
{
|
||||
for ( %i=0; %i < %this.count(); %i++ )
|
||||
{
|
||||
%pref = %this.getKey( %i );
|
||||
%value = %this.getValue( %i );
|
||||
setVariable( %pref, %value );
|
||||
}
|
||||
|
||||
// If we have an overloaded onApply method then
|
||||
// call it now to finalize the changes.
|
||||
if ( %this.isMethod( "onApply" ) )
|
||||
%this.onApply();
|
||||
else
|
||||
{
|
||||
%group = %this.getGroup();
|
||||
if ( isObject( %group ) && %group.isMethod( "onApply" ) )
|
||||
%group.onApply( %this );
|
||||
}
|
||||
}
|
||||
|
||||
function GraphicsOptionsMenuGroup::applySetting(%this, %settingName)
|
||||
{
|
||||
for(%i=0; %i < %this.getCount(); %i++)
|
||||
{
|
||||
%setting = %this.getObject(%i);
|
||||
if(%setting.displayName $= %settingName)
|
||||
{
|
||||
for ( %s=0; %s < %setting.count(); %s++ )
|
||||
{
|
||||
%pref = %setting.getKey( %s );
|
||||
%value = %setting.getValue( %s );
|
||||
setVariable( %pref, %value );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new SimGroup( MeshQualityGroup )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::TS::detailAdjust"] = 1.5;
|
||||
key["$pref::TS::skipRenderDLs"] = 0;
|
||||
};
|
||||
new ArrayObject( )
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Medium";
|
||||
|
||||
key["$pref::TS::detailAdjust"] = 1.0;
|
||||
key["$pref::TS::skipRenderDLs"] = 0;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::TS::detailAdjust"] = 0.75;
|
||||
key["$pref::TS::skipRenderDLs"] = 0;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Lowest";
|
||||
|
||||
key["$pref::TS::detailAdjust"] = 0.5;
|
||||
key["$pref::TS::skipRenderDLs"] = 1;
|
||||
};
|
||||
};
|
||||
|
||||
new SimGroup( TextureQualityGroup )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::Video::textureReductionLevel"] = 0;
|
||||
key["$pref::Reflect::refractTexScale"] = 1.25;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Medium";
|
||||
|
||||
key["$pref::Video::textureReductionLevel"] = 0;
|
||||
key["$pref::Reflect::refractTexScale"] = 1;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::Video::textureReductionLevel"] = 1;
|
||||
key["$pref::Reflect::refractTexScale"] = 0.75;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Lowest";
|
||||
|
||||
key["$pref::Video::textureReductionLevel"] = 2;
|
||||
key["$pref::Reflect::refractTexScale"] = 0.5;
|
||||
};
|
||||
};
|
||||
|
||||
new SimGroup( GroundCoverDensityGroup )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::GroundCover::densityScale"] = 1.0;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Medium";
|
||||
|
||||
key["$pref::GroundCover::densityScale"] = 0.75;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::GroundCover::densityScale"] = 0.5;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Lowest";
|
||||
|
||||
key["$pref::GroundCover::densityScale"] = 0.25;
|
||||
};
|
||||
};
|
||||
|
||||
new SimGroup( DecalLifetimeGroup )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::decalMgr::enabled"] = true;
|
||||
key["$pref::Decals::lifeTimeScale"] = 1;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Medium";
|
||||
|
||||
key["$pref::decalMgr::enabled"] = true;
|
||||
key["$pref::Decals::lifeTimeScale"] = 0.5;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::decalMgr::enabled"] = true;
|
||||
key["$pref::Decals::lifeTimeScale"] = 0.25;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "None";
|
||||
|
||||
key["$pref::decalMgr::enabled"] = false;
|
||||
};
|
||||
};
|
||||
|
||||
new SimGroup( TerrainQualityGroup )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::Terrain::lodScale"] = 0.75;
|
||||
key["$pref::Terrain::detailScale"] = 1.5;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Medium";
|
||||
|
||||
key["$pref::Terrain::lodScale"] = 1.0;
|
||||
key["$pref::Terrain::detailScale"] = 1.0;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::Terrain::lodScale"] = 1.5;
|
||||
key["$pref::Terrain::detailScale"] = 0.75;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Lowest";
|
||||
|
||||
key["$pref::Terrain::lodScale"] = 2.0;
|
||||
key["$pref::Terrain::detailScale"] = 0.5;
|
||||
};
|
||||
};
|
||||
|
||||
//Shadows and Lighting
|
||||
new SimGroup( ShadowQualityList )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::lightManager"] = "Advanced Lighting";
|
||||
key["$pref::Shadows::disable"] = false;
|
||||
key["$pref::Shadows::textureScalar"] = 1.0;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Medium";
|
||||
|
||||
key["$pref::lightManager"] = "Advanced Lighting";
|
||||
key["$pref::Shadows::disable"] = false;
|
||||
key["$pref::Shadows::textureScalar"] = 0.5;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::lightManager"] = "Advanced Lighting";
|
||||
key["$pref::Shadows::disable"] = false;
|
||||
key["$pref::Shadows::textureScalar"] = 0.25;
|
||||
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "None";
|
||||
|
||||
key["$pref::lightManager"] = "Advanced Lighting";
|
||||
key["$pref::Shadows::disable"] = true;
|
||||
key["$pref::Shadows::textureScalar"] = 0.5;
|
||||
};
|
||||
};
|
||||
|
||||
new SimGroup( ShadowDistanceList )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Highest";
|
||||
|
||||
key["$pref::Shadows::drawDistance"] = 2;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::Shadows::drawDistance"] = 1.5;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Medium";
|
||||
|
||||
key["$pref::Shadows::drawDistance"] = 1;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::Shadows::drawDistance"] = 0.5;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Lowest";
|
||||
|
||||
key["$pref::Shadows::drawDistance"] = 0.25;
|
||||
};
|
||||
};
|
||||
|
||||
new SimGroup( SoftShadowList )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::Shadows::filterMode"] = "SoftShadowHighQuality";
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::Shadows::filterMode"] = "SoftShadow";
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Off";
|
||||
|
||||
key["$pref::Shadows::filterMode"] = "None";
|
||||
};
|
||||
};
|
||||
|
||||
new SimGroup( LightDistanceList )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Highest";
|
||||
|
||||
key["$pref::Lights::drawDistance"] = 2;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::Lights::drawDistance"] = 1.5;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Medium";
|
||||
|
||||
key["$pref::Lights::drawDistance"] = 1;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::Lights::drawDistance"] = 0.5;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Lowest";
|
||||
|
||||
key["$pref::Lights::drawDistance"] = 0.25;
|
||||
};
|
||||
};
|
||||
|
||||
new SimGroup( ShaderQualityGroup )
|
||||
{
|
||||
class = "GraphicsOptionsMenuGroup";
|
||||
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "High";
|
||||
|
||||
key["$pref::Video::disablePixSpecular"] = false;
|
||||
key["$pref::Video::disableNormalmapping"] = false;
|
||||
};
|
||||
new ArrayObject()
|
||||
{
|
||||
class = "GraphicsQualityLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = "Low";
|
||||
|
||||
key["$pref::Video::disablePixSpecular"] = true;
|
||||
key["$pref::Video::disableNormalmapping"] = true;
|
||||
};
|
||||
};
|
||||
|
||||
function getCurrentQualityLevel(%qualityGroup)
|
||||
{
|
||||
for ( %i=0; %i < %qualityGroup.getCount(); %i++ )
|
||||
{
|
||||
%level = %qualityGroup.getObject( %i );
|
||||
if ( %level.isCurrent() )
|
||||
return %level.displayName;
|
||||
}
|
||||
|
||||
return "Custom";
|
||||
}
|
||||
|
||||
function getQualityLevels(%qualityGroup)
|
||||
{
|
||||
%qualityLevelsList = "";
|
||||
%qualityLevelCount = %qualityGroup.getCount()-1;
|
||||
|
||||
for ( %i=%qualityLevelCount; %i >= 0; %i-- )
|
||||
{
|
||||
%level = %qualityGroup.getObject( %i );
|
||||
|
||||
if(%i == %qualityLevelCount)
|
||||
%qualityLevelsList = %level.displayName;
|
||||
else
|
||||
%qualityLevelsList = %qualityLevelsList @ "\t" @ %level.displayName;
|
||||
}
|
||||
|
||||
return %qualityLevelsList;
|
||||
}
|
||||
|
||||
function AutodetectGraphics()
|
||||
{
|
||||
$pref::Video::autoDetect = false;
|
||||
|
||||
%shaderVer = getPixelShaderVersion();
|
||||
%intel = ( strstr( strupr( getDisplayDeviceInformation() ), "INTEL" ) != -1 ) ? true : false;
|
||||
%videoMem = GFXCardProfilerAPI::getVideoMemoryMB();
|
||||
|
||||
return AutodetectGraphics_Apply( %shaderVer, %intel, %videoMem );
|
||||
}
|
||||
|
||||
function AutodetectGraphics_Apply(%shaderVer, %intel, %videoMem )
|
||||
{
|
||||
if ( %shaderVer < 2.0 )
|
||||
{
|
||||
echo("Your video card does not meet the minimum requirment of shader model 2.0.");
|
||||
}
|
||||
|
||||
if ( %shaderVer < 3.0 || %intel )
|
||||
{
|
||||
// Allow specular and normals for 2.0a and 2.0b
|
||||
if ( %shaderVer > 2.0 )
|
||||
{
|
||||
MeshQualityGroup.applySetting("Lowest");
|
||||
TextureQualityGroup.applySetting("Lowest");
|
||||
GroundCoverDensityGroup.applySetting("Lowest");
|
||||
DecalLifetimeGroup.applySetting("None");
|
||||
TerrainQualityGroup.applySetting("Lowest");
|
||||
ShaderQualityGroup.applySetting("High");
|
||||
|
||||
ShadowQualityList.applySetting("None");
|
||||
|
||||
SoftShadowList.applySetting("Off");
|
||||
|
||||
$pref::Shadows::useShadowCaching = true;
|
||||
|
||||
$pref::Water::disableTrueReflections = true;
|
||||
$pref::Video::disableParallaxMapping = true;
|
||||
$pref::PostFX::EnableSSAO = false;
|
||||
$pref::PostFX::EnableHDR = false;
|
||||
$pref::PostFX::EnableDOF = false;
|
||||
$pref::PostFX::EnableLightRays = false;
|
||||
$pref::PostFX::EnableVignette = false;
|
||||
|
||||
$pref::Video::AA = 0;
|
||||
$pref::Video::disableVerticalSync = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
MeshQualityGroup.applySetting("Lowest");
|
||||
TextureQualityGroup.applySetting("Lowest");
|
||||
GroundCoverDensityGroup.applySetting("Lowest");
|
||||
DecalLifetimeGroup.applySetting("None");
|
||||
TerrainQualityGroup.applySetting("Lowest");
|
||||
ShaderQualityGroup.applySetting("Low");
|
||||
|
||||
ShadowQualityList.applySetting("None");
|
||||
|
||||
SoftShadowList.applySetting("Off");
|
||||
|
||||
$pref::Shadows::useShadowCaching = true;
|
||||
|
||||
$pref::Water::disableTrueReflections = true;
|
||||
$pref::Video::disableParallaxMapping = true;
|
||||
$pref::PostFX::EnableSSAO = false;
|
||||
$pref::PostFX::EnableHDR = false;
|
||||
$pref::PostFX::EnableDOF = false;
|
||||
$pref::PostFX::EnableLightRays = false;
|
||||
$pref::PostFX::EnableVignette = false;
|
||||
|
||||
$pref::Video::AA = 0;
|
||||
$pref::Video::disableVerticalSync = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( %videoMem > 1000 )
|
||||
{
|
||||
MeshQualityGroup.applySetting("High");
|
||||
TextureQualityGroup.applySetting("High");
|
||||
GroundCoverDensityGroup.applySetting("High");
|
||||
DecalLifetimeGroup.applySetting("High");
|
||||
TerrainQualityGroup.applySetting("High");
|
||||
ShaderQualityGroup.applySetting("High");
|
||||
|
||||
ShadowQualityList.applySetting("High");
|
||||
|
||||
SoftShadowList.applySetting("High");
|
||||
|
||||
//Should this default to on in ultra settings?
|
||||
$pref::Shadows::useShadowCaching = true;
|
||||
|
||||
$pref::Water::disableTrueReflections = false;
|
||||
$pref::Video::disableParallaxMapping = false;
|
||||
$pref::PostFX::EnableSSAO = true;
|
||||
$pref::PostFX::EnableHDR = true;
|
||||
$pref::PostFX::EnableDOF = true;
|
||||
$pref::PostFX::EnableLightRays = true;
|
||||
$pref::PostFX::EnableVignette = true;
|
||||
|
||||
$pref::Video::AA = 4;
|
||||
$pref::Video::disableVerticalSync = 16;
|
||||
}
|
||||
else if ( %videoMem > 400 || %videoMem == 0 )
|
||||
{
|
||||
MeshQualityGroup.applySetting("Medium");
|
||||
TextureQualityGroup.applySetting("Medium");
|
||||
GroundCoverDensityGroup.applySetting("Medium");
|
||||
DecalLifetimeGroup.applySetting("Medium");
|
||||
TerrainQualityGroup.applySetting("Medium");
|
||||
ShaderQualityGroup.applySetting("High");
|
||||
|
||||
ShadowQualityList.applySetting("Medium");
|
||||
|
||||
SoftShadowList.applySetting("Low");
|
||||
|
||||
$pref::Shadows::useShadowCaching = true;
|
||||
|
||||
$pref::Water::disableTrueReflections = false;
|
||||
$pref::Video::disableParallaxMapping = true;
|
||||
$pref::PostFX::EnableSSAO = false;
|
||||
$pref::PostFX::EnableHDR = true;
|
||||
$pref::PostFX::EnableDOF = true;
|
||||
$pref::PostFX::EnableLightRays = true;
|
||||
$pref::PostFX::EnableVignette = true;
|
||||
|
||||
$pref::Video::AA = 4;
|
||||
$pref::Video::disableVerticalSync = 4;
|
||||
|
||||
if ( %videoMem == 0 )
|
||||
echo("Torque was unable to detect available video memory. Applying 'Medium' quality.");
|
||||
}
|
||||
else
|
||||
{
|
||||
MeshQualityGroup.applySetting("Low");
|
||||
TextureQualityGroup.applySetting("Low");
|
||||
GroundCoverDensityGroup.applySetting("Low");
|
||||
DecalLifetimeGroup.applySetting("Low");
|
||||
TerrainQualityGroup.applySetting("Low");
|
||||
ShaderQualityGroup.applySetting("Low");
|
||||
|
||||
ShadowQualityList.applySetting("None");
|
||||
|
||||
SoftShadowList.applySetting("Off");
|
||||
|
||||
$pref::Shadows::useShadowCaching = true;
|
||||
|
||||
$pref::Water::disableTrueReflections = false;
|
||||
$pref::Video::disableParallaxMapping = true;
|
||||
$pref::PostFX::EnableSSAO = false;
|
||||
$pref::PostFX::EnableHDR = false;
|
||||
$pref::PostFX::EnableDOF = false;
|
||||
$pref::PostFX::EnableLightRays = false;
|
||||
$pref::PostFX::EnableVignette = false;
|
||||
|
||||
$pref::Video::AA = 0;
|
||||
$pref::Video::disableVerticalSync = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//%this.refresh();
|
||||
|
||||
//%this.apply();
|
||||
|
||||
//force postFX updates
|
||||
PostFXManager.settingsEffectSetEnabled(SSAOPostFx, $pref::PostFX::EnableSSAO);
|
||||
PostFXManager.settingsEffectSetEnabled(HDRPostFX, $pref::PostFX::EnableHDR);
|
||||
PostFXManager.settingsEffectSetEnabled(DOFPostEffect, $pref::PostFX::EnableDOF);
|
||||
PostFXManager.settingsEffectSetEnabled(LightRayPostFX, $pref::PostFX::EnableLightRays);
|
||||
PostFXManager.settingsEffectSetEnabled(VignettePostEffect, $pref::PostFX::EnableVignette);
|
||||
|
||||
echo("Graphics quality settings have been auto detected.");
|
||||
}
|
||||
|
||||
function _makePrettyResString( %resString, %giveAspectRation )
|
||||
{
|
||||
%width = getWord( %resString, $WORD::RES_X );
|
||||
%height = getWord( %resString, $WORD::RES_Y );
|
||||
|
||||
%aspect = %width / %height;
|
||||
%aspect = mRound( %aspect * 100 ) * 0.01;
|
||||
|
||||
switch$( %aspect )
|
||||
{
|
||||
case "1.33":
|
||||
%aspect = "4:3";
|
||||
case "1.78":
|
||||
%aspect = "16:9";
|
||||
default:
|
||||
%aspect = "";
|
||||
}
|
||||
|
||||
%outRes = %width @ " x " @ %height;
|
||||
if ( %giveAspectRation && %aspect !$= "" )
|
||||
%outRes = %outRes @ " (" @ %aspect @ ")";
|
||||
|
||||
return %outRes;
|
||||
}
|
||||
|
||||
function getScreenResolutionList()
|
||||
{
|
||||
%returnsList = "";
|
||||
|
||||
%resCount = Canvas.getModeCount();
|
||||
for (%i = 0; %i < %resCount; %i++)
|
||||
{
|
||||
%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;
|
||||
}
|
||||
|
||||
return %returnsList;
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ function Core_Utility::onCreate(%this)
|
|||
exec("./scripts/persistanceManagement.cs");
|
||||
exec("./scripts/module.cs");
|
||||
exec("./scripts/scene.cs");
|
||||
exec("./scripts/input.cs");
|
||||
}
|
||||
|
||||
function Core_Utility::onDestroy(%this)
|
||||
|
|
|
|||
11
Templates/BaseGame/game/core/utility/scripts/input.cs
Normal file
11
Templates/BaseGame/game/core/utility/scripts/input.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
function getGamepadAdjustAmount(%val)
|
||||
{
|
||||
// based on a default camera FOV of 90'
|
||||
return(%val * ($cameraFov / 90) * 0.01) * 10.0;
|
||||
}
|
||||
|
||||
function getMouseAdjustAmount(%val)
|
||||
{
|
||||
// based on a default camera FOV of 90'
|
||||
return(%val * ($cameraFov / 90) * 0.01) * $pref::Input::LinkMouseSensitivity;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue