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

View file

@ -0,0 +1,53 @@
//-----------------------------------------------------------------------------
// 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( ConvexEditorProfile )
{
canKeyFocus = true;
opaque = true;
fillColor = "192 192 192 192";
category = "Editor";
};
singleton GuiControlProfile (GuiDisabledTextEditProfile)
{
opaque = false;
border = 0;
bitmap = "./textEdit";
borderColor = "255 255 255 200";
fontColor = "0 0 0";
fontColorHL = "255 255 255";
fontColorNA = "128 128 128";
textOffset = "4 2";
autoSizeWidth = false;
autoSizeHeight = false;
tab = false;
canKeyFocus = false;
category = "Editor";
};
singleton GuiControlProfile (GuiSimpleBorderProfile)
{
opaque = false;
border = 1;
category = "Editor";
};

View file

@ -0,0 +1,62 @@
//-----------------------------------------------------------------------------
// 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 ConvexEditorGui::onWake( %this )
{
}
function ConvexEditorGui::onSleep( %this )
{
}
function ConvexEditorGui::createConvexBox( %this )
{
%obj = genericCreateObject( "ConvexShape" );
%this.handleDeselect();
%this.selectConvex( %obj );
%this.dropSelectionAtScreenCenter();
}
function ConvexEditorGui::onSelectionChanged( %this, %shape, %face )
{
//echo( "onSelectionChanged: " @ %shape SPC %face );
ConvexEditorSplitFaceBtn.setActive( false );
ConvexEditorSplitFaceBtn.ToolTip = "Split selected face [Disabled]" NL "Use Ctrl + Rotate instead for more control";
ConvexEditorDeleteFaceBtn.setActive( false );
ConvexEditorDeleteFaceBtn.ToolTip = "Delete selection [Disabled] (Delete)";
if ( !isObject( %shape ) )
return;
ConvexEditorDeleteFaceBtn.setActive( true );
if ( %face == -1 )
ConvexEditorDeleteFaceBtn.ToolTip = "Delete selected ConvexShape (Delete)";
else
{
ConvexEditorDeleteFaceBtn.ToolTip = "Delete selected Face (Delete)";
ConvexEditorSplitFaceBtn.ToolTip = "Split selected face" NL "Use Ctrl + Rotate instead for more control";
ConvexEditorSplitFaceBtn.setActive( true );
}
}

View file

@ -0,0 +1,440 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiConvexEditorCtrl(ConvexEditorGui) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ConvexEditorProfile";
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";
DefaultWidth = "10";
HoverSplineColor = "0 255 0 255";
SelectedSplineColor = "255 0 255 255";
HoverNodeColor = "255 255 255 255";
new GuiWindowCollapseCtrl(ConvexEditorTreeWindow) {
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 167";
MinExtent = "210 100";
canSave = "1";
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";
closeCommand = "EditorGui.setEditor( WorldEditorInspectorPlugin );";
EdgeSnap = "1";
text = "ConvexShapes";
new GuiContainer(){
profile = "ToolsGuiDefaultProfile";
Position = "5 25";
Extent = "200 120";
Docking = "Client";
Margin = "3 1 3 3 ";
HorizSizing = "width";
VertSizing = "height";
isContainer = "1";
new GuiScrollCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "GuiEditorScrollProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "200 118";
MinExtent = "8 8";
canSave = "1";
isDecoy = "0";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Docking = "Client";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
lockHorizScroll = "true";
lockVertScroll = "false";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
new GuiTreeViewCtrl(ConvexTreeView) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiTreeViewProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "1 1";
Extent = "193 21";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
hovertime = "1000";
tabSize = "16";
textOffset = "2";
fullRowSelect = "0";
itemHeight = "21";
destroyTreeOnSleep = "1";
MouseDragging = "0";
MultipleSelections = "0";
DeleteObjectAllowed = "1";
DragToItemAllowed = "0";
showRoot = "1";
internalNamesOnly = "0";
};
};
};
};
new GuiWindowCollapseCtrl(ConvexEditorOptionsWindow) {
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(ConvexEditorTreeWindow.extent, 1) - 2;
Extent = "210 530";
MinExtent = "210 298";
canSave = "1";
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";
closeCommand = "EditorGui.setEditor( WorldEditorPlugin );";
EdgeSnap = "1";
text = "Properties";
new GuiContainer(){ //Node Properties
isContainer = "1";
Profile = "inspectorStyleRolloutDarkProfile";
HorizSizing = "width";
VertSizing = "bottom";
Position = "4 24";
Extent = "202 85";
Docking = "Top";
Margin = "3 3 3 3";
new GuiTextCtrl(){
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "5 0";
Extent = "86 18";
text = "Node Properties";
};
new GuiTextCtrl(){
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "7 21";
Extent = "46 18";
text = "Position";
};
new GuiTextEditCtrl(){
internalName = "position";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "width";
VertSizing = "bottom";
Position = "57 21";
Extent = "141 18";
text = "";
AltCommand = "ConvexEditorGui.editNodeDetails();";
};
new GuiTextCtrl(){
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "7 42";
Extent = "46 18";
text = "Rotation";
};
new GuiTextEditCtrl(){
internalName = "rotation";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "width";
VertSizing = "bottom";
Position = "57 42";
Extent = "141 18";
text = "";
AltCommand = "ConvexEditorGui.editNodeDetails();";
};
new GuiTextCtrl(){
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "7 63";
Extent = "46 18";
text = "Width";
};
new GuiTextEditCtrl(){
internalName = "width";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "57 63";
Extent = "52 18";
text = "";
AltCommand = "ConvexEditorGui.editNodeDetails();";
};
new GuiTextCtrl(){
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "110 63";
Extent = "32 18";
text = "Depth";
};
new GuiTextEditCtrl(){
internalName = "depth";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "146 63";
Extent = "52 18";
text = "";
AltCommand = "ConvexEditorGui.editNodeDetails();";
};
};
new GuiContainer(){ //Conve Road 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 = "ConvexShape 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 41 3 3";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
lockHorizScroll = "true";
lockVertScroll = "false";
constantThumbHeight = "0";
childMargin = "0 0";
new GuiInspector(ConvexInspector) {
StackingType = "Vertical";
HorizStacking = "Left to Right";
VertStacking = "Top to Bottom";
Padding = "1";
name = "ConvexInspector";
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiTransparentProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "1 1";
Extent = "179 16";
MinExtent = "16 16";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
dividerMargin = "5";
};
};
new GuiMLTextCtrl(ConvexFieldInfoControl) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiInspectorFieldInfoMLTextProfile";
HorizSizing = "width";
VertSizing = "top";
Position = "1 485";
Extent = "202 42";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
useURLMouseCursor = "0";
};
};
new GuiWindowCollapseCtrl(ConvexEditorTipsWindow) {
CollapseGroup = "-1";
CollapseGroupNum = "-1";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
EdgeSnap = "1";
text = "Tips";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "1";
Profile = "ToolsGuiWindowCollapseProfile";
HorizSizing = "windowRelative";
VertSizing = "windowRelative";
position = "6 483";
Extent = "136 246";
MinExtent = "8 2";
canSave = "1";
Visible = "0";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "1";
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
lockHorizScroll = "1";
lockVertScroll = "0";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
Docking = "Client";
Margin = "3 1 3 3";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "1";
Profile = "ToolsGuiScrollProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "4 24";
Extent = "128 218";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
new GuiTextListCtrl() {
columns = "0";
fitParentWidth = "1";
clipColumnText = "0";
isContainer = "1";
Profile = "ToolsGuiTextListProfile";
HorizSizing = "width";
VertSizing = "top";
position = "1 1";
Extent = "126 2";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
internalName = "TextList";
canSaveDynamicFields = "0";
};
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,180 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(ConvexEditorSettingsTab,EditorGuiGroup) {
isContainer = "1";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "208 600";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "1";
new GuiTabPageCtrl(EConvexEditorSettingsPage) {
fitBook = "1";
text = "Convex Editor";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "1";
Profile = "ToolsGuiSolidDefaultProfile";
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "208 400";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "1";
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
lockHorizScroll = "1";
lockVertScroll = "0";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "1";
Profile = "ToolsGuiScrollProfile";
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "208 400";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
new GuiStackControl() {
StackingType = "Vertical";
HorizStacking = "Left to Right";
VertStacking = "Top to Bottom";
Padding = "0";
isContainer = "1";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "1 1";
extent = "208 210";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
new GuiRolloutCtrl() {
Profile = "GuiRolloutProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "10 10";
extent = "208 95";
Caption = "Defaults";
Margin = "0 3 0 0";
DragSizable = false;
container = true;
new GuiStackControl() {
StackingType = "Vertical";
HorizStacking = "Left to Right";
VertStacking = "Top to Bottom";
Padding = "0";
isContainer = "1";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "0 0";
Extent = "208 0";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
padding = "3";
new GuiControl() {
isContainer = "1";
horizSizing = "right";
vertSizing = "bottom";
extent = "208 18";
new GuiTextCtrl() {
text = "Material:";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "0";
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "5 1";
Extent = "70 16";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiTextEditCtrl() {
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
passwordMask = "*";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "81 0";
Extent = "121 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "1";
class = "ESettingsWindowTextEdit";
className = "ESettingsWindowTextEdit";
editorSettingsRead = "ConvexEditorPlugin.readSettings();";
editorSettingsValue = "ConvexEditor/MaterialName";
editorSettingsWrite = "ConvexEditorPlugin.writeSettings();";
};
};
};
};
};
};
};
};

View file

@ -0,0 +1,121 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(convexEditorToolbar, EditorGuiGroup) {
canSaveDynamicFields = "0";
internalName = "";
isContainer = "1";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "bottom";
Position = "305 0";
Extent = "550" SPC getWord(EditorGuiToolbar.extent, 1);
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
canMove = "0";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
resizeWidth = "0";
resizeHeight = "0";
EdgeSnap = "0";
text ="";
new GuiContainer() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "menubarProfile";
HorizSizing = "width";
VertSizing = "bottom";
Position = "0 0";
Extent = "800 32";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
hovertime = "1000";
new GuiTextCtrl() {
profile = "ToolsGuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "15 7";
extent = "86 16";
minExtent = "8 8";
visible = "1";
text = "Sketch Tool";
maxLength = "255";
helpTag = "0";
};
new GuiBitmapCtrl() {
Profile = "ToolsGuiDefaultProfile";
position = "94 3";
Extent = "2 26";
MinExtent = "1 1";
bitmap = "tools/gui/images/separator-h.png";
};
new GuiBitmapButtonCtrl(ConvexEditorCreateBoxBtn) {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "100 3";
Extent = "29 27";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
Command = "ConvexEditorGui.createConvexBox();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Create ConvexShape Box" NL "Use Alt + Click-Drag instead of this for more control of starting placement.";
hovertime = "1000";
bitmap = "tools/convexEditor/images/convex-editor-btn";
text = "";
groupNum = "-1";
buttonType = "pushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(ConvexEditorSplitFaceBtn) {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "134 3";
Extent = "29 27";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
Command = "ConvexEditorGui.splitSelectedFace();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Split selected face" NL "Use Ctrl + Rotate instead for more control.";
hovertime = "1000";
bitmap = "tools/convexEditor/images/split-face-btn";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(ConvexEditorDeleteFaceBtn) {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "166 3";
Extent = "29 27";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
Command = "ConvexEditorGui.handleDelete();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Delete selected face" NL "(Delete)";
hovertime = "1000";
bitmap = "tools/gui/images/menubar/delete-btn";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
};
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

View file

@ -0,0 +1,5 @@
singleton Material(DefaultConvexShapeMat)
{
mapTo = "unmapped_mat";
diffuseMap[0] = "./512_orange.png";
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

View file

@ -0,0 +1,220 @@
//-----------------------------------------------------------------------------
// 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 initializeConvexEditor()
{
echo(" % - Initializing Sketch Tool");
exec( "./convexEditor.cs" );
exec( "./convexEditorGui.gui" );
exec( "./convexEditorToolbar.ed.gui" );
exec( "./convexEditorGui.cs" );
ConvexEditorGui.setVisible( false );
ConvexEditorOptionsWindow.setVisible( false );
ConvexEditorTreeWindow.setVisible( false );
ConvexEditorToolbar.setVisible( false );
EditorGui.add( ConvexEditorGui );
EditorGui.add( ConvexEditorOptionsWindow );
EditorGui.add( ConvexEditorTreeWindow );
EditorGui.add( ConvexEditorToolbar );
new ScriptObject( ConvexEditorPlugin )
{
superClass = "EditorPlugin";
editorGui = ConvexEditorGui;
};
// Note that we use the WorldEditor's Toolbar.
%map = new ActionMap();
%map.bindCmd( keyboard, "1", "ConvexEditorNoneModeBtn.performClick();", "" ); // Select
%map.bindCmd( keyboard, "2", "ConvexEditorMoveModeBtn.performClick();", "" ); // Move
%map.bindCmd( keyboard, "3", "ConvexEditorRotateModeBtn.performClick();", "" );// Rotate
%map.bindCmd( keyboard, "4", "ConvexEditorScaleModeBtn.performClick();", "" ); // Scale
ConvexEditorPlugin.map = %map;
ConvexEditorPlugin.initSettings();
}
function ConvexEditorPlugin::onWorldEditorStartup( %this )
{
// Add ourselves to the window menu.
%accel = EditorGui.addToEditorsMenu( "Sketch Tool", "", ConvexEditorPlugin );
// Add ourselves to the ToolsToolbar
%tooltip = "Sketch Tool (" @ %accel @ ")";
EditorGui.addToToolsToolbar( "ConvexEditorPlugin", "ConvexEditorPalette", expandFilename("tools/convexEditor/images/convex-editor-btn"), %tooltip );
//connect editor windows
GuiWindowCtrl::attach( ConvexEditorOptionsWindow, ConvexEditorTreeWindow);
// Allocate our special menu.
// It will be added/removed when this editor is activated/deactivated.
if ( !isObject( ConvexActionsMenu ) )
{
singleton PopupMenu( ConvexActionsMenu )
{
superClass = "MenuBuilder";
barTitle = "Sketch";
Item[0] = "Hollow Selected Shape" TAB "" TAB "ConvexEditorGui.hollowSelection();";
item[1] = "Recenter Selected Shape" TAB "" TAB "ConvexEditorGui.recenterSelection();";
};
}
%this.popupMenu = ConvexActionsMenu;
exec( "./convexEditorSettingsTab.ed.gui" );
ESettingsWindow.addTabPage( EConvexEditorSettingsPage );
}
function ConvexEditorPlugin::onActivated( %this )
{
%this.readSettings();
EditorGui.bringToFront( ConvexEditorGui );
ConvexEditorGui.setVisible( true );
ConvexEditorToolbar.setVisible( true );
ConvexEditorGui.makeFirstResponder( true );
%this.map.push();
// Set the status bar here until all tool have been hooked up
EditorGuiStatusBar.setInfo( "Sketch Tool." );
EditorGuiStatusBar.setSelection( "" );
// Add our menu.
EditorGui.menuBar.insert( ConvexActionsMenu, EditorGui.menuBar.dynamicItemInsertPos );
// Sync the pallete button state with the gizmo mode.
%mode = GlobalGizmoProfile.mode;
switch$ (%mode)
{
case "None":
ConvexEditorNoneModeBtn.performClick();
case "Move":
ConvexEditorMoveModeBtn.performClick();
case "Rotate":
ConvexEditorRotateModeBtn.performClick();
case "Scale":
ConvexEditorScaleModeBtn.performClick();
}
Parent::onActivated( %this );
}
function ConvexEditorPlugin::onDeactivated( %this )
{
%this.writeSettings();
ConvexEditorGui.setVisible( false );
ConvexEditorOptionsWindow.setVisible( false );
ConvexEditorTreeWindow.setVisible( false );
ConvexEditorToolbar.setVisible( false );
%this.map.pop();
// Remove our menu.
EditorGui.menuBar.remove( ConvexActionsMenu );
Parent::onDeactivated( %this );
}
function ConvexEditorPlugin::onEditMenuSelect( %this, %editMenu )
{
%hasSelection = false;
if ( ConvexEditorGui.hasSelection() )
%hasSelection = true;
%editMenu.enableItem( 3, false ); // Cut
%editMenu.enableItem( 4, false ); // Copy
%editMenu.enableItem( 5, false ); // Paste
%editMenu.enableItem( 6, %hasSelection ); // Delete
%editMenu.enableItem( 8, %hasSelection ); // Deselect
}
function ConvexEditorPlugin::handleDelete( %this )
{
ConvexEditorGui.handleDelete();
}
function ConvexEditorPlugin::handleDeselect( %this )
{
ConvexEditorGui.handleDeselect();
}
function ConvexEditorPlugin::handleCut( %this )
{
//WorldEditorInspectorPlugin.handleCut();
}
function ConvexEditorPlugin::handleCopy( %this )
{
//WorldEditorInspectorPlugin.handleCopy();
}
function ConvexEditorPlugin::handlePaste( %this )
{
//WorldEditorInspectorPlugin.handlePaste();
}
function ConvexEditorPlugin::isDirty( %this )
{
return ConvexEditorGui.isDirty;
}
function ConvexEditorPlugin::onSaveMission( %this, %missionFile )
{
if( ConvexEditorGui.isDirty )
{
MissionGroup.save( %missionFile );
ConvexEditorGui.isDirty = false;
}
}
//-----------------------------------------------------------------------------
// Settings
//-----------------------------------------------------------------------------
function ConvexEditorPlugin::initSettings( %this )
{
EditorSettings.beginGroup( "ConvexEditor", true );
EditorSettings.setDefaultValue( "MaterialName", "DefaultConvexShapeMat" );
EditorSettings.endGroup();
}
function ConvexEditorPlugin::readSettings( %this )
{
EditorSettings.beginGroup( "ConvexEditor", true );
ConvexEditorGui.materialName = EditorSettings.value("MaterialName");
EditorSettings.endGroup();
}
function ConvexEditorPlugin::writeSettings( %this )
{
EditorSettings.beginGroup( "ConvexEditor", true );
EditorSettings.setValue( "MaterialName", ConvexEditorGui.materialName );
EditorSettings.endGroup();
}