mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-20 03:45:26 +00:00
Adds some basic, common materials to the editor so some starting point is always on-hand, as well as hook the BlankRoom starting editor level up to use them.
Added a check so if no levels are found from other modules, the default ui module will prompt the user to launch the editor to the base editor level and begin editing or return to main menu if tools are present, or inform them to double-check that there are modules with gameplay/levels and return them to the main menu in no tools available. Also set it up so if the editor is launched while a mission isn't running, it'll automatically load to the base editor level and set up a default camera object. This way editing can be done even if no level is currently loaded.
This commit is contained in:
parent
1520bc83b2
commit
9f171a42e7
42 changed files with 398 additions and 461 deletions
|
|
@ -26,7 +26,30 @@ function ChooseLevelDlg::onWake( %this )
|
|||
CL_levelList.clear();
|
||||
ChooseLevelWindow->SmallPreviews.clear();
|
||||
|
||||
%this->CurrentPreview.visible = false;
|
||||
%this->levelName.visible = false;
|
||||
%this->LevelDescriptionLabel.visible = false;
|
||||
%this->LevelDescription.visible = false;
|
||||
|
||||
%count = LevelFilesList.count();
|
||||
|
||||
if(%count == 0)
|
||||
{
|
||||
//We have no levels found. Prompt the user to open the editor to the default level if the tools are present
|
||||
if(IsDirectory("tools"))
|
||||
{
|
||||
MessageBoxYesNo("Error", "No levels were found in any modules. Do you want to load the editor and start a new level?",
|
||||
"fastLoadWorldEdit(1);", "Canvas.popDialog(ChooseLevelDlg); Canvas.setContent(MainMenuGUI);");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxOK("Error", "No levels were found in any modules. Please ensure you have modules loaded that contain gameplay code and level files.",
|
||||
"Canvas.popDialog(ChooseLevelDlg); Canvas.setContent(MainMenuGUI);");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for ( %i=0; %i < %count; %i++ )
|
||||
{
|
||||
%file = LevelFilesList.getKey( %i );
|
||||
|
|
@ -211,21 +234,38 @@ function ChooseLevelWindow::previewSelected(%this, %preview)
|
|||
|
||||
// Set the large preview image
|
||||
if (isObject(%preview) && %preview.bitmap !$= "")
|
||||
{
|
||||
%this->CurrentPreview.visible = true;
|
||||
%this->CurrentPreview.setBitmap(%preview.bitmap);
|
||||
}
|
||||
else
|
||||
%this->CurrentPreview.setBitmap("data/ui/art/no-preview");
|
||||
{
|
||||
%this->CurrentPreview.visible = false;
|
||||
}
|
||||
|
||||
// Set the current level name
|
||||
if (isObject(%preview) && %preview.levelName !$= "")
|
||||
{
|
||||
%this->LevelName.visible = true;
|
||||
%this->LevelName.setText(%preview.levelName);
|
||||
}
|
||||
else
|
||||
%this->LevelName.setText("Level");
|
||||
{
|
||||
%this->LevelName.visible = false;
|
||||
}
|
||||
|
||||
// Set the current level description
|
||||
if (isObject(%preview) && %preview.levelDesc !$= "")
|
||||
{
|
||||
%this->LevelDescription.visible = true;
|
||||
%this->LevelDescriptionLabel.visible = true;
|
||||
%this->LevelDescription.setText(%preview.levelDesc);
|
||||
}
|
||||
else
|
||||
%this->LevelDescription.setText("A Torque Level");
|
||||
{
|
||||
%this->LevelDescription.visible = false;
|
||||
%this->LevelDescriptionLabel.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
function ChooseLevelWindow::previousPreviews(%this)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(ChooseLevelDlg) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
extent = "1280 1024";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
Enabled = "1";
|
||||
enabled = "1";
|
||||
launchInEditor = "0";
|
||||
returnGui = "MainMenuGui";
|
||||
|
||||
|
|
@ -33,7 +33,8 @@
|
|||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiBitmapCtrl() {
|
||||
bitmap = "./art/no-preview";
|
||||
bitmap = "data/ui/scripts/guis/art/no-preview";
|
||||
color = "255 255 255 255";
|
||||
wrap = "0";
|
||||
position = "369 31";
|
||||
extent = "400 300";
|
||||
|
|
@ -41,15 +42,16 @@
|
|||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
visible = "0";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "CurrentPreview";
|
||||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
Enabled = "1";
|
||||
enabled = "1";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Empty Room";
|
||||
|
|
@ -66,12 +68,13 @@
|
|||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiMenuButtonProfile";
|
||||
visible = "1";
|
||||
visible = "0";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "levelName";
|
||||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
|
|
@ -90,11 +93,13 @@
|
|||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiMenuButtonProfile";
|
||||
visible = "1";
|
||||
visible = "0";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "LevelDescriptionLabel";
|
||||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
|
|
@ -104,7 +109,7 @@
|
|||
maxChars = "-1";
|
||||
useURLMouseCursor = "0";
|
||||
position = "370 380";
|
||||
extent = "165 28";
|
||||
extent = "165 14";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
|
|
@ -119,11 +124,12 @@
|
|||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "./art/previous-button";
|
||||
bitmap = "data/ui/scripts/guis/art/previous-button";
|
||||
bitmapMode = "Stretched";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
|
|
@ -143,15 +149,16 @@
|
|||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
Enabled = "1";
|
||||
enabled = "1";
|
||||
wrap = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "./art/next-button";
|
||||
bitmap = "data/ui/scripts/guis/art/next-button";
|
||||
bitmapMode = "Stretched";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
|
|
@ -171,7 +178,7 @@
|
|||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
Enabled = "1";
|
||||
enabled = "1";
|
||||
wrap = "0";
|
||||
};
|
||||
new GuiTextListCtrl(CL_levelList) {
|
||||
|
|
@ -219,28 +226,6 @@
|
|||
internalName = "SmallPreviews";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiButtonCtrl() {
|
||||
text = "Empty";
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
position = "0 0";
|
||||
extent = "368 35";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiMenuButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "ChooseLevelWindow.previewSelected(ChooseLevelWindow->SmallPreviews->SmallPreview0);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "SmallPreview0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiButtonCtrl(ChooseLevelDlgGoBtn) {
|
||||
text = "Start Level";
|
||||
|
|
@ -284,4 +269,4 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ exec( "tools/gui/profiles.ed.cs" );
|
|||
useVariable = "0";
|
||||
tile = "0";
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
extent = "1280 1024";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
|
|
@ -18,7 +18,7 @@ exec( "tools/gui/profiles.ed.cs" );
|
|||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
Enabled = "1";
|
||||
enabled = "1";
|
||||
isDecoy = "0";
|
||||
|
||||
new GuiBitmapButtonCtrl(MainMenuAppLogo) {
|
||||
|
|
@ -27,10 +27,11 @@ exec( "tools/gui/profiles.ed.cs" );
|
|||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "368 30";
|
||||
position = "624 30";
|
||||
extent = "443 139";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
|
|
@ -44,7 +45,6 @@ exec( "tools/gui/profiles.ed.cs" );
|
|||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
};
|
||||
new GuiControl(MainMenuButtonContainer) {
|
||||
position = "67 321";
|
||||
|
|
@ -168,7 +168,7 @@ exec( "tools/gui/profiles.ed.cs" );
|
|||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Exit";
|
||||
text = "Launch World Editor";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
|
|
@ -180,6 +180,46 @@ exec( "tools/gui/profiles.ed.cs" );
|
|||
profile = "GuiBlankMenuButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "fastLoadWorldEdit(1);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Launch GUI Editor";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "0 200";
|
||||
extent = "442 40";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiBlankMenuButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "fastLoadGUIEdit(1);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Exit";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "0 240";
|
||||
extent = "442 40";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiBlankMenuButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "quit();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
|
|
|
|||
|
|
@ -1,126 +1,75 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(MessageBoxYesNoDlg) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "GuiOverlayProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
helpTag = "0";
|
||||
profile = "GuiOverlayProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiContainer() {
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "168 352";
|
||||
extent = "700 64";
|
||||
minExtent = "8 2";
|
||||
new GuiWindowCtrl(MBYesNoFrame) {
|
||||
profile = "GuiWindowProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "GuiDefaultProfile";
|
||||
position = "170 175";
|
||||
extent = "300 100";
|
||||
minExtent = "48 92";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
helpTag = "0";
|
||||
maxLength = "255";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
minSize = "50 50";
|
||||
text = "";
|
||||
closeCommand = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);";
|
||||
|
||||
new GuiChunkedBitmapCtrl() {
|
||||
bitmap = "data/ui/art/hudfill.png";
|
||||
useVariable = "0";
|
||||
tile = "0";
|
||||
position = "0 0";
|
||||
extent = "700 64";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
new GuiMLTextCtrl(MBYesNoText) {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);";
|
||||
accelerator = "escape";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl(MBYesNoText) {
|
||||
text = "Re-bind \"\" to...";
|
||||
maxLength = "255";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "177 8";
|
||||
extent = "384 20";
|
||||
position = "11 38";
|
||||
extent = "280 14";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "GuiMenuButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Yes";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "270 36";
|
||||
extent = "80 22";
|
||||
minExtent = "8 8";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "top";
|
||||
profile = "GuiButtonProfile";
|
||||
position = "70 68";
|
||||
extent = "80 22";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.yesCallback);";
|
||||
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.yesCallback);";
|
||||
accelerator = "return";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "No";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "367 36";
|
||||
extent = "80 22";
|
||||
minExtent = "8 8";
|
||||
helpTag = "0";
|
||||
text = "Yes";
|
||||
simpleStyle = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "top";
|
||||
profile = "GuiButtonProfile";
|
||||
position = "167 68";
|
||||
extent = "80 22";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);";
|
||||
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);";
|
||||
accelerator = "escape";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
helpTag = "0";
|
||||
text = "No";
|
||||
simpleStyle = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
|
|||
|
|
@ -22,25 +22,14 @@
|
|||
|
||||
|
||||
// Cleanup Dialog created by 'core'
|
||||
if( isObject( MessagePopupDlg ) )
|
||||
MessagePopupDlg.delete();
|
||||
if( isObject( MessageBoxYesNoDlg ) )
|
||||
MessageBoxYesNoDlg.delete();
|
||||
if( isObject( MessageBoxYesNoCancelDlg ) )
|
||||
MessageBoxYesNoCancelDlg.delete();
|
||||
if( isObject( MessageBoxOKCancelDetailsDlg ) )
|
||||
MessageBoxOKCancelDetailsDlg.delete();
|
||||
if( isObject( MessageBoxOKCancelDlg ) )
|
||||
MessageBoxOKCancelDlg.delete();
|
||||
if( isObject( MessageBoxOKDlg ) )
|
||||
MessageBoxOKDlg.delete();
|
||||
if( isObject( IODropdownDlg ) )
|
||||
IODropdownDlg.delete();
|
||||
|
||||
|
||||
// Load Editor Dialogs
|
||||
exec("./guis/messageBoxOk.ed.gui");
|
||||
exec("./guis/messageBoxYesNo.ed.gui");
|
||||
exec("./guis/messageBoxOk.gui");
|
||||
exec("./guis/messageBoxYesNo.gui");
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// Message Sound
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue