mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-03 03:25:11 +00:00
Made GuiFadeinBitmapCtrl not only respond to mouse and keyboard events, but gamepad events as well, allowing gamepad inputs to skip opening splash pages
Ensured that guiGameListMenuCtrl adjusts values for rows marked as sliders via the left and right gamepad actions Corrected the button maps for look and move on the gamepad for the ExampleModule's default movement binds Fixed ExampleModule's default keybinds so alt+enter correctly toggles fullscreen Fixed joinServerMenu so it has a guiInputCtrl that can catch keybind events and pass them to the menuInputButtons Removed erroneous input consumption on OptionsMenuList Removed unneeded check against Graphics API list Flipped order of Anti Aliasing option to match ordering of the others Removed old, unneeded legacy option menu script files Added logic for message boxes to automatically return active MenuInputButton control to the holder before it was pushed Added fill color for the UI list gui profile so the sliders render more legibly
This commit is contained in:
parent
5b289bce5e
commit
5f95f9f8c0
15 changed files with 78 additions and 1518 deletions
|
|
@ -278,7 +278,7 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset)
|
|||
|
||||
bool isRowSelected = (getSelected() != NO_ROW) && (row == mRows[getSelected()]);
|
||||
bool isRowHighlighted = (getHighlighted() != NO_ROW) ? ((row == mRows[getHighlighted()]) && (row->mEnabled)) : false;
|
||||
if (profileHasArrows)
|
||||
/*if (profileHasArrows)
|
||||
{
|
||||
// render the left arrow
|
||||
bool arrowOnL = (isRowSelected || isRowHighlighted) && (row->mValue > row->mRange.x);
|
||||
|
|
@ -297,7 +297,7 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset)
|
|||
|
||||
drawer->clearBitmapModulation();
|
||||
drawer->drawBitmapStretchSR(profile->mTextureObject, RectI(arrowOffset, arrowExtent), profile->getBitmapArrayRect((U32)iconIndex));
|
||||
}
|
||||
}*/
|
||||
|
||||
//Draw the slider bar
|
||||
if (row->mEnabled)
|
||||
|
|
@ -324,8 +324,8 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset)
|
|||
ColorI barOutlineColor;
|
||||
if (isRowSelected)
|
||||
{
|
||||
barColor = profile->mFillColorHL;
|
||||
barOutlineColor = profile->mFillColor;
|
||||
barColor = profile->mFillColor;
|
||||
barOutlineColor = profile->mFillColorSEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1161,10 +1161,22 @@ void GuiGameListMenuCtrl::changeOption(Row* row, S32 delta)
|
|||
}
|
||||
row->mSelectedOption = newSelection;
|
||||
|
||||
if (row->mMode == GuiGameListMenuCtrl::Row::Slider)
|
||||
{
|
||||
row->mValue += row->mStepSize * delta;
|
||||
|
||||
row->mValue = mRound(row->mValue / row->mStepSize) * row->mStepSize;
|
||||
|
||||
if (row->mValue < row->mRange.x)
|
||||
row->mValue = row->mRange.x;
|
||||
if (row->mValue > row->mRange.y)
|
||||
row->mValue = row->mRange.y;
|
||||
}
|
||||
|
||||
static StringTableEntry LEFT = StringTable->insert("LEFT", true);
|
||||
static StringTableEntry RIGHT = StringTable->insert("RIGHT", true);
|
||||
|
||||
if (row->mScriptCallback != NULL && row->mSelectedOption != NO_OPTION)
|
||||
if (row->mScriptCallback != NULL && (row->mSelectedOption != NO_OPTION && row->mMode != GuiGameListMenuCtrl::Row::Slider))
|
||||
{
|
||||
setThisControl();
|
||||
StringTableEntry direction = NULL;
|
||||
|
|
@ -1714,9 +1726,6 @@ void GuiGameListMenuProfile::initPersistFields()
|
|||
|
||||
removeField("modal");
|
||||
removeField("opaque");
|
||||
removeField("fillColor");
|
||||
removeField("fillColorHL");
|
||||
removeField("fillColorNA");
|
||||
removeField("border");
|
||||
removeField("borderThickness");
|
||||
removeField("borderColor");
|
||||
|
|
|
|||
|
|
@ -132,6 +132,12 @@ bool GuiFadeinBitmapCtrl::onKeyDown(const GuiEvent &)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool GuiFadeinBitmapCtrl::onGamepadButtonDown(const GuiEvent& event)
|
||||
{
|
||||
click_callback();
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool GuiFadeinBitmapCtrl::onWake()
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ class GuiFadeinBitmapCtrl : public GuiBitmapCtrl
|
|||
virtual void onPreRender();
|
||||
virtual void onMouseDown(const GuiEvent &);
|
||||
virtual bool onKeyDown(const GuiEvent &);
|
||||
virtual bool onGamepadButtonDown(const GuiEvent& event);
|
||||
virtual bool onWake();
|
||||
virtual void onRender(Point2I offset, const RectI &updateRect);
|
||||
|
||||
|
|
|
|||
|
|
@ -128,10 +128,10 @@ ExampleMoveMap.bind( keyboard, space, jump );
|
|||
ExampleMoveMap.bind( mouse, xaxis, yaw );
|
||||
ExampleMoveMap.bind( mouse, yaxis, pitch );
|
||||
|
||||
ExampleMoveMap.bind( gamepad, thumbrx, "D", "-0.23 0.23", gamepadYaw );
|
||||
ExampleMoveMap.bind( gamepad, thumbry, "D", "-0.23 0.23", gamepadPitch );
|
||||
ExampleMoveMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamePadMoveX );
|
||||
ExampleMoveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY );
|
||||
ExampleMoveMap.bind( gamepad, rxaxis, "D", "-0.23 0.23", gamepadYaw );
|
||||
ExampleMoveMap.bind( gamepad, ryaxis, "D", "-0.23 0.23", gamepadPitch );
|
||||
ExampleMoveMap.bind( gamepad, xaxis, "D", "-0.23 0.23", gamePadMoveX );
|
||||
ExampleMoveMap.bind( gamepad, yaxis, "D", "-0.23 0.23", gamePadMoveY );
|
||||
|
||||
ExampleMoveMap.bind( gamepad, btn_a, jump );
|
||||
ExampleMoveMap.bind( gamepad, btn_x, moveup );
|
||||
|
|
@ -143,6 +143,6 @@ ExampleMoveMap.bindCmd( gamepad, btn_start, "Canvas.pushDialog(PauseMenu);", ""
|
|||
//------------------------------------------------------------------------------
|
||||
GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
|
||||
GlobalActionMap.bindCmd(keyboard, "alt k", "cls();","");
|
||||
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.attemptFullscreenToggle();");
|
||||
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.toggleFullscreen();");
|
||||
GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();");
|
||||
ExampleMoveMap.bindCmd(keyboard, "n", "toggleNetGraph();", "");
|
||||
|
|
@ -147,6 +147,8 @@ function gamePadMoveX( %val )
|
|||
|
||||
function gamePadMoveY( %val )
|
||||
{
|
||||
%val *= -1;
|
||||
|
||||
if(%val > 0)
|
||||
{
|
||||
$mvForwardAction = %val * $movementSpeed;
|
||||
|
|
@ -183,6 +185,8 @@ function gamepadYaw(%val)
|
|||
|
||||
function gamepadPitch(%val)
|
||||
{
|
||||
%val *= -1;
|
||||
|
||||
%pitchAdj = getGamepadAdjustAmount(%val);
|
||||
if(ServerConnection.isControlObjectRotDampedCamera())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,17 +6,25 @@ function JoinServerMenu::onWake()
|
|||
JoinServerJoinBtn.setActive(JS_serverList.rowCount() > 0);
|
||||
|
||||
JoinServerButtonHolder.setActive();
|
||||
|
||||
JoinServerMenuInputHandler.setFirstResponder();
|
||||
}
|
||||
|
||||
function JoinServerButtonHolder::onWake(%this)
|
||||
{
|
||||
%this-->joinButton.set("Start", "Return", "Join", "JoinServerMenu.join();");
|
||||
%this-->backButton.set("btn_b", "escape", "Back", "JoinServerMenu.backOut();");
|
||||
%this-->joinButton.set("btn_start", "Return", "Join", "JoinServerMenu.join();");
|
||||
%this-->backButton.set("btn_b", "Escape", "Back", "JoinServerMenu.backOut();");
|
||||
%this-->refreshButton.set("btn_y", "R", "Refresh", "JoinServerMenu.refresh();");
|
||||
%this-->queryLANButton.set("btn_a", "Q", "Query LAN", "JoinServerMenu.queryLan();");
|
||||
%this-->queryInternetButton.set("btn_x", "E", "Query Internet", "JoinServerMenu.query();");
|
||||
}
|
||||
|
||||
function JoinServerMenuInputHandler::onInputEvent(%this, %device, %action, %state)
|
||||
{
|
||||
if(%state)
|
||||
$activeMenuButtonContainer.processInputs(%device, %action);
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
function JoinServerMenu::query(%this)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,18 @@
|
|||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
returnGui = "MainMenuGui";
|
||||
|
||||
new GuiInputCtrl(JoinServerMenuInputHandler){
|
||||
profile = "GuiInputCtrlProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
sendBreakEvents="1";
|
||||
};
|
||||
|
||||
new GuiControl(JoinServerWindow) {
|
||||
position = "48 56";
|
||||
|
|
|
|||
|
|
@ -215,18 +215,19 @@ function OptionsMenu::populateDisplaySettingsList(%this)
|
|||
|
||||
function OptionsMenu::applyDisplaySettings(%this)
|
||||
{
|
||||
%newAdapter = GraphicsMenuDriver.getText();
|
||||
%numAdapters = GFXInit::getAdapterCount();
|
||||
//%newAdapter = GraphicsMenuDriver.getText();
|
||||
//%numAdapters = GFXInit::getAdapterCount();
|
||||
%newDevice = OptionsMenuSettingsList.getCurrentOption(0);
|
||||
|
||||
for( %i = 0; %i < %numAdapters; %i ++ )
|
||||
/*for( %i = 0; %i < %numAdapters; %i ++ )
|
||||
{
|
||||
if( GFXInit::getAdapterName( %i ) $= %newAdapter )
|
||||
%targetAdapter = GFXInit::getAdapterName( %i );
|
||||
if( GFXInit::getAdapterName( %i ) $= %newDevice )
|
||||
{
|
||||
%newDevice = GFXInit::getAdapterType( %i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Change the device.
|
||||
if ( %newDevice !$= $pref::Video::displayDevice )
|
||||
|
|
@ -258,6 +259,7 @@ function OptionsMenu::populateGraphicsSettingsList(%this)
|
|||
%onOffList = "Off\tOn";
|
||||
%highMedLow = "Low\tMedium\tHigh";
|
||||
%anisoFilter = "Off\t4\t8\t16";
|
||||
%aaFilter = "Off\t1\t2\t4";
|
||||
OptionsMenuSettingsList.addOptionRow("Shadow Quality", getQualityLevels(ShadowQualityList), false, "", -1, -30, true, "Shadow revolution quality", getCurrentQualityLevel(ShadowQualityList));
|
||||
OptionsMenuSettingsList.addOptionRow("Soft Shadow Quality", getQualityLevels(SoftShadowList), false, "", -1, -30, true, "Amount of softening applied to shadowmaps", getCurrentQualityLevel(SoftShadowList));
|
||||
OptionsMenuSettingsList.addOptionRow("Mesh Quality", getQualityLevels(MeshQualityGroup), false, "", -1, -30, true, "Fidelity of rendering of mesh objects", getCurrentQualityLevel(MeshQualityGroup));
|
||||
|
|
@ -267,7 +269,7 @@ function OptionsMenu::populateGraphicsSettingsList(%this)
|
|||
OptionsMenuSettingsList.addOptionRow("Ground Cover Density", getQualityLevels(GroundCoverDensityGroup), false, "", -1, -30, true, "Density of ground cover items, such as grass", getCurrentQualityLevel(GroundCoverDensityGroup));
|
||||
OptionsMenuSettingsList.addOptionRow("Shader Quality", getQualityLevels(ShaderQualityGroup), false, "", -1, -30, true, "Dictates the overall shader quality level, adjusting what features are enabled.", getCurrentQualityLevel(ShaderQualityGroup));
|
||||
OptionsMenuSettingsList.addOptionRow("Anisotropic Filtering", %anisoFilter, false, "", -1, -30, true, "Amount of Anisotropic Filtering on textures, which dictates their sharpness at a distance", $pref::Video::defaultAnisotropy);
|
||||
OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", "4\t2\t1\tOff", false, "", -1, -30, true, "Amount of Post-Processing Anti-Aliasing applied to rendering", $pref::Video::AA);
|
||||
OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", %aaFilter, false, "", -1, -30, true, "Amount of Post-Processing Anti-Aliasing applied to rendering", $pref::Video::AA);
|
||||
OptionsMenuSettingsList.addOptionRow("Parallax", %onOffList, false, "", -1, -30, true, "Whether the surface parallax shader effect is enabled", convertBoolToOnOff(!$pref::Video::disableParallaxMapping));
|
||||
OptionsMenuSettingsList.addOptionRow("Water Reflections", %onOffList, false, "", -1, -30, true, "Whether water reflections are enabled", convertBoolToOnOff(!$pref::Water::disableTrueReflections));
|
||||
OptionsMenuSettingsList.addOptionRow("SSAO", %onOffList, false, "", -1, -30, true, "Whether Screen-Space Ambient Occlusion is enabled", convertBoolToOnOff($pref::PostFX::EnableSSAO));
|
||||
|
|
|
|||
|
|
@ -233,8 +233,6 @@
|
|||
|
||||
new GuiGameListMenuCtrl(OptionsMenuSettingsList) {
|
||||
debugRender = "0";
|
||||
callbackOnA = "OptionsMenuSettingsList.activateRow();";
|
||||
callbackOnB = "OptionsMenuSettingsList.backOut();";
|
||||
callbackOnInputs = "1";
|
||||
position = "1 1";
|
||||
extent = "621 510";
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ function loadStartup()
|
|||
// Call the next() function to set our firt
|
||||
// splash screen
|
||||
StartupGui.next();
|
||||
|
||||
StartupGui.setFirstResponder();
|
||||
|
||||
// Play our startup sound
|
||||
//SFXPlayOnce(AudioGui, "data/ui/sounds/startup");//SFXPlay(startsnd);
|
||||
|
|
|
|||
|
|
@ -1,200 +0,0 @@
|
|||
// =============================================================================
|
||||
// AUDIO MENU
|
||||
// =============================================================================
|
||||
$AudioTestHandle = 0;
|
||||
// Description to use for playing the volume test sound. This isn't
|
||||
// played with the description of the channel that has its volume changed
|
||||
// because we know nothing about the playback state of the channel. If it
|
||||
// is paused or stopped, the test sound would not play then.
|
||||
$AudioTestDescription = new SFXDescription()
|
||||
{
|
||||
sourceGroup = AudioChannelMaster;
|
||||
};
|
||||
|
||||
function AudioMenu::loadSettings(%this)
|
||||
{
|
||||
// Audio
|
||||
//OptAudioHardwareToggle.setStateOn($pref::SFX::useHardware);
|
||||
//OptAudioHardwareToggle.setActive( true );
|
||||
|
||||
/*%this-->OptAudioVolumeMaster.setValue( $pref::SFX::masterVolume );
|
||||
%this-->OptAudioVolumeShell.setValue( $pref::SFX::channelVolume[ $GuiAudioType] );
|
||||
%this-->OptAudioVolumeSim.setValue( $pref::SFX::channelVolume[ $SimAudioType ] );
|
||||
%this-->OptAudioVolumeMusic.setValue( $pref::SFX::channelVolume[ $MusicAudioType ] );
|
||||
|
||||
AudioMenuSoundDriver.clear();
|
||||
%buffer = sfxGetAvailableDevices();
|
||||
%count = getRecordCount( %buffer );
|
||||
for(%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%record = getRecord(%buffer, %i);
|
||||
%provider = getField(%record, 0);
|
||||
|
||||
if ( AudioMenuSoundDriver.findText( %provider ) == -1 )
|
||||
AudioMenuSoundDriver.add( %provider, %i );
|
||||
}
|
||||
|
||||
AudioMenuSoundDriver.sort();
|
||||
|
||||
%selId = AudioMenuSoundDriver.findText($pref::SFX::provider);
|
||||
if ( %selId == -1 )
|
||||
AudioMenuSoundDriver.setFirstSelected();
|
||||
else
|
||||
AudioMenuSoundDriver.setSelected( %selId );*/
|
||||
|
||||
OptionsSettingStack.clear();
|
||||
|
||||
OptionsMenu.addSliderOption(OptionsSettingStack, "Master Volume", $pref::Video::Brightness, "0 1", 10, 5);
|
||||
OptionsMenu.addSliderOption(OptionsSettingStack, "Menu Volume", $pref::Video::Brightness, "0 1", 10, 5);
|
||||
OptionsMenu.addSliderOption(OptionsSettingStack, "Effects Volume", $pref::Video::Brightness, "0 1", 10, 5);
|
||||
OptionsMenu.addSliderOption(OptionsSettingStack, "Music Volume", $pref::Video::Brightness, "0 1", 10, 5);
|
||||
}
|
||||
|
||||
function AudioMenu::loadDevices(%this)
|
||||
{
|
||||
if(!isObject(SoundDeviceGroup))
|
||||
{
|
||||
new SimGroup( SoundDeviceGroup );
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundDeviceGroup.clear();
|
||||
}
|
||||
|
||||
%buffer = sfxGetAvailableDevices();
|
||||
%count = getRecordCount( %buffer );
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%record = getRecord(%buffer, %i);
|
||||
%provider = getField(%record, 0);
|
||||
%device = getField(%record, 1);
|
||||
|
||||
if($pref::SFX::provider !$= %provider)
|
||||
continue;
|
||||
|
||||
%setting = new ArrayObject()
|
||||
{
|
||||
class = "OptionsMenuSettingLevel";
|
||||
caseSensitive = true;
|
||||
|
||||
displayName = %device;
|
||||
|
||||
key["$pref::SFX::Device"] = %device;
|
||||
};
|
||||
|
||||
SoundDeviceGroup.add(%setting);
|
||||
}
|
||||
}
|
||||
|
||||
function AudioMenu::apply(%this)
|
||||
{
|
||||
sfxSetMasterVolume( $pref::SFX::masterVolume );
|
||||
|
||||
sfxSetChannelVolume( $GuiAudioType, $pref::SFX::channelVolume[ $GuiAudioType ] );
|
||||
sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ $SimAudioType ] );
|
||||
sfxSetChannelVolume( $MusicAudioType, $pref::SFX::channelVolume[ $MusicAudioType ] );
|
||||
|
||||
if ( !sfxCreateDevice( $pref::SFX::provider,
|
||||
$pref::SFX::device,
|
||||
$pref::SFX::useHardware,
|
||||
-1 ) )
|
||||
error( "Unable to create SFX device: " @ $pref::SFX::provider
|
||||
SPC $pref::SFX::device
|
||||
SPC $pref::SFX::useHardware );
|
||||
|
||||
if( !isObject( $AudioTestHandle ) )
|
||||
{
|
||||
sfxPlay(menuButtonPressed);
|
||||
}
|
||||
}
|
||||
|
||||
function AudioMenuOKButton::onClick(%this)
|
||||
{
|
||||
//save the settings and then back out
|
||||
AudioMenu.apply();
|
||||
OptionsMenu.backOut();
|
||||
}
|
||||
|
||||
function AudioMenuDefaultsButton::onClick(%this)
|
||||
{
|
||||
sfxInit();
|
||||
AudioMenu.loadSettings();
|
||||
}
|
||||
|
||||
function OptAudioUpdateMasterVolume( %volume )
|
||||
{
|
||||
if( %volume == $pref::SFX::masterVolume )
|
||||
return;
|
||||
|
||||
sfxSetMasterVolume( %volume );
|
||||
$pref::SFX::masterVolume = %volume;
|
||||
|
||||
if( !isObject( $AudioTestHandle ) )
|
||||
$AudioTestHandle = sfxPlayOnce( AudioChannel, "data/ui/sounds/volumeTest.wav" );
|
||||
}
|
||||
|
||||
function OptAudioUpdateChannelVolume( %description, %volume )
|
||||
{
|
||||
%channel = sfxGroupToOldChannel( %description.sourceGroup );
|
||||
|
||||
if( %volume == $pref::SFX::channelVolume[ %channel ] )
|
||||
return;
|
||||
|
||||
sfxSetChannelVolume( %channel, %volume );
|
||||
$pref::SFX::channelVolume[ %channel ] = %volume;
|
||||
|
||||
if( !isObject( $AudioTestHandle ) )
|
||||
{
|
||||
$AudioTestDescription.volume = %volume;
|
||||
$AudioTestHandle = sfxPlayOnce( $AudioTestDescription, "data/ui/sounds/volumeTest.wav" );
|
||||
}
|
||||
}
|
||||
|
||||
function AudioMenuSoundDriver::onSelect( %this, %id, %text )
|
||||
{
|
||||
// Skip empty provider selections.
|
||||
if ( %text $= "" )
|
||||
return;
|
||||
|
||||
$pref::SFX::provider = %text;
|
||||
AudioMenuSoundDevice.clear();
|
||||
|
||||
%buffer = sfxGetAvailableDevices();
|
||||
%count = getRecordCount( %buffer );
|
||||
for(%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%record = getRecord(%buffer, %i);
|
||||
%provider = getField(%record, 0);
|
||||
%device = getField(%record, 1);
|
||||
|
||||
if (%provider !$= %text)
|
||||
continue;
|
||||
|
||||
if ( AudioMenuSoundDevice.findText( %device ) == -1 )
|
||||
AudioMenuSoundDevice.add( %device, %i );
|
||||
}
|
||||
|
||||
// Find the previous selected device.
|
||||
%selId = AudioMenuSoundDevice.findText($pref::SFX::device);
|
||||
if ( %selId == -1 )
|
||||
AudioMenuSoundDevice.setFirstSelected();
|
||||
else
|
||||
AudioMenuSoundDevice.setSelected( %selId );
|
||||
}
|
||||
|
||||
function AudioMenuSoundDevice::onSelect( %this, %id, %text )
|
||||
{
|
||||
// Skip empty selections.
|
||||
if ( %text $= "" )
|
||||
return;
|
||||
|
||||
$pref::SFX::device = %text;
|
||||
|
||||
if ( !sfxCreateDevice( $pref::SFX::provider,
|
||||
$pref::SFX::device,
|
||||
$pref::SFX::useHardware,
|
||||
-1 ) )
|
||||
error( "Unable to create SFX device: " @ $pref::SFX::provider
|
||||
SPC $pref::SFX::device
|
||||
SPC $pref::SFX::useHardware );
|
||||
}
|
||||
|
|
@ -1,245 +0,0 @@
|
|||
function DisplayMenu::loadSettings()
|
||||
{
|
||||
OptionsMenu.currentMenu = "DisplayMenu";
|
||||
OptionsSettingStack.clear();
|
||||
|
||||
%APICount = getTokenCount(GraphicsDriverSetting::getList(),",");
|
||||
if(%APICount > 1)
|
||||
OptionsMenu.addSettingOption(OptionsSettingStack, "Diplay API", "", "GraphicsDriverSetting");
|
||||
|
||||
OptionsMenu.addSettingOption(OptionsSettingStack, "Screen Resolution", "", "ScreenResolutionSetting");
|
||||
OptionsMenu.addSettingOption(OptionsSettingStack, "Fullscreen", "", "FullscreenSetting");
|
||||
OptionsMenu.addSettingOption(OptionsSettingStack, "VSync", "", "VSyncSetting");
|
||||
|
||||
OptionsMenu.addSliderOption(OptionsSettingStack, "Field of View", $pref::Video::FOV, "65 120", 55, 75);
|
||||
|
||||
OptionsMenu.addSliderOption(OptionsSettingStack, "Brightness", $pref::Video::Brightness, "0 1", 10, 5);
|
||||
OptionsMenu.addSliderOption(OptionsSettingStack, "Contrast", $pref::Video::Contrast, "0 1", 10, 5);
|
||||
|
||||
GraphicsSettingsCache.empty();
|
||||
}
|
||||
|
||||
function DisplayMenu::apply(%this)
|
||||
{
|
||||
//Loop through the settings cache and actually apply the values
|
||||
%cachedSettingCount = GraphicsSettingsCache.count();
|
||||
|
||||
for(%i=0; %i < %cachedSettingCount; %i++)
|
||||
{
|
||||
%var = GraphicsSettingsCache.getKey(%i);
|
||||
%val = GraphicsSettingsCache.getValue(%i);
|
||||
|
||||
if(%var $= "$pref::Video::displayDevice")
|
||||
{
|
||||
MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." );
|
||||
}
|
||||
|
||||
setVariable(%var, %val);
|
||||
}
|
||||
|
||||
//Update the display settings now
|
||||
if (getWord( $pref::Video::Resolution, 2) $= "")
|
||||
{
|
||||
$pref::Video::Resolution = getWord( $pref::Video::Resolution, 0 ) SPC getWord( $pref::Video::Resolution, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$pref::Video::Resolution = getWord( $pref::Video::Resolution, 0 ) SPC getWord( $pref::Video::Resolution, 2 );
|
||||
}
|
||||
|
||||
/*if ( %newFullScreen $= "false" )
|
||||
{
|
||||
// If we're in windowed mode switch the fullscreen check
|
||||
// if the resolution is bigger than the desktop.
|
||||
%deskRes = getDesktopResolution();
|
||||
%deskResX = getWord(%deskRes, $WORD::RES_X);
|
||||
%deskResY = getWord(%deskRes, $WORD::RES_Y);
|
||||
if ( getWord( %newRes, $WORD::RES_X ) > %deskResX ||
|
||||
getWord( %newRes, $WORD::RES_Y ) > %deskResY )
|
||||
{
|
||||
$pref::Video::FullScreen = "true";
|
||||
GraphicsMenuFullScreen.setStateOn( true );
|
||||
}
|
||||
}*/
|
||||
|
||||
// Build the final mode string.
|
||||
%newMode = $pref::Video::Resolution SPC $pref::Video::FullScreen SPC 32 SPC $pref::Video::RefreshRate SPC $pref::Video::AA;
|
||||
|
||||
// Change the video mode.
|
||||
/*if ( %newMode !$= $pref::Video::mode ||
|
||||
%newVsync != $pref::Video::disableVerticalSync )
|
||||
{
|
||||
if ( %testNeedApply )
|
||||
return true;*/
|
||||
|
||||
$pref::Video::mode = %newMode;
|
||||
//$pref::Video::disableVerticalSync = %newVsync;
|
||||
configureCanvas();
|
||||
//}
|
||||
|
||||
echo("Exporting client prefs");
|
||||
%prefPath = getPrefpath();
|
||||
export("$pref::*", %prefPath @ "/clientPrefs.cs", false);
|
||||
}
|
||||
//
|
||||
function GraphicsDriverSetting::set(%setting)
|
||||
{
|
||||
switch$(%setting)
|
||||
{
|
||||
case "D3D11":
|
||||
GraphicsMenu::set("$pref::Video::displayDevice", "D3D11");
|
||||
case "OpenGL":
|
||||
GraphicsMenu::set("$pref::Video::displayDevice", "OpenGL");
|
||||
default:
|
||||
GraphicsMenu::set("$pref::Video::displayDevice", "OpenGL");
|
||||
}
|
||||
}
|
||||
|
||||
function GraphicsDriverSetting::get()
|
||||
{
|
||||
if($pref::Video::displayDevice $= "D3D11")
|
||||
return "D3D11";
|
||||
else if($pref::Video::displayDevice $= "OpenGL")
|
||||
return "OpenGL";
|
||||
else
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
function GraphicsDriverSetting::getList()
|
||||
{
|
||||
%returnsList = "";
|
||||
%buffer = getDisplayDeviceList();
|
||||
%deviceCount = getFieldCount( %buffer );
|
||||
%numAdapters = GFXInit::getAdapterCount();
|
||||
|
||||
%count = 0;
|
||||
for(%i = 0; %i < %deviceCount; %i++)
|
||||
{
|
||||
%deviceDesc = getField(%buffer, %i);
|
||||
|
||||
if(%deviceDesc $= "GFX Null Device")
|
||||
continue;
|
||||
|
||||
for( %i = 0; %i < %numAdapters; %i ++ )
|
||||
{
|
||||
if( GFXInit::getAdapterName( %i ) $= %deviceDesc )
|
||||
{
|
||||
%deviceName = GFXInit::getAdapterType( %i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(%count != 0)
|
||||
%returnsList = %returnsList @ "," @ %deviceName;
|
||||
else
|
||||
%returnsList = %deviceName;
|
||||
|
||||
%count++;
|
||||
}
|
||||
|
||||
return %returnsList;
|
||||
}
|
||||
|
||||
//
|
||||
function ScreenResolutionSetting::set(%setting)
|
||||
{
|
||||
GraphicsMenu::set("$pref::Video::Resolution", %setting);
|
||||
}
|
||||
|
||||
function ScreenResolutionSetting::get()
|
||||
{
|
||||
return _makePrettyResString( $pref::Video::Resolution );
|
||||
}
|
||||
|
||||
function ScreenResolutionSetting::getList()
|
||||
{
|
||||
%returnsList = "";
|
||||
|
||||
%resCount = Canvas.getModeCount();
|
||||
for (%i = 0; %i < %resCount; %i++)
|
||||
{
|
||||
%testResString = Canvas.getMode( %i );
|
||||
%testRes = _makePrettyResString( %testResString );
|
||||
|
||||
//sanitize
|
||||
%found = false;
|
||||
%retCount = getTokenCount(%returnsList, ",");
|
||||
for (%x = 0; %x < %retCount; %x++)
|
||||
{
|
||||
%existingEntry = getToken(%returnsList, ",", %x);
|
||||
if(%existingEntry $= %testRes)
|
||||
{
|
||||
%found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(%found)
|
||||
continue;
|
||||
|
||||
if(%i != 0)
|
||||
%returnsList = %returnsList @ "," @ %testRes;
|
||||
else
|
||||
%returnsList = %testRes;
|
||||
}
|
||||
|
||||
return %returnsList;
|
||||
}
|
||||
|
||||
//
|
||||
function FullscreenSetting::set(%setting)
|
||||
{
|
||||
switch$(%setting)
|
||||
{
|
||||
case "On":
|
||||
GraphicsMenu::set("$pref::Video::FullScreen", "1");
|
||||
case "Off":
|
||||
GraphicsMenu::set("$pref::Video::FullScreen", "0");
|
||||
default:
|
||||
GraphicsMenu::set("$pref::Video::FullScreen", "0");
|
||||
}
|
||||
}
|
||||
|
||||
function FullscreenSetting::get()
|
||||
{
|
||||
if($pref::Video::FullScreen == 1)
|
||||
return "On";
|
||||
else if($pref::Video::FullScreen == 0)
|
||||
return "Off";
|
||||
else
|
||||
return "Custom";
|
||||
}
|
||||
|
||||
function FullscreenSetting::getList()
|
||||
{
|
||||
return "Off,On";
|
||||
}
|
||||
|
||||
//
|
||||
function VSyncSetting::set(%setting)
|
||||
{
|
||||
switch$(%setting)
|
||||
{
|
||||
case "On":
|
||||
GraphicsMenu::set("$pref::Video::disableVerticalSync", "0");
|
||||
case "Off":
|
||||
GraphicsMenu::set("$pref::Video::disableVerticalSync", "1");
|
||||
default:
|
||||
GraphicsMenu::set("$pref::Video::disableVerticalSync", "1");
|
||||
}
|
||||
}
|
||||
|
||||
function VSyncSetting::get()
|
||||
{
|
||||
if($pref::Video::disableVerticalSync == 0)
|
||||
return "On";
|
||||
else if($pref::Video::disableVerticalSync == 1)
|
||||
return "Off";
|
||||
else
|
||||
return "Custom";
|
||||
}
|
||||
|
||||
function VSyncSetting::getList()
|
||||
{
|
||||
return "Off,On";
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -103,6 +103,7 @@ function MessageBoxOK(%title, %message, %callback)
|
|||
|
||||
MessageBoxOKButtonHolder-->OKButton.set("btn_a", "Return", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
|
||||
|
||||
MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
|
||||
MessageBoxOKButtonHolder.setActive();
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
|
|
@ -112,6 +113,7 @@ function MessageBoxOK(%title, %message, %callback)
|
|||
function MessageBoxOKDlg::onSleep( %this )
|
||||
{
|
||||
%this.callback = "";
|
||||
MessageBoxCtrl.originalMenuInputContainer.setActive();
|
||||
}
|
||||
|
||||
function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
|
||||
|
|
@ -126,6 +128,7 @@ function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
|
|||
MessageBoxOCButtonHolder-->OKButton.set("btn_a", "Return", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
|
||||
MessageBoxOCButtonHolder-->CancelButton.set("btn_b", "Escape", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
|
||||
|
||||
MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
|
||||
MessageBoxOCButtonHolder.setActive();
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
|
|
@ -136,6 +139,7 @@ function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
|
|||
function MessageBoxOKCancelDlg::onSleep( %this )
|
||||
{
|
||||
%this.callback = "";
|
||||
MessageBoxCtrl.originalMenuInputContainer.setActive();
|
||||
}
|
||||
|
||||
function MessageBoxOKCancelDetails(%title, %message, %details, %callback, %cancelCallback)
|
||||
|
|
@ -207,6 +211,7 @@ function MBOKCancelDetailsToggleInfoFrame()
|
|||
function MessageBoxOKCancelDetailsDlg::onSleep( %this )
|
||||
{
|
||||
%this.callback = "";
|
||||
MessageBoxCtrl.originalMenuInputContainer.setActive();
|
||||
}
|
||||
|
||||
function MessageBoxYesNo(%title, %message, %yesCallback, %noCallback)
|
||||
|
|
@ -221,6 +226,7 @@ function MessageBoxYesNo(%title, %message, %yesCallback, %noCallback)
|
|||
MessageBoxOCButtonHolder-->OKButton.set("btn_a", "Return", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
|
||||
MessageBoxOCButtonHolder-->CancelButton.set("btn_b", "Escape", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
|
||||
|
||||
MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
|
||||
MessageBoxOCButtonHolder.setActive();
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
|
|
@ -241,6 +247,7 @@ function MessageBoxYesNoCancel(%title, %message, %yesCallback, %noCallback, %can
|
|||
MessageBoxYNCButtonHolder-->noButton.set("btn_x", "backspace", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
|
||||
MessageBoxYNCButtonHolder-->cancelButton.set("btn_b", "Escape", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
|
||||
|
||||
MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
|
||||
MessageBoxYNCButtonHolder.setActive();
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
|
|
@ -256,6 +263,7 @@ function MessageBoxDlg::onSleep( %this )
|
|||
%this.yesCallback = "";
|
||||
%this.noCallback = "";
|
||||
%this.cancelCallback = "";
|
||||
MessageBoxCtrl.originalMenuInputContainer.setActive();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ new GuiGameListMenuProfile(DefaultListMenuProfile)
|
|||
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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue