mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Full Template for ticket #1
This commit is contained in:
parent
74f265b3b3
commit
f439dc8dcd
2150 changed files with 286240 additions and 0 deletions
Binary file not shown.
|
After Width: | Height: | Size: 179 B |
Binary file not shown.
|
After Width: | Height: | Size: 973 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 845 B |
131
Templates/Full/game/tools/missionAreaEditor/main.cs
Normal file
131
Templates/Full/game/tools/missionAreaEditor/main.cs
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function initializeMissionAreaEditor()
|
||||
{
|
||||
echo(" % - Initializing Mission Area Editor");
|
||||
|
||||
exec( "./missionAreaEditor.ed.cs" );
|
||||
exec( "./missionAreaEditorGui.ed.gui" );
|
||||
exec( "./missionAreaEditorGui.ed.cs" );
|
||||
|
||||
// Add ourselves to EditorGui, where all the other tools reside
|
||||
MissionAreaEditorGui.setVisible( false );
|
||||
MissionAreaEditorTerrainWindow.setVisible( false );
|
||||
MissionAreaEditorPropertiesWindow.setVisible( false );
|
||||
|
||||
EditorGui.add( MissionAreaEditorGui );
|
||||
EditorGui.add( MissionAreaEditorTerrainWindow );
|
||||
EditorGui.add( MissionAreaEditorPropertiesWindow );
|
||||
|
||||
new ScriptObject( MissionAreaEditorPlugin )
|
||||
{
|
||||
superClass = "EditorPlugin";
|
||||
editorGui = MissionAreaEditorGui;
|
||||
};
|
||||
|
||||
MissionAreaEditorPlugin.initSettings();
|
||||
}
|
||||
|
||||
function destroyMissionAreaEditor()
|
||||
{
|
||||
}
|
||||
|
||||
function MissionAreaEditorPlugin::onWorldEditorStartup( %this )
|
||||
{
|
||||
// Add ourselves to the window menu.
|
||||
%accel = EditorGui.addToEditorsMenu( "Mission Area Editor", "", MissionAreaEditorPlugin );
|
||||
|
||||
// Add ourselves to the ToolsToolbar
|
||||
%tooltip = "Mission Area Editor (" @ %accel @ ")";
|
||||
EditorGui.addToToolsToolbar( "MissionAreaEditorPlugin", "MissionAreaEditorPalette", expandFilename("tools/missionAreaEditor/images/mission-area"), %tooltip );
|
||||
|
||||
//connect editor windows
|
||||
GuiWindowCtrl::attach( MissionAreaEditorPropertiesWindow, MissionAreaEditorTerrainWindow);
|
||||
}
|
||||
|
||||
function MissionAreaEditorPlugin::onActivated( %this )
|
||||
{
|
||||
%this.readSettings();
|
||||
|
||||
EditorGui.bringToFront( MissionAreaEditorGui );
|
||||
|
||||
MissionAreaEditorGui.setVisible(true);
|
||||
MissionAreaEditorGui.makeFirstResponder( true );
|
||||
|
||||
MissionAreaEditorTerrainWindow.setVisible( true );
|
||||
MissionAreaEditorPropertiesWindow.setVisible( true );
|
||||
|
||||
// Set the status bar here until all tool have been hooked up
|
||||
EditorGuiStatusBar.setInfo("Mission Area Editor.");
|
||||
EditorGuiStatusBar.setSelection("");
|
||||
|
||||
// Allow the Gui to setup.
|
||||
MissionAreaEditorGui.onEditorActivated();
|
||||
|
||||
Parent::onActivated(%this);
|
||||
}
|
||||
|
||||
function MissionAreaEditorPlugin::onDeactivated( %this )
|
||||
{
|
||||
%this.writeSettings();
|
||||
|
||||
MissionAreaEditorGui.setVisible(false);
|
||||
MissionAreaEditorTerrainWindow.setVisible( false );
|
||||
MissionAreaEditorPropertiesWindow.setVisible( false );
|
||||
|
||||
// Allow the Gui to cleanup.
|
||||
MissionAreaEditorGui.onEditorDeactivated();
|
||||
|
||||
Parent::onDeactivated(%this);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Settings
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function MissionAreaEditorPlugin::initSettings( %this )
|
||||
{
|
||||
EditorSettings.beginGroup( "MissionAreaEditor", true );
|
||||
|
||||
EditorSettings.setDefaultValue( "MissionBoundsColor", "255 255 255" );
|
||||
|
||||
EditorSettings.endGroup();
|
||||
}
|
||||
|
||||
function MissionAreaEditorPlugin::readSettings( %this )
|
||||
{
|
||||
EditorSettings.beginGroup( "MissionAreaEditor", true );
|
||||
|
||||
MissionAreaEditorTerrainEditor.missionBoundsColor = EditorSettings.value("MissionBoundsColor");
|
||||
|
||||
EditorSettings.endGroup();
|
||||
}
|
||||
|
||||
function MissionAreaEditorPlugin::writeSettings( %this )
|
||||
{
|
||||
EditorSettings.beginGroup( "MissionAreaEditor", true );
|
||||
|
||||
EditorSettings.setValue( "MissionBoundsColor", MissionAreaEditorTerrainEditor.missionBoundsColor );
|
||||
|
||||
EditorSettings.endGroup();
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
singleton GuiControlProfile( MissionAreaEditorProfile )
|
||||
{
|
||||
canKeyFocus = true;
|
||||
opaque = true;
|
||||
fillColor = "192 192 192";
|
||||
category = "Editor";
|
||||
};
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function MissionAreaEditorGui::onEditorActivated( %this )
|
||||
{
|
||||
EWorldEditor.clearSelection();
|
||||
|
||||
%ma = getMissionAreaServerObject();
|
||||
EWorldEditor.selectObject( %ma );
|
||||
EWorldEditor.syncGui();
|
||||
MissionAreaEditorTerrainEditor.updateTerrain();
|
||||
%this.setSelectedMissionArea( %ma );
|
||||
%this.onMissionAreaSelected( %this.getSelectedMissionArea() );
|
||||
}
|
||||
|
||||
function MissionAreaEditorGui::onEditorDeactivated( %this )
|
||||
{
|
||||
}
|
||||
|
||||
function MissionAreaEditorGui::onMissionAreaSelected( %this, %missionArea )
|
||||
{
|
||||
%this.missionArea = %missionArea;
|
||||
MissionAreaEditorTerrainEditor.setMissionArea( %missionArea );
|
||||
MissionAreaInspector.inspect( %missionArea );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function MissionAreaEditorTerrainEditor::onMissionAreaModified( %this )
|
||||
{
|
||||
MissionAreaInspector.refresh();
|
||||
}
|
||||
|
||||
function MissionAreaEditorTerrainEditor::onUndo( %this )
|
||||
{
|
||||
MissionAreaInspector.refresh();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function MissionAreaInspector::inspect( %this, %obj )
|
||||
{
|
||||
%name = "";
|
||||
if ( isObject( %obj ) )
|
||||
%name = %obj.getName();
|
||||
else
|
||||
MissionAreaFieldInfoControl.setText( "" );
|
||||
|
||||
//RiverInspectorNameEdit.setValue( %name );
|
||||
Parent::inspect( %this, %obj );
|
||||
}
|
||||
|
||||
function MissionAreaInspector::onInspectorFieldModified( %this, %object, %fieldName, %arrayIndex, %oldValue, %newValue )
|
||||
{
|
||||
// Same work to do as for the regular WorldEditor Inspector.
|
||||
Inspector::onInspectorFieldModified( %this, %object, %fieldName, %arrayIndex, %oldValue, %newValue );
|
||||
}
|
||||
|
||||
function MissionAreaInspector::onFieldSelected( %this, %fieldName, %fieldTypeStr, %fieldDoc )
|
||||
{
|
||||
MissionAreaFieldInfoControl.setText( "<font:ArialBold:14>" @ %fieldName @ "<font:ArialItalic:14> (" @ %fieldTypeStr @ ") " NL "<font:Arial:14>" @ %fieldDoc );
|
||||
}
|
||||
|
|
@ -0,0 +1,245 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiMissionAreaEditorCtrl(MissionAreaEditorGui, EditorGuiGroup) {
|
||||
canSaveDynamicFields = "0";
|
||||
Enabled = "1";
|
||||
isContainer = "1";
|
||||
Profile = "MissionAreaEditorProfile";
|
||||
HorizSizing = "width";
|
||||
VertSizing = "height";
|
||||
Position = "0 0";
|
||||
Extent = "800 600";
|
||||
MinExtent = "8 8";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
tooltipprofile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
Docking = "None";
|
||||
Margin = "0 0 0 0";
|
||||
Padding = "0 0 0 0";
|
||||
AnchorTop = "0";
|
||||
AnchorBottom = "0";
|
||||
AnchorLeft = "0";
|
||||
AnchorRight = "0";
|
||||
cameraZRot = "0";
|
||||
forceFOV = "0";
|
||||
renderMissionArea = "0";
|
||||
missionAreaFillColor = "255 0 0 20";
|
||||
missionAreaFrameColor = "255 0 0 128";
|
||||
allowBorderMove = "0";
|
||||
borderMovePixelSize = "20";
|
||||
borderMoveSpeed = "0.1";
|
||||
consoleFrameColor = "255 0 0 255";
|
||||
consoleFillColor = "0 0 0 0";
|
||||
consoleSphereLevel = "1";
|
||||
consoleCircleSegments = "32";
|
||||
consoleLineWidth = "1";
|
||||
GizmoProfile = "GlobalGizmoProfile";
|
||||
|
||||
new GuiWindowCollapseCtrl(MissionAreaEditorTerrainWindow) {
|
||||
internalName = "";
|
||||
canSaveDynamicFields = "0";
|
||||
Enabled = "1";
|
||||
isContainer = "1";
|
||||
Profile = "GuiWindowProfile";
|
||||
HorizSizing = "windowRelative";
|
||||
VertSizing = "windowRelative";
|
||||
Position = getWord($pref::Video::mode, 0) - 209
|
||||
SPC getWord(EditorGuiToolbar.extent, 1) - 1;
|
||||
Extent = "210 230";
|
||||
MinExtent = "210 100";
|
||||
canSave = "1";
|
||||
isDecoy = "0";
|
||||
Visible = "1";
|
||||
tooltipprofile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
Margin = "0 0 0 0";
|
||||
Padding = "0 0 0 0";
|
||||
AnchorTop = "1";
|
||||
AnchorBottom = "0";
|
||||
AnchorLeft = "1";
|
||||
AnchorRight = "0";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
minSize = "50 50";
|
||||
EdgeSnap = "1";
|
||||
text = "Mission Area";
|
||||
|
||||
new GuiContainer(){
|
||||
profile = GuiDefaultProfile;
|
||||
Position = "5 25";
|
||||
Extent = "200 200";
|
||||
Docking = "Client";
|
||||
Margin = "3 1 3 3 ";
|
||||
HorizSizing = "width";
|
||||
VertSizing = "height";
|
||||
isContainer = "1";
|
||||
|
||||
new GuiMissionAreaCtrl(MissionAreaEditorTerrainEditor) {
|
||||
canSaveDynamicFields = "0";
|
||||
isContainer = "0";
|
||||
Profile = "EditorDefaultProfile";
|
||||
HorizSizing = "width";
|
||||
VertSizing = "height";
|
||||
position = "0 0";
|
||||
Extent = "200 200";
|
||||
MinExtent = "8 8";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
hovertime = "1000";
|
||||
wrap = "0";
|
||||
enableMirroring = "0";
|
||||
mirrorIndex = "0";
|
||||
mirrorLineColor = "255 0 255 255";
|
||||
mirrorArrowColor = "255 0 255 128";
|
||||
handleFrameColor = "255 255 255 255";
|
||||
handleFillColor = "0 0 0 255";
|
||||
defaultObjectColor = "0 255 0 100";
|
||||
waterObjectColor = "0 0 255 100";
|
||||
missionBoundsColor = "255 0 0 255";
|
||||
cameraColor = "255 0 0 255";
|
||||
squareBitmap = "1";
|
||||
enableEditing = "0";
|
||||
renderCamera = "1";
|
||||
handleBitmap = "tools/missionAreaEditor/images/DefaultHandle.png";
|
||||
};
|
||||
};
|
||||
};
|
||||
new GuiWindowCollapseCtrl(MissionAreaEditorPropertiesWindow) {
|
||||
internalName = "Window";
|
||||
canSaveDynamicFields = "0";
|
||||
Enabled = "1";
|
||||
isContainer = "1";
|
||||
Profile = "GuiWindowProfile";
|
||||
HorizSizing = "windowRelative";
|
||||
VertSizing = "windowRelative";
|
||||
Position = getWord($pref::Video::mode, 0) - 209
|
||||
SPC getWord(EditorGuiToolbar.extent, 1) + getWord(MissionAreaEditorTerrainWindow.extent, 1) - 2;
|
||||
Extent = "210 466";
|
||||
MinExtent = "210 300";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
tooltipprofile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
Margin = "0 0 0 0";
|
||||
Padding = "0 0 0 0";
|
||||
AnchorTop = "0";
|
||||
AnchorBottom = "0";
|
||||
AnchorLeft = "0";
|
||||
AnchorRight = "0";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
minSize = "50 50";
|
||||
EdgeSnap = "1";
|
||||
text = "Properties";
|
||||
|
||||
new GuiContainer(){ //Mission Area Properties
|
||||
isContainer = "1";
|
||||
Profile = "inspectorStyleRolloutDarkProfile";
|
||||
HorizSizing = "width";
|
||||
VertSizing = "bottom";
|
||||
Position = "4 112";
|
||||
Extent = "202 31";
|
||||
Docking = "Top";
|
||||
Margin = "0 0 3 3";
|
||||
|
||||
new GuiTextCtrl(){
|
||||
Profile = "GuiDefaultProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = "5 0";
|
||||
Extent = "121 18";
|
||||
text = "Mission Area Properties";
|
||||
};
|
||||
};
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
canSaveDynamicFields = "0";
|
||||
Enabled = "1";
|
||||
isContainer = "1";
|
||||
Profile = "GuiEditorScrollProfile";
|
||||
HorizSizing = "width";
|
||||
VertSizing = "height";
|
||||
Position = "4 129";
|
||||
Extent = "202 357";
|
||||
MinExtent = "8 2";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
tooltipprofile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
Docking = "Client";
|
||||
Margin = "-14 0 3 3";
|
||||
Padding = "0 0 0 0";
|
||||
AnchorTop = "0";
|
||||
AnchorBottom = "0";
|
||||
AnchorLeft = "0";
|
||||
AnchorRight = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "true";
|
||||
lockVertScroll = "false";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiInspector(MissionAreaInspector) {
|
||||
StackingType = "Vertical";
|
||||
HorizStacking = "Left to Right";
|
||||
VertStacking = "Top to Bottom";
|
||||
Padding = "1";
|
||||
name = "MissionAreaInspector";
|
||||
canSaveDynamicFields = "0";
|
||||
Enabled = "1";
|
||||
isContainer = "1";
|
||||
Profile = "GuiTransparentProfile";
|
||||
HorizSizing = "width";
|
||||
VertSizing = "height";
|
||||
Position = "1 1";
|
||||
Extent = "178 16";
|
||||
MinExtent = "16 16";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
tooltipprofile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
dividerMargin = "5";
|
||||
};
|
||||
};
|
||||
new GuiContainer(){ //Mission Area Properties
|
||||
isContainer = "1";
|
||||
Profile = GuiDefaultProfile;
|
||||
HorizSizing = "width";
|
||||
VertSizing = "bottom";
|
||||
Position = "1 0";
|
||||
Extent = "202 42";
|
||||
Docking = "Bottom";
|
||||
Margin = "0 0 3 3";
|
||||
|
||||
new GuiMLTextCtrl(MissionAreaFieldInfoControl) {
|
||||
canSaveDynamicFields = "0";
|
||||
Enabled = "1";
|
||||
isContainer = "0";
|
||||
Profile = "GuiInspectorFieldInfoMLTextProfile";
|
||||
HorizSizing = "width";
|
||||
VertSizing = "top";
|
||||
Position = "0 0";
|
||||
Extent = "202 42";
|
||||
MinExtent = "8 2";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
tooltipprofile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
useURLMouseCursor = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue