Adjusted handling for the bitmap and bitmapAsset fields for guiBitmapButtonCtrl to forcefully update the button states when changed, ensuring that the bitmaps refresh when changed via the field

Added callback for onResize to guiWindowCtrl so controls - such as the EditorTree - can be properly resized in certain circumstances when the window is changed
Added getIncrement() and getRange() to GuiGameSettingsCtrl to better facilitate options manipulation on the script side
Corrected some of the console method documentation strings in GuiGameSettingsCtrl
Removed some unneeded, extraneous files and their asset definitions that came from odd import conversions. Where applicable, created cleaned up versions to make naming conventions and references stable
Fixed canvas mode update text typo: FSAA -> FXAA
Added logic to DOF, Light Rays, SSAO and Vignette postFX's to check both the preset setting AND the user preference before enabling.
Shifted initialization order so PostFX's are loaded before we configure the canvas, to ensure stuff like the FXAAPostFX exists and can be toggled on on load
Fixed multiple issues with options menu:
 When using gamepad, unable to navigate from categories to options. Fixed so can now traverse as normal
 Input limitations on gamepad necessitated changing of how setting applying happens, is now done as a 'apply or discard' prompt when leaving the options menu
 Added proper handling for adjusting settings with gamepad with left/right inputs
 Fixed issue where the unapplied change for an option was sometimes being processed as an object name rather than an implicit string. Now made to be explicit strings to avoid issue.
 Made the menu button input for "Select" to go from categories to options gamepad only, and hidden when in the options list
 Fixed issue where changing window mode didn't correctly affect resolution option. Now set up so changing this field correctly refreshes the resolution option. Specifically, when on borderless, the resolution field does not show, preventing confusion as it is always full resolution
 Generally have the options list refresh when changes happen to allow any and all fields to be able to dynamically respond to other options having changed improving flexibility.
 Cleaned up old, unused, commented out functions
Added ability on OKCancel message boxes to override the button text if needed
Fixed issue with AssetBrowser where the shrink/grow icons next to the preview size slider were not anchored correctly.
Adjusted callback logic so if preview slider is clicked on, rather than dragged, it will correctly update the zoom values
Added sorting to Modules List dropdown for the AssetBrowser
Improved standardization of double-clicking in AssetBrowser. Now defaults to editing action if regularly browsing and selecting if in select mode. Still allows regular per-type overrides as normal
Moved definition of GuiDisabledTextEditProfile to gui profiles.ed.tscript file, removed duplicates to stop error spam
Adjusted default settings value for double-click action in AB to be edit to prevent unstable behavior
Removed old file refs from Load Recent list in the default settings
This commit is contained in:
JeffR 2022-03-26 22:36:37 -05:00
parent 05a6a249ea
commit 69d547fd72
54 changed files with 382 additions and 537 deletions

View file

@ -138,10 +138,15 @@ void GuiBitmapButtonCtrl::initPersistFields()
{
addGroup( "Bitmap" );
INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiBitmapButtonCtrl, "Texture file to display on this button.\n"
addProtectedField("Bitmap", TypeImageFilename, Offset(mBitmapName, GuiBitmapButtonCtrl), _setBitmapFieldData, &defaultProtectedGetFn, "Texture file to display on this button.\n"
"If useStates is false, this will be the file that renders on the control. Otherwise, this will "
"specify the default texture name to which the various state and modifier suffixes are appended "
"to find the per-state and per-modifier (if enabled) textures.", AbstractClassRep::FIELD_HideInInspectors); \
addProtectedField("BitmapAsset", TypeImageAssetId, Offset(mBitmapAssetId, GuiBitmapButtonCtrl), _setBitmapFieldData, &defaultProtectedGetFn, "Texture file to display on this button.\n"
"If useStates is false, this will be the file that renders on the control. Otherwise, this will "
"specify the default texture name to which the various state and modifier suffixes are appended "
"to find the per-state and per-modifier (if enabled) textures.");
addField("color", TypeColorI, Offset(mColor, GuiBitmapButtonCtrl), "color mul");
addField( "bitmapMode", TYPEID< BitmapMode >(), Offset( mBitmapMode, GuiBitmapButtonCtrl ),

View file

@ -185,6 +185,14 @@ class GuiBitmapButtonCtrl : public GuiButtonCtrl
DECLARE_CONOBJECT(GuiBitmapButtonCtrl);
DECLARE_DESCRIPTION( "A button control rendered entirely from bitmaps.\n"
"The individual button states are represented with separate bitmaps." );
//Basically a wrapper function to do our special state handling setup when the fields change
static bool _setBitmapFieldData(void* obj, const char* index, const char* data)
{
GuiBitmapButtonCtrl* object = static_cast<GuiBitmapButtonCtrl*>(obj);
object->setBitmap(StringTable->insert(data));
return false;
}
};
typedef GuiBitmapButtonCtrl::BitmapMode GuiBitmapMode;

View file

@ -66,6 +66,9 @@ IMPLEMENT_CALLBACK( GuiWindowCtrl, onCollapse, void, (), (),
"Called when the window is collapsed by clicking its title bar." );
IMPLEMENT_CALLBACK( GuiWindowCtrl, onRestore, void, (), (),
"Called when the window is restored from minimized, maximized, or collapsed state." );
IMPLEMENT_CALLBACK(GuiWindowCtrl, onResize, void, (S32 posX, S32 posY, S32 width, S32 height), (0, 0, 0, 0),
"Called when the window is resized in a regular manner by mouse manipulation.");
//-----------------------------------------------------------------------------
@ -1557,6 +1560,8 @@ bool GuiWindowCtrl::resize(const Point2I &newPosition, const Point2I &newExtent)
// Set the button coords
positionButtons();
onResize_callback(newPosition.x, newPosition.y, newExtent.x, newExtent.y);
return true;
}

View file

