mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-20 20:05:33 +00:00
Implementation of Subscenes, SceneGroups and Gamemodes
Standardizes Gamemodes to be an actual class with data and utility functions that can be parsed Adds inspector field handling for selecting gamemodes Updated Scene class to work with Gamemodes for the gamemode field Updates editor suite elements to be able to create SubScenes, SceneGroups and Gamemodes Adds ability to convert SimGroup to SubScene Updates BaseUI's chooselevel menu to have gamemode selection and filters shown levels based on selected gamemode
This commit is contained in:
parent
0d07823ecd
commit
ae8eca48e1
36 changed files with 2963 additions and 173 deletions
|
|
@ -99,4 +99,9 @@ function UI::onDestroyClientConnection(%this)
|
|||
function UI::registerGameMenus(%this, %menusArrayObj)
|
||||
{
|
||||
%menusArrayObj.add("System", SystemMenu);
|
||||
}
|
||||
|
||||
function listLevelsAndGameModes()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
|
|||
tooltipProfile = "GuiToolTipProfile";
|
||||
isContainer = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
currentMenuIdx = "0";
|
||||
launchInEditor = "0";
|
||||
previewButtonSize = "445 120";
|
||||
|
||||
|
|
@ -39,31 +40,42 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
|
|||
new GuiStackControl(ChooseLevelMenuTabList) {
|
||||
stackingType = "Horizontal";
|
||||
padding = "10";
|
||||
position = "485 61";
|
||||
extent = "310 41";
|
||||
position = "405 61";
|
||||
extent = "470 41";
|
||||
horizSizing = "center";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "0";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hidden = "1";
|
||||
|
||||
new GuiButtonCtrl() {
|
||||
text = "Level";
|
||||
text = "Game Mode";
|
||||
groupNum = "1";
|
||||
extent = "150 41";
|
||||
profile = "GuiMenuButtonProfile";
|
||||
command = "ChooseLevelMenu.openMenu(0);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
internalName = "GameModeBtn";
|
||||
class = "ChooseLevelMenuButton";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Server Config";
|
||||
text = "Level";
|
||||
groupNum = "1";
|
||||
position = "160 0";
|
||||
extent = "150 41";
|
||||
profile = "GuiMenuButtonProfile";
|
||||
command = "ChooseLevelMenu.openMenu(1);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
internalName = "LevelBtn";
|
||||
class = "ChooseLevelMenuButton";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Server Config";
|
||||
groupNum = "1";
|
||||
position = "320 0";
|
||||
extent = "150 41";
|
||||
profile = "GuiMenuButtonProfile";
|
||||
command = "ChooseLevelMenu.openMenu(2);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
internalName = "ConfigBtn";
|
||||
class = "ChooseLevelMenuButton";
|
||||
};
|
||||
};
|
||||
|
|
@ -72,14 +84,12 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
|
|||
extent = "1281 60";
|
||||
horizSizing = "width";
|
||||
profile = "GuiNonModalDefaultProfile";
|
||||
visible = "0";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
isContainer = "1";
|
||||
hidden = "1";
|
||||
|
||||
new GuiBitmapCtrl(ChooseLevelMenuPrevNavIcon) {
|
||||
BitmapAsset = "UI:Keyboard_Black_Q_image";
|
||||
position = "485 24";
|
||||
position = "405 24";
|
||||
extent = "40 40";
|
||||
vertSizing = "top";
|
||||
profile = "GuiNonModalDefaultProfile";
|
||||
|
|
@ -87,19 +97,72 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
|
|||
};
|
||||
new GuiBitmapCtrl(ChooseLevelMenuNextNavIcon) {
|
||||
BitmapAsset = "UI:Keyboard_Black_E_image";
|
||||
position = "595 24";
|
||||
position = "515 24";
|
||||
extent = "40 40";
|
||||
vertSizing = "top";
|
||||
profile = "GuiNonModalDefaultProfile";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
};
|
||||
new GuiContainer(GameModeSelectContainer) {
|
||||
position = "196 119";
|
||||
extent = "888 566";
|
||||
horizSizing = "center";
|
||||
profile = "GuiNonModalDefaultProfile";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
|
||||
new GuiScrollCtrl(GameModePreviewScroll) {
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
extent = "445 562";
|
||||
vertSizing = "height";
|
||||
profile = "GuiMenuScrollProfile";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
|
||||
new GuiStackControl(GameModePreviewArray) {
|
||||
padding = "5";
|
||||
position = "0 1";
|
||||
extent = "445 120";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "GuiMenuDefaultProfile";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
};
|
||||
new GuiBitmapCtrl(GameModePreviewBitmap) {
|
||||
BitmapAsset = "UI:no_preview_image";
|
||||
position = "448 0";
|
||||
extent = "440 440";
|
||||
horizSizing = "left";
|
||||
profile = "GuiNonModalDefaultProfile";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
new GuiTextCtrl(GameModeNameText) {
|
||||
text = "Example Level";
|
||||
position = "448 445";
|
||||
extent = "440 20";
|
||||
horizSizing = "left";
|
||||
profile = "MenuSubHeaderText";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
internalName = "GameModeNameTxt";
|
||||
};
|
||||
new GuiMLTextCtrl(GameModeDescriptionText) {
|
||||
position = "448 473";
|
||||
extent = "440 19";
|
||||
horizSizing = "left";
|
||||
profile = "GuiMLTextProfile";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
internalName = "GameModeDescTxt";
|
||||
};
|
||||
};
|
||||
new GuiContainer(LevelSelectContainer) {
|
||||
position = "196 119";
|
||||
extent = "888 566";
|
||||
horizSizing = "center";
|
||||
profile = "GuiNonModalDefaultProfile";
|
||||
visible = "0";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hidden = "1";
|
||||
|
||||
new GuiScrollCtrl(LevelPreviewScroll) {
|
||||
hScrollBar = "alwaysOff";
|
||||
|
|
@ -120,7 +183,7 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
|
|||
};
|
||||
};
|
||||
new GuiBitmapCtrl(LevelPreviewBitmap) {
|
||||
BitmapAsset = "";
|
||||
BitmapAsset = "UI:no_preview_image";
|
||||
position = "448 0";
|
||||
extent = "440 440";
|
||||
horizSizing = "left";
|
||||
|
|
@ -128,7 +191,7 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
|
|||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
new GuiTextCtrl(LevelNameText) {
|
||||
text = "";
|
||||
text = "Example Level";
|
||||
position = "448 445";
|
||||
extent = "440 20";
|
||||
horizSizing = "left";
|
||||
|
|
@ -214,7 +277,6 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
|
|||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
new GuiTextEditCtrl(serverNameCTRL) {
|
||||
text = "";
|
||||
position = "606 4";
|
||||
extent = "295 22";
|
||||
horizSizing = "left";
|
||||
|
|
@ -240,7 +302,6 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
|
|||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
new GuiTextEditCtrl(serverPassCTRL) {
|
||||
text = "";
|
||||
position = "606 4";
|
||||
extent = "295 22";
|
||||
horizSizing = "left";
|
||||
|
|
@ -314,7 +375,7 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
|
|||
tooltipProfile = "GuiToolTipProfile";
|
||||
|
||||
new GuiIconButtonCtrl(ChooseLevelStartBtn) {
|
||||
BitmapAsset = "UI:Keyboard_Black_Return_image";
|
||||
BitmapAsset = "UI:Keyboard_Black_Space_image";
|
||||
sizeIconToButton = "1";
|
||||
makeIconSquare = "1";
|
||||
textLocation = "Center";
|
||||
|
|
|
|||
|
|
@ -42,6 +42,70 @@ function ChooseLevelMenu::onWake(%this)
|
|||
%this.fillPrefEntries();
|
||||
LevelPreviewArray.clear();
|
||||
|
||||
refreshGameModesList();
|
||||
|
||||
if(!$pref::HostMultiPlayer)
|
||||
ChooseLevelTitleText.setText("SINGLE PLAYER");
|
||||
else
|
||||
ChooseLevelTitleText.setText("CREATE SERVER");
|
||||
|
||||
ChooseLevelMenuTabList-->ConfigBtn.visible = $pref::HostMultiPlayer;
|
||||
|
||||
ChooseLevelMenuTabList.visible = true;//$pref::HostMultiPlayer;
|
||||
ChooseLevelMenuNavButtonOverlay.visible = true;//$pref::HostMultiPlayer;
|
||||
|
||||
%this.schedule(32, openMenu, 0);
|
||||
}
|
||||
|
||||
function refreshGameModesList()
|
||||
{
|
||||
GameModePreviewArray.clear();
|
||||
|
||||
$pref::Server::GameMode = "";
|
||||
ChooseLevelMenuTabList-->LevelBtn.active = false;
|
||||
|
||||
//popilate the gamemodes list first
|
||||
%gamemodeList = getGameModesList();
|
||||
for(%i=0; %i < getTokenCount(%gamemodeList, ";"); %i++)
|
||||
{
|
||||
%gameModeObj = getToken(%gamemodeList, ";", %i);
|
||||
|
||||
if(isObject(%gameModeObj))
|
||||
{
|
||||
%gameModeName = %gameModeObj.gameModeName;
|
||||
if(%gameModeName $= "")
|
||||
%gameModeName = %gameModeObj.getName();
|
||||
|
||||
%preview = new GuiButtonCtrl() {
|
||||
position = "0 0";
|
||||
extent = ChooseLevelMenu.previewButtonSize;
|
||||
buttonType = "PushButton";
|
||||
profile = GuiMenuButtonLeftJustProfile;
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
internalName = "button";
|
||||
class = "GameModePreviewButton";
|
||||
//command = "ChooseGameModeBegin(" @ %i @ ");";
|
||||
altCommand = "ChooseGameModeBegin(" @ %i @ ");"; //allow doubleclick to quick action it
|
||||
text = %gameModeName;
|
||||
gameModeObj = %gameModeObj;
|
||||
gameModeDesc = %gameModeObj.description;
|
||||
previewImage = %gameModeObj.previewImage;
|
||||
textMargin = 120;
|
||||
groupNum = 2;
|
||||
cansave = false;
|
||||
};
|
||||
|
||||
GameModePreviewArray.add(%preview);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function refreshLevelsList()
|
||||
{
|
||||
LevelPreviewArray.clear();
|
||||
|
||||
//fetch the levelAssets
|
||||
ChooseLevelAssetQuery.clear();
|
||||
AssetDatabase.findAssetType(ChooseLevelAssetQuery, "LevelAsset");
|
||||
|
||||
|
|
@ -57,6 +121,7 @@ function ChooseLevelMenu::onWake(%this)
|
|||
return;
|
||||
}
|
||||
|
||||
//filter the levelAssets by the gamemode selected
|
||||
for(%i=0; %i < %count; %i++)
|
||||
{
|
||||
%assetId = ChooseLevelAssetQuery.getAsset(%i);
|
||||
|
|
@ -71,6 +136,32 @@ function ChooseLevelMenu::onWake(%this)
|
|||
if ( !isFile(%file) )
|
||||
continue;
|
||||
|
||||
if( %levelAsset.isSubScene )
|
||||
continue;
|
||||
|
||||
//filter for selected gamemode
|
||||
%levelGameModes = %levelAsset.gameModesNames;
|
||||
|
||||
echo("LevelAsset gamemodes: " @ %levelGameModes);
|
||||
|
||||
%foundGameModeMatch = false;
|
||||
for(%gm = 0; %gm < getTokenCount(%levelGameModes, ";"); %gm++)
|
||||
{
|
||||
%gameModeName = getToken(%levelGameModes, ";", %gm);
|
||||
|
||||
echo("testing gamemode: " @ %gameModeName);
|
||||
echo("selected gamemode: " @ $pref::Server::GameMode.getName());
|
||||
|
||||
if(%gameModeName $= $pref::Server::GameMode.getName())
|
||||
{
|
||||
%foundGameModeMatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!%foundGameModeMatch)
|
||||
continue;
|
||||
|
||||
%levelPreviewImg = %levelAsset.getPreviewImagePath();
|
||||
|
||||
if (!isFile(%levelPreviewImg))
|
||||
|
|
@ -78,7 +169,7 @@ function ChooseLevelMenu::onWake(%this)
|
|||
|
||||
%preview = new GuiIconButtonCtrl() {
|
||||
position = "0 0";
|
||||
extent = %this.previewButtonSize;
|
||||
extent = ChooseLevelMenu.previewButtonSize;
|
||||
buttonType = "PushButton";
|
||||
profile = GuiMenuButtonLeftJustProfile;
|
||||
horizSizing = "right";
|
||||
|
|
@ -86,7 +177,7 @@ function ChooseLevelMenu::onWake(%this)
|
|||
internalName = "button";
|
||||
class = "LevelPreviewButton";
|
||||
//command = "$selectedLevelAsset = " @ %assetId @ ";";
|
||||
altCommand = "ChooseLevelBegin(1);"; //allow doubleclick to quick action it
|
||||
altCommand = "ChooseLevelBegin(" @ %i @ ");"; //allow doubleclick to quick action it
|
||||
text = %levelAsset.levelName;
|
||||
bitmapAsset = %levelPreviewImg;
|
||||
levelAsset = %levelAsset;
|
||||
|
|
@ -107,20 +198,10 @@ function ChooseLevelMenu::onWake(%this)
|
|||
|
||||
// Also add the new level mission as defined in the world editor settings
|
||||
// if we are choosing a level to launch in the editor.
|
||||
if ( %this.launchInEditor )
|
||||
if ( ChooseLevelMenu.launchInEditor )
|
||||
{
|
||||
%this.addMissionFile( "tools/levels/DefaultEditorLevel.mis" );
|
||||
ChooseLevelMenu.addMissionFile( "tools/levels/DefaultEditorLevel.mis" );
|
||||
}
|
||||
|
||||
if(!$pref::HostMultiPlayer)
|
||||
ChooseLevelTitleText.setText("SINGLE PLAYER");
|
||||
else
|
||||
ChooseLevelTitleText.setText("CREATE SERVER");
|
||||
|
||||
ChooseLevelMenuTabList.visible = $pref::HostMultiPlayer;
|
||||
ChooseLevelMenuNavButtonOverlay.visible = $pref::HostMultiPlayer;
|
||||
|
||||
%this.schedule(32, openMenu, 0);
|
||||
}
|
||||
|
||||
if(!isObject( ChooseLevelActionMap ) )
|
||||
|
|
@ -133,8 +214,8 @@ if(!isObject( ChooseLevelActionMap ) )
|
|||
ChooseLevelActionMap.bind( keyboard, e, ChooseLevelMenuNextMenu);
|
||||
ChooseLevelActionMap.bind( gamepad, btn_r, ChooseLevelMenuNextMenu);
|
||||
|
||||
ChooseLevelActionMap.bind( keyboard, Space, ChooseLevelBegin );
|
||||
ChooseLevelActionMap.bind( gamepad, btn_a, ChooseLevelBegin );
|
||||
ChooseLevelActionMap.bind( keyboard, Space, ChooseLevelMenuOption );
|
||||
ChooseLevelActionMap.bind( gamepad, btn_a, ChooseLevelMenuOption );
|
||||
}
|
||||
|
||||
function ChooseLevelMenu::syncGUI(%this)
|
||||
|
|
@ -169,14 +250,26 @@ function LevelPreviewArray::syncGUI(%this)
|
|||
$selectedLevelAsset = %btn.levelAssetId;
|
||||
}
|
||||
|
||||
function GameModePreviewArray::syncGUI(%this)
|
||||
{
|
||||
%btn = %this.getObject(%this.listPosition);
|
||||
%btn.setHighlighted(true);
|
||||
|
||||
$pref::Server::GameMode = %btn.gameModeObject;
|
||||
}
|
||||
|
||||
function ChooseLevelMenuPrevMenu(%val)
|
||||
{
|
||||
if(%val && $pref::HostMultiPlayer)
|
||||
if(%val)
|
||||
{
|
||||
%currentIdx = ChooseLevelMenu.currentMenuIdx;
|
||||
ChooseLevelMenu.currentMenuIdx -= 1;
|
||||
|
||||
ChooseLevelMenu.currentMenuIdx = mClamp(ChooseLevelMenu.currentMenuIdx, 0, 1);
|
||||
%endIndex = 1;
|
||||
if($pref::HostMultiPlayer)
|
||||
%endIndex = 2;
|
||||
|
||||
ChooseLevelMenu.currentMenuIdx = mClamp(ChooseLevelMenu.currentMenuIdx, 0, %endIndex);
|
||||
|
||||
if(%currentIdx == ChooseLevelMenu.currentMenuIdx)
|
||||
return;
|
||||
|
|
@ -187,12 +280,16 @@ function ChooseLevelMenuPrevMenu(%val)
|
|||
|
||||
function ChooseLevelMenuNextMenu(%val)
|
||||
{
|
||||
if(%val && $pref::HostMultiPlayer)
|
||||
if(%val)
|
||||
{
|
||||
%currentIdx = ChooseLevelMenu.currentMenuIdx;
|
||||
ChooseLevelMenu.currentMenuIdx += 1;
|
||||
|
||||
ChooseLevelMenu.currentMenuIdx = mClamp(ChooseLevelMenu.currentMenuIdx, 0, 1);
|
||||
%endIndex = 1;
|
||||
if($pref::HostMultiPlayer)
|
||||
%endIndex = 2;
|
||||
|
||||
ChooseLevelMenu.currentMenuIdx = mClamp(ChooseLevelMenu.currentMenuIdx, 0, %endIndex);
|
||||
|
||||
if(%currentIdx == ChooseLevelMenu.currentMenuIdx)
|
||||
return;
|
||||
|
|
@ -201,15 +298,17 @@ function ChooseLevelMenuNextMenu(%val)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function ChooseLevelMenu::openMenu(%this, %menuIdx)
|
||||
{
|
||||
LevelSelectContainer.setVisible(%menuIdx == 0);
|
||||
ServerConfigContainer.setVisible(%menuIdx == 1);
|
||||
|
||||
GameModeSelectContainer.setVisible(%menuIdx == 0);
|
||||
LevelSelectContainer.setVisible(%menuIdx == 1);
|
||||
ServerConfigContainer.setVisible(%menuIdx == 2);
|
||||
|
||||
if(%menuIdx == 0)
|
||||
$MenuList = LevelPreviewArray;
|
||||
$MenuList = GameModePreviewArray;
|
||||
else if(%menuIdx == 1)
|
||||
$MenuList = LevelPreviewArray;
|
||||
else if(%menuIdx == 2)
|
||||
$MenuList = ServerConfigList;
|
||||
|
||||
%this.currentMenuIdx = %menuIdx;
|
||||
|
|
@ -220,37 +319,63 @@ function ChooseLevelMenu::openMenu(%this, %menuIdx)
|
|||
%this.syncGui();
|
||||
}
|
||||
|
||||
function ChooseLevelBegin(%val)
|
||||
function ChooseLevelMenuOption(%val)
|
||||
{
|
||||
if(%val)
|
||||
{
|
||||
// So we can't fire the button when loading is in progress.
|
||||
if ( isObject( ServerGroup ) )
|
||||
return;
|
||||
|
||||
Canvas.popDialog();
|
||||
|
||||
%entry = LevelPreviewArray.getObject(LevelPreviewArray.listPosition);
|
||||
|
||||
if(!AssetDatabase.isDeclaredAsset(%entry.levelAssetId))
|
||||
{
|
||||
MessageBoxOK("Error", "Selected level preview does not have a valid level asset!");
|
||||
return;
|
||||
}
|
||||
|
||||
$selectedLevelAsset = %entry.levelAssetId;
|
||||
if(ChooseLevelMenu.currentMenuIdx == 0)
|
||||
ChooseGameModeBegin(ChooseLevelMenu.listPosition);
|
||||
else if(ChooseLevelMenu.currentMenuIdx == 1)
|
||||
ChooseLevelBegin(ChooseLevelMenu.listPosition);
|
||||
}
|
||||
}
|
||||
|
||||
// Launch the chosen level with the editor open?
|
||||
if ( ChooseLevelMenu.launchInEditor )
|
||||
{
|
||||
activatePackage( "BootEditor" );
|
||||
ChooseLevelMenu.launchInEditor = false;
|
||||
StartGame(%entry.levelAssetId, "SinglePlayer");
|
||||
}
|
||||
else
|
||||
{
|
||||
StartGame(%entry.levelAssetId);
|
||||
}
|
||||
function ChooseGameModeBegin(%index)
|
||||
{
|
||||
%entry = GameModePreviewArray.getObject(%index);
|
||||
if(!isObject(%entry) || !isObject(%entry.gameModeObj))
|
||||
{
|
||||
MessageBoxOK("Error", "Selected game mode does not have a valid mode");
|
||||
return;
|
||||
}
|
||||
|
||||
$pref::Server::GameMode = %entry.gameModeObj;
|
||||
|
||||
ChooseLevelMenuTabList-->LevelBtn.active = true;
|
||||
|
||||
refreshLevelsList();
|
||||
|
||||
ChooseLevelMenu.openMenu(1);
|
||||
}
|
||||
|
||||
function ChooseLevelBegin(%index)
|
||||
{
|
||||
// So we can't fire the button when loading is in progress.
|
||||
if ( isObject( ServerGroup ) )
|
||||
return;
|
||||
|
||||
Canvas.popDialog();
|
||||
|
||||
%entry = LevelPreviewArray.getObject(%index);
|
||||
|
||||
if(!AssetDatabase.isDeclaredAsset(%entry.levelAssetId))
|
||||
{
|
||||
MessageBoxOK("Error", "Selected level preview does not have a valid level asset!");
|
||||
return;
|
||||
}
|
||||
|
||||
$selectedLevelAsset = %entry.levelAssetId;
|
||||
|
||||
// Launch the chosen level with the editor open?
|
||||
if ( ChooseLevelMenu.launchInEditor )
|
||||
{
|
||||
activatePackage( "BootEditor" );
|
||||
ChooseLevelMenu.launchInEditor = false;
|
||||
StartGame(%entry.levelAssetId, "SinglePlayer");
|
||||
}
|
||||
else
|
||||
{
|
||||
StartGame(%entry.levelAssetId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -270,6 +395,23 @@ function ChooseLevelMenu::onSleep( %this )
|
|||
}
|
||||
}
|
||||
|
||||
function GameModePreviewButton::onHighlighted(%this, %highlighted)
|
||||
{
|
||||
if(%highlighted)
|
||||
{
|
||||
$MenuList.listPosition = $MenuList.getObjectIndex(%this);
|
||||
|
||||
GameModePreviewBitmap.bitmapAsset = %this.previewImage;
|
||||
|
||||
GameModePreviewBitmap.visible = (%this.previewImage !$= "");
|
||||
|
||||
GameModeNameText.text = %this.text;
|
||||
GameModeDescriptionText.setText(%this.gameModeDesc);
|
||||
|
||||
GameModePreviewScroll.scrollToObject(%this);
|
||||
}
|
||||
}
|
||||
|
||||
function LevelPreviewButton::onHighlighted(%this, %highlighted)
|
||||
{
|
||||
if(%highlighted)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue