Ran importer on UI module to ensure guis and images are converted to latest standards

Updated all UI module controls to utilize a more standard structure with stack controls instead of the GameMenu ctrls, as well as more standardization of gamepad input handling
This commit is contained in:
JeffR 2022-02-22 20:12:39 -06:00
parent 6a357d8dfb
commit 01de818503
80 changed files with 590 additions and 673 deletions

View file

@ -81,6 +81,7 @@ function ExampleModule::initClient(%this)
exec(%prefPath @ "/keybinds." @ $TorqueScriptFileExtension);
%this.queueExec("./scripts/inputCommands");
addOptionsMenuCategory("Example Options", "testExampleOptions();");
}
//This is called when a game session client successfuly connects to a game server.
@ -105,4 +106,9 @@ function ExampleModule::onDestroyClientConnection(%this)
{
//This will pop the keybind, cleaning it up from the input stack, as it no longer applies
ExampleMoveMap.pop();
}
function testExampleOptions()
{
addListOption("Test Option", "This is a test option", $testOptionValue, "OptionA\tOptionB");
}

View file

@ -11,4 +11,4 @@
canSaveDynamicFields="true"
Extension="asset.taml"
Recurse="true" />
</ModuleDefinition>
</ModuleDefinition>

View file

@ -83,4 +83,4 @@ function UI::initClient(%this)
function UI::onCreateClientConnection(%this){}
function UI::onDestroyClientConnection(%this){}
function UI::onDestroyClientConnection(%this){}

View file

@ -2,5 +2,5 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="guiSounds"
scriptFile="@assetFile=guiSounds.cs"
scriptFile="@assetFile=guiSounds"
VersionId="1" />

View file

@ -31,4 +31,4 @@ singleton SFXProfile(menuButtonHover)
preload = true;
description = AudioGui;
fileName = "data/ui/sounds/buttonHover";
};
};

View file

@ -1,7 +1,5 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="ChooseLevelDlg"
scriptFile="@assetFile=chooseLevelDlg.gui"
scriptFile="@assetFile=chooseLevelDlg"
GUIFile="@assetFile=chooseLevelDlg.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,5 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="GuiMusicPlayer"
scriptFile="@assetFile=guiMusicPlayer.gui"
scriptFile="@assetFile=guiMusicPlayer"
GUIFile="@assetFile=guiMusicPlayer.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,4 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="IODropdownDlg"
scriptFile="@assetFile=IODropdownDlg.ed.gui"
GUIFile="@assetFile=IODropdownDlg.ed.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,5 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="JoinServerMenu"
scriptFile="@assetFile=joinServerMenu.gui"
scriptFile="@assetFile=joinServerMenu"
GUIFile="@assetFile=joinServerMenu.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,4 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="LoadingGui"
scriptFile="@assetFile=loadingGui.gui"
GUIFile="@assetFile=loadingGui.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,5 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="MainMenuGui"
scriptFile="@assetFile=mainMenu.gui"
scriptFile="@assetFile=mainMenu"
GUIFile="@assetFile=mainMenu.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,4 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="MessageBoxDlg"
scriptFile="@assetFile=messageBoxDlg.gui"
GUIFile="@assetFile=messageBoxDlg.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +0,0 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="NetGraphProfile"
scriptFile="@assetFile=netGraphGui.gui"
GUIFile="@assetFile=netGraphGui.gui"
VersionId="1" />

View file

@ -1,7 +1,5 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="OptionsMenu"
scriptFile="@assetFile=optionsMenu.gui"
scriptFile="@assetFile=optionsMenu"
GUIFile="@assetFile=optionsMenu.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,5 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="PauseMenu"
scriptFile="@assetFile=pauseMenu.gui"
scriptFile="@assetFile=pauseMenu"
GUIFile="@assetFile=pauseMenu.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,5 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="ProfilerGui"
scriptFile="@assetFile=profiler.gui"
scriptFile="@assetFile=profiler"
GUIFile="@assetFile=profiler.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,4 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="RemapConfirmDlg"
scriptFile="@assetFile=remapConfirmDlg.gui"
GUIFile="@assetFile=remapConfirmDlg.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,4 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="RemapDlg"
scriptFile="@assetFile=remapDlg.gui"
GUIFile="@assetFile=remapDlg.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -1,7 +1,5 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="StartupGui"
scriptFile="@assetFile=startupGui.gui"
scriptFile="@assetFile=startupGui"
GUIFile="@assetFile=startupGui.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -36,7 +36,7 @@ $guiContent = new GuiControl(ChooseLevelDlg) {
percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel.png";
bitmapAsset = "UI:panel_image";
color = "255 255 255 255";
position = "0 0";
extent = "927 40";
@ -79,7 +79,7 @@ $guiContent = new GuiControl(ChooseLevelDlg) {
percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel_low.png";
bitmapAsset = "UI:panel_low_image";
color = "255 255 255 255";
position = "0 40";
extent = "927 618";

View file

@ -1,102 +0,0 @@
<GuiContainer
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="0 0"
extent="700 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
class="GraphicsMenuSetting"
canSave="true"
canSaveDynamicFields="false">
<GuiBitmapCtrl
bitmap="data/ui/images/hudfill.png"
wrap="false"
position="0 0"
extent="550 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
canSave="true"
canSaveDynamicFields="false" />
<GuiTextCtrl
text="Move Forward"
maxLength="1024"
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="0 0"
extent="550 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
internalName="nameText"
canSave="true"
canSaveDynamicFields="false" />
<GuiContainer
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="550 0"
extent="150 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
canSave="true"
canSaveDynamicFields="false">
<GuiButtonCtrl
text="W"
groupNum="-1"
buttonType="PushButton"
useMouseEvents="true"
position="0 0"
extent="150 35"
minExtent="8 8"
horizSizing="relative"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
canSave="true"
canSaveDynamicFields="false"
internalName="rebindButton"
className="ControlsMenuRebindButton"/>
</GuiContainer>
</GuiContainer>

View file

@ -425,7 +425,7 @@ $guiContent = new GuiControl(JoinServerMenu) {
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
active = "0";
command = "JoinServerMenu.join();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";

View file

@ -1,10 +1,6 @@
function JoinServerMenu::onWake()
function JoinServerMenu::onWake(%this)
{
// Double check the status. Tried setting this the control
// inactive to start with, but that didn't seem to work.
JoinServerJoinBtn.setActive(JoinServerList.getCount() > 0);
JoinServerButtonHolder.setActive();
JoinServerList.setAsActiveMenuList();
@ -128,7 +124,7 @@ function JoinServerMenu::update(%this)
JoinServerList.add(%serverBtn);
}
JoinServerJoinBtn.setActive(JoinServerList.getCount() > 0);
JoinServerButtonHolder-->joinButton.setActive(JoinServerList.getCount() > 0);
}
//----------------------------------------

View file

@ -1,6 +1,6 @@
//--- OBJECT WRITE BEGIN ---
$guiContent = new GuiChunkedBitmapCtrl(MainMenuGui) {
BitmapAsset = "UI:background_dark_image";
BitmapAsset = "UI:backgrounddark_image";
useVariable = "0";
tile = "0";
position = "0 0";
@ -203,7 +203,7 @@ $guiContent = new GuiChunkedBitmapCtrl(MainMenuGui) {
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "exit();";
command = "quit();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";

View file

@ -66,4 +66,5 @@ function MainMenuGui::onReturnTo(%this)
MainMenuButtonList.hidden = false;
MainMenuButtonList.setFirstResponder();
MainMenuButtonHolder.setActive();
}
MainMenuButtonList.setAsActiveMenuList();
}

View file

@ -34,7 +34,7 @@ $guiContent = new GuiControl(MessageBoxDlg) {
percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel.png";
bitmapAsset = "UI:panel_image";
color = "255 255 255 255";
position = "0 0";
extent = "641 40";
@ -77,7 +77,7 @@ $guiContent = new GuiControl(MessageBoxDlg) {
percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel_low.png";
bitmapAsset = "UI:panel_low_image";
color = "255 255 255 255";
position = "0 40";
extent = "641 341";

View file

@ -554,4 +554,4 @@ function NetGraph::updateNetworkSimulation(%this)
}
netSimulateLag( %latency, %packetLoss );
}
}

View file

@ -213,127 +213,6 @@ $guiContent = new GuiControl(OptionsMenu) {
class = "MenuList";
canSave = "1";
canSaveDynamicFields = "0";
new GuiButtonCtrl(OptionsMenuDisplayBtn) {
text = "Display";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 0";
extent = "248 35";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "populateDisplaySettingsList();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(OptionsMenuGraphicsBtn) {
text = "Graphics";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 45";
extent = "248 35";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "populateGraphicsSettingsList();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(OptionsMenuAudioBtn) {
text = "Audio";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 90";
extent = "248 35";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "populateAudioSettingsList();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(OptionsMenuKBMBtn) {
text = "Keyboard & Mouse";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 135";
extent = "248 35";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "populateKeyboardMouseSettingsList();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(OptionsMenuGamepadBtn) {
text = "Gamepad";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 180";
extent = "248 35";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "populateGamepadSettingsList();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(OptionsMenuProfileBtn) {
text = "Profile";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 225";
extent = "248 35";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "populateProfileSettingsList();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
new GuiPanel() {
@ -493,68 +372,6 @@ $guiContent = new GuiControl(OptionsMenu) {
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
BitmapAsset = "UI:Switch_LB_image";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Prev Tab";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "0";
active = "0";
command = "OptionsMenu.prevTab();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "prevTabButton";
class = "MenuInputButton";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
BitmapAsset = "UI:Switch_RB_image";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Next Tab";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "144 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "0";
active = "0";
command = "OptionsMenu.nextTab();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "nextTabButton";
class = "MenuInputButton";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
BitmapAsset = "UI:Keyboard_Black_R_image";

View file

@ -46,12 +46,67 @@
//headbob
//FOV
function OptionsMenu::onAdd(%this)
{
if(!isObject(%this.optionsCategories))
{
%this.optionsCategories = new ArrayObject();
}
if(!isObject(%this.unappliedChanges))
{
%this.unappliedChanges = new ArrayObject();
}
addOptionsMenuCategory("Display", "populateDisplaySettingsList();");
addOptionsMenuCategory("Graphics", "populateGraphicsSettingsList();");
addOptionsMenuCategory("Audio", "populateAudioSettingsList();");
addOptionsMenuCategory("Keyboard & Mouse", "populateKeyboardMouseSettingsList();");
addOptionsMenuCategory("Gamepad", "populateGamepadSettingsList();");
}
function OptionsMenuSettingsList::onAdd(%this)
{
}
function OptionsMenuSettingsList::getOptionsList(%this, %index)
{
}
function OptionsMenu::onWake(%this)
{
for(%i=0; %i < %this.optionsCategories.count(); %i++)
{
%catName = %this.optionsCategories.getKey(%i);
%callback = %this.optionsCategories.getValue(%i);
%newCatButton = new GuiButtonCtrl() {
text = %catName;
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 180";
extent = "248 35";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = %callback;
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
OptionsMenuCategoryList.add(%newCatButton);
}
%this.unappliedChanges.empty();
MainMenuButtonList.hidden = true;
OptionsMenuCategoryList.setAsActiveMenuList();
@ -63,8 +118,6 @@ function OptionsMenu::onWake(%this)
function OptionsButtonHolder::onWake(%this)
{
//%this-->prevTabButton.set("btn_l", "", "Prev Tab", "OptionsMenu.prevTab();", true);
%this-->nextTabButton.set("btn_a", "", "Select", "OptionsMenuList.activate();", true);
%this-->resetButton.set("btn_back", "R", "Reset", "OptionsMenu.resetToDefaults();");
%this-->applyButton.set("btn_start", "Return", "Apply", "OptionsMenu.apply();");
%this-->backButton.set("btn_b", "Escape", "Back", "OptionsMenu.backOut();");
@ -74,19 +127,81 @@ function OptionsButtonHolder::onWake(%this)
function OptionsMenu::apply(%this)
{
if(%this.pageTabIndex == 0)
//Now we run through our list of unapplied changes and... apply them.
%hasKeybindChanges = false;
%hasVideoChanges = false;
%hasPostFXChanges = false;
%hasAudioChanges = false;
for(%i=0; %i < %this.unappliedChanges.count(); %i++)
{
%this.applyDisplaySettings();
%targetVar = %this.unappliedChanges.getKey(%i);
%newValue = %this.unappliedChanges.getValue(%i);
//First, lets just check through our action map names, see if any match
%wasKeybind = false;
for(%am=0; %am < ActionMapGroup.getCount(); %am++)
{
%actionMap = ActionMapGroup.getObject(%am);
if(%actionMap == GlobalActionMap.getId())
continue;
%actionMapName = %actionMap.humanReadableName $= "" ? %actionMap.getName() : %actionMap.humanReadableName;
if(%actionMapName $= %targetVar)
{
%hasKeybindChanges = true;
%wasKeybind = true;
break;
}
}
if(!%wasKeybind)
{
%currentValue = getVariable(%targetVar);
if(%currentValue !$= %newValue)
{
setVariable(%targetVar, %newValue);
//now, lets check for special cases that need additional handling
//for updates
if ( %targetVar $= "$pref::Video::displayDevice" )
{
MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." );
}
else if(startsWith(%targetVar, "$pref::Graphics::"))
{
//isolate the quality group name, like $pref::Graphics::LightingQuality
//we grab LightingQuality
%qualityGroupName = getSubStr(%targetVar, 17);
if(isObject(%qualityGroupName @ "List"))
{
//yep, it's a quality group, so apply it
(%qualityGroupName @ "List").applySetting(%newValue);
}
if(%qualityGroupName $= "TextureQuality")
{
reloadTextures();
}
}
else if(startsWith(%targetVar, "$pref::PostFX::"))
{
%hasPostFXChanges = true;
}
else if(startsWith(%targetVar, "$pref::Video::"))
{
%hasVideoChanges = true;
}
else if(startsWith(%targetVar, "$pref::SFX::"))
{
%hasAudioChanges = true;
}
}
}
}
else if(%this.pageTabIndex == 1)
{
%this.applyGraphicsSettings();
}
else if(%this.pageTabIndex == 2)
{
%this.applyAudioSettings();
}
else if(%this.pageTabIndex == 3 || %this.pageTabIndex == 4)
//If we had keybind changes, go ahead and save those out
if(%hasKeybindChanges)
{
%prefPath = getPrefpath();
@ -108,8 +223,26 @@ function OptionsMenu::apply(%this)
}
}
if(%hasPostFXChanges)
{
updatePostFXSettings();
}
if(%hasVideoChanges)
{
updateDisplaySettings();
}
if(%hasAudioChanges)
{
updateAudioSettings();
}
//Finally, write our prefs to file
%prefPath = getPrefpath();
export("$pref::*", %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension, false);
OptionsMenu.unappliedChanges.empty();
}
function OptionsMenu::resetToDefaults(%this)
@ -117,77 +250,9 @@ function OptionsMenu::resetToDefaults(%this)
MessageBoxOKCancel("", "This will set the graphical settings back to the auto-detected defaults. Do you wish to continue?", "AutodetectGraphics();", "");
}
function OptionsMenuSettingsList::onChange(%this)
{
%optionName = %this.getRowLabel(%this.getSelectedRow());
%tooltipText = %this.getTooltip(%this.getSelectedRow());
OptionName.setText(%optionName);
OptionDescription.setText(%tooltipText);
return;
OptionsMenuSettingsList.clearOptions();
%currentRowText = %this.getRowLabel(%this.getSelectedRow());
if(%currentRowText $= "Display")
{
populateDisplaySettingsList();
}
else if(%currentRowText $= "Graphics")
{
populateGraphicsSettingsList();
}
else if(%currentRowText $= "Audio")
{
populateAudioSettingsList();
}
else if(%currentRowText $= "Keyboard + Mouse")
{
populateKeyboardMouseSettingsList();
}
else if(%currentRowText $= "Gamepad")
{
populateGamepadSettingsList();
}
}
function OptionsMenu::prevTab(%this)
{
%this.pageTabIndex--;
if(%this.pageTabIndex < 0)
%this.pageTabIndex = 4;
%tabBtn = %this.getTab();
%tabBtn.performClick();
}
function OptionsMenu::nextTab(%this)
{
%this.pageTabIndex++;
if(%this.pageTabIndex > 4)
%this.pageTabIndex = 0;
%tabBtn = %this.getTab();
%tabBtn.performClick();
}
function OptionsMenu::getTab(%this)
{
if(%this.pageTabIndex == 0)
return %this-->DisplayButton;
else if(%this.pageTabIndex == 1)
return %this-->GraphicsButton;
else if(%this.pageTabIndex == 2)
return %this-->AudioButton;
else if(%this.pageTabIndex == 3)
return %this-->KBMButton;
else if(%this.pageTabIndex == 4)
return %this-->GamepadButton;
else
return %this-->DisplayButton;
}
//
//
//
function populateDisplaySettingsList()
{
OptionsMenuSettingsList.clear();
@ -220,7 +285,7 @@ function populateDisplaySettingsList()
trim(%apiList);
OptionsMenuSettingsList.addOptionRow("Display API", %apiList, false, "", true, "The display API used for rendering.", %displayDevice);
OptionsMenuSettingsList.addOptionRow("Display API", "$pref::Video::DisplayAPI", %apiList, false, "", true, "The display API used for rendering.", %displayDevice);
%numDevices = Canvas.getMonitorCount();
%devicesList = "";
@ -234,7 +299,7 @@ function populateDisplaySettingsList()
}
%selectedDevice = getField(%devicesList, $pref::Video::deviceId);
OptionsMenuSettingsList.addOptionRow("Display Device", %devicesList, false, "onDisplayModeChange", true, "The display devices the window should be on.", %selectedDevice);
OptionsMenuSettingsList.addOptionRow("Display Device", "$pref::Video::deviceId", %devicesList, false, "", true, "The display devices the window should be on.", %selectedDevice);
if (%numDevices > 1)
OptionsMenuSettingsList.setRowEnabled(1, true);
@ -242,10 +307,10 @@ function populateDisplaySettingsList()
OptionsMenuSettingsList.setRowEnabled(1, false);
%mode = getField($Video::ModeTags, $pref::Video::deviceMode);
OptionsMenuSettingsList.addOptionRow("Window Mode", $Video::ModeTags, false, "onDisplayModeChange", true, "", %mode);
OptionsMenuSettingsList.addOptionRow("Window Mode", "$pref::Video::deviceMode", $Video::ModeTags, false, "", true, "", %mode);
%resolutionList = getScreenResolutionList($pref::Video::deviceId, $pref::Video::deviceMode);
OptionsMenuSettingsList.addOptionRow("Resolution", %resolutionList, false, "onDisplayResChange", true, "Resolution of the game window", _makePrettyResString( $pref::Video::mode ));
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")
@ -253,20 +318,20 @@ function populateDisplaySettingsList()
else
OptionsMenuSettingsList.setRowEnabled(3, false);
OptionsMenuSettingsList.addOptionRow("VSync", "No\tYes", false, "", true, "", convertBoolToYesNo(!$pref::Video::disableVerticalSync));
OptionsMenuSettingsList.addOptionRow("VSync", "$pref::Video::disableVerticalSync", "No\tYes", false, "", true, "", convertBoolToYesNo(!$pref::Video::disableVerticalSync));
%refreshList = getScreenRefreshList($pref::Video::mode);
OptionsMenuSettingsList.addOptionRow("Refresh Rate", %refreshList, false, "", true, "", $pref::Video::RefreshRate);
OptionsMenuSettingsList.addOptionRow("Refresh Rate", "$pref::Video::RefreshRate", %refreshList, false, "", true, "", $pref::Video::RefreshRate);
//move to gameplay tab
OptionsMenuSettingsList.addSliderRow("Field of View", 75, 5, "65 100", "");
OptionsMenuSettingsList.addSliderRow("Field of View", "", 75, 5, "65 100", "");
OptionsMenuSettingsList.addSliderRow("Brightness", 0.5, 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("Contrast", 0.5, 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("Brightness", "", 0.5, 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("Contrast", "", 0.5, 0.1, "0 1", "");
}
function OptionsMenu::applyDisplaySettings(%this)
/*function OptionsMenu::applyDisplaySettings(%this)
{
%newDevice = OptionsMenuSettingsList.getCurrentOption(0);
@ -285,9 +350,12 @@ function OptionsMenu::applyDisplaySettings(%this)
echo("Exporting client prefs");
%prefPath = getPrefpath();
export("$pref::*", %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension, false);
}
}*/
function populateGraphicsSettingsList(%this)
//
//
//
function populateGraphicsSettingsList()
{
OptionsMenuSettingsList.clear();
@ -299,90 +367,32 @@ function populateGraphicsSettingsList(%this)
%highMedLow = "Low\tMedium\tHigh";
%anisoFilter = "Off\t4\t8\t16";
%aaFilter = "Off\t1\t2\t4";
OptionsMenuSettingsList.addOptionRow("Lighting Quality", getQualityLevels(LightingQualityList), false, "", true, "Amount and drawdistance of local lights", getCurrentQualityLevel(LightingQualityList));
OptionsMenuSettingsList.addOptionRow("Shadow Quality", getQualityLevels(ShadowQualityList), false, "", true, "Shadow revolution quality", getCurrentQualityLevel(ShadowQualityList));
OptionsMenuSettingsList.addOptionRow("Soft Shadow Quality", getQualityLevels(SoftShadowList), false, "", true, "Amount of softening applied to shadowmaps", getCurrentQualityLevel(SoftShadowList));
OptionsMenuSettingsList.addOptionRow("Mesh Quality", getQualityLevels(MeshQualityGroup), false, "", true, "Fidelity of rendering of mesh objects", getCurrentQualityLevel(MeshQualityGroup));
OptionsMenuSettingsList.addOptionRow("Object Draw Distance", getQualityLevels(MeshDrawDistQualityGroup), false, "", true, "Dictates if and when static objects fade out in the distance", getCurrentQualityLevel(MeshDrawDistQualityGroup));
OptionsMenuSettingsList.addOptionRow("Texture Quality", getQualityLevels(TextureQualityGroup), false, "", true, "Fidelity of textures", getCurrentQualityLevel(TextureQualityGroup));
OptionsMenuSettingsList.addOptionRow("Terrain Quality", getQualityLevels(TerrainQualityGroup), false, "", true, "Quality level of terrain objects", getCurrentQualityLevel(TerrainQualityGroup));
OptionsMenuSettingsList.addOptionRow("Decal Lifetime", getQualityLevels(DecalLifetimeGroup), false, "", true, "How long decals are rendered", getCurrentQualityLevel(DecalLifetimeGroup));
OptionsMenuSettingsList.addOptionRow("Ground Cover Density", getQualityLevels(GroundCoverDensityGroup), false, "", true, "Density of ground cover items, such as grass", getCurrentQualityLevel(GroundCoverDensityGroup));
OptionsMenuSettingsList.addOptionRow("Shader Quality", getQualityLevels(ShaderQualityGroup), false, "", true, "Dictates the overall shader quality level, adjusting what features are enabled.", getCurrentQualityLevel(ShaderQualityGroup));
OptionsMenuSettingsList.addOptionRow("Anisotropic Filtering", %anisoFilter, false, "", true, "Amount of Anisotropic Filtering on textures, which dictates their sharpness at a distance", $pref::Video::defaultAnisotropy);
OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", %aaFilter, false, "", true, "Amount of Post-Processing Anti-Aliasing applied to rendering", $pref::Video::AA);
OptionsMenuSettingsList.addOptionRow("Parallax", %onOffList, false, "", true, "Whether the surface parallax shader effect is enabled", convertBoolToOnOff(!$pref::Video::disableParallaxMapping));
OptionsMenuSettingsList.addOptionRow("Water Reflections", %onOffList, false, "", true, "Whether water reflections are enabled", convertBoolToOnOff(!$pref::Water::disableTrueReflections));
OptionsMenuSettingsList.addOptionRow("SSAO", %onOffList, false, "", true, "Whether Screen-Space Ambient Occlusion is enabled", convertBoolToOnOff($pref::PostFX::EnableSSAO));
OptionsMenuSettingsList.addOptionRow("Depth of Field", %onOffList, false, "", true, "Whether the Depth of Field effect is enabled", convertBoolToOnOff($pref::PostFX::EnableDOF));
OptionsMenuSettingsList.addOptionRow("Vignette", %onOffList, false, "", true, "Whether the vignette effect is enabled", convertBoolToOnOff($pref::PostFX::EnableVignette));
OptionsMenuSettingsList.addOptionRow("Light Rays", %onOffList, false, "", true, "Whether the light rays effect is enabled", convertBoolToOnOff($pref::PostFX::EnableLightRays));
OptionsMenuSettingsList.addOptionRow("Lighting Quality", "$pref::Graphics::LightingQuality", getQualityLevels(LightingQualityList), false, "", true, "Amount and drawdistance of local lights", getCurrentQualityLevel(LightingQualityList));
OptionsMenuSettingsList.addOptionRow("Shadow Quality", "$pref::Graphics::ShadowQuality", getQualityLevels(ShadowQualityList), false, "", true, "Shadow revolution quality", getCurrentQualityLevel(ShadowQualityList));
OptionsMenuSettingsList.addOptionRow("Soft Shadow Quality", "$pref::Graphics::SoftShadowQuality", getQualityLevels(SoftShadowList), false, "", true, "Amount of softening applied to shadowmaps", getCurrentQualityLevel(SoftShadowList));
OptionsMenuSettingsList.addOptionRow("Mesh Quality", "$pref::Graphics::MeshQuality", getQualityLevels(MeshQualityGroup), false, "", true, "Fidelity of rendering of mesh objects", getCurrentQualityLevel(MeshQualityGroup));
OptionsMenuSettingsList.addOptionRow("Object Draw Distance", "$pref::Graphics::ObjectDrawDistance", getQualityLevels(MeshDrawDistQualityGroup), false, "", true, "Dictates if and when static objects fade out in the distance", getCurrentQualityLevel(MeshDrawDistQualityGroup));
OptionsMenuSettingsList.addOptionRow("Texture Quality", "$pref::Graphics::TextureQuality", getQualityLevels(TextureQualityGroup), false, "", true, "Fidelity of textures", getCurrentQualityLevel(TextureQualityGroup));
OptionsMenuSettingsList.addOptionRow("Terrain Quality", "$pref::Graphics::TerrainQuality", getQualityLevels(TerrainQualityGroup), false, "", true, "Quality level of terrain objects", getCurrentQualityLevel(TerrainQualityGroup));
OptionsMenuSettingsList.addOptionRow("Decal Lifetime", "$pref::Graphics::DecalLifetime", getQualityLevels(DecalLifetimeGroup), false, "", true, "How long decals are rendered", getCurrentQualityLevel(DecalLifetimeGroup));
OptionsMenuSettingsList.addOptionRow("Ground Cover Density", "$pref::Graphics::GroundCoverDensity", getQualityLevels(GroundCoverDensityGroup), false, "", true, "Density of ground cover items, such as grass", getCurrentQualityLevel(GroundCoverDensityGroup));
OptionsMenuSettingsList.addOptionRow("Shader Quality", "$pref::Graphics::ShaderQuality", getQualityLevels(ShaderQualityGroup), false, "", true, "Dictates the overall shader quality level, adjusting what features are enabled.", getCurrentQualityLevel(ShaderQualityGroup));
OptionsMenuSettingsList.addOptionRow("Anisotropic Filtering", "$pref::Video::defaultAnisotropy", %anisoFilter, false, "", true, "Amount of Anisotropic Filtering on textures, which dictates their sharpness at a distance", $pref::Video::defaultAnisotropy);
OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", "$pref::Video::AA", %aaFilter, false, "", true, "Amount of Post-Processing Anti-Aliasing applied to rendering", $pref::Video::AA);
OptionsMenuSettingsList.addOptionRow("Parallax", "$pref::Video::disableParallaxMapping", %onOffList, false, "", true, "Whether the surface parallax shader effect is enabled", convertBoolToOnOff(!$pref::Video::disableParallaxMapping));
OptionsMenuSettingsList.addOptionRow("Water Reflections", "$pref::Water::disableTrueReflections", %onOffList, false, "", true, "Whether water reflections are enabled", convertBoolToOnOff(!$pref::Water::disableTrueReflections));
OptionsMenuSettingsList.addOptionRow("SSAO", "$pref::PostFX::EnableSSAO", %onOffList, false, "", true, "Whether Screen-Space Ambient Occlusion is enabled", convertBoolToOnOff($pref::PostFX::EnableSSAO));
OptionsMenuSettingsList.addOptionRow("Depth of Field", "$pref::PostFX::EnableDOF", %onOffList, false, "", true, "Whether the Depth of Field effect is enabled", convertBoolToOnOff($pref::PostFX::EnableDOF));
OptionsMenuSettingsList.addOptionRow("Vignette", "$pref::PostFX::EnableVignette", %onOffList, false, "", true, "Whether the vignette effect is enabled", convertBoolToOnOff($pref::PostFX::EnableVignette));
OptionsMenuSettingsList.addOptionRow("Light Rays", "$pref::PostFX::EnableLightRays", %onOffList, false, "", true, "Whether the light rays effect is enabled", convertBoolToOnOff($pref::PostFX::EnableLightRays));
}
function OptionsMenu::applyGraphicsSettings(%this)
{
LightingQualityList.applySetting(OptionsMenuSettingsList.getCurrentOption(0));
ShadowQualityList.applySetting(OptionsMenuSettingsList.getCurrentOption(1));
SoftShadowList.applySetting(OptionsMenuSettingsList.getCurrentOption(2));
MeshQualityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(3));
MeshDrawDistQualityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(4));
TextureQualityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(5));
TerrainQualityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(6));
DecalLifetimeGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(7));
GroundCoverDensityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(8));
ShaderQualityGroup.applySetting(OptionsMenuSettingsList.getCurrentOption(9));
//Update Textures
reloadTextures();
//Update lighting
// Set the light manager. This should do nothing
// if its already set or if its not compatible.
//setLightManager( $pref::lightManager );
$pref::PostFX::EnableSSAO = convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(14));
$pref::PostFX::EnableDOF = convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(15));
$pref::PostFX::EnableVignette = convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(16));
$pref::PostFX::EnableLightRays = convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(17));
PostFXManager.settingsEffectSetEnabled(SSAOPostFx, $pref::PostFX::EnableSSAO);
PostFXManager.settingsEffectSetEnabled(DOFPostEffect, $pref::PostFX::EnableDOF);
PostFXManager.settingsEffectSetEnabled(LightRayPostFX, $pref::PostFX::EnableLightRays);
PostFXManager.settingsEffectSetEnabled(vignettePostFX, $pref::PostFX::EnableVignette);
$pref::Video::disableParallaxMapping = !convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(12));
//water reflections
$pref::Water::disableTrueReflections = !convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(13));
// Check the anisotropic filtering.
%level = OptionsMenuSettingsList.getCurrentOption(10);
if ( %level != $pref::Video::defaultAnisotropy )
{
$pref::Video::defaultAnisotropy = %level;
}
%newFSAA = OptionsMenuSettingsList.getCurrentOption(11);
if (%newFSAA $= "off")
%newFSAA = 0;
if (%newFSAA !$= $pref::Video::AA)
{
$pref::Video::AA = %newFSAA;
configureCanvas();
}
echo("Exporting client prefs");
%prefPath = getPrefpath();
export("$pref::*", %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension, false);
}
function updateDisplaySettings()
{
//Update the display settings now
%deviceName = OptionsMenuSettingsList.getCurrentOption(1);
%deviceName = getDisplayDeviceName();
%newDeviceID = getWord(%deviceName, 0) - 1;
%deviceModeName = OptionsMenuSettingsList.getCurrentOption(2);
%deviceModeName = getField($Video::ModeTags, $pref::Video::deviceMode);
%newDeviceMode = 0;
foreach$(%modeName in $Video::ModeTags)
{
@ -392,15 +402,15 @@ function updateDisplaySettings()
%newDeviceMode++;
}
%newRes = getWord(OptionsMenuSettingsList.getCurrentOption(3), 0) SPC getWord(OptionsMenuSettingsList.getCurrentOption(3), 2);
%newRes = $pref::Video::Resolution;
%newBpp = 32; // ... its not 1997 anymore.
%newFullScreen = %deviceModeName $= "Fullscreen" ? true : false;
%newRefresh = OptionsMenuSettingsList.getCurrentOption(5);
%newVsync = !convertOptionToBool(OptionsMenuSettingsList.getCurrentOption(4));
%newRefresh = $pref::Video::RefreshRate;
%newVsync = !$pref::Video::disableVerticalSync;
%newFSAA = $pref::Video::AA;
// Build the final mode string.
%newMode = %newRes SPC %newFullScreen SPC %newBpp SPC %newRefresh SPC %newFSAA;
%newMode = $pref::Video::Resolution SPC %newFullScreen SPC %newBpp SPC %newRefresh SPC %newFSAA;
// Change the video mode.
if ( %newMode !$= $pref::Video::mode || %newDeviceID != $pref::Video::deviceId ||
@ -433,7 +443,18 @@ function updateDisplaySettings()
}
}
function populateAudioSettingsList(%this)
function updatePostFXSettings()
{
PostFXManager.settingsEffectSetEnabled(SSAOPostFx, $pref::PostFX::EnableSSAO);
PostFXManager.settingsEffectSetEnabled(DOFPostEffect, $pref::PostFX::EnableDOF);
PostFXManager.settingsEffectSetEnabled(LightRayPostFX, $pref::PostFX::EnableLightRays);
PostFXManager.settingsEffectSetEnabled(vignettePostFX, $pref::PostFX::EnableVignette);
}
//
//
//
function populateAudioSettingsList()
{
OptionsMenuSettingsList.clear();
@ -472,13 +493,13 @@ function populateAudioSettingsList(%this)
}
}
OptionsMenuSettingsList.addOptionRow("Audio Provider", %audioProviderList, false, "audioProviderChanged", true, "", $currentAudioProvider);
OptionsMenuSettingsList.addOptionRow("Audio Device", %audioDeviceList, false, "", true, $pref::SFX::device);
OptionsMenuSettingsList.addOptionRow("Audio Provider", "$pref::SFX::AudioProvider", %audioProviderList, false, "audioProviderChanged", true, "", $currentAudioProvider);
OptionsMenuSettingsList.addOptionRow("Audio Device", "$pref::SFX::device", %audioDeviceList, false, "", true, $pref::SFX::device);
OptionsMenuSettingsList.addSliderRow("Master Volume", $pref::SFX::masterVolume, 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("GUI Volume", $pref::SFX::channelVolume[ $GuiAudioType], 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("Effects Volume", $pref::SFX::channelVolume[ $SimAudioType ], 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("Music Volume", $pref::SFX::channelVolume[ $MusicAudioType ], 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("Master Volume", "$pref::SFX::masterVolume", $pref::SFX::masterVolume, 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("GUI Volume", "$pref::SFX::channelVolume[ $GuiAudioType]", $pref::SFX::channelVolume[ $GuiAudioType], 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("Effects Volume", "$pref::SFX::channelVolume[ $SimAudioType ]", $pref::SFX::channelVolume[ $SimAudioType ], 0.1, "0 1", "");
OptionsMenuSettingsList.addSliderRow("Music Volume", "$pref::SFX::channelVolume[ $MusicAudioType ]", $pref::SFX::channelVolume[ $MusicAudioType ], 0.1, "0 1", "");
}
function audioProviderChanged()
@ -491,21 +512,21 @@ function audioProviderChanged()
populateAudioSettingsList();
}
function OptionsMenu::applyAudioSettings(%this)
function updateAudioSettings()
{
$pref::SFX::masterVolume = OptionsMenuSettingsList.getValue(2);
//$pref::SFX::masterVolume = OptionsMenuSettingsList.getValue(2);
sfxSetMasterVolume( $pref::SFX::masterVolume );
$pref::SFX::channelVolume[ $GuiAudioType ] = OptionsMenuSettingsList.getValue(3);
$pref::SFX::channelVolume[ $SimAudioType ] = OptionsMenuSettingsList.getValue(4);
$pref::SFX::channelVolume[ $MusicAudioType ] = OptionsMenuSettingsList.getValue(5);
//$pref::SFX::channelVolume[ $GuiAudioType ] = OptionsMenuSettingsList.getValue(3);
//$pref::SFX::channelVolume[ $SimAudioType ] = OptionsMenuSettingsList.getValue(4);
//$pref::SFX::channelVolume[ $MusicAudioType ] = OptionsMenuSettingsList.getValue(5);
sfxSetChannelVolume( $GuiAudioType, $pref::SFX::channelVolume[ $GuiAudioType ] );
sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ $SimAudioType ] );
sfxSetChannelVolume( $MusicAudioType, $pref::SFX::channelVolume[ $MusicAudioType ] );
$pref::SFX::provider = OptionsMenuSettingsList.getCurrentOption(0);
$pref::SFX::device = OptionsMenuSettingsList.getCurrentOption(1);
//$pref::SFX::provider = OptionsMenuSettingsList.getCurrentOption(0);
//$pref::SFX::device = OptionsMenuSettingsList.getCurrentOption(1);
if ( !sfxCreateDevice( $pref::SFX::provider,
$pref::SFX::device,
@ -521,7 +542,10 @@ function OptionsMenu::applyAudioSettings(%this)
}
}
function populateKeyboardMouseSettingsList(%this)
//
//
//
function populateKeyboardMouseSettingsList()
{
OptionsMenuSettingsList.clear();
@ -534,7 +558,7 @@ function populateKeyboardMouseSettingsList(%this)
//OptionsMenuSettingsList.refresh();
}
function populateGamepadSettingsList(%this)
function populateGamepadSettingsList()
{
OptionsMenuSettingsList.clear();
@ -544,15 +568,30 @@ function populateGamepadSettingsList(%this)
$remapListDevice = "gamepad";
fillRemapList();
OptionsMenuSettingsList.refresh();
OptionsMenuSettingsList.updateStack();
}
//
//
//
function OptionsMenuList::activateRow(%this)
{
OptionsMenuSettingsList.setFirstResponder();
}
function OptionsMenu::backOut(%this)
{
if(%this.unappliedChanges.count() != 0)
{
MessageBoxOKCancel("Discard Changes?", "You have unapplied changes to your settings, do you wish to continue?", "OptionsMenu.doOptionsMenuBackOut();", "");
}
else
{
%this.doOptionsMenuBackOut();
}
}
function OptionsMenu::doOptionsMenuBackOut(%this)
{
//save the settings and then back out
if(OptionsMain.hidden == false)
@ -583,7 +622,7 @@ function OptionsMenuSettingsList::setRowEnabled(%this, %row, %status)
}
}
function OptionsMenuSettingsList::addOptionRow(%this, %label, %optionsList, %wrapOptions, %callback, %enabled, %description, %defaultValue)
function OptionsMenuSettingsList::addOptionRow(%this, %label, %targetPrefVar, %optionsList, %wrapOptions, %callback, %enabled, %description, %defaultValue)
{
if(%enabled $= "")
%enabled = true;
@ -600,14 +639,27 @@ function OptionsMenuSettingsList::addOptionRow(%this, %label, %optionsList, %wra
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
//now some override trickery, if we have a value cached for unapplied changes, swapsies the defaultValue out
//with the unapplied, allowing us to change options categories without losing changes
%unappliedPrefIndex = OptionsMenu.unappliedChanges.getIndexFromValue(%targetPrefVar);
if(%unappliedPrefIndex != -1)
{
%unappliedValue = OptionsMenu.unappliedChanges.getValue(%unappliedPrefIndex);
%defaultValue = %unappliedValue;
}
%option.setListSetting(%label, %optionsList, %wrapOptions, %callback, %enabled, %description, %defaultValue);
%this.add(%option);
}
function OptionsMenuSettingsList::addSliderRow(%this, %label, %defaultValue, %increment, %range, %callback, %enabled, %description)
function OptionsMenuSettingsList::addSliderRow(%this, %label, %targetPrefVar, %defaultValue, %increment, %range, %callback, %enabled, %description)
{
if(%enabled $= "")
%enabled = true;
@ -626,11 +678,46 @@ function OptionsMenuSettingsList::addSliderRow(%this, %label, %defaultValue, %in
useMouseEvents = true;
};
%option.targetPrefVar = %targetPrefVar; //create a var-option association
//now some override trickery, if we have a value cached for unapplied changes, swapsies the defaultValue out
//with the unapplied, allowing us to change options categories without losing changes
%unappliedPrefIndex = OptionsMenu.unappliedChanges.getIndexFromValue(%targetPrefVar);
if(%unappliedPrefIndex != -1)
{
%unappliedValue = OptionsMenu.unappliedChanges.getValue(%unappliedPrefIndex);
%defaultValue = %unappliedValue;
}
%option.setSliderSetting(%label, %defaultValue, %increment, %range, %callback, %enabled, %description);
%this.add(%option);
}
function OptionsMenuSettingsList::addKeybindRow(%this, %label, %bitmapName, %callback, %enabled, %description)
{
if(%enabled $= "")
%enabled = true;
%optionsRowSize = 40;
%optionColumnWidth = %this.extent.x - 450;
%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.setKeybindSetting(%label, %bitmapName, %callback, %enabled, %description);
%this.add(%option);
}
//
function OptionsMenuCategoryList::onNavigate(%this, %index)
{
@ -738,6 +825,24 @@ function onDisplayResChange(%val)
OptionsMenuSettingsList.selectOption(5, %newRate);
}
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)
{
OptionName.setText(%this.getLabel());
@ -748,4 +853,84 @@ function MenuOptionsButton::onMouseLeave(%this)
{
OptionName.setText("");
OptionDescription.setText("");
}
}
function MenuOptionsButton::onChange(%this)
{
%optionMode = %this.getMode();
%optionName = %this.getLabel();
%tooltipText = %this.getTooltip();
%targetVar = %this.targetPrefVar;
OptionName.setText(%optionName);
OptionDescription.setText(%tooltipText);
%currentValue = %this.getCurrentOption();
if(%currentValue !$= "")
{
if(%currentValue $= "yes" || %currentValue $= "on")
%saveReadyValue = 1;
else if(%currentValue $= "no" || %currentValue $= "off")
%saveReadyValue = 0;
else
%saveReadyValue = %currentValue;
%prefIndex = OptionsMenu.unappliedChanges.getIndexFromKey(%targetVar);
if(%prefIndex == -1)
OptionsMenu.unappliedChanges.add(%targetVar, %saveReadyValue);
else
OptionsMenu.unappliedChanges.setValue(%saveReadyValue, %prefIndex);
}
}
function OptionsMenu::onKeybindChanged(%this, %actionMap, %keybind)
{
%prefIndex = OptionsMenu.unappliedChanges.getIndexFromKey(%actionMap);
if(%prefIndex == -1)
OptionsMenu.unappliedChanges.add(%actionMap, %keybind);
else
OptionsMenu.unappliedChanges.setValue(%keybind, %prefIndex);
}
//
// Indicates what category the options item should be added into
//
function addOptionsMenuCategory(%categoryName, %selectCallback)
{
OptionsMenu.optionsCategories.add(%categoryName, %selectCallback);
}
function removeOptionsMenuCategory(%categoryName)
{
%index = OptionsMenu.optionsCategories.getIndexFromKey(%categoryName);
if(%index != -1)
OptionsMenu.optionsCategories.erase(%index);
}
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);
}

