diff --git a/Engine/source/assets/assetManager.cpp b/Engine/source/assets/assetManager.cpp index 9d925d873..30efc47db 100644 --- a/Engine/source/assets/assetManager.cpp +++ b/Engine/source/assets/assetManager.cpp @@ -210,7 +210,7 @@ bool AssetManager::addModuleDeclaredAssets( ModuleDefinition* pModuleDefinition dSprintf(extensionBuffer, sizeof(extensionBuffer), "*.%s", pDeclaredAssets->getExtension()); // Scan declared assets at location. - if ( !scanDeclaredAssets( filePathBuffer, extensionBuffer, pDeclaredAssets->getRecurse(), pModuleDefinition ) ) + if ( !scanDeclaredAssets( filePathBuffer, extensionBuffer, pDeclaredAssets->getRecurse(), pModuleDefinition ) && mEchoInfo) { // Warn. Con::warnf( "AssetManager::addModuleDeclaredAssets() - No assets found at location '%s' with extension '%s'.", filePathBuffer, pDeclaredAssets->getExtension() ); diff --git a/Templates/BaseGame/game/core/console/scripts/profiles.tscript b/Templates/BaseGame/game/core/console/scripts/profiles.tscript index 097ae7da6..98a407643 100644 --- a/Templates/BaseGame/game/core/console/scripts/profiles.tscript +++ b/Templates/BaseGame/game/core/console/scripts/profiles.tscript @@ -52,7 +52,7 @@ new GuiControlProfile(GuiConsoleTextProfile) category = "Core"; }; -$ConsoleDefaultFillColor = "12 14 19 175"; +$ConsoleDefaultFillColor = "0 0 0 175"; if(!isObject(ConsoleScrollProfile)) new GuiControlProfile(ConsoleScrollProfile : GuiScrollProfile) diff --git a/Templates/BaseGame/game/core/gui/scripts/profiles.tscript b/Templates/BaseGame/game/core/gui/scripts/profiles.tscript index bd3d55604..fe02febfa 100644 --- a/Templates/BaseGame/game/core/gui/scripts/profiles.tscript +++ b/Templates/BaseGame/game/core/gui/scripts/profiles.tscript @@ -267,3 +267,24 @@ new GuiControlProfile(GuiScrollProfile) bitmapAsset = "Core_GUI:scrollBar_image"; category = "Core"; }; + +// --------------------------------------------------------------------------- +singleton GuiControlProfile( GuiInputCtrlProfile ) +{ + tab = true; + canKeyFocus = true; + category = "Core"; +}; + +singleton GuiControlProfile (GuiTextProfile) +{ + justify = "left"; + fontColor = "20 20 20"; + category = "Core"; +}; + +singleton GuiControlProfile (GuiTextRightProfile : GuiTextProfile) +{ + justify = "right"; + category = "Core"; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/core/rendering/scripts/graphicsOptions.tscript b/Templates/BaseGame/game/core/rendering/scripts/graphicsOptions.tscript index 10d883bea..f48023dd2 100644 --- a/Templates/BaseGame/game/core/rendering/scripts/graphicsOptions.tscript +++ b/Templates/BaseGame/game/core/rendering/scripts/graphicsOptions.tscript @@ -1,4 +1,4 @@ -function GraphicsQualityLevel::isCurrent( %this ) +function OptionsQualityLevel::isCurrent( %this ) { // Test each pref to see if the current value // equals our stored value. @@ -15,7 +15,7 @@ function GraphicsQualityLevel::isCurrent( %this ) return true; } -function GraphicsQualityLevel::apply( %this ) +function OptionsQualityLevel::apply( %this ) { for ( %i=0; %i < %this.count(); %i++ ) { @@ -36,7 +36,7 @@ function GraphicsQualityLevel::apply( %this ) } } -function GraphicsOptionsMenuGroup::applySetting(%this, %settingName) +function OptionsSettings::applySetting(%this, %settingName) { for(%i=0; %i < %this.getCount(); %i++) { @@ -62,78 +62,92 @@ new SimGroup(VideoSettingsGroup) class = "PrimaryOptionsGroup"; displayName = "Video"; - new SimGroup(BasicVideoSettingsGroup) + new SimGroup(VideoDisplaySettingsGroup) { class = "SubOptionsGroup"; - displayName = "Basic"; + displayName = "Display Settings"; - new SimGroup() - { + new SimGroup( VideoAPISettingsGroup ) + { class = "OptionsSettings"; - - OptionName = "Graphical Quality"; - Description = "Controls the general graphical quality"; - - new ArrayObject() - { - class = "OptionsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::TS::detailAdjust"] = 1.0; - key["$pref::TS::skipRenderDLs"] = 0; - key["$pref::useStaticObjectFade"] = true; - key["$pref::staticObjectFadeStart"] = 75; - key["$pref::staticObjectFadeEnd"] = 100; - key["$pref::staticObjectUnfadeableSize"] = 75; - }; - - new ArrayObject() - { - class = "OptionsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::TS::detailAdjust"] = 1.5; - key["$pref::TS::skipRenderDLs"] = 0; - key["$pref::useStaticObjectFade"] = false; - key["$pref::staticObjectFadeStart"] = 75; - key["$pref::staticObjectFadeEnd"] = 100; - key["$pref::staticObjectUnfadeableSize"] = 75; - }; + OptionName = "Display API"; }; - new SimGroup() - { + new SimGroup( DisplayDevicesGroup ) + { class = "OptionsSettings"; - - OptionName = "Lighting Quality"; - Description = "Controls the lighting and shadows quality"; + OptionName = "Display Devices"; + }; + + new SimGroup( DisplayModeGroup ) + { + class = "OptionsSettings"; + OptionName = "Display Mode"; new ArrayObject() { class = "OptionsQualityLevel"; - caseSensitive = true; - - displayName = "High"; + displayName = "Windowed"; - key["$pref::lightManager"] = "Advanced Lighting"; - key["$pref::Shadows::disable"] = false; - key["$pref::Shadows::textureScalar"] = 1.0; - key["$pref::PSSM::detailAdjustScale"] = 1.0; - key["$pref::allowLocalLightShadows"] = true; - }; + key["$pref::Video::deviceMode"] = 0; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Borderless"; + + key["$pref::Video::deviceMode"] = 1; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Fullscreen"; + + key["$pref::Video::deviceMode"] = 2; + }; + }; + + new SimGroup ( DisplayResSettingsGroup ) + { + class = "OptionsSettings"; + OptionName = "Display Resolution"; + }; + + new SimGroup ( VSyncSettingsGroup ) + { + class = "OptionsSettings"; + OptionName = "VSync"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Off"; + + key["$pref::Video::enableVerticalSync"] = 0; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "On"; + + key["$pref::Video::enableVerticalSync"] = 1; + }; + }; + + new SimGroup ( DisplayRefreshSettingsGroup ) + { + class = "OptionsSettings"; + OptionName = "Refresh Rate"; }; }; - new SimGroup(AdvancedVideoSettingsGroup) + //General quality settings + new SimGroup() { class = "SubOptionsGroup"; - displayName = "Advanced"; - - new SimGroup() + displayName = "Object Quality"; + + new SimGroup( MeshDetailSettingsGroup ) { class = "OptionsSettings"; @@ -145,36 +159,24 @@ new SimGroup(VideoSettingsGroup) class = "OptionsQualityLevel"; caseSensitive = true; - displayName = "High"; - - key["$pref::TS::detailAdjust"] = 1.5; - key["$pref::TS::skipRenderDLs"] = 0; - }; - - }; - }; - - /*new SimGroup(AdvancedVideoSettingsGroup) - { - groupName = "Advanced"; - - new SimGroup( MeshQualityGroup ) - { - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() + displayName = "Lowest"; + + key["$pref::TS::detailAdjust"] = 0.5; + key["$pref::TS::skipRenderDLs"] = 1; + }; + new ArrayObject() { - class = "GraphicsQualityLevel"; + class = "OptionsQualityLevel"; caseSensitive = true; - displayName = "High"; - - key["$pref::TS::detailAdjust"] = 1.5; + displayName = "Low"; + + key["$pref::TS::detailAdjust"] = 0.75; key["$pref::TS::skipRenderDLs"] = 0; - }; + }; new ArrayObject( ) { - class = "GraphicsQualityLevel"; + class = "OptionsQualityLevel"; caseSensitive = true; displayName = "Medium"; @@ -184,46 +186,48 @@ new SimGroup(VideoSettingsGroup) }; 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( MeshDrawDistQualityGroup ) - { - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; + class = "OptionsQualityLevel"; caseSensitive = true; displayName = "High"; - key["$pref::useStaticObjectFade"] = false; - key["$pref::staticObjectFadeStart"] = 75; - key["$pref::staticObjectFadeEnd"] = 100; - key["$pref::staticObjectUnfadeableSize"] = 75; - - }; + key["$pref::TS::detailAdjust"] = 1.5; + key["$pref::TS::skipRenderDLs"] = 0; + }; + }; + + new SimGroup( MeshDrawDistQualityGroup ) + { + class = "OptionsSettings"; + OptionName = "Mesh Draw Distance"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Lowest"; + + key["$pref::useStaticObjectFade"] = true; + key["$pref::staticObjectFadeStart"] = 25; + key["$pref::staticObjectFadeEnd"] = 50; + key["$pref::staticObjectUnfadeableSize"] = 200; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Low"; + + key["$pref::useStaticObjectFade"] = true; + key["$pref::staticObjectFadeStart"] = 50; + key["$pref::staticObjectFadeEnd"] = 75; + key["$pref::staticObjectUnfadeableSize"] = 100; + }; new ArrayObject( ) { - class = "GraphicsQualityLevel"; + class = "OptionsQualityLevel"; caseSensitive = true; displayName = "Medium"; @@ -235,57 +239,37 @@ new SimGroup(VideoSettingsGroup) }; new ArrayObject() { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::useStaticObjectFade"] = true; - key["$pref::staticObjectFadeStart"] = 50; - key["$pref::staticObjectFadeEnd"] = 75; - key["$pref::staticObjectUnfadeableSize"] = 100; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Lowest"; - - key["$pref::useStaticObjectFade"] = true; - key["$pref::staticObjectFadeStart"] = 25; - key["$pref::staticObjectFadeEnd"] = 50; - key["$pref::staticObjectUnfadeableSize"] = 200; - }; - }; - - new SimGroup( TextureQualityGroup ) - { - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; + class = "OptionsQualityLevel"; caseSensitive = true; displayName = "High"; - key["$pref::Video::textureReductionLevel"] = 0; - key["$pref::Reflect::refractTexScale"] = 1.25; - }; + key["$pref::useStaticObjectFade"] = false; + key["$pref::staticObjectFadeStart"] = 75; + key["$pref::staticObjectFadeEnd"] = 100; + key["$pref::staticObjectUnfadeableSize"] = 75; + + }; + }; + + new SimGroup( TextureQualityGroup ) + { + class = "OptionsSettings"; + OptionName = "Texture Quality"; + new ArrayObject() { - class = "GraphicsQualityLevel"; + class = "OptionsQualityLevel"; caseSensitive = true; - displayName = "Medium"; - - key["$pref::Video::textureReductionLevel"] = 0; - key["$pref::Reflect::refractTexScale"] = 1; + displayName = "Lowest"; + + key["$pref::Video::textureReductionLevel"] = 2; + key["$pref::Reflect::refractTexScale"] = 0.5; }; new ArrayObject() { - class = "GraphicsQualityLevel"; + class = "OptionsQualityLevel"; caseSensitive = true; displayName = "Low"; @@ -295,441 +279,742 @@ new SimGroup(VideoSettingsGroup) }; new ArrayObject() { - class = "GraphicsQualityLevel"; + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Medium"; + + key["$pref::Video::textureReductionLevel"] = 0; + key["$pref::Reflect::refractTexScale"] = 1; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "High"; + + key["$pref::Video::textureReductionLevel"] = 0; + key["$pref::Reflect::refractTexScale"] = 1.25; + }; + }; + + new SimGroup( GroundCoverDensityGroup ) + { + class = "OptionsSettings"; + OptionName = "Ground Cover Density"; + Description = "Density of ground cover items, such as grass"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Lowest"; + + key["$pref::GroundCover::densityScale"] = 0.25; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Low"; + + key["$pref::GroundCover::densityScale"] = 0.5; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Medium"; + + key["$pref::GroundCover::densityScale"] = 0.75; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "High"; + + key["$pref::GroundCover::densityScale"] = 1.0; + }; + }; + + new SimGroup( DecalLifetimeGroup ) + { + class = "OptionsSettings"; + OptionName = "Decal Life Time"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "None"; + + key["$pref::decalMgr::enabled"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Low"; + + key["$pref::decalMgr::enabled"] = true; + key["$pref::Decals::lifeTimeScale"] = 0.25; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Medium"; + + key["$pref::decalMgr::enabled"] = true; + key["$pref::Decals::lifeTimeScale"] = 0.5; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "High"; + + key["$pref::decalMgr::enabled"] = true; + key["$pref::Decals::lifeTimeScale"] = 1; + }; + }; + + new SimGroup( TerrainQualityGroup ) + { + class = "OptionsSettings"; + OptionName = "Terrain Quality"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; caseSensitive = true; displayName = "Lowest"; - key["$pref::Video::textureReductionLevel"] = 2; - key["$pref::Reflect::refractTexScale"] = 0.5; + key["$pref::Terrain::lodScale"] = 2.0; + key["$pref::Terrain::detailScale"] = 0.5; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Low"; + + key["$pref::Terrain::lodScale"] = 1.5; + key["$pref::Terrain::detailScale"] = 0.75; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Medium"; + + key["$pref::Terrain::lodScale"] = 1.0; + key["$pref::Terrain::detailScale"] = 1.0; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "High"; + + key["$pref::Terrain::lodScale"] = 0.75; + key["$pref::Terrain::detailScale"] = 1.5; + }; + }; + }; + + //Shadows and Lighting + new SimGroup() + { + class = "SubOptionsGroup"; + displayName = "Lighting Quality"; + + new SimGroup( ShadowQualityList ) + { + class = "OptionsSettings"; + OptionName = "Shadow Quality"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "None"; + + key["$pref::lightManager"] = "Advanced Lighting"; + key["$pref::Shadows::disable"] = true; + key["$pref::Shadows::textureScalar"] = 0.5; + key["$pref::allowLocalLightShadows"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Low"; + + key["$pref::lightManager"] = "Advanced Lighting"; + key["$pref::Shadows::disable"] = false; + key["$pref::Shadows::textureScalar"] = 0.25; + key["$pref::PSSM::detailAdjustScale"] = 0.25; + key["$pref::allowLocalLightShadows"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Medium"; + + key["$pref::lightManager"] = "Advanced Lighting"; + key["$pref::Shadows::disable"] = false; + key["$pref::Shadows::textureScalar"] = 0.5; + key["$pref::PSSM::detailAdjustScale"] = 0.5; + key["$pref::allowLocalLightShadows"] = true; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "High"; + + key["$pref::lightManager"] = "Advanced Lighting"; + key["$pref::Shadows::disable"] = false; + key["$pref::Shadows::textureScalar"] = 1.0; + key["$pref::PSSM::detailAdjustScale"] = 1.0; + key["$pref::allowLocalLightShadows"] = true; }; }; - };*/ -}; - -//Fields have display name, populated by group. Direct name association to the fieldset - -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"; + new SimGroup( ShadowDistanceList ) + { + class = "OptionsSettings"; + OptionName = "Shadow Distance"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; - 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"; + displayName = "Lowest"; - key["$pref::Terrain::lodScale"] = 1.5; - key["$pref::Terrain::detailScale"] = 0.75; + key["$pref::Shadows::drawDistance"] = 0.1; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Low"; + + key["$pref::Shadows::drawDistance"] = 0.25; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Medium"; + + key["$pref::Shadows::drawDistance"] = 0.5; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "High"; + + key["$pref::Shadows::drawDistance"] = 0.75; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Highest"; + + key["$pref::Shadows::drawDistance"] = 1; + }; + }; + + new SimGroup( LightingQualityList ) + { + class = "OptionsSettings"; + OptionName = "Lighting Quality"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Low"; + + key["$pref::maximumNumOfLights"] = 5; + key["$pref::useLightFade"] = true; + key["$pref::lightFadeStart"] = 10; + key["$pref::lightFadeEnd"] = 25; + + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Medium"; + + key["$pref::maximumNumOfLights"] = 10; + key["$pref::useLightFade"] = true; + key["$pref::lightFadeStart"] = 25; + key["$pref::lightFadeEnd"] = 50; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "High"; + + key["$pref::maximumNumOfLights"] = 15; + key["$pref::useLightFade"] = true; + key["$pref::lightFadeStart"] = 50; + key["$pref::lightFadeEnd"] = 75; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Highest"; + + key["$pref::maximumNumOfLights"] = -1; + key["$pref::useLightFade"] = false; + key["$pref::lightFadeStart"] = 50; + key["$pref::lightFadeEnd"] = 75; + }; + }; + + new SimGroup( SoftShadowList ) + { + class = "OptionsSettings"; + OptionName = "Soft Shadowing"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Off"; + + key["$pref::Shadows::filterMode"] = "None"; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Low"; + + key["$pref::Shadows::filterMode"] = "SoftShadow"; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "High"; + + key["$pref::Shadows::filterMode"] = "SoftShadowHighQuality"; + }; + }; + + new SimGroup( LightDistanceList ) + { + class = "OptionsSettings"; + OptionName = "Lights Draw Distance"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Lowest"; + + key["$pref::Lights::drawDistance"] = 0.25; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Low"; + + key["$pref::Lights::drawDistance"] = 0.25; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Medium"; + + key["$pref::Lights::drawDistance"] = 0.5; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "High"; + + key["$pref::Lights::drawDistance"] = 0.75; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Highest"; + + key["$pref::Lights::drawDistance"] = 1; + }; + }; }; - new ArrayObject() + + new SimGroup() { - class = "GraphicsQualityLevel"; - caseSensitive = true; + class = "SubOptionsGroup"; + displayName = "Effects"; + + new SimGroup() + { + class = "OptionsSettings"; + OptionName = "Shader Quality"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "Low"; + + key["$pref::Video::disablePixSpecular"] = true; + key["$pref::Video::disableNormalmapping"] = true; + key["$pref::PostFX::EnableHDRBloom"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + caseSensitive = true; + + displayName = "High"; + + key["$pref::Video::disablePixSpecular"] = false; + key["$pref::Video::disableNormalmapping"] = false; + key["$pref::PostFX::EnableHDRBloom"] = true; + }; + + }; - displayName = "Lowest"; + new SimGroup() + { + class = "OptionsSettings"; + OptionName = "Anisotropic Filtering"; + Description = "Amount of Anisotropic Filtering on textures, which dictates their sharpness at a distance"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Off"; + + key["$pref::Video::defaultAnisotropy"] = 0; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "4x"; + + key["$pref::Video::defaultAnisotropy"] = 4; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "8x"; + + key["$pref::Video::defaultAnisotropy"] = 8; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "16x"; + + key["$pref::Video::defaultAnisotropy"] =16; + }; + }; - key["$pref::Terrain::lodScale"] = 2.0; - key["$pref::Terrain::detailScale"] = 0.5; - }; + new SimGroup() + { + class = "OptionsSettings"; + OptionName = "Anti-Aliasing"; + Description = "The Anti-Aliasing Method applied to rendering"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "None"; + + key["$pref::Video::AAMode"] = "None"; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "FXAA"; + + key["$pref::Video::AAMode"] = "FXAA"; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "SMAA"; + + key["$pref::Video::AAMode"] = "SMAA"; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "SMAA High"; + + key["$pref::Video::AAMode"] ="SMAA High"; + }; + }; + + new SimGroup() + { + class = "OptionsSettings"; + OptionName = "Parallax"; + Description = "Whether the surface parallax shader effect is enabled"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Off"; + + key["$pref::Video::enableParallaxMapping"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "On"; + + key["$pref::Video::enableParallaxMapping"] = true; + }; + + }; + + new SimGroup() + { + class = "OptionsSettings"; + OptionName = "True Water Reflections"; + Description = "Whether realtime water reflections are enabled"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Off"; + + key["$pref::Water::enableTrueReflections"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "On"; + + key["$pref::Water::enableTrueReflections"] = true; + }; + }; + + new SimGroup() + { + class = "OptionsSettings"; + OptionName = "SSAO"; + Description = "Whether Screen-Space Ambient Occlusion is enabled"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Off"; + + key["$pref::PostFX::EnableSSAO"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "On"; + + key["$pref::PostFX::EnableSSAO"] = true; + }; + }; + + new SimGroup() + { + class = "OptionsSettings"; + OptionName = "Depth of Field"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Off"; + + key["$pref::PostFX::EnableDOF"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "On"; + + key["$pref::PostFX::EnableDOF"] = true; + }; + }; + + new SimGroup() + { + class = "OptionsSettings"; + OptionName = "Vignette"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Off"; + + key["$pref::PostFX::EnableVignette"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "On"; + + key["$pref::PostFX::EnableVignette"] = true; + }; + }; + + new SimGroup() + { + class = "OptionsSettings"; + OptionName = "Light Rays"; + + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "Off"; + + key["$pref::PostFX::EnableLightRays"] = false; + }; + new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = "On"; + + key["$pref::PostFX::EnableLightRays"] = true; + }; + }; + }; }; -//Shadows and Lighting -new SimGroup( ShadowQualityList ) +function VideoSettingsGroup::populateDisplaySettings(%this) { - class = "GraphicsOptionsMenuGroup"; + VideoAPISettingsGroup.clear(); + DisplayDevicesGroup.clear(); + DisplayResSettingsGroup.clear(); + DisplayRefreshSettingsGroup.clear(); - new ArrayObject() + %apiList = ""; + %apiCount = GFXInit::getAdapterCount(); + for(%i=0; %i < %apiCount; %i++) { - class = "GraphicsQualityLevel"; - caseSensitive = true; + %api = GFXInit::getAdapterType(%i); - displayName = "High"; - - key["$pref::lightManager"] = "Advanced Lighting"; - key["$pref::Shadows::disable"] = false; - key["$pref::Shadows::textureScalar"] = 1.0; - key["$pref::PSSM::detailAdjustScale"] = 1.0; - key["$pref::allowLocalLightShadows"] = true; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::lightManager"] = "Advanced Lighting"; - key["$pref::Shadows::disable"] = false; - key["$pref::Shadows::textureScalar"] = 0.5; - key["$pref::PSSM::detailAdjustScale"] = 0.5; - key["$pref::allowLocalLightShadows"] = true; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::lightManager"] = "Advanced Lighting"; - key["$pref::Shadows::disable"] = false; - key["$pref::Shadows::textureScalar"] = 0.25; - key["$pref::PSSM::detailAdjustScale"] = 0.25; - key["$pref::allowLocalLightShadows"] = false; - - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "None"; - - key["$pref::lightManager"] = "Advanced Lighting"; - key["$pref::Shadows::disable"] = true; - key["$pref::Shadows::textureScalar"] = 0.5; - key["$pref::allowLocalLightShadows"] = false; - }; -}; - -new SimGroup( ShadowDistanceList ) -{ - class = "GraphicsOptionsMenuGroup"; + if(%api !$= "NullDevice") + { + %entry = new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = %api; + key["$pref::Video::displayDevice"] = %api; + }; + + VideoAPISettingsGroup.add(%entry); + } + } - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Highest"; - - key["$pref::Shadows::drawDistance"] = 1; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::Shadows::drawDistance"] = 0.75; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::Shadows::drawDistance"] = 0.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::Shadows::drawDistance"] = 0.25; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Lowest"; - - key["$pref::Shadows::drawDistance"] = 0.1; - }; -}; - -new SimGroup( LightingQualityList ) -{ - class = "GraphicsOptionsMenuGroup"; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Highest"; - - key["$pref::maximumNumOfLights"] = -1; - key["$pref::useLightFade"] = false; - key["$pref::lightFadeStart"] = 50; - key["$pref::lightFadeEnd"] = 75; - }; + %numDevices = Canvas.getMonitorCount(); + + %devicesList = getDisplayDeviceList(); - new ArrayObject() + for(%i=0; %i < getFieldCount(%devicesList); %i++) { - class = "GraphicsQualityLevel"; - caseSensitive = true; + %device = getField(%devicesList, %i); - displayName = "High"; + %entry = new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = %device; + key["$pref::Video::displayDeviceId"] = %device; + }; - key["$pref::maximumNumOfLights"] = 15; - key["$pref::useLightFade"] = true; - key["$pref::lightFadeStart"] = 50; - key["$pref::lightFadeEnd"] = 75; - }; + DisplayDevicesGroup.add(%entry); + } + + %mode = getField($Video::ModeTags, $pref::Video::deviceMode); - new ArrayObject() + if(%mode !$= "Borderless") { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::maximumNumOfLights"] = 10; - key["$pref::useLightFade"] = true; - key["$pref::lightFadeStart"] = 25; - key["$pref::lightFadeEnd"] = 50; - }; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::maximumNumOfLights"] = 5; - key["$pref::useLightFade"] = true; - key["$pref::lightFadeStart"] = 10; - key["$pref::lightFadeEnd"] = 25; + %resolutionList = getScreenResolutionList($pref::Video::deviceId, $Video::Mode[%mode]); + for(%i=0; %i < getFieldCount(%resolutionList); %i++) + { + %rawResolution = getField(%resolutionList, %i); + %prettyResolution = _makePrettyResString(%rawResolution); + + %entry = new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = %prettyResolution; + key["$pref::Video::Resolution"] = %rawResolution; + }; + + DisplayResSettingsGroup.add(%entry); + } + } - }; -}; + %refreshList = getScreenRefreshList($pref::Video::mode); + for(%i=0; %i < getFieldCount(%refreshList); %i++) + { + %refreshRate = getField(%refreshList, %i); -new SimGroup( SoftShadowList ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; + %entry = new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = %refreshRate; + key["$pref::Video::RefreshRate"] = %refreshRate; + }; - 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"] = 1; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::Lights::drawDistance"] = 0.75; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::Lights::drawDistance"] = 0.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::Lights::drawDistance"] = 0.25; - }; - 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; - key["$pref::PostFX::EnableHDRBloom"] = true; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::Video::disablePixSpecular"] = true; - key["$pref::Video::disableNormalmapping"] = true; - key["$pref::PostFX::EnableHDRBloom"] = false; - }; -}; - + DisplayRefreshSettingsGroup.add(%entry); + } +} function getCurrentQualityLevel(%qualityGroup) { for ( %i=0; %i < %qualityGroup.getCount(); %i++ ) { %level = %qualityGroup.getObject( %i ); if ( %level.isCurrent() ) - return %level.displayName; + return %level; } return "Custom"; @@ -1036,4 +1321,35 @@ function getScreenRefreshList(%resolution) %rateArray.delete(); return %returnsList; +} + +function getDisplayDeviceList() +{ + %numDevices = Canvas.getMonitorCount(); + %devicesList = ""; + for(%i = 0; %i < %numDevices; %i++) + { + %device = (%i+1) @ " - " @ Canvas.getMonitorName(%i); + if(%i==0) + %devicesList = %device; + else + %devicesList = %devicesList @ "\t" @ %device; + } + + return %devicesList; +} + +function getDisplayDeviceId(%displayDeviceName) +{ + %deviceList = getDisplayDeviceList(); + + %deviceCount = getFieldCount(%deviceList); + for(%d = 0; %d < %deviceCount; %d++) + { + %deviceName = getField(%deviceList, %d); + if(%deviceName $= %displayDeviceName) + return %d; + } + + return -1; } \ No newline at end of file diff --git a/Templates/BaseGame/game/core/sfx/Core_SFX.tscript b/Templates/BaseGame/game/core/sfx/Core_SFX.tscript index f0babb90f..771048b32 100644 --- a/Templates/BaseGame/game/core/sfx/Core_SFX.tscript +++ b/Templates/BaseGame/game/core/sfx/Core_SFX.tscript @@ -7,7 +7,7 @@ function Core_SFX::onCreate(%this) exec("./scripts/audioDescriptions." @ $TorqueScriptFileExtension); exec("./scripts/audioEnvironments." @ $TorqueScriptFileExtension); exec("./scripts/audioStates." @ $TorqueScriptFileExtension); - + exec("./scripts/audioOptions." @ $TorqueScriptFileExtension); } function Core_SFX::onDestroy(%this) diff --git a/Templates/BaseGame/game/core/sfx/scripts/audioOptions.tscript b/Templates/BaseGame/game/core/sfx/scripts/audioOptions.tscript new file mode 100644 index 000000000..19417c2e4 --- /dev/null +++ b/Templates/BaseGame/game/core/sfx/scripts/audioOptions.tscript @@ -0,0 +1,82 @@ +new SimGroup(AudioSettingsGroup) +{ + class = "PrimaryOptionsGroup"; + displayName = "Audio"; + + new SimGroup() + { + class = "SubOptionsGroup"; + displayName = "Audio Devices"; + + new SimGroup(AudioSettingsProviderGroup) + { + class = "AudioOptionsSettings"; + + OptionName = "Audio Provider"; + Description = ""; + }; + + new SimGroup(AudioSettingsDeviceGroup) + { + class = "AudioOptionsSettings"; + + OptionName = "Audio Device"; + Description = ""; + }; + }; +}; + +function AudioSettingsGroup::populateSettings(%this) +{ + AudioSettingsProviderGroup.clear(); + AudioSettingsDeviceGroup.clear(); + + %buffer = sfxGetAvailableDevices(); + %count = getRecordCount( %buffer ); + + for(%i = 0; %i < %count; %i++) + { + %record = getRecord(%buffer, %i); + %provider = getField(%record, 0); + %device = getField(%record, 1); + + //When the client is actually running, we don't care about null audo devices + if(%provider $= "null") + continue; + + //We can't have duplicate providers, so double check for uniqueness + %foundProvider = false; + foreach(%registeredProviders in AudioSettingsProviderGroup) + { + if(%registeredProviders.displayName $= %provider) + { + %foundProvider = true; + break; + } + } + + if(!%foundProvider) + { + //Provider entry + %providerEntry = new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = %provider; + key["$pref::SFX::provider"] = %provider; + }; + + AudioSettingsProviderGroup.add(%providerEntry); + } + + //Device Entry + %deviceEntry = new ArrayObject() + { + class = "OptionsQualityLevel"; + displayName = %device; + provider = %provider; //this is for filtering later, if we need to + key["$pref::SFX::device"] = %device; + }; + + AudioSettingsDeviceGroup.add(%deviceEntry); + } +} diff --git a/Templates/BaseGame/game/data/ExampleModule/scripts/client/defaultKeybinds.tscript b/Templates/BaseGame/game/data/ExampleModule/scripts/client/defaultKeybinds.tscript index cb4f84431..913b088fc 100644 --- a/Templates/BaseGame/game/data/ExampleModule/scripts/client/defaultKeybinds.tscript +++ b/Templates/BaseGame/game/data/ExampleModule/scripts/client/defaultKeybinds.tscript @@ -17,13 +17,20 @@ addKeyRemap("Ascend", "ExampleMoveMap", "keyboard", "moveup", "Makes the camera addKeyRemap("Descend", "ExampleMoveMap", "keyboard", "movedown", "Makes the camera descend"); addKeyRemap("Jump", "ExampleMoveMap", "keyboard", "jump", "Jump"); +addKeyRemap("Forward", "ExampleMoveMap", "gamepad", "gamePadMoveY", "Forward Movement"); +addKeyRemap("Backward", "ExampleMoveMap", "gamepad", "gamePadMoveY", "Backward Movement"); +addKeyRemap("Strafe Left", "ExampleMoveMap", "gamepad", "gamePadMoveX", "Left Strafing Movement"); +addKeyRemap("Strafe Right", "ExampleMoveMap", "gamepad", "gamePadMoveX", "Right Strafing Movement"); +addKeyRemap("Jump", "ExampleMoveMap", "gamepad", "jump", "Jump"); + //------------------------------------------------------------------------------ // Non-remapable binds //------------------------------------------------------------------------------ ExampleMoveMap.bind( keyboard, F2, showPlayerList ); ExampleMoveMap.bind(keyboard, "ctrl h", hideHUDs); ExampleMoveMap.bind(keyboard, "alt p", doScreenShotHudless); -ExampleMoveMap.bindCmd(keyboard, "escape", "", "Canvas.pushDialog(PauseMenu);"); +ExampleMoveMap.bindCmd(keyboard, "escape", "", "Canvas.pushDialog(GameMenu);"); +ExampleMoveMap.bindCmd(gamepad, btn_start, "Canvas.pushDialog(GameMenu);", "" ); //------------------------------------------------------------------------------ // Movement Keys diff --git a/Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.tscript b/Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.tscript index 39ecf2ef5..646a55101 100644 --- a/Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.tscript +++ b/Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.tscript @@ -73,7 +73,7 @@ function ChooseLevelMenu::onWake(%this) position = "0 0"; extent = "480 480"; buttonType = "ToggleButton"; - profile = LevelPreviewButtonProfile; + profile = GuiMenuButtonLeftJustProfile; horizSizing = "width"; vertSizing = "height"; internalName = "button"; diff --git a/Templates/BaseGame/game/data/UI/guis/optionsMenu.gui b/Templates/BaseGame/game/data/UI/guis/optionsMenu.gui index f7a6daa70..6fb19d7e1 100644 --- a/Templates/BaseGame/game/data/UI/guis/optionsMenu.gui +++ b/Templates/BaseGame/game/data/UI/guis/optionsMenu.gui @@ -32,8 +32,8 @@ $guiContent = new GuiControl(OptionsMenu) { stackingType = "Horizontal"; padding = "10"; dynamicSize = "0"; - position = "430 0"; - extent = "420 40"; + position = "330 0"; + extent = "650 40"; horizSizing = "center"; vertSizing = "center"; profile = "GuiDefaultProfile"; @@ -55,11 +55,19 @@ $guiContent = new GuiControl(OptionsMenu) { tooltipProfile = "GuiToolTipProfile"; }; new GuiButtonCtrl() { - text = "Controls"; + text = "Keyboard/Mouse"; position = "260 0"; + extent = "220 40"; + profile = "GuiMenuButtonProfile"; + command = "OptionsMenu.openOptionsCategory(\"KBM\");"; + tooltipProfile = "GuiToolTipProfile"; + }; + new GuiButtonCtrl() { + text = "Controller"; + position = "480 0"; extent = "160 40"; profile = "GuiMenuButtonProfile"; - command = "OptionsMenu.openOptionsCategory(\"Controls\");"; + command = "OptionsMenu.openOptionsCategory(\"Controller\");"; tooltipProfile = "GuiToolTipProfile"; }; }; @@ -98,6 +106,7 @@ $guiContent = new GuiControl(OptionsMenu) { tooltipProfile = "GuiToolTipProfile"; new GuiStackControl(VideoSettingsList) { + class = "OptionsMenuList"; padding = "5"; changeChildSizeToFit = "0"; position = "0 1"; @@ -108,6 +117,7 @@ $guiContent = new GuiControl(OptionsMenu) { tooltipProfile = "GuiToolTipProfile"; }; new GuiStackControl(AudioSettingsList) { + class = "OptionsMenuList"; padding = "5"; changeChildSizeToFit = "0"; position = "0 1"; @@ -119,7 +129,21 @@ $guiContent = new GuiControl(OptionsMenu) { tooltipProfile = "GuiToolTipProfile"; hidden = "1"; }; - new GuiStackControl(ControlSettingsList) { + new GuiStackControl(KBMControlsList) { + class = "OptionsMenuList"; + padding = "5"; + changeChildSizeToFit = "0"; + position = "0 1"; + extent = "800 200"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiDefaultProfile"; + visible = "0"; + tooltipProfile = "GuiToolTipProfile"; + hidden = "1"; + }; + new GuiStackControl(GamepadControlsList) { + class = "OptionsMenuList"; padding = "5"; changeChildSizeToFit = "0"; position = "0 1"; @@ -174,7 +198,7 @@ $guiContent = new GuiControl(OptionsMenu) { makeIconSquare = "1"; textLocation = "Center"; text = "Reset"; - position = "947 0"; + position = "1135 0"; extent = "140 40"; horizSizing = "left"; vertSizing = "center"; diff --git a/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript b/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript index d2c3fbb8c..9437a6b57 100644 --- a/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript +++ b/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript @@ -52,7 +52,8 @@ $optionsEntryPad = 10; $OptionsMenuCategories[0] = "Video"; $OptionsMenuCategories[1] = "Audio"; -$OptionsMenuCategories[2] = "Controls"; +$OptionsMenuCategories[2] = "KBM"; +$OptionsMenuCategories[3] = "Controller"; function OptionsMenu::onAdd(%this) { @@ -75,48 +76,13 @@ function OptionsMenu::onWake(%this) { %this.unappliedChanges.empty(); - VideoSettingsList.clear(); + %this.populateVideoSettings(); - for(%i=0; %i < VideoSettingsGroup.getCount(); %i++) - { - %setting = VideoSettingsGroup.getObject(%i); - - echo(" OptionsMenu::onWake() - video: " @ %setting.class); - if(%setting.class $= "SubOptionsGroup") - { - %entry = addOptionGroup(); - %entry.text = %setting.displayName; - - if(isObject(%entry)) - VideoSettingsList.add(%entry); - - for(%s=0; %s < %setting.getCount(); %s++) - { - %option = %setting.getObject(%s); - - %optionsEntry = addOptionEntry(%option); - - if(isObject(%optionsEntry)) - { - %optionsEntry.resize(0, 0, VideoSettingsList.extent.x, %optionsEntry.extent.y); - - VideoSettingsList.add(%optionsEntry); - } - } - } - else if(%setting.class $= "OptionsSettings") - { - %optionsEntry = addOptionEntry(%option); - - if(isObject(%optionsEntry)) - { - %optionsEntry.resize(0, 0, VideoSettingsList.extent.x, %optionsEntry.extent.y); - - VideoSettingsList.add(%optionsEntry); - } - } - } + %this.populateAudioSettings(); + %this.populateKBMControls(); + + %this.populateGamepadControls(); //establish the cached prefs values here %this.openOptionsCategory("Video"); @@ -148,30 +114,73 @@ if(!isObject( OptionsMenuActionMap ) ) OptionsMenuActionMap.bind( gamepad, btn_x, OptionsMenuReset ); } -function VideoSettingsList::syncGui(%this) +function OptionsMenuList::syncGui(%this) { %this.callOnChildren("setHighlighted", false); %btn = %this.getObject(%this.listPosition); - if(%btn.class $= "OptionsListEntry") + if(%btn.class $= "OptionsListEntry" || + %btn.class $= "OptionsListSliderEntry" || + %btn.class $= "OptionsKeybindEntry") %btn-->button.setHighlighted(true); -} + + //iterate over the items and ensure that they are formatted well based on the settings selected + foreach(%option in %this) + { + %container = %option-->valuesContainer; + + if(%option.class $= "OptionsListEntry") + { + %hasLevels = %option.optionsObject.getCount() <= 1; + + %optionObject = %option.optionsObject; + + //If it's out of range of the options, it's probably a custom value + if(%option.currentOptionIndex < %optionObject.getCount() && %option.currentOptionIndex >= 0) + { + %currentOptionLevel = %optionObject.getObject(%option.currentOptionIndex); + %currentOptionLevelTxt = %currentOptionLevel.displayName; + } + else + { + %currentOptionLevelTxt = "Custom"; + } + + %optionValTextWidth = %option-->optionValue.profile.getStringWidth(%currentOptionLevelTxt); + + %option-->optionValue.resize(%container.extent.x - %container-->prevValButton.extent.x - %optionValTextWidth - 20, 0, + %optionValTextWidth + 20, %container.extent.y); + + %option-->optionValue.text = %currentOptionLevelTxt; + + %container-->prevValButton.position.x = %option-->optionValue.position.x - 20; + %container-->nextValButton.position.x = %container.extent.x - %container-->prevValButton.extent.x; -function AudioSettingsList::syncGui(%this) -{ - -} - -function ControlSettingsList::syncGui(%this) -{ - + //if there's no alternatives, disable the left/right buttons + %container-->prevValButton.setHidden(%hasLevels); + %container-->nextValButton.setHidden(%hasLevels); + } + else if(%option.class $= "OptionsListSliderEntry") + { + } + else if(%option.class $= "OptionsKeybindEntry") + { + %bindImgAsset = getButtonBitmap(%option.device, getField(%option.keymap, 1)); + + if(%bindImgAsset $= "UI:Keyboard_Black_Blank_image") + %bindImgAsset = ""; + + %container-->bindButton.setBitmap(%bindImgAsset); + } + } } function OptionsMenu::openOptionsCategory(%this, %categoryName) { VideoSettingsList.setVisible(%categoryName $= "Video"); AudioSettingsList.setVisible(%categoryName $= "Audio"); - ControlSettingsList.setVisible(%categoryName $= "Controls"); + KBMControlsList.setVisible(%categoryName $= "KBM"); + GamepadControlsList.setVisible(%categoryName $= "Controller"); if(%categoryName $= "Video") { @@ -190,12 +199,18 @@ function OptionsMenu::openOptionsCategory(%this, %categoryName) %this.currentCatgeoryIdx = 1; } - else if(%categoryName $= "Controls") + else if(%categoryName $= "KBM") { - $MenuList = ControlSettingsList; + $MenuList = KBMControlsList; %this.currentCatgeoryIdx = 2; } + else if(%categoryName $= "Controller") + { + $MenuList = GamepadControlsList; + + %this.currentCatgeoryIdx = 3; + } $MenuList.syncGui(); %this.syncGui(); @@ -265,7 +280,9 @@ function OptionMenuNavigatePrev(%val) if(%val) { $MenuList.listPosition -= 1; - while( $MenuList.listPosition >= 0 && $MenuList.getObject($MenuList.listPosition).class !$= OptionsListEntry) + while( $MenuList.listPosition >= 0 && ($MenuList.getObject($MenuList.listPosition).class !$= "OptionsListEntry" && + $MenuList.getObject($MenuList.listPosition).class !$= "OptionsListSliderEntry" && + $MenuList.getObject($MenuList.listPosition).class !$= "OptionsKeybindEntry")) { $MenuList.listPosition -= 1; } @@ -282,7 +299,9 @@ function OptionMenuNavigateNext(%val) if(%val) { $MenuList.listPosition += 1; - while($MenuList.listPosition < $MenuList.getCount() && $MenuList.getObject($MenuList.listPosition).class !$= OptionsListEntry) + while($MenuList.listPosition < $MenuList.getCount() && ($MenuList.getObject($MenuList.listPosition).class !$= "OptionsListEntry" && + $MenuList.getObject($MenuList.listPosition).class !$= "OptionsListSliderEntry" && + $MenuList.getObject($MenuList.listPosition).class !$= "OptionsKeybindEntry")) { $MenuList.listPosition += 1; } @@ -304,32 +323,50 @@ function OptionMenuStickNavigate(%val) function OptionMenuPrevSetting(%val) { + if(!%val) + return; + %option = $MenuList.getObject($MenuList.listPosition); - echo("Option: " @ %option.className); - %optionObject = %option.optionsObject; - %currentOptionLevel = %optionObject.getObject(%option.currentOptionIndex); - %option.currentOptionIndex = mClamp(%option.currentOptionIndex-1, 0, %optionObject.getCount()-1); - - %newOptionLevel = %optionObject.getObject(%option.currentOptionIndex); - - echo("Changed option: " @ %optionObject.optionName @ " from level: " @ %currentOptionLevel.displayName @ " to level: " @ %newOptionLevel.displayName); + if(!isObject(%option)) + return; + + if(%option.class !$= "OptionsListEntry") + { + %optionObject = %option.optionsObject; + %currentOptionLevel = %optionObject.getObject(%option.currentOptionIndex); + + %option.currentOptionIndex = mClamp(%option.currentOptionIndex-1, 0, %optionObject.getCount()-1); + + %newOptionLevel = %optionObject.getObject(%option.currentOptionIndex); + + echo("Changed option: " @ %optionObject.optionName @ " from level: " @ %currentOptionLevel.displayName @ " to level: " @ %newOptionLevel.displayName); + } $MenuList.syncGUI(); } function OptionMenuNextSetting(%val) { + if(!%val) + return; + %option = $MenuList.getObject($MenuList.listPosition); - echo("Option: " @ %option.className); - %optionObject = %option.optionsObject; - %currentOptionLevel = %optionObject.getObject(%option.currentOptionIndex); - %option.currentOptionIndex = mClamp(%option.currentOptionIndex+1, 0, %optionObject.getCount()-1); - - %newOptionLevel = %optionObject.getObject(%option.currentOptionIndex); - - echo("Changed option: " @ %optionObject.optionName @ " from level: " @ %currentOptionLevel.displayName @ " to level: " @ %newOptionLevel.displayName); + if(!isObject(%option) ) + return; + + if(%option.class !$= "OptionsListEntry") + { + %optionObject = %option.optionsObject; + %currentOptionLevel = %optionObject.getObject(%option.currentOptionIndex); + + %option.currentOptionIndex = mClamp(%option.currentOptionIndex+1, 0, %optionObject.getCount()-1); + + %newOptionLevel = %optionObject.getObject(%option.currentOptionIndex); + + echo("Changed option: " @ %optionObject.optionName @ " from level: " @ %currentOptionLevel.displayName @ " to level: " @ %newOptionLevel.displayName); + } $MenuList.syncGUI(); } @@ -339,6 +376,208 @@ function OptionMenuStickChangeSetting(%val) } +// +// +// +function OptionsMenu::populateVideoSettings(%this) +{ + VideoSettingsList.clear(); + + VideoSettingsGroup::populateDisplaySettings(); + + for(%i=0; %i < VideoSettingsGroup.getCount(); %i++) + { + %setting = VideoSettingsGroup.getObject(%i); + + if(%setting.class $= "SubOptionsGroup") + { + %entry = addOptionGroup(%setting.displayName); + + if(isObject(%entry)) + VideoSettingsList.add(%entry); + + for(%s=0; %s < %setting.getCount(); %s++) + { + %option = %setting.getObject(%s); + + %optionsEntry = addOptionEntry(%option); + + if(isObject(%optionsEntry)) + VideoSettingsList.add(%optionsEntry); + } + } + else if(%setting.class $= "OptionsSettings") + { + %optionsEntry = addOptionEntry(%setting); + + if(isObject(%optionsEntry)) + VideoSettingsList.add(%optionsEntry); + } + } + + //Ensure our newly templated options listings are sized right + for(%i=0; %i < VideoSettingsList.getCount(); %i++) + { + %entry = VideoSettingsList.getObject(%i); + %entry.resize(0, 0, VideoSettingsList.extent.x - 15, %entry.extent.y); //-10 for the scroll wheel pad + } +} + +function OptionsMenu::populateAudioSettings(%this) +{ + AudioSettingsList.clear(); + AudioSettingsGroup.populateSettings(); + + //Process the lists + for(%i=0; %i < AudioSettingsGroup.getCount(); %i++) + { + %setting = AudioSettingsGroup.getObject(%i); + + if(%setting.class $= "SubOptionsGroup") + { + %entry = addOptionGroup(%setting.displayName); + + if(isObject(%entry)) + AudioSettingsList.add(%entry); + + for(%s=0; %s < %setting.getCount(); %s++) + { + %option = %setting.getObject(%s); + + %optionsEntry = addOptionEntry(%option); + + if(isObject(%optionsEntry)) + AudioSettingsList.add(%optionsEntry); + } + } + else if(%setting.class $= "AudioOptionsSettings") + { + %optionsEntry = addOptionEntry(%setting); + + if(isObject(%optionsEntry)) + AudioSettingsList.add(%optionsEntry); + } + } + + AudioSettingsList.add(addOptionGroup("Channel Volume")); + + AudioSettingsList.add(addOptionSlider("Master Volume", "", "$pref::SFX::masterVolume", 0, 1, 0.1)); + AudioSettingsList.add(addOptionSlider("GUI Volume", "", "$pref::SFX::channelVolume[" @ $GuiAudioType @ "]", 0, 1, 0.1)); + AudioSettingsList.add(addOptionSlider("Effects Volume", "", "$pref::SFX::channelVolume[" @ $SimAudioType @ "]", 0, 1, 0.1)); + AudioSettingsList.add(addOptionSlider("Music Volume", "", "$pref::SFX::channelVolume[" @ $MusicAudioType @ "]", 0, 1, 0.1)); + + //Ensure our newly templated options listings are sized right + for(%i=0; %i < AudioSettingsList.getCount(); %i++) + { + %entry = AudioSettingsList.getObject(%i); + %entry.resize(0, 0, AudioSettingsList.extent.x - 15, %entry.extent.y); //-10 for the scroll wheel pad + } +} + +function OptionsMenu::populateKBMControls(%this) +{ + //$remapListDevice = "keyboard"; + %this.populateKeybinds("keyboard", KBMControlsList); + + %this.syncGui(); +} + +function OptionsMenu::populateGamepadControls(%this) +{ + //$remapListDevice = ; + %this.populateKeybinds("gamepad", GamepadControlsList); + + %this.syncGui(); +} + +function OptionsMenu::populateKeybinds(%this, %device, %controlsList) +{ + //%device = $remapListDevice; + + %controlsList.clear(); + + //build out our list of action maps + %actionMapCount = ActionMapGroup.getCount(); + + %actionMapList = ""; + for(%i=0; %i < %actionMapCount; %i++) + { + %actionMap = ActionMapGroup.getObject(%i); + + if(%actionMap == GlobalActionMap.getId()) + continue; + + %actionMapName = %actionMap.humanReadableName $= "" ? %actionMap.getName() : %actionMap.humanReadableName; + + //see if we have any actual listed remappable keys for this movemap. if so, drop it from the listing + %hasRemaps = false; + for ( %r = 0; %r < $RemapCount; %r++ ) + { + %testMapName = $RemapActionMap[%r].humanReadableName $= "" ? $RemapActionMap[%r].getName() : $RemapActionMap[%r].humanReadableName; + + if(%actionMapName $= %testMapName) + { + //got a match to at least one, so we're ok to continue + %hasRemaps = true; + break; + } + } + + if(!%hasRemaps) + continue; + + if(%actionMapList $= "") + %actionMapList = %actionMapName; + else + %actionMapList = %actionMapList TAB %actionMapName; + } + + //If we didn't find any valid actionMaps, then just exit out + if(%actionMapList $= "") + return; + + if($activeRemapControlSet $= "") + $activeRemapControlSet = getField(%actionMapList, 0); + + if(getFieldCount(%actionMapList) > 1) + { + for(%am = 0; %am < getFieldCount(%actionMapList); %am++) + { + %currentActionMap = getField(%actionMapList, %am); + + %actionMapGroupEntry = addOptionGroup(%currentActionMap); + %controlsList.add(%actionMapGroupEntry); + + for ( %i = 0; %i < $RemapCount; %i++ ) + { + if(%device !$= "" && %device !$= $RemapDevice[%i]) + continue; + + %actionMapName = $RemapActionMap[%i].humanReadableName $= "" ? $RemapActionMap[%i].getName() : $RemapActionMap[%i].humanReadableName; + + if(%currentActionMap !$= %actionMapName) + continue; + + %keyMap = buildFullMapString( %i, $RemapActionMap[%i], %device ); + + %description = $RemapDescription[%i]; + + %remapEntry = addActionMapEntry(%actionMapName, %device, %keyMap, %description); + %controlsList.add(%remapEntry); + } + } + } + + //Ensure our newly templated options listings are sized right + for(%i=0; %i < %controlsList.getCount(); %i++) + { + %entry = %controlsList.getObject(%i); + %entry.resize(0, 0, %controlsList.extent.x - 15, %entry.extent.y); //-10 for the scroll wheel pad + } +} +// +// old +// //We capitalize on the canClose test here, because we want to prompt for unapplied options changes before //backing out. So when the UINavigation test canClose, we can see if we have unapplied settings and prompt //that via the message box and return false. @@ -377,22 +616,6 @@ function OptionsMenu::onClose(%this) } -function OptionsMenuSettingsList::onAdd(%this) -{ -} - -function OptionsMenuSettingsList::getOptionsList(%this, %index) -{ -} - -function OptionsMenu::select(%this) -{ - if(OptionsMenuCategoryList.isActiveMenuList()) - { - OptionsMenuSettingsList.setAsActiveMenuList(); - } -} - function OptionsMenu::apply(%this) { //Now we run through our list of unapplied changes and... apply them. @@ -537,67 +760,8 @@ function OptionsMenu::resetToDefaults(%this) MessageBoxOKCancel("", "This will set the graphical settings back to the auto-detected defaults. Do you wish to continue?", "AutodetectGraphics();", ""); } -function OptionsMenu::refresh(%this) -{ - //cache our scroll position so we can ensure we end up back at it after the refresh - %lastScrollPos = OptionsMenuSettingsScroll.getScrollPosition(); - - %cat = %this.currentCategory; - if(%this.currentCategory !$= "") - { - if(!isInt(%this.currentCategory)) - { - %this.currentCategory = getOptionsCategoryIndexByName(%this.currentCategory); - } - - if(%this.currentCategory == -1) - return; - - %category = %this.optionsCategories.getKey(%this.currentCategory); - %command = %this.optionsCategories.getValue(%this.currentCategory); - eval(%command); - } - - //now, because we reconstruct the displayed set, we'll force the mouse(if we're using it as our input) - //to be poked so we can re-track to whatever control, if any, we're over - if($activeControllerType !$= "gamepad") - { - Canvas.setCursorPos(Canvas.getCursorPos()); - } - - //restore scroll position - OptionsMenuSettingsScroll.setScrollPosition(%lastScrollPos.x, %lastScrollPos.y); -} - -function OptionsMenu::getOptionVariableValue(%this, %variableName) -{ - %unappliedPrefIndex = %this.unappliedChanges.getIndexFromKey(%variableName); - if(%unappliedPrefIndex != -1) - { - %value = %this.unappliedChanges.getValue(%unappliedPrefIndex); - return strreplace(%value, "\"", ""); - } - - %sanitizedVar = strReplace(%variableName, "[", ""); - %sanitizedVar = strReplace(%sanitizedVar, "]", ""); - %sanitizedVar = strReplace(%sanitizedVar, ",", "_"); - return getVariable(%sanitizedVar); -} - -function OptionsMenuSelectButton::onVisible(%this, %state) -{ - //We're sorta cheating here. - //This button should only be displayed when we're in the categories list - //so whenever the status changes, such as automatically refreshing due to - //navigation events, we'll just do a quick check to ensure we're - //in the right visibility mode - if(%state && OptionsMenuSettingsList.isActiveMenuList()) - { - %this.setHidden(true); - } -} -// // +// old ones // function populateDisplaySettingsList() { @@ -686,7 +850,7 @@ function populateDisplaySettingsList() } // -// +// // function populateGraphicsSettingsList() { @@ -775,7 +939,7 @@ function updateGraphicsSettings() } } -function updateDisplaySettings() +/*function updateDisplaySettings() { //Update the display settings now %deviceName = getDisplayDeviceName(); @@ -851,7 +1015,7 @@ function updateDisplaySettings() $pref::Video::AA = %newAA; configureCanvas(); } -} +}*/ function updatePostFXSettings() { @@ -959,328 +1123,6 @@ function updateAudioSettings() // // // -function populateKeyboardMouseSettingsList() -{ - OptionsMenuSettingsList.clear(); - - OptionsMenu.currentCategory = "Keyboard & Mouse"; - - if(isObject(OptionName)) - OptionName.setText(""); - if(isObject(OptionDescription)) - OptionDescription.setText(""); - - $remapListDevice = "keyboard"; - fillRemapList(); - - //OptionsMenuSettingsList.refresh(); -} - -function populateGamepadSettingsList() -{ - OptionsMenuSettingsList.clear(); - - OptionsMenu.currentCategory = "Gamepad"; - - if(isObject(OptionName)) - OptionName.setText(""); - if(isObject(OptionDescription)) - OptionDescription.setText(""); - - $remapListDevice = "gamepad"; - fillRemapList(); - - OptionsMenuSettingsList.updateStack(); -} - -// -// -// -function getDisplayDeviceList() -{ - %numDevices = Canvas.getMonitorCount(); - %devicesList = ""; - for(%i = 0; %i < %numDevices; %i++) - { - %device = (%i+1) @ " - " @ Canvas.getMonitorName(%i); - if(%i==0) - %devicesList = %device; - else - %devicesList = %devicesList @ "\t" @ %device; - } - - return %devicesList; -} - -function getDisplayDeviceId(%displayDeviceName) -{ - %deviceList = getDisplayDeviceList(); - - %deviceCount = getFieldCount(%deviceList); - for(%d = 0; %d < %deviceCount; %d++) - { - %deviceName = getField(%deviceList, %d); - if(%deviceName $= %displayDeviceName) - return %d; - } - - return -1; -} -// -// -// -function OptionsMenuList::activateRow(%this) -{ - //OptionsMenuSettingsList.setFirstResponder(); - OptionsMenuSettingsList.setAsActiveMenuList(); -} - -function OptionsMenuSettingsList::setRowEnabled(%this, %row, %status) -{ - %option = %this.getObject(%row); - if(isObject(%option)) - { - %option.setEnabled(%status); - } -} - -function OptionsMenuSettingsList::addOptionRow(%this, %label, %targetPrefVar, %optionsList, %wrapOptions, %callback, %enabled, %description, %defaultValue) -{ - if(%enabled $= "") - %enabled = true; - - %optionsRowSize = 30; - %optionColumnWidth = %this.extent.x * 0.5;//todo, calculate off longest option text? - - %option = new GuiGameSettingsCtrl() { - class = "MenuOptionsButton"; - profile = "GuiMenuButtonProfile"; - horizSizing = "width"; - vertSizing = "bottom"; - position = "0 0"; - extent = %this.extent.x SPC %optionsRowSize; - columnSplit = %optionColumnWidth; - useMouseEvents = true; - previousBitmapAsset = "UI:previousOption_n_image"; - nextBitmapAsset = "UI:nextOption_n_image"; - }; - - %option.targetPrefVar = %targetPrefVar; //create a var-option association - - if(%defaultValue $= "") - { - %unappliedPrefIndex = OptionsMenu.unappliedChanges.getIndexFromKey(%targetPrefVar); - if(%unappliedPrefIndex != -1) - { - %value = OptionsMenu.unappliedChanges.getValue(%unappliedPrefIndex); - %defaultValue = strreplace(%value, "\"", ""); - } - - if(%defaultValue $= "") - { - %sanitizedVar = strReplace(%targetPrefVar, "[", ""); - %sanitizedVar = strReplace(%sanitizedVar, "]", ""); - %sanitizedVar = strReplace(%sanitizedVar, ",", "_"); - %defaultValue = getVariable(%sanitizedVar); - } - } - - /*if(%defaultValue $= "Off" || %defaultValue $= "No") - %defaultValue = "0"; - if(%defaultValue $= "On" || %defaultValue $= "Yes") - %defaultValue = "1";*/ - - %option.setListSetting(%label, %optionsList, %wrapOptions, %callback, %enabled, %description, %defaultValue); - - %this.add(%option); -} - -function OptionsMenuSettingsList::addOptionQualityLevelRow(%this, %label, %targetPrefVar, %qualityLevelList, %wrapOptions, %callback, %enabled, %description, %defaultValue) -{ - if(%defaultValue $= "") - { - %unappliedPrefIndex = OptionsMenu.unappliedChanges.getIndexFromKey(%targetPrefVar); - if(%unappliedPrefIndex != -1) - { - %value = OptionsMenu.unappliedChanges.getValue(%unappliedPrefIndex); - %defaultValue = strreplace(%value, "\"", ""); - } - - if(%defaultValue $= "") - { - %sanitizedVar = strReplace(%targetPrefVar, "[", ""); - %sanitizedVar = strReplace(%sanitizedVar, "]", ""); - %sanitizedVar = strReplace(%sanitizedVar, ",", "_"); - %defaultValue = getVariable(%sanitizedVar); - } - - if(%defaultValue $= "") - %defaultValue = getCurrentQualityLevel(%qualityLevelList); - } - - return %this.addOptionRow(%label, %targetPrefVar, getQualityLevels(%qualityLevelList), - %wrapOptions, %callback, %enabled, %description, %defaultValue); -} - -function OptionsMenuSettingsList::addOptionBoolRow(%this, %label, %targetPrefVar, %qualityLevelList, %wrapOptions, %callback, %enabled, %description, %defaultValue, %inverted) -{ - if(%defaultValue $= "") - %defaultValue = OptionsMenu.getOptionVariableValue(%targetPrefVar); - - if(%inverted $= "") - %inverted = false; - - //Lame and hacky, but some variables are 'disabled' and some are 'enabled' - if(isInt(%defaultValue) && %inverted) - { - if(%defaultValue == 0) - %defaultValue = 1; - else - %defaultValue = 0; - } - - if(%qualityLevelList $= $yesNoList && isInt(%defaultValue)) - { - %defaultValue = convertBoolToYesNo(%defaultValue); - } - else if(%qualityLevelList $= $onOffList && isInt(%defaultValue)) - { - %defaultValue = convertBoolToOnOff(%defaultValue); - } - - return %this.addOptionRow(%label, %targetPrefVar, %qualityLevelList, - %wrapOptions, %callback, %enabled, %description, %defaultValue); -} - -function OptionsMenuSettingsList::addSliderRow(%this, %label, %targetPrefVar, %increment, %range, %callback, %enabled, %description, %defaultValue) -{ - if(%enabled $= "") - %enabled = true; - - %optionsRowSize = 30; - %optionColumnWidth = %this.extent.x * 0.5;//todo, calculate off longest option text? - - %option = new GuiGameSettingsCtrl() { - class = "MenuOptionsButton"; - profile = "GuiMenuButtonProfile"; - horizSizing = "width"; - vertSizing = "bottom"; - position = "0 0"; - extent = %this.extent.x SPC %optionsRowSize; - columnSplit = %optionColumnWidth; - useMouseEvents = true; - }; - - %option.targetPrefVar = %targetPrefVar; //create a var-option association - - if(%defaultValue $= "") - %defaultValue = OptionsMenu.getOptionVariableValue(%targetPrefVar); - - %option.setSliderSetting(%label, %defaultValue, %increment, %range, %callback, %enabled, %description); - - %this.add(%option); -} - -function OptionsMenuSettingsList::addKeybindRow(%this, %label, %bitmapName, %callback, %enabled, %description, %remapIndex) -{ - if(%enabled $= "") - %enabled = true; - - %optionsRowSize = 40; - %optionColumnWidth = %this.extent.x * 0.5;//todo, calculate off longest option text? - - %option = new GuiGameSettingsCtrl() { - class = "MenuOptionsButton"; - profile = "GuiMenuButtonProfile"; - horizSizing = "width"; - vertSizing = "bottom"; - position = "0 0"; - extent = %this.extent.x SPC %optionsRowSize; - columnSplit = %optionColumnWidth; - useMouseEvents = true; - }; - - %option.remapIndex = %remapIndex; - - %option.setKeybindSetting(%label, %bitmapName, %callback, %enabled, %description); - - %this.add(%option); -} - -// -function OptionsMenuCategoryList::onNavigate(%this, %index) -{ - OptionsMenu.currentCategory = %index; - %this.getObject(%index).performClick(); -} - -function convertOptionToBool(%val) -{ - if(%val $= "yes" || %val $= "on") - return 1; - else - return 0; -} - -function convertBoolToYesNo(%val) -{ - if(%val == 1) - return "Yes"; - else if(%val == 0) - return "No"; - - return %val; -} - -function convertBoolToOnOff(%val) -{ - if(%val == 1) - return "On"; - else if(%val == 0) - return "Off"; - - return %val; -} - -function getDisplayDeviceName() -{ - %numDevices = Canvas.getMonitorCount(); - %devicesList = ""; - for(%i = 0; %i < %numDevices; %i++) - { - %device = (%i+1) @ " - " @ Canvas.getMonitorName(%i); - if(%i==0) - %devicesList = %device; - else - %devicesList = %devicesList @ "\t" @ %device; - } - - return getField(%devicesList, $pref::Video::deviceId); -} -// -// -// -function MenuOptionsButton::onMouseEnter(%this) -{ - if(isObject(OptionName)) - OptionName.setText(%this.getLabel()); - if(isObject(OptionDescription)) - OptionDescription.setText(%this.getToolTip()); -} - -function MenuOptionsButton::onMouseLeave(%this) -{ - if(isObject(OptionName)) - OptionName.setText(""); - if(isObject(OptionDescription)) - OptionDescription.setText(""); -} - -function MenuOptionsButton::onHighlighted(%this, %state) -{ - MenuListButton::onHighlighted(%this, %state); -} - function MenuOptionsButton::onChange(%this) { %optionMode = %this.getMode(); @@ -1347,71 +1189,14 @@ function OptionsMenu::onKeybindChanged(%this, %actionMap, %keybind) } // -// Indicates what category the options item should be added into +// new // -function addOptionsMenuCategory(%categoryName, %selectCallback) -{ - //Don't add duplicates! - %index = OptionsMenu.optionsCategories.getIndexFromKey(%categoryName); - if(%index == -1) - OptionsMenu.optionsCategories.add(%categoryName, %selectCallback); -} - -function removeOptionsMenuCategory(%categoryName) -{ - %index = OptionsMenu.optionsCategories.getIndexFromKey(%categoryName); - if(%index != -1) - OptionsMenu.optionsCategories.erase(%index); -} - -function getOptionsCategoryIndexByName(%categoryName) -{ - for(%i=0; %i < OptionsMenu.optionsCategories.count(); %i++) - { - if(OptionsMenu.optionsCategories.getKey(%i) $= %categoryName) - return %i; - } - - return -1; -} - -function addListOption(%label, %description, %targetPrefVar, %optionsList, %wrapOptions, %callback, %enabled) -{ - if(%wrapOptions $= "") - %wrapOptions = false; - - if(%enabled $= "") - %enabled = true; - - OptionsMenuSettingsList.addOptionRow(%label, %targetPrefVar, %optionsList, %wrapOptions, %callback, %enabled, %description, %targetPrefVar); -} - -function addSliderOption(%label, %description, %targetPrefVar, %defaultValue, %increment, %range, %callback, %enabled) -{ - if(%enabled $= "") - %enabled = true; - - OptionsMenuSettingsList.addSliderRow(%label, %targetPrefVar, %defaultValue, %increment, %range, %callback, %enabled, %description); -} - -function addKeybindOption(%label, %description, %bitmapName, %callback, %enabled) -{ - if(%enabled $= "") - %enabled = true; - - OptionsMenuSettingsList.addSliderRow(%label, %bitmapName, %callback, %enabled, %description); -} - - -// -// -// -function addOptionGroup() +function addOptionGroup(%displayName) { %group = new GuiTextCtrl() { - text = "Graphics"; + text = %displayName; position = "0 0"; - extent = "500 30"; + extent = "500 45"; profile = "MenuHeaderText"; tooltipProfile = "GuiToolTipProfile"; }; @@ -1427,23 +1212,35 @@ function optionsMenuButton::onHighlighted(%this, %highlighted) %container-->optionDescription.profile = %highlighted ? GuiMLTextProfileHighlighted : GuiMLTextProfile; %valuesContainer = %container-->valuesContainer; - %valuesContainer-->optionValue.profile = %highlighted ? GuiMenuTextProfileHighlighted : GuiMenuTextProfile; -} - -function optionsMenuButton::onMouseDown(%this) -{ - //check if we're clicking on the left or right of the value and adjust it accordingly + %valuesContainer-->optionValue.profile = %highlighted ? GuiMenuTextProfileHL : GuiMenuTextProfile; + + OptionsMenuSettingsScroll.scrollToObject(%container); } function addOptionEntry(%optionObj) { - if(!isObject(%optionObj) || %optionObj.class !$= "OptionsSettings") + if(!isObject(%optionObj) || (%optionObj.class !$= "OptionsSettings" && %optionObj.class !$= "AudioOptionsSettings")) { error("addOptionsEntry() - attempting to create a new options entry, but was provided an invalid options object"); return 0; } - %qualityLevel = %optionObj.getObject(0); + %qualityLevel = getCurrentQualityLevel(%optionObj); + + if(isObject(%qualityLevel)) + { + %qualityLevelText = %qualityLevel.displayName; + %qualityLevelIndex = %optionObj.getObjectIndex(%qualityLevel); + } + else + { + %qualityLevelText = %qualityLevel; + %qualityLevelIndex = %optionObj.getCount(); + } + + %optionNameHeight = 20; + if(%optionObj.Description $= "") + %optionNameHeight = 40; %entry = new GuiContainer() { position = "0 0"; @@ -1454,7 +1251,8 @@ function addOptionEntry(%optionObj) vertSizing = "bottom"; class = "OptionsListEntry"; optionsObject = %optionObj; - currentOptionIndex = 0; + currentOptionIndex = %qualityLevelIndex; + canSave = "0"; new GuiButtonCtrl() { profile = GuiMenuButtonProfile; @@ -1469,7 +1267,7 @@ function addOptionEntry(%optionObj) new GuiTextCtrl() { text = %optionObj.OptionName; position = $optionsEntryPad SPC -1; - extent = "400 20"; + extent = 400 SPC %optionNameHeight; profile = "MenuSubHeaderText"; tooltipProfile = "GuiToolTipProfile"; internalName = "optionName"; @@ -1501,7 +1299,7 @@ function addOptionEntry(%optionObj) }; new GuiTextCtrl() { - text = %qualityLevel.displayName; + text = %qualityLevelText; position = "330 0"; extent = "50 40"; profile = "GuiMenuTextProfile"; @@ -1521,5 +1319,166 @@ function addOptionEntry(%optionObj) }; }; + return %entry; +} + +function addOptionSlider(%optionName, %optionDesc, %prefName, %sliderMin, %sliderMax, %sliderTicks) +{ + %currentVal = getVariable(%prefName); + + if(%currentVal $= "") + %currentVal = %sliderMin; + + %optionNameHeight = 20; + if(%optionDesc $= "") + %optionNameHeight = 40; + + %entry = new GuiContainer() { + position = "0 0"; + extent = "800 40"; + profile = GuiMenuDefaultProfile; + tooltipProfile = "GuiToolTipProfile"; + horizSizing = "width"; + vertSizing = "bottom"; + class = "OptionsListSliderEntry"; + canSave = "0"; + + new GuiButtonCtrl() { + profile = GuiMenuButtonProfile; + position = "0 0"; + extent = "800 40"; + horizSizing = "width"; + vertSizing = "height"; + internalName = "button"; + class = "optionsMenuButton"; + }; + + new GuiTextCtrl() { + text = %optionName; + position = $optionsEntryPad SPC -1; + extent = 400 SPC %optionNameHeight; + profile = "MenuSubHeaderText"; + tooltipProfile = "GuiToolTipProfile"; + internalName = "optionName"; + }; + + new GuiTextCtrl() { + text = %optionDesc; + position = $optionsEntryPad SPC 17; + extent = "400 18"; + profile = "GuiMLTextProfile"; + tooltipProfile = "GuiToolTipProfile"; + internalName = "optionDescription"; + }; + + new GuiContainer() { + position = "400 0"; + extent = "400 40"; + profile = GuiModelessDialogProfile; + tooltipProfile = "GuiToolTipProfile"; + horizSizing = "left"; + vertSizing = "height"; + internalName = "valuesContainer"; + + new GuiSliderCtrl() { + range = %sliderMin SPC %sliderMax; + ticks = %sliderTicks; + snap = "1"; + value = %currentVal; + useFillBar = "1"; + fillBarColor = $TextMediumEmphasisColor; + renderTicks = "0"; + position = "0 10"; + extent = "300 20"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "center"; + profile = GuiMenuButtonProfile; + visible = "1"; + active = "1"; + command = "$thisControl.updateSliderValue();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + class = "OptionsSliderEntrySlider"; + }; + }; + }; + + return %entry; +} + +function OptionsSliderEntrySlider::updateSliderValue(%this) +{ + //update settings value here +} + +function OptionsMenuActionMapButton::onHighlighted(%this, %highlighted) +{ + %container = %this.getParent(); + %container-->actionName.profile = %highlighted ? MenuSubHeaderTextHighlighted : MenuSubHeaderText; + + OptionsMenuSettingsScroll.scrollToObject(%container); +} + +function addActionMapEntry(%actionMap, %device, %keyMap, %description) +{ + %entry = new GuiContainer() { + position = "0 0"; + extent = "800 40"; + profile = GuiMenuDefaultProfile; + tooltipProfile = "GuiToolTipProfile"; + horizSizing = "width"; + vertSizing = "bottom"; + class = "OptionsKeybindEntry"; + canSave = "0"; + actionMap = %actionMap; + device = %device; + keymap = %keyMap; + + new GuiButtonCtrl() { + profile = GuiMenuButtonProfile; + position = "0 0"; + extent = "800 40"; + horizSizing = "width"; + vertSizing = "height"; + internalName = "button"; + class = "OptionsMenuActionMapButton"; + }; + + new GuiTextCtrl() { + text = getField(%keyMap, 0); + position = $optionsEntryPad SPC -1; + extent = "400 40"; + profile = "MenuSubHeaderText"; + tooltipProfile = "GuiToolTipProfile"; + internalName = "actionName"; + }; + + new GuiContainer() { + position = "400 3"; + extent = "400 34"; + profile = GuiModelessDialogProfile; + tooltipProfile = "GuiToolTipProfile"; + horizSizing = "left"; + vertSizing = "height"; + internalName = "valuesContainer"; + + new GuiIconButtonCtrl() { + position = "300 -10"; + extent = "98 45"; + BitmapAsset = ""; + profile = GuiRemapActionMapButtonProfile; + sizeIconToButton = true; + makeIconSquare = true; + iconLocation = "center"; + internalName = "bindButton"; + active = false; + }; + }; + }; + return %entry; } \ No newline at end of file diff --git a/Templates/BaseGame/game/data/UI/scripts/profiles.tscript b/Templates/BaseGame/game/data/UI/scripts/profiles.tscript index 93e65e7dd..c6c34cb9c 100644 --- a/Templates/BaseGame/game/data/UI/scripts/profiles.tscript +++ b/Templates/BaseGame/game/data/UI/scripts/profiles.tscript @@ -4,48 +4,45 @@ $TextHighEmphasisColor = "224 224 224"; $TextHighEmphasisColorHL = "0 0 0"; $TextDisabledColor = "108 108 108"; -singleton GuiGameListMenuProfile(DefaultListMenuProfile) +// --------------------------------------------------------------------------- +// Defaults +// --------------------------------------------------------------------------- +singleton GuiControlProfile( GuiMenuDefaultProfile ) { - fontType = "Arial Bold"; - fontSize = 20; - fontColor = $TextMediumEmphasisColor; - fontColorSEL = $TextMediumEmphasisColor; - fontColorNA = $TextDisabledColor; - fontColorHL = $TextMediumEmphasisColor; - - fillColor = "108 108 108"; - fillColorHL = "140 140 140"; - fillColorSEL = "180 180 180"; - - HitAreaUpperLeft = "16 20"; - HitAreaLowerRight = "503 74"; - IconOffset = "40 0"; - TextOffset = "100 0"; - RowSize = "500 90"; - ColumnSplit = "250"; - RightPad = "20"; - bitmap = "UI:listMenuArray_image"; - canKeyFocus = true; + opaque = false; + fillColor = "0 0 0 0"; + category = "BaseUI"; }; -singleton GuiControlProfile(GamepadDefaultProfile) +singleton GuiControlProfile( GuiModelessDialogProfile : GuiMenuDefaultProfile ) { - border = 0; + modal = false; }; -singleton GuiControlProfile(GamepadButtonTextLeft) +singleton GuiControlProfile(GuiMenuBackgroundProfile) { - fontType = "Arial Bold"; - fontSize = 20; - fontColor = "255 255 255"; - justify = "left"; + category = "BaseUI"; + opaque = true; + fillcolor = "34 34 34 255"; }; -singleton GuiControlProfile(GamepadButtonTextRight : GamepadButtonTextLeft) +singleton GuiControlProfile(GuiMenuPanelProfile) { - justify = "right"; + category = "BaseUI"; + opaque = true; + fillcolor = "15 15 15 255"; }; +singleton GuiControlProfile(GuiMenuBasePanelProfile) +{ + category = "BaseUI"; + opaque = true; + fillcolor = "40 40 40 255"; +}; + +// --------------------------------------------------------------------------- +// Text +// --------------------------------------------------------------------------- singleton GuiControlProfile(MenuHeaderText) { fontType = "Arial Bold"; @@ -53,6 +50,7 @@ singleton GuiControlProfile(MenuHeaderText) fontColor = $TextHighEmphasisColor; justify = "left"; modal = false; + category = "BaseUI"; }; singleton GuiControlProfile(MenuHeaderTextHighlighted : MenuHeaderText) @@ -60,11 +58,8 @@ singleton GuiControlProfile(MenuHeaderTextHighlighted : MenuHeaderText) fontColor = $TextHighEmphasisColorHL; }; -singleton GuiControlProfile(MenuHeaderTextCenter) +singleton GuiControlProfile(MenuHeaderTextCenter : MenuHeaderText) { - fontType = "Arial Bold"; - fontSize = 32; - fontColor = $TextHighEmphasisColor; justify = "center"; }; @@ -75,6 +70,7 @@ singleton GuiControlProfile(MenuSubHeaderText) fontColor = $TextMediumEmphasisColor; justify = "left"; modal = false; + category = "BaseUI"; }; singleton GuiControlProfile(MenuSubHeaderTextHighlighted : MenuSubHeaderText) @@ -101,6 +97,7 @@ singleton GuiControlProfile(MenuMLSubHeaderText) autoSizeWidth = true; autoSizeHeight = true; modal = false; + category = "BaseUI"; }; singleton GuiControlProfile(MenuMLSubHeaderTextCenter : MenuMLSubHeaderText) @@ -108,92 +105,6 @@ singleton GuiControlProfile(MenuMLSubHeaderTextCenter : MenuMLSubHeaderText) justify = "center"; }; -singleton GuiControlProfile( GuiMenuDefaultProfile ) -{ - opaque = false; - fillColor = "0 0 0 0"; -}; - -singleton GuiControlProfile( GuiMenuButtonProfile ) -{ - opaque = true; - border = false; - fontSize = 24; - fontType = "Arial Bold"; - fontColor = "200 200 200 255"; - fontColorHL = "0 0 0 255"; - fontColorNA = "108 108 108 255"; - fontColorSEL = "200 200 200 255"; - fillColor = "0 0 0 0"; - fillColorHL = "255 255 255 255"; - fillColorNA = "40 40 40"; - borderColor = "87 87 87"; - borderColorNA = "0 0 0"; - borderColorHL = "194 64 64"; - fixedExtent = 0; - justify = "center"; - canKeyFocus = false; - //bitmapAsset = "UI:menu_button_image"; - hasBitmapArray = false; - soundButtonDown = "UI:buttonClick"; - soundButtonOver = "UI:buttonHover"; - category = "BaseUI"; - fontColors[0] = "200 200 200 255"; - fontColors[2] = "108 108 108 255"; - fontColors[3] = "200 200 200 255"; - fontColors[5] = "Magenta"; - fontColorLinkHL = "Magenta"; -}; - -singleton GuiControlProfile( LevelPreviewButtonProfile : GuiMenuButtonProfile ) -{ - fontSize = 22; - justify = "Left"; -}; - -singleton GuiControlProfile( GuiHighlightMenuButtonProfile ) -{ - opaque = true; - border = false; - fontSize = 18; - fontType = "Arial Bold"; - fontColor = "240 240 240"; - fontColorHL = "0 0 0"; - fontColorNA = "125 125 125"; - //fontColorSEL ="0 0 0"; - fixedExtent = false; - justify = "center"; - canKeyFocus = false; - bitmapAsset = "UI:selector_button_highlight_only_image"; - hasBitmapArray = false; - category = "Core"; -}; - -singleton GuiControlProfile( GuiBlankMenuButtonProfile ) -{ - opaque = true; - border = false; - fontSize = 18; - fontType = "Arial Bold"; - fontColor = "220 220 220"; - fontColorHL = "255 255 255"; - fontColorNA = "200 200 200"; - //fontColorSEL ="0 0 0"; - fixedExtent = false; - justify = "center"; - canKeyFocus = false; - bitmapAsset = "UI:selector_button_blank_image"; - hasBitmapArray = false; - soundButtonDown = menuButtonPressed; - soundButtonOver = menuButtonHover; - category = "Core"; -}; - -singleton GuiControlProfile( GuiJoinServerButtonProfile : GuiMenuButtonProfile ) -{ - justify = "left"; -}; - singleton GuiControlProfile( GuiMenuTextProfile ) { opaque = true; @@ -209,99 +120,11 @@ singleton GuiControlProfile( GuiMenuTextProfile ) modal = false; }; -singleton GuiControlProfile( GuiMenuTextProfileHighlighted : GuiMenuTextProfile ) +singleton GuiControlProfile( GuiMenuTextProfileHL : GuiMenuTextProfile ) { fontColor = "0 0 0"; }; -singleton GuiControlProfile (GuiSolidDefaultProfile) -{ - opaque = true; - border = true; - category = "Core"; -}; - -singleton GuiControlProfile (GuiTransparentProfile) -{ - opaque = false; - border = false; - category = "Core"; -}; - -singleton GuiControlProfile( GuiGroupBorderProfile ) -{ - border = false; - opaque = false; - hasBitmapArray = true; - bitmapAsset = "UI:group_border_image"; - category = "Core"; -}; - -singleton GuiControlProfile( GuiTabBorderProfile ) -{ - border = false; - opaque = false; - hasBitmapArray = true; - bitmapAsset = "UI:tab_border_image"; - category = "Core"; -}; - -singleton GuiControlProfile( GuiModelessDialogProfile ) -{ - modal = false; - category = "Core"; -}; - -singleton GuiControlProfile (GuiFrameSetProfile) -{ - fillcolor = "255 255 255"; - borderColor = "246 245 244"; - border = 1; - opaque = true; - border = true; - category = "Core"; -}; - -singleton GuiControlProfile( GuiInputCtrlProfile ) -{ - tab = true; - canKeyFocus = true; - category = "Core"; -}; - -singleton GuiControlProfile (GuiTextProfile) -{ - justify = "left"; - fontColor = "20 20 20"; - category = "Core"; -}; - -singleton GuiControlProfile (GuiTextRightProfile : GuiTextProfile) -{ - justify = "right"; - category = "Core"; -}; - -singleton GuiControlProfile (GuiAutoSizeTextProfile) -{ - fontColor = "0 0 0"; - autoSizeWidth = true; - autoSizeHeight = true; - category = "Core"; -}; - -singleton GuiControlProfile( GuiMediumTextProfile : GuiTextProfile ) -{ - fontSize = 24; - category = "Core"; -}; - -singleton GuiControlProfile( GuiBigTextProfile : GuiTextProfile ) -{ - fontSize = 36; - category = "Core"; -}; - singleton GuiControlProfile( GuiMLTextProfile ) { fontColor = $TextMediumEmphasisColor; @@ -324,224 +147,48 @@ singleton GuiControlProfile( GuiMLTextProfileHighlighted : GuiMLTextProfile ) fontColor = $TextMediumEmphasisColorHL; }; -singleton GuiControlProfile( GuiMLWhiteTextProfile ) -{ - fontColor = "220 220 220"; - fontColorHL = $TextMediumEmphasisColor; - autoSizeWidth = true; - autoSizeHeight = true; - border = false; - category = "Core"; -}; - -singleton GuiControlProfile( GuiTextArrayProfile : GuiTextProfile ) -{ - fontColor = $TextMediumEmphasisColor; - fontColorHL = $TextMediumEmphasisColor; - fontColorSEL = $TextMediumEmphasisColor; - fontColorNA = $TextDisabledColor; - - fillColor = "22 22 22 255"; - fillColorHL = "22 22 22 255"; - fillColorSEL = "56 56 56 255"; - - border = true; - borderColor ="87 87 87"; - borderColorHL = "87 87 87"; - borderColorSEL = "255 255 255"; - - category = "Core"; - canKeyFocus = true; -}; - -singleton GuiControlProfile( GuiMenuTextEditProfile : GuiTextEditProfile ) -{ - fontColor = $TextMediumEmphasisColor; - fontColorHL = $TextMediumEmphasisColor; - fontColorSEL = $TextMediumEmphasisColor; - fontColorNA = $TextDisabledColor; - - fillColor = "22 22 22 255"; - fillColorHL = "22 22 22 255"; - - border = true; - borderColor ="87 87 87"; - borderColorHL = "87 87 87"; - borderColorSEL = "255 255 255"; - - category = "Core"; -}; - -// ---------------------------------------------------------------------------- -// TODO: Revisit Popupmenu -// ---------------------------------------------------------------------------- - -singleton GuiControlProfile( GuiPopupMenuItemBorder : GuiButtonProfile ) +// --------------------------------------------------------------------------- +// Interactive Controls +// --------------------------------------------------------------------------- +singleton GuiControlProfile( GuiMenuButtonProfile ) { opaque = true; - border = true; - fontColor = "0 0 0"; - fontColorHL = "0 0 0"; - fontColorNA = "255 255 255"; - fixedExtent = false; + border = false; + fontSize = 24; + fontType = "Arial Bold"; + fontColor = "200 200 200 255"; + fontColorHL = "0 0 0 255"; + fontColorNA = "108 108 108 255"; + fontColorSEL = "200 200 200 255"; + fillColor = "0 0 0 0"; + fillColorHL = "255 255 255 255"; + fillColorNA = "40 40 40"; + borderColor = "87 87 87"; + borderColorNA = "0 0 0"; + borderColorHL = "194 64 64"; + fixedExtent = 0; justify = "center"; canKeyFocus = false; - bitmapAsset = "UI:menubutton_image"; - category = "Core"; + hasBitmapArray = false; + soundButtonDown = "UI:buttonClick"; + soundButtonOver = "UI:buttonHover"; + category = "BaseUI"; + fontColors[0] = "200 200 200 255"; + fontColors[2] = "108 108 108 255"; + fontColors[3] = "200 200 200 255"; }; -singleton GuiControlProfile( GuiPopUpMenuDefault : GuiDefaultProfile ) +singleton GuiControlProfile( GuiMenuButtonLeftJustProfile : GuiMenuButtonProfile ) { - opaque = true; - mouseOverSelected = true; - textOffset = "3 3"; - border = 0; - borderThickness = 0; - fixedExtent = true; - hasBitmapArray = true; - - fillColor = EditorSettings.value("Theme/fieldBGColor");//"255 255 255";//100 - fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");//"91 101 116"; - fillColorSEL = EditorSettings.value("Theme/fieldBGSELColor");//"91 101 116"; - fontColor = EditorSettings.value("Theme/fieldTextColor");//"215 215 215"; - fontColorHL = EditorSettings.value("Theme/fieldTextHLColor");//"215 215 215"; - fontColorSEL = EditorSettings.value("Theme/fieldTextSELColor");//"215 215 215"; - fontColorNA = EditorSettings.value("Theme/fieldTextColor");//"215 215 215"; - borderColor = EditorSettings.value("Theme/dividerDarkColor"); - profileForChildren = GuiPopupMenuItemBorder; - category = "Core"; + justify = "Left"; }; -singleton GuiControlProfile( GuiPopUpMenuProfile : GuiPopUpMenuDefault ) +singleton GuiControlProfile( GuiRemapActionMapButtonProfile : GuiMenuButtonProfile ) { - textOffset = "6 4"; - bitmapAsset = "UI:dropDown_image"; - hasBitmapArray = true; - border = 1; - profileForChildren = GuiPopUpMenuDefault; - category = "Core"; + fillColor = "18 18 18 255"; + fillColorHL = "0 0 0 255"; }; -singleton GuiControlProfile( GuiTabBookProfile ) -{ - fillColorHL = "100 100 100"; - fillColorNA = "150 150 150"; - fontColor = "30 30 30"; - fontColorHL = "0 0 0"; - fontColorNA = "50 50 50"; - fontType = "Arial"; - fontSize = 14; - justify = "center"; - bitmapAsset = "UI:tab_image"; - tabWidth = 64; - tabHeight = 24; - tabPosition = "Top"; - tabRotation = "Horizontal"; - textOffset = "0 -3"; - tab = true; - cankeyfocus = true; - category = "Core"; -}; - -singleton GuiControlProfile( GuiTabPageProfile : GuiDefaultProfile ) -{ - fontType = "Arial"; - fontSize = 10; - justify = "center"; - bitmapAsset = "UI:tab_image"; - opaque = false; - fillColor = "240 239 238"; - category = "Core"; -}; - -singleton GuiControlProfile( GuiConsoleProfile ) -{ - fontType = ($platform $= "macos") ? "Monaco" : "Lucida Console"; - fontSize = ($platform $= "macos") ? 13 : 12; - fontColor = "255 255 255"; - fontColorHL = "0 255 255"; - fontColorNA = "255 0 0"; - fontColors[6] = "100 100 100"; - fontColors[7] = "100 100 0"; - fontColors[8] = "0 0 100"; - fontColors[9] = "0 100 0"; - category = "Core"; -}; - -singleton GuiControlProfile( GuiConsoleTextProfile ) -{ - fontColor = "0 0 0"; - autoSizeWidth = true; - autoSizeHeight = true; - textOffset = "2 2"; - opaque = true; - fillColor = "255 255 255"; - border = true; - borderThickness = 1; - borderColor = "0 0 0"; - category = "Core"; -}; - -$ConsoleDefaultFillColor = "0 0 0 175"; - -singleton GuiControlProfile( ConsoleScrollProfile : GuiScrollProfile ) -{ - opaque = true; - fillColor = $ConsoleDefaultFillColor; - border = 1; - //borderThickness = 0; - borderColor = "0 0 0"; - category = "Core"; -}; - -singleton GuiControlProfile( ConsoleTextEditProfile : GuiTextEditProfile ) -{ - fillColor = "242 241 240 255"; - fillColorHL = "255 255 255"; - category = "Core"; -}; - -//----------------------------------------------------------------------------- -// Center and bottom print -//----------------------------------------------------------------------------- - -singleton GuiControlProfile ( CenterPrintProfile ) -{ - opaque = false; - fillColor = "128 128 128"; - fontColor = "0 255 0"; - border = true; - borderColor = "0 255 0"; - category = "Core"; -}; - -singleton GuiControlProfile ( CenterPrintTextProfile ) -{ - opaque = false; - fontType = "Arial"; - fontSize = 12; - fontColor = "0 255 0"; - category = "Core"; -}; - -// ---------------------------------------------------------------------------- -// Radio button control -// ---------------------------------------------------------------------------- -singleton GuiControlProfile( GuiRadioProfile ) -{ - fontSize = 14; - fillColor = "232 232 232"; - fontColor = "20 20 20"; - fontColorHL = "80 80 80"; - fixedExtent = true; - bitmapAsset = "UI:radioButton_image"; - hasBitmapArray = true; - category = "Core"; -}; - -// -// Scroll Profile -// singleton GuiControlProfile(GuiMenuScrollProfile) { opaque = false; @@ -552,33 +199,4 @@ singleton GuiControlProfile(GuiMenuScrollProfile) bitmapAsset = "UI:scrollBar_image"; hasBitmapArray = true; category = "BaseUI"; -}; - -singleton GuiControlProfile(SliderBitmapGUIProfile) -{ - bitmapAsset = "UI:optionsMenuSliderBitmapArray_image"; - hasBitmapArray = true; - opaque = false; - borderColor = "0 0 0 255"; -}; - -singleton GuiControlProfile(GuiMenuBackgroundProfile) -{ - category = "BaseUI"; - opaque = true; - fillcolor = "34 34 34 255"; -}; - -singleton GuiControlProfile(GuiMenuPanelProfile) -{ - category = "BaseUI"; - opaque = true; - fillcolor = "15 15 15 255"; -}; - -singleton GuiControlProfile(GuiMenuBasePanelProfile) -{ - category = "BaseUI"; - opaque = true; - fillcolor = "40 40 40 255"; }; \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditor.gui b/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditor.gui index b6315df53..e48614c5a 100644 --- a/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditor.gui +++ b/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditor.gui @@ -302,7 +302,7 @@ new VPathEditor(EVPathEditor) { }; new GuiPopUpMenuCtrl(EPathEditorNodeOrientationMode){ internalName = "weight"; - Profile = "GuiPopUpMenuProfile"; + Profile = "ToolsGuiPopUpMenuProfile"; HorizSizing = "right"; VertSizing = "bottom"; Position = "57 84"; @@ -385,7 +385,7 @@ new VPathEditor(EVPathEditor) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; - Profile = "GuiTransparentProfile"; + Profile = "ToolsGuiTransparentProfile"; HorizSizing = "right"; VertSizing = "bottom"; Position = "1 1"; diff --git a/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorToolbar.gui b/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorToolbar.gui index 57651df52..5a1f0a808 100644 --- a/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorToolbar.gui +++ b/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorToolbar.gui @@ -30,7 +30,7 @@ $guiContent = new GuiControl(VPathEditorToolbar) new GuiTextCtrl() { internalName = "ToolbarLabel"; - profile = "GuiTextProfile"; + profile = "ToolsGuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 7"; @@ -48,7 +48,7 @@ $guiContent = new GuiControl(VPathEditorToolbar) internalName = "PathTypeMenu"; Enabled = "1"; isContainer = "0"; - Profile = "GuiPopUpMenuProfile"; + Profile = "ToolsGuiPopUpMenuProfile"; HorizSizing = "right"; VertSizing = "bottom"; Position = "85 7"; diff --git a/Templates/BaseGame/game/tools/VerveEditor/GUI/GuiProfiles.tscript b/Templates/BaseGame/game/tools/VerveEditor/GUI/GuiProfiles.tscript index ada3b1a08..457e0fae2 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/GUI/GuiProfiles.tscript +++ b/Templates/BaseGame/game/tools/VerveEditor/GUI/GuiProfiles.tscript @@ -79,7 +79,7 @@ singleton GuiControlProfile( VEditorTextEditProfile : VEditorDefaultProfile ) canKeyFocus = true; }; -singleton GuiControlProfile( VEditorPopupMenuProfile : GuiPopUpMenuProfile ) +singleton GuiControlProfile( VEditorPopupMenuProfile : ToolsGuiPopUpMenuProfile ) { FillColorHL = "90 90 90"; FillColorSEL = "0 0 0"; @@ -204,7 +204,7 @@ singleton GuiControlProfile( VEditorPropertyLabelProfile : VEditorTextProfile ) //----------------------------------------------------------------------------- -singleton GuiControlProfile( VEditorPreferenceLabelProfile : GuiTextProfile ) +singleton GuiControlProfile( VEditorPreferenceLabelProfile : ToolsGuiTextProfile ) { opaque = true; fillColor = "242 241 240"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript index 1216eaab6..a63aef2c9 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript @@ -2420,7 +2420,7 @@ function AssetBrowserPreviewButton::onMouseDragged(%this) %ctrl = new GuiDragAndDropControl() { canSaveDynamicFields = "0"; - Profile = "GuiSolidDefaultProfile"; + Profile = "ToolsGuiSolidDefaultProfile"; HorizSizing = "right"; VertSizing = "bottom"; Position = %xPos SPC %yPos; diff --git a/Templates/BaseGame/game/tools/gui/messageBoxes/IODropdownDlg.ed.gui b/Templates/BaseGame/game/tools/gui/messageBoxes/IODropdownDlg.ed.gui index e62771773..dda5498a0 100644 --- a/Templates/BaseGame/game/tools/gui/messageBoxes/IODropdownDlg.ed.gui +++ b/Templates/BaseGame/game/tools/gui/messageBoxes/IODropdownDlg.ed.gui @@ -54,7 +54,7 @@ $guiContent = new GuiControl(IODropdownDlg) { }; new GuiBitmapBorderCtrl() { isContainer = "0"; - profile = "GuiGroupBorderProfile"; + profile = "ToolsGuiGroupBorderProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "7 51"; diff --git a/Templates/BaseGame/game/tools/gui/renderTargetVisualizer.ed.gui b/Templates/BaseGame/game/tools/gui/renderTargetVisualizer.ed.gui index 79007fda4..9c6b5fa15 100644 --- a/Templates/BaseGame/game/tools/gui/renderTargetVisualizer.ed.gui +++ b/Templates/BaseGame/game/tools/gui/renderTargetVisualizer.ed.gui @@ -5,7 +5,7 @@ $guiContent = new GuiControl(RenderTargetVisualizer) { minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiModelessDialogProfile"; + profile = "ToolsGuiModelessDialogProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -79,7 +79,7 @@ $guiContent = new GuiControl(RenderTargetVisualizer) { minExtent = "8 2"; horizSizing = "width"; vertSizing = "bottom"; - profile = "GuiPopUpMenuProfile"; + profile = "ToolsGuiPopUpMenuProfile"; visible = "1"; active = "1"; command = "RenderTargetsList.updateTarget();"; diff --git a/Templates/BaseGame/game/tools/levels/DefaultEditorLevel.asset.taml b/Templates/BaseGame/game/tools/levels/DefaultEditorLevel.asset.taml index 5fdb84bfc..9b3fe43b3 100644 --- a/Templates/BaseGame/game/tools/levels/DefaultEditorLevel.asset.taml +++ b/Templates/BaseGame/game/tools/levels/DefaultEditorLevel.asset.taml @@ -1,10 +1,7 @@ + VersionId="1"/> diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui index 39c431697..6f7640ea1 100644 --- a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui +++ b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui @@ -2619,7 +2619,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { hovertime = "1000"; new GuiContainer(){ // enable/disable - profile="GuiTransparentProfile"; + profile="ToolsGuiTransparentProfile"; isContainer = "1"; position = "0 0"; Extent = "300 24"; @@ -2652,7 +2652,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { }; new GuiContainer(){ // scale - profile="GuiTransparentProfile"; + profile="ToolsGuiTransparentProfile"; isContainer = "1"; position = "0 0"; Extent = "300 24"; @@ -2735,7 +2735,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { }; new GuiContainer(){ // direction - profile="GuiTransparentProfile"; + profile="ToolsGuiTransparentProfile"; isContainer = "1"; position = "0 0"; Extent = "300 24"; @@ -2817,7 +2817,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { }; }; new GuiContainer(){ // strength - profile="GuiTransparentProfile"; + profile="ToolsGuiTransparentProfile"; isContainer = "1"; position = "0 0"; Extent = "300 24"; @@ -2899,7 +2899,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { }; }; new GuiContainer(){ // coverage - profile="GuiTransparentProfile"; + profile="ToolsGuiTransparentProfile"; isContainer = "1"; position = "0 0"; Extent = "300 24"; @@ -2981,7 +2981,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { }; }; new GuiContainer(){ // specular - profile="GuiTransparentProfile"; + profile="ToolsGuiTransparentProfile"; isContainer = "1"; position = "0 0"; Extent = "300 24"; @@ -3063,7 +3063,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { }; }; new GuiContainer(){ // empty space - profile="GuiTransparentProfile"; + profile="ToolsGuiTransparentProfile"; isContainer = "1"; position = "0 0"; Extent = "300 10"; diff --git a/Templates/BaseGame/game/tools/navEditor/NavEditorGui.gui b/Templates/BaseGame/game/tools/navEditor/NavEditorGui.gui index cb0b0f098..a512eb327 100644 --- a/Templates/BaseGame/game/tools/navEditor/NavEditorGui.gui +++ b/Templates/BaseGame/game/tools/navEditor/NavEditorGui.gui @@ -549,7 +549,7 @@ $guiContent = new GuiNavEditorCtrl(NavEditorGui, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; - Profile = "GuiTransparentProfile"; + Profile = "ToolsGuiTransparentProfile"; HorizSizing = "width"; VertSizing = "height"; Position = "1 1"; diff --git a/Templates/BaseGame/game/tools/navEditor/NavEditorSettingsTab.gui b/Templates/BaseGame/game/tools/navEditor/NavEditorSettingsTab.gui index 9aafcd0b9..6cc6cbb71 100644 --- a/Templates/BaseGame/game/tools/navEditor/NavEditorSettingsTab.gui +++ b/Templates/BaseGame/game/tools/navEditor/NavEditorSettingsTab.gui @@ -14,7 +14,7 @@ $guiContent = new GuiTabPageCtrl(ENavEditorSettingsPage) { minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "GuiSolidDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/settings.xml b/Templates/BaseGame/game/tools/settings.xml index ede1a4e14..4960ec633 100644 --- a/Templates/BaseGame/game/tools/settings.xml +++ b/Templates/BaseGame/game/tools/settings.xml @@ -41,7 +41,7 @@ Edit Asset 0 976 2016 360 + name="LastPosExt">0 976 2200 360 1