@ -201,6 +201,7 @@ class GuiWindowCtrl : public GuiContainer
DECLARE_CALLBACK( void, onMaximize, () );
DECLARE_CALLBACK( void, onCollapse, () );
DECLARE_CALLBACK( void, onRestore, () );
DECLARE_CALLBACK(void, onResize, (S32 posX, S32 posY, S32 width, S32 height));
/// @}

View file

@ -740,7 +740,7 @@ void GuiGameSettingsCtrl::changeOption(S32 delta)
if (mScriptCallback != NULL && (mSelectedOption != NO_OPTION && mMode != GuiGameSettingsCtrl::Slider))
{
setThisControl();
StringTableEntry direction = NULL;
StringTableEntry direction = StringTable->EmptyString();
if (delta < 0)
{
direction = LEFT;
@ -749,7 +749,7 @@ void GuiGameSettingsCtrl::changeOption(S32 delta)
{
direction = RIGHT;
}
if ((direction != NULL) && (Con::isFunction(mScriptCallback)))
if ((direction != StringTable->EmptyString()) && (Con::isFunction(mScriptCallback)))
{
Con::executef(mScriptCallback, direction);
}
@ -849,6 +849,16 @@ void GuiGameSettingsCtrl::setValue(F32 value)
mValue = value;
}
F32 GuiGameSettingsCtrl::getIncrement()
{
return mStepSize;
}
Point2F GuiGameSettingsCtrl::getRange()
{
return mRange;
}
const char* GuiGameSettingsCtrl::getTooltip()
{
return mTooltip;
@ -1100,22 +1110,31 @@ DefineEngineMethod(GuiGameSettingsCtrl, addOption, void, (const char* displayTex
}
DefineEngineMethod(GuiGameSettingsCtrl, getValue, F32, (), ,
"Sets the list of options on the given control.\n\n"
"@param optionsList A tab separated list of options for the control.")
"Gets the value of the slider on the given control.")
{
return object->getValue();
}
DefineEngineMethod(GuiGameSettingsCtrl, setValue, void, (F32 value), ,
"Sets the list of options on the given control.\n\n"
"@param optionsList A tab separated list of options for the control.")
"Sets the value of the slider on the given control.")
{
object->setValue(value);
}
DefineEngineMethod(GuiGameSettingsCtrl, getIncrement, F32, (), ,
"Gets the increment amount of the slider on a given control.")
{
return object->getIncrement();
}
DefineEngineMethod(GuiGameSettingsCtrl, getRange, Point2F, (), ,
"Gets the min and max values for the range of the slider on a given control.")
{
return object->getRange();
}
DefineEngineMethod(GuiGameSettingsCtrl, getTooltip, const char*, (), ,
"Sets the list of options on the given control.\n\n"
"@param optionsList A tab separated list of options for the control.")
"Gets the tooltip on the given control.")
{
return object->getTooltip();
}

View file

@ -214,6 +214,16 @@ public:
Mode getMode() { return mMode; }
/// <summary>
/// Gets the incremenet amount
/// </summary>
F32 getIncrement();
/// <summary>
/// Gets range of values allowed
/// </summary>
Point2F getRange();
/// Gets the tooltip
const char* getTooltip();

View file

@ -1 +0,0 @@
constuctorFileName="@assetFile=camera.tscript" />

View file

@ -115,7 +115,7 @@ function configureCanvas()
"--Screen Mode : " @ %fsLabel NL
"--Bits Per Pixel : " @ %bpp NL
"--Refresh Rate : " @ %rate NL
"--FSAA Level : " @ %aa NL
"--FXAA Level : " @ %aa NL
"--------------");
// Actually set the new video mode

View file

@ -474,7 +474,7 @@ function DepthOfFieldPostFX::populatePostFXSettings(%this)
function PostEffectEditorInspector::toggleDepthOfFieldPostFX(%this)
{
if($PostFX::DepthOfFieldPostFX::Enabled)
if($PostFX::DepthOfFieldPostFX::Enabled && $pref::PostFX::EnableDOF)
DepthOfFieldPostFX.enable();
else
DepthOfFieldPostFX.disable();
@ -482,7 +482,7 @@ function PostEffectEditorInspector::toggleDepthOfFieldPostFX(%this)
function DepthOfFieldPostFX::applyFromPreset(%this)
{
if($PostFX::DepthOfFieldPostFX::Enabled)
if($PostFX::DepthOfFieldPostFX::Enabled && $pref::PostFX::EnableDOF)
DepthOfFieldPostFX.enable();
else
DepthOfFieldPostFX.disable();

View file

@ -126,7 +126,7 @@ function LightRayPostFX::populatePostFXSettings(%this)
function PostEffectEditorInspector::toggleLightRayPostFX(%this)
{
if($PostFX::LightRayPostFX::Enabled)
if($PostFX::LightRayPostFX::Enabled && $pref::PostFX::EnableLightRays)
LightRayPostFX.enable();
else
LightRayPostFX.disable();
@ -134,7 +134,7 @@ function PostEffectEditorInspector::toggleLightRayPostFX(%this)
function LightRayPostFX::applyFromPreset(%this)
{
if($PostFX::LightRayPostFX::Enabled)
if($PostFX::LightRayPostFX::Enabled && $pref::PostFX::EnableLightRays)
%this.enable();
else
%this.disable();

View file

@ -165,7 +165,7 @@ function SSAOPostFx::populatePostFXSettings(%this)
function PostEffectEditorInspector::toggleSSAOPostFx(%this)
{
if($PostFX::SSAOPostFx::Enabled)
if($PostFX::SSAOPostFx::Enabled && $pref::PostFX::EnableSSAO)
SSAOPostFx.enable();
else
SSAOPostFx.disable();
@ -173,7 +173,7 @@ function PostEffectEditorInspector::toggleSSAOPostFx(%this)
function SSAOPostFx::applyFromPreset(%this)
{
if($PostFXManager::PostFX::Enable)
if($PostFXManager::PostFX::Enable && $pref::PostFX::EnableSSAO)
%this.enable();
else
%this.disable();

View file

@ -91,7 +91,7 @@ function VignettePostFX::populatePostFXSettings(%this)
//Allow us to easily toggle the postFX and have it respond immediately
function PostEffectEditorInspector::toggleVignettePostFX(%this)
{
if($PostFX::VignettePostFX::Enabled)
if($PostFX::VignettePostFX::Enabled && $pref::PostFX::EnableVignette)
VignettePostFX.enable();
else
VignettePostFX.disable();
@ -102,7 +102,7 @@ function PostEffectEditorInspector::toggleVignettePostFX(%this)
//when rendering. This allows us to modify things but still leave room for reverting or temporarily applying them
function VignettePostFX::applyFromPreset(%this)
{
if($PostFX::VignettePostFX::Enabled)
if($PostFX::VignettePostFX::Enabled && $pref::PostFX::EnableVignette)
%this.enable();
else
%this.disable();

View file

@ -57,10 +57,10 @@ function Core_Rendering::initClient(%this)
if ( isFile( %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension ) )
exec( %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension );
configureCanvas();
postFXInit();
configureCanvas();
//Autodetect settings if it's our first time
if($pref::Video::autoDetect)
AutodetectGraphics();

View file

@ -12,7 +12,7 @@
<Material.Stages>
<Stages_beginarray
DiffuseMapAsset="Core_Rendering:moon_noglow_image"
vertColor="1";/>
vertColor="1"/>
</Material.Stages>
</Material>
</MaterialAsset>

View file

@ -1,9 +0,0 @@
//--- OBJECT WRITE BEGIN ---
singleton Material(moon_noglow) {
mapTo="moon_noglow";
DiffuseMapAsset = "Core_Rendering:moon_noglow_image";
emissive = true;
translucent = true;
vertColor[ 0 ] = true;
};
//--- OBJECT WRITE END ---

View file

@ -1,14 +0,0 @@
<MaterialAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="OccluderProxyMaterial"
materialDefinitionName="OccluderProxyMaterial"
VersionId="1">
<Material
Name="OccluderProxyMaterial">
<Material.Stages>
<Stages_beginarray
DiffuseMapAsset="ToolsModule:occluderProxyImage_image"/>
</Material.Stages>
</Material>
</MaterialAsset>

View file

@ -1,7 +1,7 @@
<ImageAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="moon_wcorona"
AssetName="moon_wcorona_image"
imageFile="@assetFile=moon_wcorona.png"
UseMips="true"
isHDRImage="false"

View file

@ -12,7 +12,7 @@
<Material.Stages>
<Stages_beginarray
DiffuseMapAsset="Core_Rendering:moon_wcorona_image"
vertColor="1";/>
vertColor="1"/>
</Material.Stages>
</Material>
</MaterialAsset>

View file

@ -1,9 +0,0 @@
//--- OBJECT WRITE BEGIN ---
singleton Material(moon_wglow) {
mapTo="moon_wglow";
DiffuseMapAsset = "Core_Rendering:moon_wglow_image";
emissive = true;
translucent = true;
vertColor[ 0 ] = true;
};
//--- OBJECT WRITE END ---

View file

@ -1,14 +0,0 @@
<MaterialAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="OccluderProxyMaterial"
materialDefinitionName="OccluderProxyMaterial"
VersionId="1">
<Material
Name="OccluderProxyMaterial">
<Material.Stages>
<Stages_beginarray
DiffuseMapAsset="ToolsModule:occluderProxyImage_image"/>
</Material.Stages>
</Material>
</MaterialAsset>

View file

@ -7,7 +7,7 @@
<Material
Name="NoShapeMat"
mapTo="NoShape"
translucent="1";
translucent="1"
translucentBlendOp="LerpAlpha";
castShadows="0">
<Material.Stages>

View file

@ -1,296 +1,160 @@
//--- OBJECT WRITE BEGIN ---
$guiContent = new GuiControl(OptionsMenu) {
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
currentCategory = "Display";
optionsCategories = "17177";
pageTabIndex = "0";
returnGui = "MainMenuGui";
tamlReader = "20088";
tile = "0";
unappliedChanges = "17178";
useVariable = "0";
new GuiControl() {
position = "48 56";
extent = "928 655";
minExtent = "8 2";
horizSizing = "aspectCenter";
vertSizing = "center";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiBitmapBarCtrl() {
percent = "100";
vertical = "0";
flipClip = "0";
BitmapAsset = "UI:panel_low_image";
color = "255 255 255 255";
position = "0 40";
extent = "927 618";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapBarCtrl() {
percent = "100";
vertical = "0";
flipClip = "0";
BitmapAsset = "UI:panel_image";
color = "255 255 255 255";
position = "0 0";
extent = "927 40";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "OPTIONS";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "22 7";
extent = "120 28";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "MenuHeaderText";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(OptionName) {
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "3 606";
extent = "293 17";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "MenuSubHeaderText";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiMLTextCtrl(OptionDescription) {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "This is a placeholder text for an option.";
useURLMouseCursor = "0";
position = "3 625";
extent = "293 14";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiMLTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiSplitContainer() {
orientation = "Vertical";
splitterSize = "2";
splitPoint = "250 100";
fixedPanel = "FirstPanel";
fixedSize = "250";
docking = "None";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 48";
extent = "928 555";
minExtent = "64 64";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiMenuScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiPanel() {
docking = "Client";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
extent = "248 555";
minExtent = "16 16";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiOverlayProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "Panel1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiStackControl(OptionsMenuCategoryList) {
stackingType = "Vertical";
horizStacking = "Left to Right";
vertStacking = "Top to Bottom";
padding = "10";
dynamicSize = "0";
dynamicNonStackExtent = "0";
dynamicPos = "0";
changeChildSizeToFit = "1";
changeChildPosition = "1";
position = "0 0";
extent = "248 555";
minExtent = "16 16";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
class = "MenuList";
canSave = "1";
canSaveDynamicFields = "0";
new GuiButtonCtrl() {
text = "Display";
extent = "248 35";
profile = "GuiMenuButtonProfile";
command = "populateDisplaySettingsList();";
tooltipProfile = "GuiToolTipProfile";
};
new GuiButtonCtrl() {
text = "Graphics";
position = "0 45";
extent = "248 35";
profile = "GuiMenuButtonProfile";
command = "populateGraphicsSettingsList();";
tooltipProfile = "GuiToolTipProfile";
};
new GuiButtonCtrl() {
text = "Audio";
position = "0 90";
extent = "248 35";
profile = "GuiMenuButtonProfile";
command = "populateAudioSettingsList();";
tooltipProfile = "GuiToolTipProfile";
};
new GuiButtonCtrl() {
text = "Keyboard & Mouse";
position = "0 135";
extent = "248 35";
profile = "GuiMenuButtonProfile";
command = "populateKeyboardMouseSettingsList();";
tooltipProfile = "GuiToolTipProfile";
};
new GuiButtonCtrl() {
text = "Gamepad";
position = "0 180";
extent = "248 35";
profile = "GuiMenuButtonProfile";
command = "populateGamepadSettingsList();";
tooltipProfile = "GuiToolTipProfile";
};
};
};
new GuiPanel() {
docking = "Client";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "252 0";
extent = "676 555";
minExtent = "16 16";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiOverlayProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "panel2";
canSave = "1";
canSaveDynamicFields = "0";
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
lockHorizScroll = "0";
lockVertScroll = "0";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
extent = "676 554";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "GuiMenuScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiStackControl(OptionsMenuSettingsList) {
stackingType = "Vertical";
horizStacking = "Left to Right";
vertStacking = "Top to Bottom";
padding = "5";
dynamicSize = "1";
dynamicNonStackExtent = "0";
dynamicPos = "0";
changeChildSizeToFit = "0";
changeChildPosition = "1";
position = "1 1";
extent = "661 30";
minExtent = "16 16";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
class = "MenuList";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
@ -299,130 +163,67 @@ $guiContent = new GuiControl(OptionsMenu) {
new GuiControl(OptionsButtonHolder) {
position = "116 711";
extent = "791 40";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "top";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
class = "MenuInputButtonContainer";
canSave = "1";
canSaveDynamicFields = "0";
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
BitmapAsset = "UI:Keyboard_Black_Return_image";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Apply";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "507 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "OptionsMenu.apply();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "applyButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
BitmapAsset = "UI:Keyboard_Black_Escape_image";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Back";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "651 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "OptionsMenu.backOut();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "backButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
BitmapAsset = "UI:Keyboard_Black_R_image";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Reset";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "325 0";
position = "173 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "OptionsMenu.resetToDefaults();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "resetButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl(OptionsMenuSelectButton) {
BitmapAsset = "UI:Keyboard_Black_Return_image";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
text = "Select";
position = "507 0";
extent = "140 40";
profile = "GuiMenuButtonProfile";
command = "";
tooltipProfile = "GuiToolTipProfile";
internalName = "SelectButton";
class = "MenuInputButton";
};
new GuiIconButtonCtrl() {
BitmapAsset = "UI:Keyboard_Black_Escape_image";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
text = "Back";
position = "651 0";
extent = "140 40";
profile = "GuiMenuButtonProfile";
command = "OptionsMenu.backOut();";
tooltipProfile = "GuiToolTipProfile";
internalName = "backButton";
class = "MenuInputButton";
};
};
new GuiInputCtrl(OptionsMenuInputHandler) {
sendAxisEvents = "1";
sendBreakEvents = "1";
sendModifierEvents = "0";
ignoreMouseEvents = "1";
lockMouse = "0";
position = "-50 0";
extent = "10 10";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "top";
profile = "GuiInputCtrlProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
class = "MenuInputHandler";
canSave = "1";
canSaveDynamicFields = "0";
};
};
//--- OBJECT WRITE END ---

View file

@ -55,9 +55,11 @@ function OptionsMenu::onAdd(%this)
if(!isObject(%this.unappliedChanges))
{
%this.unappliedChanges = new ArrayObject();
%this.unappliedChanges = new ArrayObject(OptionsMenuUnappliedChanges);
}
%this.currentCategory = "";
addOptionsMenuCategory("Display", "populateDisplaySettingsList();");
addOptionsMenuCategory("Graphics", "populateGraphicsSettingsList();");
addOptionsMenuCategory("Audio", "populateAudioSettingsList();");
@ -121,12 +123,33 @@ function OptionsMenu::onWake(%this)
function OptionsButtonHolder::onWake(%this)
{
%this-->resetButton.set("btn_back", "R", "Reset", "OptionsMenu.resetToDefaults();");
%this-->applyButton.set("btn_start", "Return", "Apply", "OptionsMenu.apply();");
%this-->selectButton.set("btn_a", "Return", "Select", "OptionsMenu.select();", true);
%this-->backButton.set("btn_b", "Escape", "Back", "OptionsMenu.backOut();");
//OptionsMenuCategoryList.getObject(0).performClick();
}
function OptionsMenu::select(%this)
{
if(OptionsMenuCategoryList.isActiveMenuList())
{
OptionsMenuSettingsList.setAsActiveMenuList();
%this.updateSelectButton();
}
}
function OptionsMenu::updateSelectButton(%this)
{
if(OptionsMenuCategoryList.isActiveMenuList())
{
%this-->selectButton.setHidden(false);
}
else if(OptionsMenuSettingsList.isActiveMenuList())
{
%this-->selectButton.setHidden(true);
}
}
function OptionsMenu::apply(%this)
{
//Now we run through our list of unapplied changes and... apply them.
@ -137,7 +160,7 @@ function OptionsMenu::apply(%this)
for(%i=0; %i < %this.unappliedChanges.count(); %i++)
{
%targetVar = %this.unappliedChanges.getKey(%i);
%newValue = %this.unappliedChanges.getValue(%i);
%newValue = strReplace(%this.unappliedChanges.getValue(%i), "\"", "");
//First, lets just check through our action map names, see if any match
%wasKeybind = false;
@ -245,6 +268,9 @@ function OptionsMenu::apply(%this)
export("$pref::*", %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension, false);
OptionsMenu.unappliedChanges.empty();
//Now we can back out of the options menu
OptionsMenu.doOptionsMenuBackOut();
}
function OptionsMenu::resetToDefaults(%this)
@ -252,6 +278,40 @@ 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)
{
if(%this.currentCategory !$= "")
{
%category = %this.optionsCategories.getKey(%this.currentCategory);
%command = %this.optionsCategories.getValue(%this.currentCategory);
eval(%command);
}
}
function OptionsMenu::getOptionVariableValue(%this, %variableName)
{
%unappliedPrefIndex = %this.unappliedChanges.getIndexFromKey(%variableName);
if(%unappliedPrefIndex != -1)
{
%value = %this.unappliedChanges.getValue(%unappliedPrefIndex);
return strreplace(%value, "\"", "");
}
return getVariable(%variableName);
}
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);
}
}
//
//
//
@ -308,17 +368,16 @@ function populateDisplaySettingsList()
else
OptionsMenuSettingsList.setRowEnabled(1, false);
%mode = OptionsMenu.getOptionVariableValue("$pref::Video::deviceMode");
if(isInt(%mode))
%mode = getField($Video::ModeTags, $pref::Video::deviceMode);
OptionsMenuSettingsList.addOptionRow("Window Mode", "$pref::Video::deviceMode", $Video::ModeTags, false, "", true, "", %mode);
%resolutionList = getScreenResolutionList($pref::Video::deviceId, $pref::Video::deviceMode);
OptionsMenuSettingsList.addOptionRow("Resolution", "$pref::Video::Resolution", %resolutionList, false, "onDisplayResChange", true, "Resolution of the game window", _makePrettyResString( $pref::Video::mode ));
//If they're doing borderless, the window resolution must match the display resolution
if(%mode !$= "Borderless")
OptionsMenuSettingsList.setRowEnabled(3, true);
else
OptionsMenuSettingsList.setRowEnabled(3, false);
{
%resolutionList = getScreenResolutionList($pref::Video::deviceId, $pref::Video::deviceMode);
OptionsMenuSettingsList.addOptionRow("Resolution", "$pref::Video::Resolution", %resolutionList, false, "", true, "Resolution of the game window", _makePrettyResString( $pref::Video::mode ));
}
OptionsMenuSettingsList.addOptionRow("VSync", "$pref::Video::disableVerticalSync", "No\tYes", false, "", true, "", convertBoolToYesNo(!$pref::Video::disableVerticalSync));
@ -333,27 +392,6 @@ function populateDisplaySettingsList()
OptionsMenuSettingsList.addSliderRow("Contrast", "", 0.5, 0.1, "0 1", "");
}
/*function OptionsMenu::applyDisplaySettings(%this)
{
%newDevice = OptionsMenuSettingsList.getCurrentOption(0);
// Change the device.
if ( %newDevice !$= $pref::Video::displayDevice )
{
$pref::Video::displayDevice = %newDevice;
if( %newDevice !$= getDisplayDeviceInformation() )
MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." );
$changingDisplayDevice = %newDevice;
}
updateDisplaySettings();
echo("Exporting client prefs");
%prefPath = getPrefpath();
export("$pref::*", %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension, false);
}*/
//
//
//
@ -394,6 +432,20 @@ function updateDisplaySettings()
//Update the display settings now
%deviceName = getDisplayDeviceName();
%newDeviceID = getWord(%deviceName, 0) - 1;
if(!isInt($pref::Video::deviceMode))
{
//probably saved out as the mode name, so just translate it back
for(%i=0; %i < getFieldCount($Video::ModeTags); %i++)
{
if(getField($Video::ModeTags, %i) $= $pref::Video::deviceMode)
{
$pref::Video::deviceMode = %i;
break;
}
}
}
%deviceModeName = getField($Video::ModeTags, $pref::Video::deviceMode);
%newDeviceMode = 0;
foreach$(%modeName in $Video::ModeTags)
@ -404,6 +456,14 @@ function updateDisplaySettings()
%newDeviceMode++;
}
if($pref::Video::deviceMode == $Video::ModeBorderless)
{
//if we're changing to borderless, we swap to the full resolution of the desktop
$pref::Video::mode = Canvas.getBestCanvasRes($pref::Video::deviceId, $pref::Video::deviceMode);
$pref::Video::Resolution = $pref::Video::mode.x SPC $pref::Video::mode.y;
}
%newRes = $pref::Video::Resolution;
%newBpp = 32; // ... its not 1997 anymore.
%newFullScreen = %deviceModeName $= "Fullscreen" ? true : false;
@ -448,7 +508,7 @@ function updateDisplaySettings()
function updatePostFXSettings()
{
PostFXManager.settingsEffectSetEnabled(SSAOPostFx, $pref::PostFX::EnableSSAO);
PostFXManager.settingsEffectSetEnabled(DOFPostEffect, $pref::PostFX::EnableDOF);
PostFXManager.settingsEffectSetEnabled(DepthOfFieldPostFX, $pref::PostFX::EnableDOF);
PostFXManager.settingsEffectSetEnabled(LightRayPostFX, $pref::PostFX::EnableLightRays);
PostFXManager.settingsEffectSetEnabled(vignettePostFX, $pref::PostFX::EnableVignette);
}
@ -583,14 +643,22 @@ function OptionsMenuList::activateRow(%this)
function OptionsMenu::backOut(%this)
{
if(OptionsMenuSettingsList.isActiveMenuList())
{
OptionsMenuCategoryList.setAsActiveMenuList();
%this.updateSelectButton();
}
else
{
if(%this.unappliedChanges.count() != 0)
{
MessageBoxOKCancel("Discard Changes?", "You have unapplied changes to your settings, do you wish to continue?", "OptionsMenu.doOptionsMenuBackOut();", "");
MessageBoxOKCancel("Discard Changes?", "You have unapplied changes to your settings, do you wish to apply or discard them?", "OptionsMenu.apply();", "OptionsMenu.doOptionsMenuBackOut();", "Apply", "Discard");
}
else
{
%this.doOptionsMenuBackOut();
}
}
}
function OptionsMenu::doOptionsMenuBackOut(%this)
@ -630,7 +698,7 @@ function OptionsMenuSettingsList::addOptionRow(%this, %label, %targetPrefVar, %o
%enabled = true;
%optionsRowSize = 30;
%optionColumnWidth = %this.extent.x - 450;//todo, calculate off longest option text?
%optionColumnWidth = %this.extent.x * 0.3;//todo, calculate off longest option text?
%option = new GuiGameSettingsCtrl() {
class = "MenuOptionsButton";
@ -723,6 +791,7 @@ function OptionsMenuSettingsList::addKeybindRow(%this, %label, %bitmapName, %cal
//
function OptionsMenuCategoryList::onNavigate(%this, %index)
{
OptionsMenu.currentCategory = %index;
%this.getObject(%index).performClick();
}
@ -750,83 +819,6 @@ function convertBoolToOnOff(%val)
return "Off";
}
function onDisplayModeChange(%val)
{
// The display device (monitor) or screen mode has changed. Refill the
// resolution list with only available options.
%deviceName = OptionsMenuSettingsList.getCurrentOption(1);
%newDeviceID = getWord(%deviceName, 0) - 1;
%deviceModeName = OptionsMenuSettingsList.getCurrentOption(2);
%newDeviceMode = 0;
foreach$(%modeName in $Video::ModeTags)
{
if (%deviceModeName $= %modeName)
break;
else
%newDeviceMode++;
}
%resolutionList = getScreenResolutionList(%newDeviceID, %newDeviceMode);
if (%newDeviceMode == $Video::ModeBorderless)
{ // If we're switching to borderless, default to monitor res on Windows OS,
// monitor usable area for other platforms.
if ($platform $= "windows")
%newRes = getWords(Canvas.getMonitorRect(%newDeviceID), 2);
else
%newRes = getWords(Canvas.getMonitorUsableRect(%newDeviceID), 2);
}
else
{ // Otherwise, if our old resolution is still in the list, attempt to reset it.
%oldRes = getWord(OptionsMenuSettingsList.getCurrentOption(3), 0) SPC getWord(OptionsMenuSettingsList.getCurrentOption(3), 2);
%found = false;
%retCount = getFieldCount(%resolutionList);
for (%i = 0; %i < %retCount; %i++)
{
%existingEntry = getField(%resolutionList, %i);
if ((%existingEntry.x $= %oldRes.x) && (%existingEntry.z $= %oldRes.y))
{
%found = true;
%newRes = %oldRes;
break;
}
}
if (!%found)
{ // Pick the best resoltion available for the device and mode
%newRes = Canvas.getBestCanvasRes(%newDeviceID, %newDeviceMode);
}
}
if(%newDeviceMode == $Video::ModeBorderless)
OptionsMenuSettingsList.setRowEnabled(3, false);
else
OptionsMenuSettingsList.setRowEnabled(3, true);
OptionsMenuSettingsList.setOptions(3, %resolutionList);
OptionsMenuSettingsList.selectOption(3, _makePrettyResString(%newRes));
}
function onDisplayResChange(%val)
{ // The resolution has changed. Setup refresh rates available at this res.
%newRes = getWord(OptionsMenuSettingsList.getCurrentOption(3), 0) SPC getWord(OptionsMenuSettingsList.getCurrentOption(3), 2);
%refreshList = getScreenRefreshList(%newRes);
// If our old rate still exists, select it
%oldRate = OptionsMenuSettingsList.getCurrentOption(5);
%retCount = getFieldCount(%refreshList);
for (%i = 0; %i < %retCount; %i++)
{
%existingEntry = getField(%refreshList, %i);
%newRate = %existingEntry;
if (%existingEntry $= %oldRate)
break;
}
OptionsMenuSettingsList.setOptions(5, %refreshList);
OptionsMenuSettingsList.selectOption(5, %newRate);
}
function getDisplayDeviceName()
{
%numDevices = Canvas.getMonitorCount();
@ -880,10 +872,16 @@ function MenuOptionsButton::onChange(%this)
%prefIndex = OptionsMenu.unappliedChanges.getIndexFromKey(%targetVar);
if(%prefIndex == -1)
OptionsMenu.unappliedChanges.add(%targetVar, %saveReadyValue);
else
OptionsMenu.unappliedChanges.setValue(%saveReadyValue, %prefIndex);
{
echo("Setting UnappliedChanges via add: key:" @ %targetVar @", value: " @ %saveReadyValue);
OptionsMenu.unappliedChanges.add(%targetVar, "\"" @ %saveReadyValue @ "\"" );
}
else
OptionsMenu.unappliedChanges.setValue("\"" @ %saveReadyValue @ "\"", %prefIndex);
}
//Update the UI in case there's responsive logic
schedule(32, OptionsMenu, "refresh");
}
function OptionsMenu::onKeybindChanged(%this, %actionMap, %keybind)

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="group_border_image"
imageFile="@assetFile=group-border.png"
imageFile="@assetFile=group_border.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="no_preview_image"
imageFile="@assetFile=no-preview.png"
imageFile="@assetFile=no_preview.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

@ -1,3 +0,0 @@
<ImageAsset
AssetName="nopreview_image"
imageFile="@assetFile=nopreview.png"/>

View file

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View file

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 744 B

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="selector_button_blank_image"
imageFile="@assetFile=selector-button-blank.png"
imageFile="@assetFile=selector_button_blank.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="selector_button_dark_image"
imageFile="@assetFile=selector-button-dark.png"
imageFile="@assetFile=selector_button_dark.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="selector_button_highlight_only_image"
imageFile="@assetFile=selector-button-highlight-only.png"
imageFile="@assetFile=selector_button_highlight_only.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="selector_button_image"
imageFile="@assetFile=selector-button.png"
imageFile="@assetFile=selector_button.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

@ -1,3 +0,0 @@
<ImageAsset
AssetName="selectorbutton_image"
imageFile="@assetFile=selectorbutton.png"/>

View file

@ -1,3 +0,0 @@
<ImageAsset
AssetName="selectorbuttonblank_image"
imageFile="@assetFile=selectorbuttonblank.png"/>

View file

@ -1,3 +0,0 @@
<ImageAsset
AssetName="selectorbuttondark_image"
imageFile="@assetFile=selectorbuttondark.png"/>

View file

@ -1,3 +0,0 @@
<ImageAsset
AssetName="selectorbuttonhighlightonly_image"
imageFile="@assetFile=selectorbuttonhighlightonly.png"/>

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="tab_border_image"
imageFile="@assetFile=tab-border.png"
imageFile="@assetFile=tab_border.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

@ -1,3 +0,0 @@
<ImageAsset
AssetName="tabborder_image"
imageFile="@assetFile=tabborder.png"/>

View file

@ -412,6 +412,13 @@ function MenuInputHandler::onInputEvent(%this, %device, %action, %state)
// Menu List processing
// These functions manage the navigation and activation of the Menu Lists
//==============================================================================
function MenuList::isActiveMenuList(%this)
{
if($activeMenuList == %this)
return true;
return false;
}
function MenuList::setAsActiveMenuList(%this, %startPosition, %menuMode)
{
@ -485,8 +492,6 @@ function MenuList::navigateDown(%this)
function MenuList::navigateLeft()
{
echo("Menu list navigated left!");
//Atm, we're only handling specific control types, namely options entries, but
//this could readily be expanded upon to handle grids like for inventory screens
//or the like
@ -494,17 +499,54 @@ function MenuList::navigateLeft()
%btn = $activeMenuList.getObject($activeMenuListPosition.y);
if(%btn.getClassName() $= "GuiGameSettingsCtrl" && %btn.isEnabled())
{
warnf("MenuList::navigateLeft() - actioned the option" @ %btn @ " to the left");
%mode = %btn.getMode();
if(%mode == 0) //options list
{
%optionId = %btn.getCurrentOptionIndex() - 1;
%btn.selectOptionByIndex(%optionId);
%btn.onChange();
}
else if(%mode == 1) //slider
{
%value = %btn.getValue();
%adjustedValue = %value - %btn.getIncrement();
%minValue = %btn.getRange().x;
if(%adjustedValue < %minValue)
%adjustedValue = %minValue;
%btn.setValue(%adjustedValue);
%btn.onChange();
}
}
}
function MenuList::navigateRight()
{
echo("Menu list navigated right!");
%btn = $activeMenuList.getObject($activeMenuListPosition.y);
if(%btn.getClassName() $= "GuiGameSettingsCtrl" && %btn.isEnabled())
{
warnf("MenuList::navigateLeft() - actioned the option" @ %btn @ " to the left");
%mode = %btn.getMode();
if(%mode == 0) //options list
{
%optionId = %btn.getCurrentOptionIndex() + 1;
%btn.selectOptionByIndex(%optionId);
%btn.onChange();
}
else if(%mode == 1) //slider
{
%value = %btn.getValue();
%adjustedValue = %value + %btn.getIncrement();
%maxValue = %btn.getRange().y;
if(%adjustedValue > %maxValue)
%adjustedValue = %maxValue;
%btn.setValue(%adjustedValue);
%btn.onChange();
}
}
}
function MenuList::getActiveRow(%this)
{
return $activeMenuListPosition.y;
}

View file

@ -116,7 +116,7 @@ function MessageBoxOKDlg::onSleep( %this )
MessageBoxCtrl.originalMenuInputContainer.setActive();
}
function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback, %okLabelOverride, %cancelLabelOverride)
{
Canvas.pushDialog(MessageBoxDlg);
MessageBoxTitleText.text = %title;
@ -125,8 +125,18 @@ function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
MessageBoxYNCButtonHolder.hidden = true;
MessageBoxOKButtonHolder.hidden = true;
MessageBoxOCButtonHolder-->OKButton.set("btn_a", "Return", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
MessageBoxOCButtonHolder-->CancelButton.set("btn_b", "Escape", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
if(%okLabelOverride $= "")
%okLabel = "OK";
else
%okLabel = %okLabelOverride;
if(%cancelLabelOverride $= "")
%cancelLabel = "Cancel";
else
%cancelLabel = %cancelLabelOverride;
MessageBoxOCButtonHolder-->OKButton.set("btn_a", "Return", %okLabel, "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
MessageBoxOCButtonHolder-->CancelButton.set("btn_b", "Escape", %cancelLabel, "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
MessageBoxOCButtonHolder.setActive();

View file

@ -1089,7 +1089,7 @@ $guiContent = new GuiControl(AssetBrowser) {
position = "5 588";
extent = "20 20";
minExtent = "8 2";
horizSizing = "left";
horizSizing = "right";
vertSizing = "top";
profile = "ToolsGuiDefaultProfile";
visible = "1";
@ -1124,13 +1124,14 @@ $guiContent = new GuiControl(AssetBrowser) {
class = "assetBrowserPreviewSlider";
canSave = "1";
canSaveDynamicFields = "0";
command = "AssetBrowser-->previewSlider.onMouseDragged();";
};
new GuiBitmapCtrl() {
bitmapAsset = "ToolsModule:larger_image";
position = "103 588";
extent = "20 20";
minExtent = "8 2";
horizSizing = "left";
horizSizing = "right";
vertSizing = "top";
profile = "ToolsGuiDefaultProfile";
visible = "1";

View file

@ -127,6 +127,8 @@ function AssetBrowserModuleList::refresh(%this)
%moduleName = %moduleDef.ModuleId;
%this.add(%moduleName, %i);
}
%this.sort();
}
function AssetBrowserSelModuleAddBtn::onClick(%this)

View file

@ -360,6 +360,13 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
{
%this.previewData = new ScriptObject();
}
else
{
%this.previewData.tooltip = "";
%this.previewData.assetName = "";
%this.previewData.previewImage = "";
%this.previewData.doubleClickCommand = "";
}
AssetPreviewArray.empty();
@ -493,8 +500,6 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
%tooltip = %assetName;
%doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
%textBottomPad = 20;
%previewButton = new GuiIconButtonCtrl()
@ -535,6 +540,15 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
%previewButton.moduleName = %moduleName;
%previewButton.assetType = %assetType;
if(%this.selectMode)
{
%doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
}
else
{
%doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
}
//Build out the preview
%buildCommand = %this @ ".build" @ %assetType @ "Preview(\"" @ %assetDesc @ "\"," @ %this.previewData @ ");";
eval(%buildCommand);
@ -543,6 +557,8 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
%tooltip = %this.previewData.tooltip;
%assetName = %this.previewData.assetName;
%previewImage = %this.previewData.previewImage;
if(%this.previewData.doubleClickCommand !$= "")
%doubleClickCommand = %this.previewData.doubleClickCommand;
%previewButton.assetName = %assetName;

View file

@ -507,6 +507,11 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
"\nAsset Type: Material Asset" @
"\nAsset Definition ID: " @ %assetDef @
"\nDefinition Path: " @ %assetDef.getScriptPath();
if(!%this.selectMode)
{
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
}
}
function AssetBrowser::onMaterialAssetEditorDropped(%this, %assetDef, %position)

View file

@ -27,20 +27,3 @@ singleton GuiControlProfile( ConvexEditorProfile )
fillColor = "192 192 192 192";
category = "Editor";
};
singleton GuiControlProfile (GuiDisabledTextEditProfile)
{
opaque = false;
border = 0;
bitmap = "./textEdit";
borderColor = "255 255 255 200";
fontColor = "0 0 0";
fontColorHL = "255 255 255";
fontColorNA = "128 128 128";
textOffset = "4 2";
autoSizeWidth = false;
autoSizeHeight = false;
tab = false;
canKeyFocus = false;
category = "Editor";
};

View file

@ -39,7 +39,7 @@ new GuiControlProfile (ToolsGuiDefaultProfile)
// fill color
opaque = false;
fillColor = EditorSettings.value("Theme/tabsColor");
fillColorHL = EditorSettings.value("Theme/tabsGLColor");
fillColorHL = EditorSettings.value("Theme/tabsHLColor");
fillColorSEL = EditorSettings.value("Theme/tabsSELColor");
fillColorNA = EditorSettings.value("Theme/tabsSELColor");
@ -355,7 +355,7 @@ new GuiControlProfile( ToolsGuiButtonProfile )
opaque = true;
border = true;
fillColor = EditorSettings.value("Theme/tabsColor");
fillColorHL = EditorSettings.value("Theme/tabsGLColor");
fillColorHL = EditorSettings.value("Theme/tabsHLColor");
fillColorSEL = EditorSettings.value("Theme/tabsSELColor");
fillColorNA = EditorSettings.value("Theme/tabsSELColor");
@ -1238,3 +1238,20 @@ singleton GuiControlProfile (GuiSimpleBorderProfile)
border = 1;
category = "Editor";
};
singleton GuiControlProfile (GuiDisabledTextEditProfile)
{
opaque = false;
border = 0;
bitmapAsset = "ToolsModule:textEdit_image";
borderColor = "255 255 255 200";
fontColor = "0 0 0";
fontColorHL = "255 255 255";
fontColorNA = "128 128 128";
textOffset = "4 2";
autoSizeWidth = false;
autoSizeHeight = false;
tab = false;
canKeyFocus = false;
category = "Editor";
};

View file

@ -27,20 +27,3 @@ singleton GuiControlProfile( MeshRoadEditorProfile )
fillColor = "192 192 192 192";
category = "Editor";
};
singleton GuiControlProfile (GuiDisabledTextEditProfile)
{
opaque = false;
border = 0;
bitmap = "./textEdit";
borderColor = "255 255 255 200";
fontColor = "0 0 0";
fontColorHL = "255 255 255";
fontColorNA = "128 128 128";
textOffset = "4 2";
autoSizeWidth = false;
autoSizeHeight = false;
tab = false;
canKeyFocus = false;
category = "Editor";
};

View file

@ -38,6 +38,8 @@
name="AutoImport">0</Setting>
<Group
name="Browser">
<Setting
name="doubleClickAction">Edit Asset</Setting>
<Setting
name="previewTileSize">1</Setting>
<Setting
@ -363,14 +365,10 @@
name="forceLoadDAE">0</Setting>
<Setting
name="forceSidebarToSide">1</Setting>
<Setting
name="lastEditedLevel">FPSGameplay:EmptyLevel</Setting>
<Setting
name="orthoFOV">4.60158</Setting>
<Setting
name="orthoShowGrid">1</Setting>
<Setting
name="recentLevelsList">FPSGameplay:EmptyLevel,FPSGameplay:EmptyTerrain,pbr:PbrMatTestLevel,TTR:DasBootLevel</Setting>
<Setting
name="startupMode">Blank Level</Setting>
<Setting

View file

@ -1820,6 +1820,12 @@ function EditorTree::update( %this )
%this.buildVisibleTree( false );
}
//------------------------------------------------------------------------------
function EWTreeWindow::onResize(%this, %posX, %posY, %width, %height )
{
EditorTree.extent.x = %this.extent.x;
}
//------------------------------------------------------------------------------
// Tooltip for TSStatic