View file

@ -49,25 +49,31 @@ $guiContent = new GuiControl(PauseMenu) {
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiGameListMenuCtrl(PauseMenuList) {
debugRender = "0";
callbackOnInputs = "1";
consumeKeyInputEvents = "1";
new GuiStackControl(PauseMenuList) {
stackingType = "Vertical";
horizStacking = "Left to Right";
vertStacking = "Top to Bottom";
padding = "15";
dynamicSize = "0";
dynamicNonStackExtent = "0";
dynamicPos = "0";
changeChildSizeToFit = "1";
changeChildPosition = "1";
position = "0 0";
extent = "700 320";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "DefaultListMenuProfile";
minExtent = "16 16";
horizSizing = "center";
vertSizing = "center";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
class = "UIMenuButtonList";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
class = "MenuList";
};
};
new GuiControl(PauseButtonHolder) {
@ -147,5 +153,26 @@ $guiContent = new GuiControl(PauseMenu) {
canSaveDynamicFields = "0";
};
};
new GuiInputCtrl(PauseMenuInputHandler) {
class = "MenuInputHandler";
sendAxisEvents = "1";
sendBreakEvents = "1";
sendModifierEvents = "0";
ignoreMouseEvents = "1";
lockMouse = "0";
position = "-50 0";
extent = "10 10";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "GuiInputCtrlProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
//--- OBJECT WRITE END ---

View file

@ -8,19 +8,21 @@ function PauseMenu::onWake(%this)
}
PauseMenuList.hidden = false;
PauseMenuList.setFirstResponder();
PauseButtonHolder.setActive();
PauseMenuList.clearRows();
PauseMenuList.clear();
if($Tools::loaded && EditorIsActive())
{
PauseMenuList.addRow("Exit Editor", "fastLoadWorldEdit", -1, -30);
%this.addPauseMenuButton("Exit Editor", "fastLoadWorldEdit();");
}
PauseMenuList.addRow("Options", "openPauseMenuOptions", -1, -30);
PauseMenuList.addRow("Exit to Menu", "pauseMenuExitToMenu", -1, -30);
PauseMenuList.addRow("Exit to Desktop", "pauseMenuExitToDesktop", -1, -30);
%this.addPauseMenuButton("Options", "openPauseMenuOptions();");
%this.addPauseMenuButton("Exit to Menu", "pauseMenuExitToMenu();");
%this.addPauseMenuButton("Exit to Desktop", "pauseMenuExitToDesktop();");
PauseMenuList.setAsActiveMenuList();
PauseButtonHolder.setActive();
PauseMenuInputHandler.setFirstResponder();
}
@ -36,8 +38,9 @@ function PauseMenu::onSleep(%this)
function PauseMenu::onReturnTo(%this)
{
PauseMenuList.hidden = false;
PauseMenuList.setFirstResponder();
PauseMenuList.setAsActiveMenuList();
PauseButtonHolder.setActive();
PauseMenuInputHandler.setFirstResponder();
}
function openPauseMenuOptions()
@ -61,6 +64,32 @@ function pauseMenuExitToDesktop()
function PauseButtonHolder::onWake(%this)
{
%this-->goButton.set("btn_a", "Return", "OK", "PauseMenuList.activateRow();", true);
%this-->goButton.set("btn_a", "Return", "OK", "PauseMenuList.activate();", true);
%this-->backButton.set("btn_b", "Escape", "Back", "Canvas.popDialog();");
}
}
function PauseMenu::addPauseMenuButton(%this, %buttonText, %buttonCallback)
{
%newButton = new GuiButtonCtrl() {
text = %buttonText;
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 0";
extent = "400 55";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = %buttonCallback;
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
PauseMenuList.add(%newButton);
}

View file

@ -363,4 +363,4 @@ function metrics( %expr )
}
else
$GameCanvas.popDialog(FrameOverlayGui);
}
}

View file

@ -1,7 +1,4 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="recordingsDlg"
scriptFile="@assetFile=RecordingsDlg.gui"
GUIFile="@assetFile=RecordingsDlg.gui"
VersionId="1" />
VersionId="1"/>

View file

@ -35,7 +35,7 @@ $guiContent = new GuiFadeinBitmapCtrl(StartupGui) {
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
bitmap = "";
bitmapAsset = "";
wrap = "0";
command = "StartupGui.click();";
};
@ -54,7 +54,7 @@ $guiContent = new GuiFadeinBitmapCtrl(StartupGui) {
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
bitmap = "";
bitmapAsset = "";
wrap = "0";
command = "StartupGui.click();";
};

View file

@ -32,7 +32,7 @@ function loadStartup()
// A list of the splash screens and logos
// to cycle through. Note that they have to
// be in consecutive numerical order
StartupGui.bitmap[0] = "UI:background_dark_image";
StartupGui.bitmap[0] = "UI:backgrounddark_image";
StartupGui.logo[0] = "UI:Torque_3D_logo_alt_image";
StartupGui.logoPos[0] = "178 251";
StartupGui.logoExtent[0] = "443 139";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="Torque_3D_logo_alt_image"
imageFile="@assetFile=Torque-3D-logo_alt.png"
imageFile="@assetFile=Torque_3D_logo_alt.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="Torque_3D_logo_image"
imageFile="@assetFile=Torque-3D-logo.png"
imageFile="@assetFile=Torque_3D_logo.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="Torque_3D_logo_shortcut_image"
imageFile="@assetFile=Torque-3D-logo-shortcut.png"
imageFile="@assetFile=Torque_3D_logo_shortcut.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

View file

@ -2,7 +2,7 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="Torque_3D_logo_w_image"
imageFile="@assetFile=Torque-3D-logo-w.png"
imageFile="@assetFile=Torque_3D_logo_w.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

View file

@ -1,8 +0,0 @@
<ImageAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="background_dark_image"
imageFile="@assetFile=background-dark.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 B

View file

@ -1,8 +0,0 @@
<ImageAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="slider___Copy_image"
imageFile="@assetFile=slider - Copy.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -130,7 +130,7 @@ function fillRemapList()
{
%device = $remapListDevice;
OptionsMenuSettingsList.clearRows();
OptionsMenuSettingsList.clear();
//build out our list of action maps
%actionMapCount = ActionMapGroup.getCount();
@ -158,7 +158,7 @@ function fillRemapList()
if($activeRemapControlSet $= "")
$activeRemapControlSet = getField(%actionMapList, 0);
OptionsMenuSettingsList.addOptionRow("Control Set", %actionMapList, false, "controlSetChanged", -1, -30, true, "Which keybind control set to edit", $activeRemapControlSet);
OptionsMenuSettingsList.addOptionRow("Control Set", "$activeRemapControlSet", %actionMapList, false, "controlSetChanged", true, "Which keybind control set to edit", $activeRemapControlSet);
for ( %i = 0; %i < $RemapCount; %i++ )
{
@ -173,7 +173,9 @@ function fillRemapList()
%keyMap = buildFullMapString( %i, $RemapActionMap[%i], %device );
%description = $RemapDescription[%i];
OptionsMenuSettingsList.addKeybindRow(getField(%keyMap, 0), getButtonBitmap(%device, getField(%keyMap, 1)), "doKeyRemap", -1, -15, true, %description);
%buttonImageAsset = getButtonBitmap(%device, getField(%keyMap, 1));
OptionsMenuSettingsList.addKeybindRow(getField(%keyMap, 0), %buttonImageAsset, "doKeyRemap", true, %description);
}
//OptionsMenuSettingsList.refresh();
@ -182,7 +184,7 @@ function fillRemapList()
function controlSetChanged()
{
$activeRemapControlSet = OptionsMenuSettingsList.getCurrentOption(0);
$activeRemapControlSet = OptionsMenuSettingsList.getCurrentOption();
fillRemapList();
}
@ -194,6 +196,11 @@ function doKeyRemap( %rowIndex )
RemapDlg-->OptRemapText.setValue( "Re-bind \"" @ %name @ "\" to..." );
OptRemapInputCtrl.index = %rowIndex;
Canvas.pushDialog( RemapDlg );
//Let the options menu know
%actionMap = $RemapActionMap[%rowIndex];
OptionsMenu.onKeybindChanged(%actionMap, %name);
}
function ControlsMenuRebindButton::onClick(%this)
@ -327,4 +334,4 @@ function redoMapping( %device, %actionMap, %action, %cmd, %oldIndex, %newIndex )
%actionMap.bind( %device, %action, %cmd );
fillRemapList();
}
}

