Initial implementation of the new Base Game Template and some starting modules.

This makes some tweaks to the engine to support this, specifically, it tweaks the hardcoded shaderpaths to defer to a pref variable, so none of the shader paths are hardcoded.

Also tweaks how post effects read in texture files, removing a bizzare filepath interpretation choice, where if the file path didn't start with "/" it forcefully appended the script's file path. This made it impossible to have images not in the same dir as the script file defining the post effect.

This was changed and the existing template's post effects tweaked for now to just add "./" to those few paths impacted, as well as the perf vars to support the non-hardcoded shader paths in the engine.
This commit is contained in:
Areloch 2017-02-24 02:40:56 -06:00
parent 5c8a82180b
commit 1ed8b05169
1572 changed files with 146699 additions and 85 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

View file

@ -0,0 +1,152 @@
//-----------------------------------------------------------------------------
// 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);
}
function MissionAreaEditorPlugin::setEditorFunction( %this )
{
%missionAreaExists = isObject(getMissionAreaServerObject());
if( %missionAreaExists == false )
MessageBoxYesNoCancel("No Mission Area","Would you like to create a New Mission Area?", "MissionAreaEditorPlugin.createNewMissionArea();");
return %missionAreaExists;
}
function MissionAreaEditorPlugin::createNewMissionArea(%this)
{
%newMissionArea = new MissionArea();
%newMissionArea.area = "-256 -256 512 512";
MissionGroup.add(%newMissionArea);
EditorGui.setEditor(MissionAreaEditorPlugin);
EWorldEditor.isDirty = true;
}
//-----------------------------------------------------------------------------
// 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();
}

View file

@ -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";
};

View file

@ -0,0 +1,84 @@
//-----------------------------------------------------------------------------
// 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();
if( isObject( %ma ) )
{
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 );
}

View file

@ -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 = "ToolsGuiToolTipProfile";
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 = "ToolsGuiWindowProfile";
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 = "ToolsGuiToolTipProfile";
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 = "ToolsGuiDefaultProfile";
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 = "ToolsGuiWindowProfile";
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 = "ToolsGuiToolTipProfile";
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 = "ToolsGuiDefaultProfile";
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 = "ToolsGuiToolTipProfile";
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 = "ToolsGuiTransparentProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "1 1";
Extent = "178 16";
MinExtent = "16 16";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
dividerMargin = "5";
};
};
new GuiContainer(){ //Mission Area Properties
isContainer = "1";
Profile = "ToolsGuiDefaultProfile";
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 = "ToolsGuiToolTipProfile";
hovertime = "1000";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
useURLMouseCursor = "0";
};
};
};
};