View file

@ -37,4 +37,4 @@ else
renderOffset = "0 0";
bitmapName = "data/ui/images/defaultCursor";
};
}
}

View file

@ -10,117 +10,123 @@ function getButtonBitmap(%device, %button)
%device = "Xbox";
}
%path = "";
%assetId = "";
if(%device $= "PS4")
{
%path = "data/ui/images/inputs/PS4/PS4_";
%assetId = "UI:PS4_";
if(%button $= "A" || %button $= "btn_a")
%path = %path @ "Cross";
%assetId = %assetId @ "Cross";
else if(%button $= "B" || %button $= "btn_b")
%path = %path @ "Circle";
%assetId = %assetId @ "Circle";
else if(%button $= "X" || %button $= "btn_x")
%path = %path @ "Square";
%assetId = %assetId @ "Square";
else if(%button $= "Y" || %button $= "btn_y")
%path = %path @ "Triangle";
%assetId = %assetId @ "Triangle";
else if(%button $= "LB")
%path = %path @ "L1";
%assetId = %assetId @ "L1";
else if(%button $= "LT")
%path = %path @ "L2";
%assetId = %assetId @ "L2";
else if(%button $= "RB")
%path = %path @ "R1";
%assetId = %assetId @ "R1";
else if(%button $= "RT")
%path = %path @ "R2";
%assetId = %assetId @ "R2";
else if(%button $= "thumbrx" || %button $= "thumbry")
%path = %path @ "Right_Stick";
%assetId = %assetId @ "Right_Stick";
else if(%button $= "thumblx" || %button $= "thumbly")
%path = %path @ "Left_Stick";
%assetId = %assetId @ "Left_Stick";
else if(%button $= "start")
%path = %path @ "Options";
%assetId = %assetId @ "Options";
else if(%button $= "back")
%path = %path @ "Share";
%assetId = %assetId @ "Share";
else if(%button $= "dpadu")
%path = %path @ "Dpad_Up";
%assetId = %assetId @ "Dpad_Up";
else if(%button $= "dpadd")
%path = %path @ "Dpad_Down";
%assetId = %assetId @ "Dpad_Down";
else if(%button $= "dpadl")
%path = %path @ "Dpad_Left";
%assetId = %assetId @ "Dpad_Left";
else if(%button $= "dpadr")
%path = %path @ "Dpad_Right";
%assetId = %assetId @ "Dpad_Right";
%assetId = %assetId @ "_image";
}
else if(%device $= "Switch")
{
%path = "data/ui/images/inputs/Switch/Switch_";
%assetId = "UI:Switch_";
if(%button $= "A" || %button $= "btn_a")
%path = %path @ "B";
%assetId = %assetId @ "B";
else if(%button $= "B" || %button $= "btn_b")
%path = %path @ "A";
%assetId = %assetId @ "A";
else if(%button $= "X" || %button $= "btn_x")
%path = %path @ "Y";
%assetId = %assetId @ "Y";
else if(%button $= "Y" || %button $= "btn_y")
%path = %path @ "X";
%assetId = %assetId @ "X";
else if(%button $= "LB")
%path = %path @ "LB";
%assetId = %assetId @ "LB";
else if(%button $= "LT")
%path = %path @ "LT";
%assetId = %assetId @ "LT";
else if(%button $= "RB")
%path = %path @ "RB";
%assetId = %assetId @ "RB";
else if(%button $= "RT")
%path = %path @ "RT";
%assetId = %assetId @ "RT";
else if(%button $= "thumbrx" || %button $= "thumbry")
%path = %path @ "Right_Stick";
%assetId = %assetId @ "Right_Stick";
else if(%button $= "thumblx" || %button $= "thumbly")
%path = %path @ "Left_Stick";
%assetId = %assetId @ "Left_Stick";
else if(%button $= "start")
%path = %path @ "Plus";
%assetId = %assetId @ "Plus";
else if(%button $= "back")
%path = %path @ "Minus";
%assetId = %assetId @ "Minus";
else if(%button $= "dpadu")
%path = %path @ "Dpad_Up";
%assetId = %assetId @ "Dpad_Up";
else if(%button $= "dpadd")
%path = %path @ "Dpad_Down";
%assetId = %assetId @ "Dpad_Down";
else if(%button $= "dpadl")
%path = %path @ "Dpad_Left";
%assetId = %assetId @ "Dpad_Left";
else if(%button $= "dpadr")
%path = %path @ "Dpad_Right";
%assetId = %assetId @ "Dpad_Right";
%assetId = %assetId @ "_image";
}
else if(%device $= "Keyboard" || %device $= "Mouse")
{
%pathBase = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_";
%path = %pathBase @ %button @ ".png";
if(!isFile(%path))
%path = %pathBase @ "Blank";
%assetId = "UI:Keyboard_Black_" @ %button @ "_image";
}
else if(%device !$= "")
{
%path = "data/ui/images/inputs/Xbox/Xbox_";
%assetId = "UI:Xbox_";
if(%button $= "btn_a")
%path = %path @ "B";
%assetId = %assetId @ "B";
else if(%button $= "btn_b")
%path = %path @ "A";
%assetId = %assetId @ "A";
else if(%button $= "btn_x")
%path = %path @ "Y";
%assetId = %assetId @ "Y";
else if(%button $= "btn_y")
%path = %path @ "X";
%assetId = %assetId @ "X";
else if(%button $= "thumbrx" || %button $= "thumbry")
%path = %path @ "Right_Stick";
%assetId = %assetId @ "Right_Stick";
else if(%button $= "thumblx" || %button $= "thumbly")
%path = %path @ "Left_Stick";
%assetId = %assetId @ "Left_Stick";
else if(%button $= "start")
%path = %path @ "Menu";
%assetId = %assetId @ "Menu";
else if(%button $= "back")
%path = %path @ "Windows";
%assetId = %assetId @ "Windows";
else if(%button $= "dpadu")
%path = %path @ "Dpad_Up";
%assetId = %assetId @ "Dpad_Up";
else if(%button $= "dpadd")
%path = %path @ "Dpad_Down";
%assetId = %assetId @ "Dpad_Down";
else if(%button $= "dpadl")
%path = %path @ "Dpad_Left";
%assetId = %assetId @ "Dpad_Left";
else if(%button $= "dpadr")
%path = %path @ "Dpad_Right";
%assetId = %assetId @ "Dpad_Right";
%assetId = %assetId @ "_image";
}
return %path;
}
if(!AssetDatabase.isDeclaredAsset(%assetId))
%assetId = "UI:Keyboard_Black_Blank_image";
return %assetId;
}

View file

@ -1743,7 +1743,9 @@ function beginGUIImport()
DirectoryHandler::createFolder(0, filePath(%destinationPath));
}
if(!pathCopy(%file, %destinationPath, false))
//Check if we need to even copy in the first place. If we do, ensure
//the copy actually worked
if((makeRelativePath(%file) !$= %destinationPath) && !pathCopy(%file, %destinationPath, false))
{
projectImporterLog("ProjectImporter::beginGUIImport() - failed to copy GUI: " @ %file @
" to destination: " @ %destinationPath);
@ -1779,9 +1781,9 @@ function processGUIntoAsset(%guiName, %file)
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%scriptFile = "";
if(isImportingFile(%filePath @ "/" @ %fileName @ ".tscript"))
if(isImportingFile(makeFullPath(%filePath @ "/" @ %fileName @ "." @ $TorqueScriptFileExtension)))
{
%scriptFile = %fileName @ ".tscript";
%scriptFile = %fileName;
}
%asset = new GUIAsset()