Initial commit

This commit is contained in:
Eagle517
2025-02-17 23:17:30 -06:00
commit 7cad314c94
4726 changed files with 1145203 additions and 0 deletions

View File

@ -0,0 +1,82 @@
//--- OBJECT WRITE BEGIN ---
new SimGroup(MissionGroup) {
new ScriptObject(MissionInfo) {
name = "New Mission";
desc0 = "A simple new mission template.";
descLines = "1";
};
new MissionArea(MissionArea) {
area = "-360 -648 720 1296";
flightCeiling = "300";
flightCeilingRange = "20";
locked = "true";
};
new Sky(Sky) {
position = "336 136 0";
rotation = "1 0 0 0";
scale = "1 1 1";
cloudHeightPer[0] = "0.349971";
cloudHeightPer[1] = "0.3";
cloudHeightPer[2] = "0.199973";
cloudSpeed1 = "0.0005";
cloudSpeed2 = "0.001";
cloudSpeed3 = "0.0003";
visibleDistance = "500";
useSkyTextures = "1";
renderBottomTexture = "0";
SkySolidColor = "0.600000 0.600000 0.600000 1.000000";
fogDistance = "300";
fogColor = "0.600000 0.600000 0.600000 1.000000";
fogVolume1 = "0 0 0";
fogVolume2 = "0 0 0";
fogVolume3 = "0 0 0";
materialList = "~/data/skies/sky_day.dml";
windVelocity = "1 1 0";
windEffectPrecipitation = "1";
fogVolumeColor1 = "128.000000 128.000000 128.000000 -222768174765569860000000000000000000000.000000";
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
fogVolumeColor3 = "128.000000 128.000000 128.000000 -170698929442160050000000000000000000000.000000";
locked = "true";
};
new Sun() {
direction = "0.57735 0.57735 -0.57735";
color = "0.600000 0.600000 0.600000 1.000000";
ambient = "0.400000 0.400000 0.400000 1.000000";
position = "0 0 0";
locked = "true";
rotation = "1 0 0 0";
scale = "1 1 1";
};
new TerrainBlock(Terrain) {
rotation = "1 0 0 0";
scale = "1 1 1";
//detailTexture = "~/data/terrains/details/detail1";
terrainFile = "./newMission.ter";
//bumpTexture = "~/data/terrains/details/detail1Bump";
squareSize = "8";
bumpScale = "2";
bumpOffset = "0.007";
zeroBumpScale = "7";
squareSize = "8";
position = "-1024 -1024 0";
locked = "true";
};
new SimGroup(PlayerDropPoints) {
new SpawnSphere() {
position = "78.9891 -214.86 183.615";
rotation = "0 0 1 130.062";
scale = "0.940827 1.97505 1";
dataBlock = "SpawnSphereMarker";
radius = "10";
sphereWeight = "1";
indoorWeight = "1";
outdoorWeight = "1";
homingCount = "0";
locked = "false";
lockCount = "0";
};
};
};
//--- OBJECT WRITE END ---

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,9 @@
day_0001
day_0002
day_0003
day_0004
day_0005
day_0006
day_0007
cloud1
cloud1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

View File

@ -0,0 +1,145 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(DebuggerBreakConditionDlg) {
profile = "GuiDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
new GuiWindowCtrl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "220 146";
extent = "200 188";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Set the break condition";
resizeWidth = "True";
resizeHeight = "True";
canMove = "False";
canClose = "False";
canMinimize = "False";
canMaximize = "False";
minSize = "50 50";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 28";
extent = "121 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Enter the break condition:";
};
new GuiTextEditCtrl(BreakCondition) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 44";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
altCommand = "DbgBreakConditionSet();";
helpTag = "0";
historySize = "0";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 68";
extent = "57 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Pass Count:";
};
new GuiTextEditCtrl(BreakPassCount) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 84";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
historySize = "0";
returnTab = "true";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 108";
extent = "27 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Clear:";
};
new GuiTextEditCtrl(BreakClear) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 124";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
historySize = "0";
returnTab = "true";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "56 156";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DbgBreakConditionSet();";
helpTag = "0";
text = "Set";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "104 156";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.popDialog(DebuggerBreakConditionDlg);";
helpTag = "0";
text = "Cancel";
};
};
};
//--- OBJECT WRITE END ---

View File

@ -0,0 +1,148 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(DebuggerConnectDlg) {
profile = "GuiDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
new GuiWindowCtrl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "220 146";
extent = "200 188";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Connect to server:";
resizeWidth = "True";
resizeHeight = "True";
canMove = "False";
canClose = "False";
canMinimize = "False";
canMaximize = "False";
minSize = "50 50";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 28";
extent = "55 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "IP Address:";
};
new GuiTextEditCtrl(DebuggerConnectAddress) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 44";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
variable = "$pref::DBGConnectAddress";
helpTag = "0";
historySize = "0";
returnTab = "true";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 68";
extent = "21 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Port:";
};
new GuiTextEditCtrl(DebuggerConnectPort) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 84";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
variable = "$pref::DBGConnectPort";
helpTag = "0";
historySize = "0";
returnTab = "true";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 108";
extent = "52 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Password:";
};
new GuiTextEditCtrl(DebuggerConnectPassword) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 124";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
variable = "$pref::DBGConnectPassword";
helpTag = "0";
historySize = "0";
returnTab = "true";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "56 156";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DbgConnect();";
helpTag = "0";
text = "Open";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "104 156";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.popDialog(DebuggerConnectDlg);";
helpTag = "0";
text = "Cancel";
};
};
};
//--- OBJECT WRITE END ---

View File

@ -0,0 +1,93 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(DebuggerEditWatchDlg) {
profile = "GuiDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
new GuiWindowCtrl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "220 180";
extent = "200 108";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Edit a Variable";
resizeWidth = "True";
resizeHeight = "True";
canMove = "False";
canClose = "False";
canMinimize = "False";
canMaximize = "False";
minSize = "50 50";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 28";
extent = "99 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Enter the new value:";
};
new GuiTextEditCtrl(EditWatchDialogValue) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 44";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
altCommand = "DbgWatchDialogEdit();";
helpTag = "0";
historySize = "0";
fontHL = "14 253 Arial";
font = "14 244 Arial";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "56 80";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DbgWatchDialogEdit();";
helpTag = "0";
text = "Edit";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "104 80";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.popDialog(DebuggerEditWatchDlg);";
helpTag = "0";
text = "Cancel";
};
};
};
//--- OBJECT WRITE END ---

View File

@ -0,0 +1,93 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(DebuggerFindDlg) {
profile = "GuiDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
new GuiWindowCtrl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "220 180";
extent = "200 108";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "File Search";
resizeWidth = "True";
resizeHeight = "True";
canMove = "False";
canClose = "False";
canMinimize = "False";
canMaximize = "False";
minSize = "50 50";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 28";
extent = "99 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Search for:";
};
new GuiTextEditCtrl(DebuggerFindStringText) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 44";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
altCommand = "DbgFileViewFind();";
helpTag = "0";
historySize = "0";
fontHL = "14 253 Arial";
font = "14 244 Arial";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "56 80";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DbgFileViewFind();";
helpTag = "0";
text = "Find";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "104 80";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.popDialog(DebuggerFindDlg);";
helpTag = "0";
text = "Cancel";
};
};
};
//--- OBJECT WRITE END ---

View File

@ -0,0 +1,576 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(DebuggerGui) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "8 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.pushDialog(DebuggerConnectDlg, 80);";
helpTag = "0";
text = "Connect";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "72 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.pushDialog(OpenFileDialog, 80);";
helpTag = "0";
text = "File";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "72 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "dbgStepIn();";
accelerator = "f7";
helpTag = "0";
text = "Step In";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "136 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "dbgStepOver();";
accelerator = "f8";
helpTag = "0";
text = "Step Over";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "200 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "dbgStepOut();";
accelerator = "f6";
helpTag = "0";
text = "Step Out";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "264 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "dbgContinue();";
accelerator = "f9";
helpTag = "0";
text = "Run";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "328 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.pushDialog(DebuggerFindDlg, 80);";
helpTag = "0";
text = "Find";
};
new GuiTextCtrl(DebuggerCursorWatch) {
profile = "GuiTextProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "398 4";
extent = "126 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "";
justify = "left";
};
new GuiTextCtrl(DebuggerStatus) {
profile = "GuiTextProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "532 4";
extent = "60 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "NOT CONNECTED";
justify = "right";
};
new GuiFrameSetCtrl(DebuggerRootFrame) {
profile = "GuiContentProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 24";
extent = "640 456";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
columns = "0 486";
rows = "0";
borderWidth = "4";
borderColor = "0.000000, 0.000000, 0.000000, 0.000000";
borderEnable = "dynamic";
borderMovable = "dynamic";
new GuiFrameSetCtrl(DebuggerLeftFrame) {
profile = "GuiContentProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "482 456";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
columns = "0";
rows = "0 350";
borderWidth = "4";
borderColor = "0.000000, 0.000000, 0.000000, 0.000000";
borderEnable = "dynamic";
borderMovable = "dynamic";
new GuiControl() {
profile = "GuiDefaultProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "482 346";
minExtent = "8 8";
visible = "True";
setFirstResponder = "True";
modal = "True";
helpTag = "0";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "8 4";
extent = "47 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Open File:";
};
new GuiPopUpMenuCtrl(DebuggerFilePopup) {
profile = "GuiPopUpMenuProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "64 4";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "True";
modal = "True";
helpTag = "0";
maxPopupHeight = "200";
};
new GuiScrollCtrl() {
profile = "GuiScrollProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 24";
extent = "482 321";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
willFirstRespond = "True";
hScrollBar = "dynamic";
vScrollBar = "dynamic";
constantThumbHeight = "False";
new DbgFileView(DebuggerFileView) {
profile = "GuiTextArrayProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 -433";
extent = "509 3904";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
};
};
};
new GuiControl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 350";
extent = "482 106";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "8 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.pushDialog(DebuggerWatchDlg, 80);";
helpTag = "0";
text = "Add";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "72 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.pushDialog(DebuggerEditWatchDlg, 80);";
helpTag = "0";
text = "Edit";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "136 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DbgDeleteSelectedWatch();";
helpTag = "0";
text = "Delete";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "200 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DebuggerWatchView.clear();";
helpTag = "0";
text = "Clear";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "264 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DbgRefreshWatches();";
helpTag = "0";
text = "Refresh";
};
new GuiScrollCtrl() {
profile = "GuiScrollProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 24";
extent = "481 80";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
willFirstRespond = "True";
hScrollBar = "dynamic";
vScrollBar = "dynamic";
constantThumbHeight = "False";
new GuiTextListCtrl(DebuggerWatchView) {
profile = "GuiTextListProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 8";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
enumerate = "False";
resizeCell = "True";
columns = "0 200";
};
};
};
};
new GuiFrameSetCtrl(DebuggerRightFrame) {
profile = "GuiContentProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "486 0";
extent = "154 456";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
columns = "0";
rows = "0 150 350";
borderWidth = "4";
borderColor = "0.000000, 0.000000, 0.000000, 0.000000";
borderEnable = "dynamic";
borderMovable = "dynamic";
new GuiScrollCtrl() {
profile = "GuiScrollProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "154 146";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
willFirstRespond = "True";
hScrollBar = "dynamic";
vScrollBar = "dynamic";
constantThumbHeight = "False";
new GuiTextListCtrl(DebuggerCallStack) {
profile = "GuiTextListProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 8";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
enumerate = "False";
resizeCell = "True";
columns = "-1 -1 0";
};
};
new GuiControl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 150";
extent = "154 196";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "4 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.pushDialog(DebuggerBreakConditionDlg, 80);";
helpTag = "0";
text = "Condition";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "68 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DbgDeleteSelectedBreak();";
helpTag = "0";
text = "Delete";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "132 4";
extent = "56 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DebuggerBreakPoints.clearBreaks();";
helpTag = "0";
text = "Clear";
};
new GuiScrollCtrl() {
profile = "GuiScrollProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 24";
extent = "153 171";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
willFirstRespond = "True";
hScrollBar = "dynamic";
vScrollBar = "dynamic";
constantThumbHeight = "False";
new GuiTextListCtrl(DebuggerBreakPoints) {
profile = "GuiTextListProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "182 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
enumerate = "False";
resizeCell = "True";
columns = "16 56 156";
};
};
};
new GuiControl() {
profile = "GuiWindowProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 350";
extent = "154 106";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
new GuiScrollCtrl() {
profile = "GuiScrollProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "153 80";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
willFirstRespond = "True";
hScrollBar = "dynamic";
vScrollBar = "dynamic";
constantThumbHeight = "False";
new GuiTextListCtrl(DebuggerConsoleView) {
profile = "GuiTextListProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "62 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
enumerate = "False";
resizeCell = "True";
columns = "0";
};
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "top";
position = "15 83";
extent = "9 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "%";
};
new GuiTextEditCtrl(DbgConsoleEntry) {
profile = "GuiTextEditProfile";
horizSizing = "width";
vertSizing = "top";
position = "29 83";
extent = "120 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
altCommand = "DbgConsoleEntryReturn();";
helpTag = "0";
historySize = "32";
};
};
};
};
};
//--- OBJECT WRITE END ---

View File

@ -0,0 +1,92 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(DebuggerWatchDlg) {
profile = "GuiDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
new GuiWindowCtrl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "220 180";
extent = "200 108";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Add a Watch Expression:";
resizeWidth = "True";
resizeHeight = "True";
canMove = "False";
canClose = "False";
canMinimize = "False";
canMaximize = "False";
minSize = "50 50";
opaque = "true";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 28";
extent = "88 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Enter the Variable:";
};
new GuiTextEditCtrl(WatchDialogExpression) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 44";
extent = "160 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
altCommand = "DbgWatchDialogAdd();";
helpTag = "0";
historySize = "0";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "56 80";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "DbgWatchDialogAdd();";
helpTag = "0";
text = "Add";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "104 80";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "Canvas.popDialog(DebuggerWatchDlg);";
helpTag = "0";
text = "Cancel";
};
};
};
//--- OBJECT WRITE END ---

View File

@ -0,0 +1,552 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Remote scripting debugger
// To use the debugger, use dbgSetParameters(port, password); in the console
// of the server to enable debugger connections. Then on some other system,
// start up the app (you don't have to start a game or connect to the
// server) and exec("common/debugger/debugger.cs"); in the console. Then use
// the debugger GUI to connect to the server with the right port and password.
// Create the GUIs.
exec("./DebuggerBreakConditionDlg.gui");
exec("./DebuggerConnectDlg.gui");
exec("./DebuggerEditWatchDlg.gui");
exec("./DebuggerFindDlg.gui");
exec("./DebuggerGui.gui");
exec("./DebuggerWatchDlg.gui");
// Create a TCP object named TCPDebugger.
new TCPObject(TCPDebugger);
// Used to get unique IDs for breakpoints and watch expressions.
$DbgBreakId = 0;
$DbgWatchSeq = 1;
// Functions for the TCPDebugger object:
// onLine is invoked whenever the TCP object receives a line from the server.
// Treat the first word as a "command" and dispatch to an appropriate
// handler.
function TCPDebugger::onLine(%this, %line)
{
echo("Got line=>" @ %line);
%cmd = firstWord(%line);
%rest = restWords(%line);
if (%cmd $= "PASS") {
%this.handlePass(%rest);
}
else if(%cmd $= "COUT") {
%this.handleLineOut(%rest);
}
else if(%cmd $= "FILELISTOUT") {
%this.handleFileList(%rest);
}
else if(%cmd $= "BREAKLISTOUT") {
%this.handleBreakList(%rest);
}
else if(%cmd $= "BREAK") {
%this.handleBreak(%rest);
}
else if(%cmd $= "RUNNING") {
%this.handleRunning();
}
else if(%cmd $= "EVALOUT") {
%this.handleEvalOut(%rest);
}
else {
%this.handleError(%line);
}
}
// Handler for PASS response.
function TCPDebugger::handlePass(%this, %message)
{
if (%message $= "WrongPass") {
DebuggerConsoleView.print("Disconnected - wrong password.");
%this.disconnect();
}
else if(%message $= "Connected.") {
DebuggerConsoleView.print("Connected.");
DebuggerStatus.setValue("CONNECTED");
%this.send("FILELIST\r\n");
}
}
// Handler for COUT response.
function TCPDebugger::handleLineOut(%this, %line)
{
DebuggerConsoleView.print(%line);
}
// Handler for FILELISTOUT response.
function TCPDebugger::handleFileList(%this, %line)
{
DebuggerFilePopup.clear();
%word = 0;
while ((%file = getWord(%line, %word)) !$= "") {
%word++;
DebuggerFilePopup.add(%file, %word);
}
}
// Handler for BREAKLISTOUT response.
function TCPDebugger::handleBreakList(%this, %line)
{
%file = getWord(%line, 0);
if (%file != $DebuggerFile) {
return;
}
%pairs = getWord(%line, 1);
%curLine = 1;
DebuggerFileView.clearBreakPositions();
// Set the possible break positions.
for (%i = 0; %i < %pairs; %i++) {
%skip = getWord(%line, %i * 2 + 2);
%breaks = getWord(%line, %i * 2 + 3);
%curLine += %skip;
for (%j = 0; %j < %breaks; %j++) {
DebuggerFileView.setBreakPosition(%curLine);
%curLine++;
}
}
// Now set the actual break points.
for (%i = 0; %i < DebuggerBreakPoints.rowCount(); %i++) {
%breakText = DebuggerBreakPoints.getRowText(%i);
%breakLine = getField(%breakText, 0);
%breakFile = getField(%breakText, 1);
if (%breakFile == $DebuggerFile) {
DebuggerFileView.setBreak(%breakLine);
}
}
}
// Handler for BREAK response.
function TCPDebugger::handleBreak(%this, %line)
{
DebuggerStatus.setValue("BREAK");
// Query all the watches.
for (%i = 0; %i < DebuggerWatchView.rowCount(); %i++) {
%id = DebuggerWatchView.getRowId(%i);
%row = DebuggerWatchView.getRowTextById(%id);
%expr = getField(%row, 0);
%this.send("EVAL " @ %id @ " 0 " @ %expr @ "\r\n");
}
// Update the call stack window.
DebuggerCallStack.clear();
%file = getWord(%line, 0);
%lineNumber = getWord(%line, 1);
%funcName = getWord(%line, 2);
DbgOpenFile(%file, %lineNumber, true);
%nextWord = 3;
%rowId = 0;
%id = 0;
while(1) {
DebuggerCallStack.setRowById(%id, %file @ "\t" @ %lineNumber @ "\t" @ %funcName);
%id++;
%file = getWord(%line, %nextWord);
%lineNumber = getWord(%line, %nextWord + 1);
%funcName = getWord(%line, %nextWord + 2);
%nextWord += 3;
if (%file $= "") {
break;
}
}
}
// Handler for RUNNING response.
function TCPDebugger::handleRunning(%this)
{
DebuggerFileView.setCurrentLine(-1, true);
DebuggerCallStack.clear();
DebuggerStatus.setValue("RUNNING...");
}
// Handler for EVALOUT response.
function TCPDebugger::handleEvalOut(%this, %line)
{
%id = firstWord(%line);
%value = restWords(%line);
// See if it's the cursor watch, or from the watch window.
if (%id < 0) {
DebuggerCursorWatch.setText(DebuggerCursorWatch.expr SPC "=" SPC %value);
}
else {
%row = DebuggerWatchView.getRowTextById(%id);
if (%row $= "") {
return;
}
%expr = getField(%row, 0);
DebuggerWatchView.setRowById(%id, %expr @ "\t" @ %value);
}
}
// Handler for unrecognized response.
function TCPDebugger::handleError(%this, %line)
{
DebuggerConsoleView.print("ERROR - bogus message: " @ %line);
}
// XXX Do we want/need to define any of these?
function TCPDebugger::onDNSResolve(%this)
{
}
function TCPDebugger::onConnecting(%this)
{
}
function TCPDebugger::onConnected(%this)
{
}
function TCPDebugger::onConnectFailed(%this)
{
}
function TCPDebugger::onDisconnect(%this)
{
}
// Functions for the GUI objects:
// Print a line of response from the server.
function DebuggerConsoleView::print(%this, %line)
{
%row = %this.addRow(0, %line);
%this.scrollVisible(%row);
}
// When entry in file list selected, open the file.
function DebuggerFilePopup::onSelect(%this, %id, %text)
{
DbgOpenFile(%text, 0, false);
}
// When entry on call stack selected, open the file and go to the line.
function DebuggerCallStack::onAction(%this)
{
%id = %this.getSelectedId();
if (%id == -1) {
return;
}
%text = %this.getRowTextById(%id);
%file = getField(%text, 0);
%line = getField(%text, 1);
DbgOpenFile(%file, %line, %id == 0);
}
// Add a breakpoint at the selected spot, if it doesn't already exist.
function DebuggerBreakPoints::addBreak(%this, %file, %line, %clear, %passct, %expr)
{
// columns 0 = line, 1 = file, 2 = expr
%textLine = %line @ "\t" @ %file @ "\t" @ %expr @ "\t" @ %passct @ "\t" @ %clear;
%selId = %this.getSelectedId();
%selText = %this.getRowTextById(%selId);
if ((getField(%selText, 0) $= %line) && (getField(%selText, 1) $= %file)) {
%this.setRowById(%selId, %textLine);
}
else {
%this.addRow($DbgBreakId, %textLine);
$DbgBreakId++;
}
}
// Remove the selected breakpoint.
function DebuggerBreakPoints::removeBreak(%this, %file, %line)
{
for (%i = 0; %i < %this.rowCount(); %i++) {
%id = %this.getRowId(%i);
%text = %this.getRowTextById(%id);
if ((getField(%text, 0) $= %line) && (getField(%text, 1) $= %file)) {
%this.removeRowById(%id);
return;
}
}
}
// Remove all breakpoints.
function DebuggerBreakPoints::clearBreaks(%this)
{
while (%this.rowCount()) {
%id = %this.getRowId(0);
%text = %this.getRowTextById(%id);
%file = getField(%text, 1);
%line = getField(%text, 0);
DbgRemoveBreakPoint(%file, %line);
}
}
// Go to file & line for the selected breakpoint.
function DebuggerBreakPoints::onAction(%this)
{
%id = %this.getSelectedId();
if (%id == -1) {
return;
}
%text = %this.getRowTextById(%id);
%line = getField(%text, 0);
%file = getField(%text, 1);
DbgOpenFile(%file, %line, false);
}
// Handle breakpoint removal executed from the file-view GUI.
function DebuggerFileView::onRemoveBreakPoint(%this, %line)
{
%file = $DebuggerFile;
DbgRemoveBreakPoint(%file, %line);
}
// Handle breakpoint addition executed from the file-view GUI.
function DebuggerFileView::onSetBreakPoint(%this, %line)
{
%file = $DebuggerFile;
DbgSetBreakPoint(%file, %line, 0, 0, true);
}
// Support functions:
// Add a watch expression.
function DbgWatchDialogAdd()
{
%expr = WatchDialogExpression.getValue();
if (%expr !$= "") {
DebuggerWatchView.setRowById($DbgWatchSeq, %expr @"\t(unknown)");
TCPDebugger.send("EVAL " @ $DbgWatchSeq @ " 0 " @ %expr @ "\r\n");
$DbgWatchSeq++;
}
Canvas.popDialog(DebuggerWatchDlg);
}
// Edit a watch expression.
function DbgWatchDialogEdit()
{
%newValue = EditWatchDialogValue.getValue();
%id = DebuggerWatchView.getSelectedId();
if (%id >= 0) {
%row = DebuggerWatchView.getRowTextById(%id);
%expr = getField(%row, 0);
if (%newValue $= "") {
%assignment = %expr @ " = \"\"";
}
else {
%assignment = %expr @ " = " @ %newValue;
}
TCPDebugger.send("EVAL " @ %id @ " 0 " @ %assignment @ "\r\n");
}
Canvas.popDialog(DebuggerEditWatchDlg);
}
// Set/change the singular "cursor watch" expression.
function DbgSetCursorWatch(%expr)
{
DebuggerCursorWatch.expr = %expr;
if (DebuggerCursorWatch.expr $= "") {
DebuggerCursorWatch.setText("");
}
else {
TCPDebugger.send("EVAL -1 0 " @ DebuggerCursorWatch.expr @ "\r\n");
}
}
// Connect to the server with the given addr/port/password.
function DbgConnect()
{
%address = DebuggerConnectAddress.getValue();
%port = DebuggerConnectPort.getValue();
%password = DebuggerConnectPassword.getValue();
if ((%address !$= "" ) && (%port !$= "" ) && (%password !$= "" )) {
TCPDebugger.connect(%address @ ":" @ %port);
TCPDebugger.schedule(5000, send, %password @ "\r\n");
TCPDebugger.password = %password;
}
Canvas.popDialog(DebuggerConnectDlg);
}
// Put a condition on a breakpoint.
function DbgBreakConditionSet()
{
// Read the condition.
%condition = BreakCondition.getValue();
%passct = BreakPassCount.getValue();
%clear = BreakClear.getValue();
if (%condition $= "") {
%condition = "true";
}
if (%passct $= "") {
%passct = "0";
}
if (%clear $= "") {
%clear = "false";
}
// Set the condition.
%id = DebuggerBreakPoints.getSelectedId();
if (%id != -1) {
%bkp = DebuggerBreakPoints.getRowTextById(%id);
DbgSetBreakPoint(getField(%bkp, 1), getField(%bkp, 0), %clear, %passct, %condition);
}
Canvas.popDialog(DebuggerBreakConditionDlg);
}
// Open a file, go to the indicated line, and optionally select the line.
function DbgOpenFile(%file, %line, %selectLine)
{
if (%file !$= "") {
// Open the file in the file view.
if (DebuggerFileView.open(%file)) {
// Go to the line.
DebuggerFileView.setCurrentLine(%line, %selectLine);
// Get the breakpoints for this file.
if (%file !$= $DebuggerFile) {
TCPDebugger.send("BREAKLIST " @ %file @ "\r\n");
$DebuggerFile = %file;
}
}
}
}
// Search in the fileview GUI.
function DbgFileViewFind()
{
%searchString = DebuggerFindStringText.getValue();
DebuggerFileView.findString(%searchString);
Canvas.popDialog(DebuggerFindDlg);
}
// Set a breakpoint, optionally with condition.
function DbgSetBreakPoint(%file, %line, %clear, %passct, %expr)
{
if (!%clear) {
if (%file == $DebuggerFile) {
DebuggerFileView.setBreak(%line);
}
}
DebuggerBreakPoints.addBreak(%file, %line, %clear, %passct, %expr);
TCPDebugger.send("BRKSET " @ %file @ " " @ %line @ " " @ %clear @ " " @ %passct @ " " @ %expr @ "\r\n");
}
// Remove a breakpoint.
function DbgRemoveBreakPoint(%file, %line)
{
if (%file == $DebuggerFile) {
DebuggerFileView.removeBreak(%line);
}
TCPDebugger.send("BRKCLR " @ %file @ " " @ %line @ "\r\n");
DebuggerBreakPoints.removeBreak(%file, %line);
}
// Remove whatever breakpoint is selected in the breakpoints GUI.
function DbgDeleteSelectedBreak()
{
%selectedBreak = DebuggerBreakPoints.getSelectedId();
%rowNum = DebuggerBreakPoints.getRowNumById(%selectedWatch);
if (%rowNum >= 0) {
%breakText = DebuggerBreakPoints.getRowText(%rowNum);
%breakLine = getField(%breakText, 0);
%breakFile = getField(%breakText, 1);
DbgRemoveBreakPoint(%breakFile, %breakLine);
}
}
// Send an expression to the server for evaluation.
function DbgConsoleEntryReturn()
{
%msg = DbgConsoleEntry.getValue();
if (%msg !$= "") {
DebuggerConsoleView.print("%" @ %msg);
if (DebuggerStatus.getValue() $= "NOT CONNECTED") {
DebuggerConsoleView.print("*** Not connected.");
}
else if (DebuggerStatus.getValue() $= "BREAK") {
DebuggerConsoleView.print("*** Target is in BREAK mode.");
}
else {
TCPDebugger.send("CEVAL " @ %msg @ "\r\n");
}
}
DbgConsoleEntry.setValue("");
}
// Print a line from the server.
function DbgConsolePrint(%status)
{
DebuggerConsoleView.print(%status);
}
// Delete the currently selected watch expression.
function DbgDeleteSelectedWatch()
{
%selectedWatch = DebuggerWatchView.getSelectedId();
%rowNum = DebuggerWatchView.getRowNumById(%selectedWatch);
DebuggerWatchView.removeRow(%rowNum);
}
// Evaluate all the watch expressions.
function DbgRefreshWatches()
{
for (%i = 0; %i < DebuggerWatchView.rowCount(); %i++) {
%id = DebuggerWatchView.getRowId(%i);
%row = DebuggerWatchView.getRowTextById(%id);
%expr = getField(%row, 0);
TCPDebugger.send("EVAL " @ %id @ " 0 " @ %expr @ "\r\n");
}
}
// Various functions for doing incremental execution.
function dbgStepIn()
{
TCPDebugger.send("STEPIN\r\n");
}
function dbgStepOut()
{
TCPDebugger.send("STEPOUT\r\n");
}
function dbgStepOver()
{
TCPDebugger.send("STEPOVER\r\n");
}
function dbgContinue()
{
TCPDebugger.send("CONTINUE\r\n");
}
// Start up the GUI.
DebuggerConsoleView.setActive(false);
Canvas.pushDialog(DebuggerGui);

View File

@ -0,0 +1,517 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(AIEButtonBarDlg) {
profile = "GuiModelessDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiChunkedBitmapCtrl() {
profile = "GuiContentProfile";
horizSizing = "right";
vertSizing = "height";
position = "0 30";
extent = "120 420";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiCheckBoxCtrl(ExteriorCheckBox) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "11 23";
extent = "100 22";
minExtent = "8 8";
visible = "1";
command = "ExteriorCheckBox.updateCheckBox();";
helpTag = "0";
text = "Draw Ext";
};
new GuiCheckBoxCtrl(InteriorCheckBox) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "11 47";
extent = "100 22";
minExtent = "8 8";
visible = "1";
command = "InteriorCheckBox.updateCheckBox();";
helpTag = "0";
text = "Draw Int";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "11 6";
extent = "73 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Visual Options:";
};
new GuiCheckBoxCtrl(JetConnectionsCheckBox) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "11 73";
extent = "100 22";
minExtent = "8 8";
visible = "1";
command = "JetConnectionsCheckBox.updateCheckBox();";
helpTag = "0";
text = "Draw Jet";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 201";
extent = "100 29";
minExtent = "8 8";
visible = "1";
command = "makeJettableGraph(Nav);";
helpTag = "0";
text = "Bot Graph";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 169";
extent = "100 29";
minExtent = "8 8";
visible = "1";
command = "makeJettableGraph(Spawn);";
helpTag = "0";
text = "Spawn Graph";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 233";
extent = "100 29";
minExtent = "8 8";
visible = "1";
command = "AIEButtonBarDlg.createLOSXref();";
helpTag = "0";
text = "Build LOS";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 265";
extent = "100 29";
minExtent = "8 8";
visible = "1";
command = "navGraph.saveGraph();";
helpTag = "0";
text = "Save";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "11 151";
extent = "56 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Graph Build";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "11 315";
extent = "64 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "AI Objectives";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 331";
extent = "100 29";
minExtent = "8 8";
visible = "1";
command = "AICreateObjectives();";
helpTag = "0";
text = "Build Objectives";
};
new GuiPopUpMenuCtrl(ObjectiveList) {
profile = "GuiPopUpProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 368";
extent = "101 20";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "New Objective";
maxPopupHeight = "200";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 395";
extent = "100 29";
minExtent = "8 8";
visible = "1";
command = "AISaveMissionObjectives();";
helpTag = "0";
text = "Save";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 102";
extent = "73 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Camera speed:";
};
new GuiSliderCtrl() {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "6 121";
extent = "80 20";
minExtent = "80 20";
visible = "1";
variable = "value";
command = "$Camera::movementSpeed = $ThisControl.getValue();";
helpTag = "0";
range = "0.000000 200.000000";
ticks = "10";
value = "20";
};
};
};
//--- OBJECT WRITE END ---
//------------------------------------------------------------------------------
// Functions
//------------------------------------------------------------------------------
function makeUnbridgedGraph()
{
GraphCurrentOperation.setValue("Generating interior nodes...");
Canvas.repaint();
navGraph::generateInterior();
dataProgress();
GraphCurrentOperation.setValue("Remaking graph...");
Canvas.repaint();
remakeTheGraph();
dataProgress();
}
function makeJettableGraph(%NAVorSPAWN)
{
AIworking(true);
$NavGraph::operations = 7;
$NavGraph::operationsDone = 0;
navGraph.setGenMode(%NAVorSPAWN);
navGraph::exteriorInspect();
dataProgress();
makeUnbridgedGraph();
GraphCurrentOperation.setValue("Beginning slow bridge finding pass");
Canvas.repaint();
navGraph.assemble();
navGraph.cullIslands();
remakeTheGraph();
navGraph.pushBridges();
navGraph.makeTables();
dataProgress();
AIworking(false);
}
//------------------------------------------------------------------------------
function AIEButtonBarDlg::getPrefs(%this)
{
}
//------------------------------------------------------------------------------
function AIEbuttonBarDlg::setPrefs(%this)
{
}
//------------------------------------------------------------------------------
function AIEButtonBarDlg::init(%this)
{
InteriorCheckBox.setValue($pref::NavGraph::drawIndoor);
ExteriorCheckBox.setValue($pref::NavGraph::drawOutdoor);
if(!$pref::NavGraph::drawIndoor)
JetConnectionsCheckBox.visible = false;
JetConnectionsCheckBox.setValue($pref::NavGraph::drawJetEdges);
ObjectiveList.clear();
ObjectiveList.setText("New Objective");
ObjectiveList.add("Deploy Outdoor Turret", 1);
ObjectiveList.add("Deploy Indoor Turret", 2);
ObjectiveList.add("Deploy Inventory", 3);
ObjectiveList.add("Touch FlipFlop", 4);
ObjectiveList.add("Mortar Target", 5);
ObjectiveList.add("Repair Equipment", 6);
ObjectiveList.add("Attack Target", 7);
ObjectiveList.add("Defend Location", 8);
objectiveList.add("New Group", 9);
//ObjectivesList.sort();
}
//------------------------------------------------------------------------------
function AIEButtonBarDlg::onSleep(%this)
{
}
//------------------------------------------------------------------------------
function AIEButtonBarDlg::onWake(%this)
{
}
//------------------------------------------------------------------------------
function dataProgress()
{
$NavGraph::operationsDone++;
%percent = $NavGraph::operationsDone / $NavGraph::operations;
GraphBuildProgress.setValue(%percent);
Canvas.repaint();
}
//------------------------------------------------------------------------------
function remakeTheGraph()
{
GraphCurrentOperation.setValue("making graph...");
Canvas.repaint();
navGraph.makeGraph();
dataProgress();
}
//------------------------------------------------------------------------------
function AIEButtonBarDlg::createLOSXref()
{
AIworking(true);
GraphCurrentOperation.setValue("Making LOS CrossRef Table...");
GraphBuildProgress.setValue(0);
if(2.player)
navGraph.prepLOS(2.player.getTransform());
else
navGraph.prepLOS("0 0 0");
while(navGraph.makeLOS())
{
GraphBuildProgress.setValue($graphProcessPercent);
Canvas.repaint();
}
GraphBuildProgress.setValue(100);
Canvas.repaint();
AIworking(false);
}
function ExteriorCheckBox::updateCheckBox()
{
$pref::NavGraph::drawOutdoor = !$pref::NavGraph::drawOutdoor;
}
function InteriorCheckBox::updateCheckBox()
{
$pref::NavGraph::drawIndoor = !$pref::NavGraph::drawIndoor;
if(!$pref::NavGraph::drawIndoor)
JetConnectionsCheckBox.visible = false;
else
jetConnectionsCheckBox.visible = true;
}
function JetConnectionsCheckBox::updateCheckBox()
{
$pref::NavGraph::drawJetEdges = !$pref::NavGraph::drawJetEdges;
}
function AISaveMissionObjectives()
{
// once we have created all objecitves, save out the mis file
if(!isObject(MissionGroup))
{
error("No mission exists!");
return;
}
// check for read-only
%file = "FixMe/missions/" @ $Client::MissionFile;
if(!isWriteableFileName(%file))
{
error("Mission file '" @ %file @ "' is not writeable.");
return;
}
// ok, were good to save.
missionGroup.save("missions/" @ $Client::MissionFile);
}
function AIObjectivesLock(%lock)
{
%numTeams = nameToId("MissionGroup/Teams").getCount();
for(%j = 0; %j < %numTeams; %j++)
{
%objGroup = nameToId("MissionGroup/Teams/team" @ %j @ "/AIObjectives");
if(%objGroup == -1)
continue;
%objCount = %objGroup.getCount();
for(%i = 0; %i < %objCount; %i++)
{
%obj = %objGroup.getObject(%i);
%obj.locked = %lock;
}
}
// save
AISaveMissionObjectives();
}
function addNewObjective(%type)
{
if($AIEditor::inspectTeam == 1)
%team = 1;
else if($AIEditor::inspectTeam == 2)
%team = 2;
else
%team = 1;
%tGroup = nameToId("MissionGroup/Teams/team" @ %team @ "/AIObjectives");
if(%tGroup < 1)
return;
if($InstantGroup $= "MissionGroup")
$InstantGroup = %tGroup;
switch$(%type)
{
case "Defend Location":
%objective = new AIObjective(AIODefendLocation)
{
dataBlock = "AIObjectiveMarker";
};
case "Repair Equipment":
%objective = new AIObjective(AIORepairObject)
{
dataBlock = "AIObjectiveMarker";
};
case "Deploy Outdoor Turret":
%Objective = new AIObjective(AIODeployEquipment)
{
dataBlock = "AIObjectiveMarker";
weightLevel1 = 4100;
weightLevel2 = 0;
description = "Deploy outdoor Turret";
offense = false;
defense = true;
targetObjectId = -1;
targetObject = -1;
targetClientId = -1;
equipment = "TurretOutdoorDeployable";
buyEquipmentSet = "MediumOutdoorTurretSet";
};
case "Deploy Indoor Turret":
%Objective = new AIObjective(AIODeployEquipment)
{
dataBlock = "AIObjectiveMarker";
weightLevel1 = 4100;
weightLevel2 = 0;
description = "Deploy indoor Turret";
offense = false;
defense = true;
targetObjectId = -1;
targetObject = -1;
targetClientId = -1;
equipment = "TurretIndoorDeployable";
buyEquipmentSet = "MediumIndoorTurretSet";
};
case "Attack Target":
%objective = new AIObjective(AIOAttackObject)
{
dataBlock = "AIObjectiveMarker";
};
case "Touch FlipFlop":
%objective = new AIObjective(AIOTouchObject)
{
dataBlock = "AIObjectiveMarker";
};
case "Mortar Target":
%objective = new AIObjective(AIOMortarObject)
{
dataBlock = "AIObjectiveMarker";
};
case "Deploy Inventory":
%Objective = new AIObjective(AIODeployEquipment)
{
dataBlock = "AIObjectiveMarker";
weightLevel1 = 4100;
weightLevel2 = 0;
description = "Deploy Inventory Station";
offense = false;
defense = true;
targetObjectId = -1;
targetObject = -1;
targetClientId = -1;
equipment = "InventoryDeployable";
buyEquipmentSet = "MediumInventorySet";
};
case "New Group":
%set = new SimGroup("ObjectiveSet");
%tGroup.add(%set);
return;
default:
error("no defined type.");
return;
}
$InstantGroup.add(%objective);
aiEdit.clearSelection();
aiEdit.selectObject(%objective);
aiEdit.dropSelection();
%objective.location = %objective.getWorldBoxCenter();
Inspector.inspect(%objective);
InspectorNameEdit.setValue(%objective.getName());
}
function ObjectiveList::onSelect(%this, %id, %text)
{
addNewObjective(%text);
ObjectiveList.setText("New Objective");
}

View File

@ -0,0 +1,162 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(AIEFrameSetDlg) {
profile = "GuiModelessDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
activeToolCount = "0";
new GuiFrameSetCtrl(AIEFrameSet) {
profile = "GuiContentProfile";
horizSizing = "width";
vertSizing = "height";
position = "120 30";
extent = "520 420";
minExtent = "8 8";
visible = "1";
helpTag = "0";
columns = "0";
rows = "0";
borderWidth = "4";
borderColor = "206 206 206 206";
borderEnable = "dynamic";
borderMovable = "dynamic";
autoBalance = "0";
new GuiControl(AIEFrame) {
profile = "GuiDefaultProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "520 420";
minExtent = "8 8";
visible = "1";
helpTag = "0";
borderWidth = "2";
};
new GuiFrameSetCtrl(AIEToolFrameSet) {
profile = "GuiContentProfile";
horizSizing = "width";
vertSizing = "height";
position = "520 420";
extent = "20 20";
minExtent = "8 8";
visible = "1";
helpTag = "0";
columns = "0";
borderWidth = "3";
borderColor = "206 206 206 206";
borderEnable = "dynamic";
borderMovable = "dynamic";
autoBalance = "0";
};
};
};
//--- OBJECT WRITE END ---
//------------------------------------------------------------------------------
// Functions
//------------------------------------------------------------------------------
function AIEFrameSetDlg::getPrefs(%this)
{
}
function AIEFrameSetDlg::setPrefs(%this)
{
}
function AIEFrameSetDlg::onWake(%this)
{
$AIEdit = true;
AIEditorMap.push();
aiEdit.clearIgnoreList();
aiEdit.ignoreObjClass(AIObjective);
aiEdit.toggleIgnoreList = true;
aiEdit.renderNav = true;
}
function AIEFrameSetDlg::onSleep(%this)
{
$AIEdit = false;
AIEditorMap.pop();
EditorTree.open("MissionGroup");
}
function AIEFrameSetDlg::init(%this)
{
AIEFrame.add(aiEdit);
%this.resetFrames();
}
function AIEFrameSetDlg::update(%this)
{
// check the frame to see if it is visible
if(AIEToolFrameSet.getCount())
{
%res = getResolution();
//90 = width of button bar
%width = getWord(%res, 0) - 90;
if(AIEFrameSet.getColumnOffset(1) > %width - editor.minToolFrameWidth)
AIEFrameSet.setColumnOffset(1, %width - editor.minToolFrameWidth);
}
}
function AIEFrameSetDlg::resetFrames(%this)
{
%tools = AIEToolFrameSet;
while(%tools.getRowCount() > %tools.getCount())
%tools.removeRow();
while(%tools.getRowCount() < %tools.getCount())
%tools.addRow();
%offset = 400;
// update the frame view
%frameSet = AIEFrameSet;
if(!%tools.getCount() && (%frameSet.getColumnCount() > 1))
{
%Offset = %frameSet.getColumnOffset(1);
%frameSet.removeColumn();
}
if(%tools.getCount() && (%frameSet.getColumnCount() == 1))
{
%frameSet.addColumn();
%frameSet.setColumnOffset(1, %offset);
}
//if(%tools.getCount())
//%this.toolPaneOffset = AIEFrameSet.getColumnOffset(1);
%this.activeToolCount = %tools.getCount();
}
function AIEFrameSetDlg::addTool(%this, %tool)
{
%group = nameToId("MissionGroup/Teams/team" @ $AIEditor::inspectTeam @ "/AIObjectives");
if(%group == -1)
return false;
if($AIEditor::inspectTeam == 1)
EditorTree.open("MissionGroup/Teams/team1/AIObjectives");
else
EditorTree.open("MissionGroup/Teams/team2/AIObjectives");
AIEToolFrameSet.add(%tool);
%this.resetFrames();
return true;
}
function AIEFrameSetDlg::removeTool(%this, %tool)
{
AIEToolFrameSet.remove(%tool);
%this.resetFrames();
}

View File

@ -0,0 +1,66 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(AIEWorkingDlg) {
profile = "GuiModelessDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "0";
helpTag = "0";
new GuiChunkedBitmapCtrl() {
profile = "GuiContentProfile";
horizSizing = "right";
vertSizing = "top";
position = "234 5";
extent = "400 130";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
new GuiTextCtrl() {
profile = "GuiBigTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "16 10";
extent = "378 40";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
text = "Building Graph ...";
};
new GuiProgressCtrl(GraphBuildProgress) {
profile = "GuiProgressProfile";
horizSizing = "center";
vertSizing = "top";
position = "29 50";
extent = "342 31";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
setValue = "0";
};
new GuiTextCtrl(GraphCurrentOperation) {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "35 96";
extent = "8 18";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
};
};
};
//--- OBJECT WRITE END ---

View File

@ -0,0 +1,32 @@
new WorldEditor(aiEdit)
{
profile = "GuiDefaultProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "520 420";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
selectHandle = "./SelectHandle.png";
defaultHandle = "./DefaultHandle.png";
lockedHandle = "./LockedHandle.png";
};
//------------------------------------------------------------------------------
function AIworking(%working)
{
if(%working)
{
Canvas.pushDialog(AIEWorkingDlg);
GraphBuildProgress.setValue(0.0);
}
else
Canvas.popDialog(AIEWorkingDlg);
Canvas.repaint();
}

View File

@ -0,0 +1,90 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(AIEditorToolBar) {
profile = "GuiModelessDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiControl() {
profile = "GuiContentProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "0 0";
extent = "640 30";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiCheckBoxCtrl(AIEditorObjectivesTree1CheckBox) {
profile = "GuiRadioProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "290 5";
extent = "114 20";
minExtent = "8 8";
visible = "1";
command = "AIEditorObjectivesTree1CheckBox.setTreeGui(1);";
helpTag = "0";
text = "Objectives Team 1";
};
new GuiCheckBoxCtrl(AIEditorObjectivesTree2CheckBox) {
profile = "GuiRadioProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "405 5";
extent = "114 20";
minExtent = "8 8";
visible = "1";
command = "AIEditorObjectivesTree2CheckBox.setTreeGui(2);";
helpTag = "0";
text = "Objectives Team 2";
};
new GuiCheckBoxCtrl(AIEditorObjectivesInspectorCheckBox) {
profile = "GuiRadioProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "520 5";
extent = "114 20";
minExtent = "8 8";
visible = "1";
command = "if($ThisControl.getValue()) AIEFrameSetDlg.addTool(EditorToolInspectorGui); else AIEFrameSetDlg.removeTool(EditorToolInspectorGui);";
helpTag = "0";
text = "Objectives Inspector";
};
};
};
//--- OBJECT WRITE END ---
function AIEditorToolBar::init(%this)
{
}
function AIEditorObjectivesTree1CheckBox::setTreeGui(%this, %team)
{
$AIEditor::inspectTeam = %team;
AIEditorObjectivesTree2CheckBox.setValue(false);
if($ThisControl.getValue())
%isSet = AIEFrameSetDlg.addTool(EditorToolTreeViewGui);
else
%isSet = AIEFrameSetDlg.removeTool(EditorToolTreeViewGui);
$ThisControl.setValue(%isSet);
}
function AIEditorObjectivesTree2CheckBox::setTreeGui(%this, %team)
{
$AIEditor::inspectTeam = %team;
AIEditorObjectivesTree1CheckBox.setValue(false);
if($ThisControl.getValue())
%isSet = AIEFrameSetDlg.addTool(EditorToolTreeViewGui);
else
%isSet = AIEFrameSetDlg.removeTool(EditorToolTreeViewGui);
$ThisControl.setValue(%isSet);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

View File

@ -0,0 +1,294 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(TerrainEditorValuesSettingsGui) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiWindowCtrl() {
profile = "GuiWindowProfile";
horizSizing = "center";
vertSizing = "center";
position = "117 113";
extent = "408 247";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Terrain Action Values";
maxLength = "255";
resizeWidth = "0";
resizeHeight = "0";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
closeCommand = "Canvas.popDIalog(TerrainEditorValuesSettingsGui);";
new GuiControl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "198 27";
extent = "203 115";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "86 12";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "ETerrainEditor.adjustHeightVal";
command = "ETerrainEditor.adjustHeightVal = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Adjust height increment.";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "86 37";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "ETerrainEditor.setHeightVal";
command = "ETerrainEditor.setHeightVal = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Elevation for set height operation.";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "86 62";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "ETerrainEditor.scaleVal";
command = "ETerrainEditor.scaleVal = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Scale height increment.";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "86 87";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "ETerrainEditor.smoothFactor";
command = "ETerrainEditor.smoothFactor = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Smoothing factor -- lower values are less agressive.";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "11 12";
extent = "64 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Adjust Height";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Adjust height increment.";
maxLength = "255";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "11 37";
extent = "49 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Set Height";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Elevation for set height operation.";
maxLength = "255";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "11 62";
extent = "60 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Scale Height";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Scale height increment.";
maxLength = "255";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 87";
extent = "70 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Smooth Factor";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Smoothing factor -- lower values are less agressive.";
maxLength = "255";
};
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "218 205";
extent = "80 20";
minExtent = "8 8";
visible = "1";
command = "Canvas.popDIalog(TerrainEditorValuesSettingsGui);";
helpTag = "0";
text = "OK";
groupNum = "-1";
buttonType = "PushButton";
};
new GuiControl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "7 27";
extent = "188 212";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiFilterCtrl(TESoftSelectFilter) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 22";
extent = "155 162";
minExtent = "8 8";
visible = "1";
helpTag = "0";
controlPoints = "7";
filter = "1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "6 4";
extent = "67 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Soft Selection";
tooltipprofile = "GuiToolTipProfile";
tooltip = "This spline scale modifies the hardness of the brush. Left is center, right is outer edge.";
maxLength = "255";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "12 189";
extent = "8 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "0";
maxLength = "255";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "12 26";
extent = "8 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "1";
maxLength = "255";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "60 190";
extent = "45 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "<Radius>";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Brush radius for Selection Mode.";
maxLength = "255";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "125 187";
extent = "50 18";
minExtent = "8 8";
visible = "1";
variable = "ETerrainEditor.softSelectRadius";
command = "ETerrainEditor.softSelectRadius = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Brush radius for Selection Mode.";
};
};
new GuiButtonCtrl(TESettingsApplyButton) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "307 205";
extent = "80 20";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Apply";
groupNum = "-1";
buttonType = "PushButton";
};
};
};
//--- OBJECT WRITE END ---

View File

@ -0,0 +1,692 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(WorldEditorSettingsDlg) {
profile = "GuiModelessDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiWindowCtrl() {
profile = "GuiWindowProfile";
horizSizing = "center";
vertSizing = "center";
position = "90 55";
extent = "459 370";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "WorldEditor Settings";
maxLength = "255";
resizeWidth = "0";
resizeHeight = "0";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
closeCommand = "Canvas.popDialog(WorldEditorSettingsDlg);";
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "369 343";
extent = "80 20";
minExtent = "8 8";
visible = "1";
command = "Canvas.popDialog(WorldEditorSettingsDlg);";
helpTag = "0";
text = "OK";
groupNum = "-1";
buttonType = "PushButton";
};
new GuiControl(WESettingsGeneralTab) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "231 27";
extent = "220 210";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 10";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.planarMovement";
command = "EWorldEditor.planarMovement = $ThisControl.getValue();";
helpTag = "0";
text = "Planar Movement";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Object will move along plane when dragged.";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 36";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.boundingBoxCollision";
command = "EWorldEditor.boundingBoxCollision = $ThisControl.getValue();";
helpTag = "0";
text = "Collide With Object\'s Bounding Box";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Object can be selected by placing cursor anywhere on objects bounding box.";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 88";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.axisGizmoActive";
command = "EWorldEditor.axisGizmoActive = $ThisControl.getValue();";
helpTag = "0";
text = "Axis Gizmo Active";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Enable gizmo.";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 62";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.objectsUseBoxCenter";
command = "EWorldEditor.objectsUseBoxCenter = $ThisControl.getValue();";
helpTag = "0";
text = "Objects Use Box Center";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "If checked, handle is in object center, otherwise at lower limit of object bounding box.";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "13 123";
extent = "83 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Min Scale Factor:";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Minimum multiple by which objects can be scaled from original size.";
maxLength = "255";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "13 146";
extent = "83 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Max Scale Factor:";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Maximum multiple by which objects can be scaled from original size.";
maxLength = "255";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "104 123";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.minScaleFactor";
command = "EWorldEditor.minScaleFactor = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Minimum multiple by which objects can be scaled from original size.";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "104 146";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.maxScaleFactor";
command = "EWorldEditor.maxScaleFactor = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Maximum multiple by which objects can be scaled from original size.";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "13 178";
extent = "80 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Visible Distance:";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Minimum distance within which object handles are visible/selectable.";
maxLength = "255";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "104 178";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "pref::Editor::visibleDistance";
command = "$pref::Editor::visibleDistance = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Minimum distance within which object handles are visible/selectable.";
};
};
new GuiControl(WESettingsDisplayTab) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "7 27";
extent = "220 210";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 10";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.renderPlane";
command = "EWorldEditor.renderPlane = $ThisControl.getValue();";
helpTag = "0";
text = "Render Plane";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Show plane when objects are selected.";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 37";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.renderPlaneHashes";
command = "EWorldEditor.renderPlaneHashes = $ThisControl.getValue();";
helpTag = "0";
text = "Render Plane Hashes";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Show hashes when objects are selected.";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 64";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.renderObjText";
command = "EWorldEditor.renderObjText = $ThisControl.getValue();";
helpTag = "0";
text = "Render Object Text";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Show objects' names and IDs.";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 119";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.renderSelectionBox";
command = "EWorldEditor.renderSelectionBox = $ThisControl.getValue();";
helpTag = "0";
text = "Render Selection Box";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Show selection boxes.";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "93 151";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.planeDim";
command = "EWorldEditor.planeDim = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Length by width dimensions of plane (floating point OK).";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "18 151";
extent = "59 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Plane Extent";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Length by width dimensions of plane (floating point OK).";
maxLength = "255";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "18 175";
extent = "44 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Grid Size";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Hash spacing for grid (floating point OK).";
maxLength = "255";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "93 175";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.gridSize";
command = "EWorldEditor.gridSize = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Hash spacing for grid (floating point OK).";
};
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 90";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.renderObjHandle";
command = "EWorldEditor.renderObjHandle = $ThisControl.getValue();";
helpTag = "0";
text = "Render Object Handle";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Show objects' handles (red dot).";
groupNum = "-1";
buttonType = "ToggleButton";
};
};
new GuiControl(WESettingsSnapTab) {
profile = "GuiContentProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "6 52";
extent = "220 210";
minExtent = "8 8";
visible = "0";
helpTag = "0";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "22 39";
extent = "44 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Grid Size";
maxLength = "255";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "97 39";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.gridSize";
command = "EWorldEditor.gridSize = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
};
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 10";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.snapToGrid";
command = "EWorldEditor.snapToGrid = $ThisControl.getValue();";
helpTag = "0";
text = "Snap To Grid";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "12 66";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.snapRotations";
command = "EWorldEditor.snapRotations = $ThisControl.getValue();";
helpTag = "0";
text = "Snap Rotations";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "22 95";
extent = "56 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Snap Angle";
maxLength = "255";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "97 95";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.rotationSnap";
command = "EWorldEditor.rotationSnap = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
};
};
new GuiControl(WESettingsMouseTab) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "7 241";
extent = "220 121";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 10";
extent = "200 24";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.showMousePopupInfo";
command = "EWorldEditor.showMousePopupInfo = $ThisControl.getValue();";
helpTag = "0";
text = "Show Mouse Popup Info";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Show mouse popup scales when moving-rotating-scaling.";
groupNum = "-1";
buttonType = "ToggleButton";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "101 35";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.mouseMoveScale";
command = "EWorldEditor.mouseMoveScale = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Increase or decrease mouse sensitivity for mouse move action.";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "101 60";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.mouseRotateScale";
command = "EWorldEditor.mouseRotateScale = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Increase or decrease mouse sensitivity for mouse rotate action.";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "101 85";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.mouseScaleScale";
command = "EWorldEditor.mouseScaleScale = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Increase or decrease mouse sensitivity for mouse scale action.";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "12 60";
extent = "61 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Rotate Scale";
maxLength = "255";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Increase or decrease mouse sensitivity for mouse rotate action.";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "12 85";
extent = "57 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Scale Scale";
maxLength = "255";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Increase or decrease mouse sensitivity for mouse scale action.";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "12 35";
extent = "56 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Move Scale";
maxLength = "255";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Increase or decrease mouse sensitivity for mouse move action.";
};
};
new GuiControl(WESettingsMiscTab) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "231 241";
extent = "220 64";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "9 35";
extent = "78 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Project Distance";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Ray-length for selection cursor.";
maxLength = "255";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "9 9";
extent = "89 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Gizmo Screen Len";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Gizmo axis length in screen pixels.";
maxLength = "255";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "101 35";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.projectDistance";
command = "EWorldEditor.projectDistance = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Ray-length for selection cursor.";
};
new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "101 9";
extent = "107 18";
minExtent = "8 8";
visible = "1";
variable = "EWorldEditor.axisGizmoMaxScreenLen";
command = "EWorldEditor.axisGizmoMaxScreenLen = $ThisControl.getValue();";
helpTag = "0";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
Tooltipprofile = "GuiToolTipProfile";
tooltip = "Gizmo axis length in screen pixels.";
};
};
};
};
//--- OBJECT WRITE END ---

View File

@ -0,0 +1,62 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Editor Cursors
//------------------------------------------------------------------------------
new GuiCursor(EditorHandCursor)
{
hotSpot = "7 0";
bitmapName = "./CUR_hand.png";
};
new GuiCursor(EditorRotateCursor)
{
hotSpot = "11 18";
bitmapName = "./CUR_rotate.png";
};
new GuiCursor(EditorMoveCursor)
{
hotSpot = "9 13";
bitmapName = "./CUR_grab.png";
};
new GuiCursor(EditorArrowCursor)
{
hotSpot = "0 0";
bitmapName = "./CUR_3darrow.png";
};
new GuiCursor(EditorUpDownCursor)
{
hotSpot = "5 10";
bitmapName = "./CUR_3dupdown";
};
new GuiCursor(EditorLeftRightCursor)
{
hotSpot = "9 5";
bitmapName = "./CUR_3dleftright";
};
new GuiCursor(EditorDiagRightCursor)
{
hotSpot = "8 8";
bitmapName = "./CUR_3ddiagright";
};
new GuiCursor(EditorDiagLeftCursor)
{
hotSpot = "8 8";
bitmapName = "./CUR_3ddiagleft";
};
new GuiControl(EmptyControl)
{
profile = "GuiButtonProfile";
};

View File

@ -0,0 +1,114 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Mission Editor Manager
new ActionMap(EditorMap);
EditorMap.bindCmd(keyboard, "f2", "editor.setEditor(WorldEditor);", "");
EditorMap.bindCmd(keyboard, "f3", "editor.setEditor(TerrainEditor);", "");
EditorMap.bindCmd(keyboard, "f4", "editor.setEditor(Terraformer);", "");
EditorMap.bindCmd(keyboard, "f5", "editor.setEditor(AIEditor);", "");
EditorMap.bindCmd(keyboard, "alt s", "Canvas.pushDialog(EditorSaveMissionDlg);", "");
EditorMap.bindCmd(keyboard, "alt r", "lightScene(\"\", forceAlways);", "");
EditorMap.bindCmd(keyboard, "escape", "editor.close();", "");
// alt-#: set bookmark
for(%i = 0; %i < 9; %i++)
EditorMap.bindCmd(keyboard, "alt " @ %i, "editor.setBookmark(" @ %i @ ");", "");
// ctrl-#: goto bookmark
for(%i = 0; %i < 9; %i++)
EditorMap.bindCmd(keyboard, "ctrl " @ %i, "editor.gotoBookmark(" @ %i @ ");", "");
//------------------------------------------------------------------------------
// World Editor
new ActionMap(WorldEditorMap);
WorldEditorMap.bindCmd(keyboard, "space", "wEditor.nextMode();", "");
WorldEditorMap.bindCmd(keyboard, "delete", "wEditor.copySelection();wEditor.deleteSelection();", "");
WorldEditorMap.bindCmd(keyboard, "ctrl c", "wEditor.copySelection();", "");
WorldEditorMap.bindCmd(keyboard, "ctrl x", "wEditor.copySelection();wEditor.deleteSelection();", "");
WorldEditorMap.bindCmd(keyboard, "ctrl v", "wEditor.pasteSelection();", "");
WorldEditorMap.bindCmd(keyboard, "ctrl z", "wEditor.undo();", "");
WorldEditorMap.bindCmd(keyboard, "ctrl y", "wEditor.redo();", "");
WorldEditorMap.bindCmd(keyboard, "ctrl h", "wEditor.hideSelection(true);", "");
WorldEditorMap.bindCmd(keyboard, "alt h", "wEditor.hideSelection(false);", "");
WorldEditorMap.bindCmd(keyboard, "ctrl d", "wEditor.dropSelection();", "");
WorldEditorMap.bindCmd(keyboard, "ctrl q", "wEditor.dropCameraToSelection();", "");
WorldEditorMap.bindCmd(keyboard, "ctrl m", "wEditor.moveSelectionInPlace();", "");
WorldEditorMap.bindCmd(keyboard, "ctrl r", "wEditor.resetTransforms();", "");
WorldEditorMap.bindCmd(keyboard, "i", "Canvas.pushDialog(interiorDebugDialog);", "");
WorldEditorMap.bindCmd(keyboard, "o", "Canvas.pushDialog(WorldEditorSettingsDlg);", "");
//------------------------------------------------------------------------------
// Terrain Editor
new ActionMap(TerrainEditorMap);
TerrainEditorMap.bindCmd(keyboard, "ctrl z", "tEditor.undo();", "");
TerrainEditorMap.bindCmd(keyboard, "ctrl y", "tEditor.redo();", "");
TerrainEditorMap.bindCmd(keyboard, "left", "tEditor.offsetBrush(-1, 0);", "");
TerrainEditorMap.bindCmd(keyboard, "right", "tEditor.offsetBrush(1, 0);", "");
TerrainEditorMap.bindCmd(keyboard, "up", "tEditor.offsetBrush(0, 1);", "");
TerrainEditorMap.bindCmd(keyboard, "down", "tEditor.offsetBrush(0, -1);", "");
TerrainEditorMap.bindCmd(keyboard, "1", "TERaiseHeightActionRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "2", "TELowerHeightActionRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "3", "TESetHeightActionRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "4", "TESetEmptyActionRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "5", "TEClearEmptyActionRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "6", "TEFlattenHeightActionRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "7", "TESmoothHeightActionRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "8", "TESetMaterialActionRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "9", "TEAdjustHeightActionRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "shift 1", "tEditor.processUsesBrush = true;TERaiseHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", "");
TerrainEditorMap.bindCmd(keyboard, "shift 2", "tEditor.processUsesBrush = true;TELowerHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", "");
TerrainEditorMap.bindCmd(keyboard, "shift 3", "tEditor.processUsesBrush = true;TESetHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", "");
TerrainEditorMap.bindCmd(keyboard, "shift 4", "tEditor.processUsesBrush = true;TESetEmptyActionRadio.setValue(1);tEditor.processUsesBrush = false;", "");
TerrainEditorMap.bindCmd(keyboard, "shift 5", "tEditor.processUsesBrush = true;TEClearEmptyActionRadio.setValue(1);tEditor.processUsesBrush = false;", "");
TerrainEditorMap.bindCmd(keyboard, "shift 6", "tEditor.processUsesBrush = true;TEFlattenHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", "");
TerrainEditorMap.bindCmd(keyboard, "shift 7", "tEditor.processUsesBrush = true;TESmoothHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", "");
TerrainEditorMap.bindCmd(keyboard, "shift 8", "tEditor.processUsesBrush = true;TESetMaterialActionRadio.setValue(1);tEditor.processUsesBrush = false;", "");
TerrainEditorMap.bindCmd(keyboard, "shift 9", "tEditor.processUsesBrush = true;TEAdjustHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", "");
TerrainEditorMap.bindCmd(keyboard, "h", "TESelectModeRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "j", "TEPaintModeRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "k", "TEAdjustModeRadio.setValue(1);", "");
TerrainEditorMap.bindCmd(keyboard, "i", "Canvas.pushDialog(interiorDebugDialog);", "");
TerrainEditorMap.bindCmd(keyboard, "o", "Canvas.pushDialog(TerrainEditorValuesSettingsGui, 99);", "");
TerrainEditorMap.bindCmd(keyboard, "m", "Canvas.pushDialog(TerrainEditorTextureSelectGui, 99);", "");
TerrainEditorMap.bindCmd(keyboard, "backspace", "tEditor.clearSelection();", "");
//------------------------------------------------------------------------------
// AI Editor
new ActionMap(AIEditorMap);
AIEditorMap.bindCmd(keyboard, "space", "aiEdit.nextMode();", "");
AIEditorMap.bindCmd(keyboard, "delete", "aiEdit.copySelection();aiEdit.deleteSelection();", "");
AIEditorMap.bindCmd(keyboard, "ctrl c", "aiEdit.copySelection();", "");
AIEditorMap.bindCmd(keyboard, "ctrl x", "aiEdit.copySelection();aiEdit.deleteSelection();", "");
AIEditorMap.bindCmd(keyboard, "ctrl v", "aiEdit.pasteSelection();", "");
AIEditorMap.bindCmd(keyboard, "ctrl h", "aiEdit.hideSelection(true);", "");
AIEditorMap.bindCmd(keyboard, "alt h", "aiEdit.hideSelection(false);", "");
AIEditorMap.bindCmd(keyboard, "ctrl d", "aiEdit.dropSelection();", "");
AIEditorMap.bindCmd(keyboard, "ctrl q", "aiEdit.dropCameraToSelection();", "");
AIEditorMap.bindCmd(keyboard, "ctrl m", "aiEdit.moveSelectionInPlace();", "");
AIEditorMap.bindCmd(keyboard, "ctrl r", "aiEdit.resetTransforms();", "");
AIEditorMap.bindCmd(keyboard, "i", "Canvas.pushDialog(interiorDebugDialog);", "");

150
example/creator/editor/editor.cs Executable file
View File

@ -0,0 +1,150 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Hard coded images referenced from C++ code
//------------------------------------------------------------------------------
// editor/SelectHandle.png
// editor/DefaultHandle.png
// editor/LockedHandle.png
//------------------------------------------------------------------------------
// Functions
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Mission Editor
//------------------------------------------------------------------------------
function Editor::create()
{
// Not much to do here, build it and they will come...
// Only one thing... the editor is a gui control which
// expect the Canvas to exist, so it must be constructed
// before the editor.
new EditManager(Editor)
{
profile = "GuiContentProfile";
horizSizing = "right";
vertSizing = "top";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
open = false;
};
}
function Editor::onAdd(%this)
{
// Basic stuff
exec("./cursors.cs");
// Tools
exec("./editor.bind.cs");
exec("./ObjectBuilderGui.gui");
// New World Editor
exec("./EditorGui.gui");
exec("./EditorGui.cs");
// World Editor
exec("./WorldEditorSettingsDlg.gui");
// Terrain Editor
exec("./TerrainEditorVSettingsGui.gui");
// Ignore Replicated fxStatic Instances.
EWorldEditor.ignoreObjClass("fxShapeReplicatedStatic");
// do gui initialization...
EditorGui.init();
//
exec("./editorRender.cs");
}
function Editor::checkActiveLoadDone()
{
if(isObject(EditorGui) && EditorGui.loadingMission)
{
Canvas.setContent(EditorGui);
EditorGui.loadingMission = false;
return true;
}
return false;
}
//------------------------------------------------------------------------------
function toggleEditor(%make)
{
if (%make)
{
if (!$missionRunning)
{
// just in case ...
disconnect();
Editor.close();
// Allow users to override if they want.
%newMission = "~/data/newMission.mis";
if($Editor::newMissionOverride !$= "")
%newMission = $Editor::newMissionOverride;
createServer( "SinglePlayer", expandFilename(%newMission));
%conn = new GameConnection(ServerConnection);
RootGroup.add(ServerConnection);
%conn.setConnectArgs($pref::Player::Name);
%conn.setJoinPassword($Client::Password);
%conn.connectLocal();
Editor::create();
MissionCleanup.add(Editor);
EditorGui.loadingMission = true;
EditorGui.saveAs = true;
Editor.open();
$dropcameracount = 0;
schedule(100,0,dropFreakinCameraAtPlayer);
}
else
{
if (!isObject(Editor))
{
Editor::create();
MissionCleanup.add(Editor);
}
if (Canvas.getContent() == EditorGui.getId())
if (MissionInfo.type $= "DemoScene")
{
commandToServer('dropPlayerAtCamera');
Editor.close("SceneGui");
}
else
{
Editor.close("PlayGui");
}
else
{
if (MissionInfo.type $= "DemoScene")
commandToServer('dropCameraAtPlayer');
Editor.open();
}
}
}
}
//------------------------------------------------------------------------------
// The editor action maps are defined in editor.bind.cs
GlobalActionMap.bind(keyboard, "f11", toggleEditor);

View File

@ -0,0 +1,41 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Console onEditorRender functions:
//------------------------------------------------------------------------------
// Functions:
// - renderSphere([pos], [radius], <sphereLevel>);
// - renderCircle([pos], [normal], [radius], <segments>);
// - renderTriangle([pnt], [pnt], [pnt]);
// - renderLine([start], [end], <thickness>);
//
// Variables:
// - consoleFrameColor - line prims are rendered with this
// - consoleFillColor
// - consoleSphereLevel - level of polyhedron subdivision
// - consoleCircleSegments
// - consoleLineWidth
//------------------------------------------------------------------------------
function SpawnSphere::onEditorRender(%this, %editor, %selected, %expanded)
{
if(%selected $= "true")
{
%editor.consoleFrameColor = "255 0 0";
%editor.consoleFillColor = "0 15 0 15";
%editor.renderSphere(%this.getWorldBoxCenter(), %this.radius, 1);
}
}
//function Item::onEditorRender(%this, %editor, %selected, %expanded)
//{
// if(%this.getDataBlock().getName() $= "MineDeployed")
// {
// %editor.consoleFillColor = "0 0 0 0";
// %editor.consoleFrameColor = "255 0 0";
// %editor.renderSphere(%this.getWorldBoxCenter(), 6, 1);
// }
//}

View File

@ -0,0 +1 @@
This directory is used to load heightfields from.

View File

@ -0,0 +1,680 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(ObjectBuilderGui) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
new GuiWindowCtrl(OBTargetWindow) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "217 74";
extent = "256 282";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
new GuiTextCtrl() {
profile = "GuiCenterTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "13 31";
extent = "84 25";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
text = "Object Name:";
};
new GuiTextEditCtrl(OBObjectName) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "105 31";
extent = "143 18";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
historySize = "0";
};
new GuiControl(OBContentWindow) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "8 56";
extent = "240 193";
minExtent = "0 0";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
};
new GuiButtonCtrl(OBOKButton) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "70 254";
extent = "80 20";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
command = "ObjectBuilderGui.onOK();";
helpTag = "0";
text = "OK";
};
new GuiButtonCtrl(OBCancelButton) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "156 254";
extent = "80 20";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
command = "ObjectBuilderGui.onCancel();";
helpTag = "0";
text = "Cancel";
};
};
};
//--- OBJECT WRITE END ---
function ObjectBuilderGui::init(%this)
{
%this.baseOffsetX = 9;
%this.baseOffsetY = 10;
%this.scriptFile = "editor/newObject.cs";
%this.defaultObjectName = "";
%this.defaultFieldStep = 26;
%this.columnOffset = 95;
%this.fieldNameExtent = "132 18";
%this.textEditExtent = "127 18";
%this.checkBoxExtent = "18 18";
%this.popupMenuExtent = "127 18";
%this.fileButtonExtent = "127 18";
//
%this.numControls = 0;
%this.reset();
}
function ObjectBuilderGui::reset(%this)
{
%this.curXPos = %this.baseOffsetX;
%this.curYPos = %this.baseOffsetY;
%this.createCallback = "";
%this.currentControl = 0;
//
OBObjectName.setValue(%this.defaultObjectName);
//
%this.newObject = 0;
%this.className = "";
%this.numFields = 0;
//
for(%i = 0; %i < %this.numControls; %i++)
{
%this.textControls[%i].delete();
%this.controls[%i].delete();
}
%this.numControls = 0;
}
//------------------------------------------------------------------------------
function ObjectBuilderGui::createFileType(%this, %index)
{
if(%index >= %this.numFields || %this.field[%index, name] $= "")
{
error("ObjectBuilderGui::createFileType: invalid field");
return;
}
//
if(%this.field[%index, text] $= "")
%name = %this.field[%index, name];
else
%name = %this.field[%index, text];
//
%this.textControls[%this.numControls] = new GuiTextCtrl() {
profile = "GuiTextProfile";
text = %name;
extent = %this.fieldNameExtent;
position = %this.curXPos @ " " @ %this.curYPos;
modal = "1";
};
//
%this.controls[%this.numControls] = new GuiButtonCtrl() {
profile = "GuiButtonProfile";
extent = %this.fileButtonExtent;
position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos;
modal = "1";
command = %this @ ".getFileName(" @ %index @ ");";
};
%val = %this.field[%index, value];
%this.controls[%this.numControls].setValue(fileBase(%val) @ fileExt(%val));
%this.numControls++;
%this.curYPos += %this.defaultFieldStep;
}
function ObjectBuilderGui::getFileName(%this, %index)
{
if(%index >= %this.numFields || %this.field[%index, name] $= "")
{
error("ObjectBuilderGui::getFileName: invalid field");
return;
}
%val = %this.field[%index, value];
%path = filePath(%val);
%ext = fileExt(%val);
%this.currentControl = %index;
getLoadFilename(%path @ "*" @ %ext, %this @ ".gotFileName");
}
function ObjectBuilderGui::gotFileName(%this, %name)
{
%this.controls[%this.currentControl].setValue(%name);
}
//------------------------------------------------------------------------------
function ObjectBuilderGui::createDataBlockType(%this, %index)
{
if(%index >= %this.numFields || %this.field[%index, name] $= "")
{
error("ObjectBuilderGui::createDataBlockType: invalid field");
return;
}
//
if(%this.field[%index, text] $= "")
%name = %this.field[%index, name];
else
%name = %this.field[%index, text];
//
%this.textControls[%this.numControls] = new GuiTextCtrl() {
profile = "GuiTextProfile";
text = %name;
extent = %this.fieldNameExtent;
position = %this.curXPos @ " " @ %this.curYPos;
modal = "1";
};
//
%this.controls[%this.numControls] = new GuiPopupMenuCtrl() {
profile = "GuiPopUpMenuProfile";
extent = %this.popupMenuExtent;
position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos;
modal = "1";
maxPopupHeight = "200";
};
%classname = getWord(%this.field[%index, value], 0);
%this.controls[%this.numControls].add("", -1);
// add the datablocks
for(%i = 0; %i < DataBlockGroup.getCount(); %i++)
{
%obj = DataBlockGroup.getObject(%i);
if(%obj.getClassName() $= %classname)
%this.controls[%this.numControls].add(%obj.getName(), %i);
}
%this.controls[%this.numControls].setValue(getWord(%this.field[%index, value], 1));
%this.numControls++;
%this.curYPos += %this.defaultFieldStep;
}
function ObjectBuilderGui::createBoolType(%this, %index)
{
if(%index >= %this.numFields || %this.field[%index, name] $= "")
{
error("ObjectBuilderGui::createBoolType: invalid field");
return;
}
//
if(%this.field[%index, value] $= "")
%value = 0;
else
%value = %this.field[%index, value];
//
if(%this.field[%index, text] $= "")
%name = %this.field[%index, name];
else
%name = %this.field[%index, text];
//
%this.textControls[%this.numControls] = new GuiTextCtrl() {
profile = "GuiTextProfile";
text = %name;
extent = %this.fieldNameExtent;
position = %this.curXPos @ " " @ %this.curYPos;
modal = "1";
};
//
%this.controls[%this.numControls] = new GuiCheckBoxCtrl() {
profile = "GuiCheckBoxProfile";
extent = %this.checkBoxExtent;
position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos;
modal = "1";
};
%this.controls[%this.numControls].setValue(%value);
%this.numControls++;
%this.curYPos += %this.defaultFieldStep;
}
function ObjectBuilderGui::createStringType(%this, %index)
{
if(%index >= %this.numFields || %this.field[%index, name] $= "")
{
error("ObjectBuilderGui::createStringType: invalid field");
return;
}
//
if(%this.field[%index, text] $= "")
%name = %this.field[%index, name];
else
%name = %this.field[%index, text];
//
%this.textControls[%this.numControls] = new GuiTextCtrl() {
profile = "GuiTextProfile";
text = %name;
extent = %this.fieldNameExtent;
position = %this.curXPos @ " " @ %this.curYPos;
modal = "1";
};
//
%this.controls[%this.numControls] = new GuiTextEditCtrl() {
profile = "GuiTextEditProfile";
extent = %this.textEditExtent;
text = %this.field[%index, value];
position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos;
modal = "1";
};
%this.numControls++;
%this.curYPos += %this.defaultFieldStep;
}
//------------------------------------------------------------------------------
function ObjectBuilderGui::adjustSizes(%this)
{
if(%this.numControls == 0)
%this.curYPos = 0;
OBTargetWindow.extent = "256 " @ %this.curYPos + 88;
OBContentWindow.extent = "240 " @ %this.curYPos;
OBOKButton.position = "70 " @ %this.curYPos + 62;
OBCancelButton.position = "156 " @ %this.curYPos + 62;
}
function ObjectBuilderGui::process(%this)
{
if(%this.className $= "")
{
error("ObjectBuilderGui::process: classname is not specified");
return;
}
OBTargetWindow.setValue("Building Object: " @ %this.className);
//
for(%i = 0; %i < %this.numFields; %i++)
{
switch$(%this.field[%i, type])
{
case "TypeBool":
%this.createBoolType(%i);
case "TypeDataBlock":
%this.createDataBlockType(%i);
case "TypeFile":
%this.createFileType(%i);
default:
%this.createStringType(%i);
}
}
// add the controls
for(%i = 0; %i < %this.numControls; %i++)
{
OBContentWindow.add(%this.textControls[%i]);
OBContentWindow.add(%this.controls[%i]);
}
//
%this.adjustSizes();
//
Canvas.pushDialog(%this);
}
function ObjectBuilderGui::processNewObject(%this, %obj)
{
if(%this.createCallback !$= "")
eval(%this.createCallback);
if(!isObject(EWorldEditor))
return;
$InstantGroup.add(%obj);
EWorldEditor.clearSelection();
EWorldEditor.selectObject(%obj);
EWorldEditor.dropSelection();
}
function ObjectBuilderGui::onOK(%this)
{
// get current values
for(%i = 0; %i < %this.numControls; %i++)
%this.field[%i, value] = %this.controls[%i].getValue();
//
%file = new FileObject();
%file.openForWrite(%this.scriptFile);
%file.writeLine(%this @ ".newObject = new " @ %this.className @ "(" @ OBObjectName.getValue() @ ") {");
for(%i = 0; %i < %this.numFields; %i++)
%file.writeLine(" " @ %this.field[%i, name] @ " = \"" @ %this.field[%i, value] @ "\";");
%file.writeLine("};");
%file.close();
%file.delete();
//
exec(%this.scriptFile);
if(%this.newObject != 0)
%this.processNewObject(%this.newObject);
%this.reset();
Canvas.popDialog(%this);
}
function ObjectBuilderGui::onCancel(%this)
{
%this.reset();
Canvas.popDialog(%this);
}
function ObjectBuilderGui::addField(%this, %name, %type, %text, %value)
{
%this.field[%this.numFields, name] = %name;
%this.field[%this.numFields, type] = %type;
%this.field[%this.numFields, text] = %text;
%this.field[%this.numFields, value] = %value;
%this.numFields++;
}
//------------------------------------------------------------------------------
// Environment
//------------------------------------------------------------------------------
function ObjectBuilderGui::buildfxFoliageReplicator(%this)
{
%this.className = "fxFoliageReplicator";
%this.process();
}
function ObjectBuilderGui::buildfxShapeReplicator(%this)
{
%this.className = "fxShapeReplicator";
%this.process();
}
function ObjectBuilderGui::buildfxSunLight(%this)
{
%this.className = "fxSunLight";
%this.process();
}
function ObjectBuilderGui::buildSky(%this)
{
%this.className = "Sky";
%this.addField("materialList", "TypeFile", "Material list", "Lush_l4.dml");
%this.addField("cloudSpeed[0]", "TypePoint2", "Cloud0 Speed", "0.0000003 0.0000003");
%this.addField("cloudSpeed[1]", "TypePoint2", "Cloud1 Speed", "0.0000006 0.0000006");
%this.addField("cloudSpeed[2]", "TypePoint2", "Cloud2 Speed", "0.0000009 0.0000009");
%this.addField("cloudHeightPer[0]", "TypeFloat", "Cloud0 Height", "0.349971");
%this.addField("cloudHeightPer[1]", "TypeFloat", "Cloud1 Height", "0.25");
%this.addField("cloudHeightPer[2]", "TypeFloat", "Cloud2 Height", "0.199973");
%this.addField("visibleDistance", "TypeFloat", "Visible distance", "900");
%this.addField("fogDistance", "TypeFloat", "Fog distance", "600");
%this.addField("fogColor", "TypeColor", "Fog color", "0.5 0.5 0.5");
%this.addField("fogVolume1", "TypePoint3", "Fog volume", "120 0 100");
%this.addField("fogVolume2", "TypePoint3", "Fog volume", "0 0 0");
%this.addField("fogVolume3", "TypePoint3", "Fog volume", "0 0 0");
%this.process();
}
function ObjectBuilderGui::buildfxLight(%this)
{
%this.className = "fxLight";
%this.addField("dataBlock", "TypeDataBlock", "fxLight Data", "fxLightData");
%this.process();
}
function ObjectBuilderGui::buildSun(%this)
{
%this.className = "Sun";
%this.addField("direction", "TypeVector", "Direction", "1 1 -1");
%this.addField("color", "TypeColor", "Sun color", "0.8 0.8 0.8");
%this.addField("ambient", "TypeColor", "Ambient color", "0.2 0.2 0.2");
%this.process();
}
function ObjectBuilderGui::buildLightning(%this)
{
%this.className = "Lightning";
%this.addField("dataBlock", "TypeDataBlock", "Data block", "LightningData DefaultStorm");
%this.process();
}
function ObjectBuilderGui::buildWater(%this)
{
%this.className = "WaterBlock";
// jff: this object needs some work!!
%this.addField("extent", "TypePoint3", "Extent", "100 100 10");
%this.addField("textureSize", "TypePoint2", "Texture size", "32 32");
%this.addField("params[0]", "TypePoint4", "Wave Param0", "0.32 -0.67 0.066 0.5");
%this.addField("params[1]", "TypePoint4", "Wave Param1", "0.63 -2.41 0.33 0.21");
%this.addField("params[2]", "TypePoint4", "Wave Param2", "0.39 0.39 0.2 0.133");
%this.addField("params[3]", "TypePoint4", "Wave Param3", "1.21 -0.61 0.13 -0.33");
%this.addField("floodFill", "TypeBool", "Flood fill?", "true");
%this.addField("seedPoints", "TypeString", "Seed points", "0 0 1 0 1 1 0 1");
%this.addField("surfaceTexture", "TypeString", "Surface Texture",
"~/data/water/water");
%this.addField("envMapTexture", "TypeString", "Env Map Texture",
"~/data/skies/sunset_0007");
%this.process();
}
function ObjectBuilderGui::buildTerrain(%this)
{
%this.className = "TerrainBlock";
%this.createCallback = "ETerrainEditor.attachTerrain();";
%this.addField("terrainFile", "TypeFile", "Terrain file", "terrains/terr1.ter");
%this.addField("squareSize", "TypeInt", "Square size", "8");
%this.process();
}
function ObjectBuilderGui::buildAudioEmitter(%this)
{
%this.className = "AudioEmitter";
%this.addField("profile", "TypeDataBlock", "Sound Profile", "AudioProfile");
%this.addField("description", "TypeDataBlock", "Sound Description", "AudioDescription");
%this.addField("fileName", "TypeFile", "Audio file", "");
%this.addField("useProfileDescription", "TypeBool", "Use profile's desc?", "false");
%this.addFIeld("volume", "TypeFloat", "Volume", "1.0");
%this.addField("isLooping", "TypeBool", "Looping?", "true");
%this.addField("is3D", "TypeBool", "Is 3D sound?", "true");
%this.addField("ReferenceDistance", "TypeFloat", "Reference distance", "5.0"); //EFM
%this.addField("maxDistance", "TypeFloat", "Max distance", "35.0");
%this.addField("coneInsideAngle", "TypeInt", "Cone inside angle", "90");
%this.addField("coneOutsideAngle", "TypeInt", "Cone outside angle", "120");
%this.addField("coneOutsideVolume", "TypeFloat", "Cone outside volume", "0.25");
%this.addField("loopCount", "TypeInt", "Loop count", "-1");
%this.addField("minLoopGap", "TypeInt", "Min loop gap (ms)", "0");
%this.addField("maxLoopGap", "TypeInt", "Max loop gap (ms)", "0");
%this.addField("type", "TypeInt", "Audio type", $SimAudioType);
%this.process();
}
function ObjectBuilderGui::buildPrecipitation(%this)
{
%this.className = "Precipitation";
%this.addField("nameTag", "TypeString", "Name", "");
%this.addField("dataBlock", "TypeDataBlock", "Precipitation data", "PrecipitationData");
%this.process();
}
function ObjectBuilderGui::buildParticleEmitter(%this)
{
%this.className = "ParticleEmitterNode";
%this.addField("dataBlock", "TypeDataBlock", "datablock", "ParticleEmitterNodeData");
%this.addField("emitter", "TypeDataBlock", "Particle data", "ParticleEmitterData");
%this.process();
}
//------------------------------------------------------------------------------
// Mission
//------------------------------------------------------------------------------
function ObjectBuilderGui::buildMissionArea(%this)
{
%this.className = "MissionArea";
%this.addField("area", "TypeRect", "Bounding area", "0 0 1024 1024");
%this.process();
}
function ObjectBuilderGui::buildPath(%this)
{
%this.className = "Path";
%this.process();
}
function ObjectBuilderGui::buildPathMarker(%this)
{
%this.className = "Marker";
%this.process();
}
//function ObjectBuilderGui::buildForcefield(%this)
//{
// %this.className = "ForcefieldBare";
// %this.addField("dataBlock", "TypeDataBlock", "Data Block", "ForceFieldBareData defaultForceFieldBare");
// %this.process();
//}
function ObjectBuilderGui::buildTrigger(%this)
{
%this.className = "Trigger";
%this.addField("dataBlock", "TypeDataBlock", "Data Block", "TriggerData defaultTrigger");
%this.addField("polyhedron", "TypeTriggerPolyhedron", "Polyhedron", "0 0 0 1 0 0 0 -1 0 0 0 1");
%this.process();
}
function ObjectBuilderGui::buildPhysicalZone(%this)
{
%this.className = "PhysicalZone";
%this.addField("polyhedron", "TypeTriggerPolyhedron", "Polyhedron", "0 0 0 1 0 0 0 -1 0 0 0 1");
%this.process();
}
function ObjectBuilderGui::buildCamera(%this)
{
%this.className = "Camera";
%this.addField("position", "TypePoint3", "Position", "0 0 0");
%this.addField("rotation", "TypePoint4", "Rotation", "1 0 0 0");
%this.addField("dataBlock", "TypeDataBlock", "Data block", "CameraData Observer");
%this.addField("team", "TypeInt", "Team", "0");
%this.process();
}
//------------------------------------------------------------------------------
// System
//------------------------------------------------------------------------------
function ObjectBuilderGui::buildSimGroup(%this)
{
%this.className = "SimGroup";
%this.process();
}
//------------------------------------------------------------------------------
// AI
//------------------------------------------------------------------------------
//function ObjectBuilderGui::buildObjective(%this)
//{
// %this.className = "AIObjective";
// %this.process();
//}
//function ObjectBuilderGui::buildNavigationGraph(%this)
//{
// %this.className = "NavigationGraph";
// %this.process();
//}

View File

@ -0,0 +1,368 @@
// The Particle Editor!
// Edits both emitters and their particles in realtime in game.
//
// Open the particle editor to spawn a test emitter in front of the player.
// Edit the sliders, check boxes, and text fields and see the results in
// realtime. Switch between emitters and particles with the buttons in the
// top left corner. When in particle mode, the only particles available will
// be those assigned to the current emitter to avoid confusion. In the top
// right corner, there is a button marked "Drop Emitter", which will spawn the
// test emitter in front of the player again, and a button marked "Restart
// Emitter", which will play the particle animation again.
//TODO: animTexName on Particles (max 50)
function toggleParticleEditor(%val)
{
if (!%val)
return;
if ($ParticleEditor::isOpen)
{
Canvas.popDialog(ParticleEditor);
$ParticleEditor::isOpen = false;
return;
}
if (!isObject(ParticleEditor))
{
exec("common/editor/ParticleEditor.gui");
ParticleEditor.initEditor();
}
ParticleEditor.startup();
Canvas.pushDialog(ParticleEditor);
$ParticleEditor::isOpen = true;
}
function ParticleEditor::startup(%this)
{
$ParticleEditor::activeEditor.updateControls();
if (!isObject($ParticleEditor::emitterNode))
%this.resetEmitterNode();
}
function ParticleEditor::initEditor(%this)
{
echo("Initializing ParticleEmitterData and ParticleData DataBlocks...");
%count = DatablockGroup.getCount();
%emitterCount = 0;
%particleCount = 0;
PEE_EmitterSelector.clear();
PEE_EmitterParticleSelector1.clear();
PEE_EmitterParticleSelector2.clear();
PEE_EmitterParticleSelector3.clear();
PEE_EmitterParticleSelector4.clear();
PEP_ParticleSelector.clear();
for (%i = 0; %i < %count; %i++)
{
%obj = DatablockGroup.getObject(%i);
if (%obj.getClassName() $= "ParticleEmitterData")
{
PEE_EmitterSelector.add(%obj.getName(), %emitterCount);
%emitterCount++;
}
if (%obj.getClassName() $= "ParticleData")
{
PEE_EmitterParticleSelector1.add(%obj.getName(), %particleCount);
PEE_EmitterParticleSelector2.add(%obj.getName(), %particleCount);
PEE_EmitterParticleSelector3.add(%obj.getName(), %particleCount);
PEE_EmitterParticleSelector4.add(%obj.getName(), %particleCount);
%particleCount++;
}
}
PEE_EmitterParticleSelector2.add("", %particleCount); //insert a blank space
PEE_EmitterParticleSelector3.add("", %particleCount); //insert a blank space
PEE_EmitterParticleSelector4.add("", %particleCount); //insert a blank space
echo("Found" SPC %emitterCount SPC "emitters and" SPC %particleCount SPC "particles.");
PEE_EmitterSelector.sort();
PEE_EmitterParticleSelector1.sort();
PEE_EmitterParticleSelector2.sort();
PEE_EmitterParticleSelector3.sort();
PEE_EmitterParticleSelector4.sort();
PEE_EmitterSelector.setSelected(0);
%this.openEmitterPane();
}
function PE_EmitterEditor::updateControls(%this)
{
%id = PEE_EmitterSelector.getSelected();
%data = PEE_EmitterSelector.getTextById(%id);
PEE_ejectionPeriodMS.setValue( %data.ejectionPeriodMS);
PEE_periodVarianceMS.setValue( %data.periodVarianceMS);
PEE_ejectionVelocity.setValue( %data.ejectionVelocity);
PEE_velocityVariance.setValue( %data.velocityVariance);
PEE_ejectionOffset.setValue( %data.ejectionOffset);
PEE_lifetimeMS.setValue( %data.lifetimeMS);
PEE_lifetimeVarianceMS.setValue( %data.lifetimeVarianceMS);
PEE_thetaMin.setValue( %data.thetaMin);
PEE_thetaMax.setValue( %data.thetaMax);
PEE_phiReferenceVel.setValue( %data.phiReferenceVel);
PEE_phiVariance.setValue( %data.phiVariance);
PEE_overrideAdvance.setValue( %data.overrideAdvance);
PEE_orientParticles.setValue( %data.orientParticles);
PEE_orientOnVelocity.setValue( %data.orientOnVelocity);
PEE_useEmitterSizes.setValue( %data.useEmitterSizes);
PEE_useEmitterColors.setValue( %data.useEmitterColors);
PEE_EmitterParticleSelector1.setText(getField(%data.particles, 0));
PEE_EmitterParticleSelector2.setText(getField(%data.particles, 1));
PEE_EmitterParticleSelector3.setText(getField(%data.particles, 2));
PEE_EmitterParticleSelector4.setText(getField(%data.particles, 3));
$ParticleEditor::currEmitter = %data;
}
function PE_ParticleEditor::updateControls(%this)
{
%id = PEP_ParticleSelector.getSelected();
%data = PEP_ParticleSelector.getTextById(%id);
PEP_dragCoefficient.setValue( %data.dragCoefficient);
PEP_windCoefficient.setValue( %data.windCoefficient);
PEP_gravityCoefficient.setValue( %data.gravityCoefficient);
PEP_inheritedVelFactor.setValue( %data.inheritedVelFactor);
PEP_constantAcceleration.setValue(%data.constantAcceleration);
PEP_lifetimeMS.setValue( %data.lifetimeMS);
PEP_lifetimeVarianceMS.setValue( %data.lifetimeVarianceMS);
PEP_spinSpeed.setValue( %data.spinSpeed);
PEP_spinRandomMin.setValue( %data.spinRandomMin);
PEP_framesPerSec.setValue( %data.framesPerSec);
PEP_spinRandomMax.setValue( %data.spinRandomMax);
PEP_useInvAlpha.setValue( %data.useInvAlpha);
PEP_animateTexture.setValue( %data.animateTexture);
PEP_times0.setText( %data.times[0]);
PEP_times1.setText( %data.times[1]);
PEP_times2.setText( %data.times[2]);
PEP_times3.setText( %data.times[3]);
PEP_sizes0.setText( %data.sizes[0]);
PEP_sizes1.setText( %data.sizes[1]);
PEP_sizes2.setText( %data.sizes[2]);
PEP_sizes3.setText( %data.sizes[3]);
PEP_colors0.setText( %data.colors[0]);
PEP_colors1.setText( %data.colors[1]);
PEP_colors2.setText( %data.colors[2]);
PEP_colors3.setText( %data.colors[3]);
PEP_textureName.setText( %data.textureName);
$ParticleEditor::currParticle = %data;
}
function ParticleEditor::openEmitterPane(%this)
{
PE_Window.setText("Particle Editor - Emitters");
PE_EmitterEditor.setVisible(true);
PE_EmitterButton.setActive(false);
PE_ParticleEditor.setVisible(false);
PE_ParticleButton.setActive(true);
PE_EmitterEditor.updateControls();
$ParticleEditor::activeEditor = PE_EmitterEditor;
}
function ParticleEditor::openParticlePane(%this)
{
PE_Window.setText("Particle Editor - Particles");
PE_EmitterEditor.setVisible(false);
PE_EmitterButton.setActive(true);
PE_ParticleEditor.setVisible(true);
PE_ParticleButton.setActive(false);
PEP_ParticleSelector.clear();
PEP_ParticleSelector.add(PEE_EmitterParticleSelector1.getText(), 0);
%count = 1;
if (PEE_EmitterParticleSelector2.getText() !$= "")
{
PEP_ParticleSelector.add(PEE_EmitterParticleSelector2.getText(), %count);
%count++;
}
if (PEE_EmitterParticleSelector3.getText() !$= "")
{
PEP_ParticleSelector.add(PEE_EmitterParticleSelector3.getText(), %count);
%count++;
}
if (PEE_EmitterParticleSelector4.getText() !$= "")
PEP_ParticleSelector.add(PEE_EmitterParticleSelector4.getText(), %count);
PEP_ParticleSelector.sort();
PEP_ParticleSelector.setSelected(0); //select the PEE_EmitterParticleSelector1 particle
PE_ParticleEditor.updateControls();
$ParticleEditor::activeEditor = PE_ParticleEditor;
}
function PE_EmitterEditor::updateEmitter(%this)
{
$ParticleEditor::currEmitter.ejectionPeriodMS = PEE_ejectionPeriodMS.getValue();
$ParticleEditor::currEmitter.periodVarianceMS = PEE_periodVarianceMS.getValue();
if ($ParticleEditor::currEmitter.periodVarianceMS >= $ParticleEditor::currEmitter.ejectionPeriodMS)
{
$ParticleEditor::currEmitter.periodVarianceMS = $ParticleEditor::currEmitter.ejectionPeriodMS - 1;
PEE_periodVarianceMS.setValue($ParticleEditor::currEmitter.periodVarianceMS);
}
$ParticleEditor::currEmitter.ejectionVelocity = PEE_ejectionVelocity.getValue();
$ParticleEditor::currEmitter.velocityVariance = PEE_velocityVariance.getValue();
if ($ParticleEditor::currEmitter.velocityVariance >= $ParticleEditor::currEmitter.ejectionVelocity)
{
$ParticleEditor::currEmitter.velocityVariance = $ParticleEditor::currEmitter.ejectionVelocity - 0.01;
if ($ParticleEditor::currEmitter.velocityVariance < 0)
$ParticleEditor::currEmitter.velocityVariance = 0;
PEE_velocityVariance.setValue($ParticleEditor::currEmitter.velocityVariance);
}
$ParticleEditor::currEmitter.ejectionOffset = PEE_ejectionOffset.getValue();
$ParticleEditor::currEmitter.lifetimeMS = PEE_lifetimeMS.getValue();
$ParticleEditor::currEmitter.lifetimeVarianceMS = PEE_lifetimeVarianceMS.getValue();
if ($ParticleEditor::currEmitter.lifetimeMS == 0)
{
$ParticleEditor::currEmitter.lifetimeVarianceMS = 0;
PEE_lifetimeVarianceMS.setValue($ParticleEditor::currEmitter.lifetimeVarianceMS);
}
else if ($ParticleEditor::currEmitter.lifetimeVarianceMS >= $ParticleEditor::currEmitter.lifetimeMS)
{
$ParticleEditor::currEmitter.lifetimeVarianceMS = $ParticleEditor::currEmitter.lifetimeMS - 1;
PEE_lifetimeVarianceMS.setValue($ParticleEditor::currEmitter.lifetimeVarianceMS);
}
$ParticleEditor::currEmitter.thetaMin = PEE_thetaMin.getValue();
$ParticleEditor::currEmitter.thetaMax = PEE_thetaMax.getValue();
$ParticleEditor::currEmitter.phiReferenceVel = PEE_phiReferenceVel.getValue();
$ParticleEditor::currEmitter.phiVariance = PEE_phiVariance.getValue();
$ParticleEditor::currEmitter.overrideAdvance = PEE_overrideAdvance.getValue();
$ParticleEditor::currEmitter.orientParticles = PEE_orientParticles.getValue();
$ParticleEditor::currEmitter.orientOnVelocity = PEE_orientOnVelocity.getValue();
$ParticleEditor::currEmitter.useEmitterSizes = PEE_useEmitterSizes.getValue();
$ParticleEditor::currEmitter.useEmitterColors = PEE_useEmitterColors.getValue();
$ParticleEditor::currEmitter.particles = PEE_EmitterParticleSelector1.getText();
if (PEE_EmitterParticleSelector2.getText() !$= "")
$ParticleEditor::currEmitter.particles = $ParticleEditor::currEmitter.particles TAB PEE_EmitterParticleSelector2.getText();
if (PEE_EmitterParticleSelector3.getText() !$= "")
$ParticleEditor::currEmitter.particles = $ParticleEditor::currEmitter.particles TAB PEE_EmitterParticleSelector3.getText();
if (PEE_EmitterParticleSelector4.getText() !$= "")
$ParticleEditor::currEmitter.particles = $ParticleEditor::currEmitter.particles TAB PEE_EmitterParticleSelector4.getText();
$ParticleEditor::currEmitter.reload();
}
function PE_ParticleEditor::updateParticle(%this)
{
$ParticleEditor::currParticle.dragCoefficient = PEP_dragCoefficient.getValue();
$ParticleEditor::currParticle.windCoefficient = PEP_windCoefficient.getValue();
$ParticleEditor::currParticle.gravityCoefficient = PEP_gravityCoefficient.getValue();
$ParticleEditor::currParticle.inheritedVelFactor = PEP_inheritedVelFactor.getValue();
$ParticleEditor::currParticle.constantAcceleration = PEP_constantAcceleration.getValue();
$ParticleEditor::currParticle.lifetimeMS = PEP_lifetimeMS.getValue();
$ParticleEditor::currParticle.lifetimeVarianceMS = PEP_lifetimeVarianceMS.getValue();
if ($ParticleEditor::currParticle.lifetimeVarianceMS >= $ParticleEditor::currParticle.lifetimeMS)
{
$ParticleEditor::currParticle.lifetimeVarianceMS = $ParticleEditor::currParticle.lifetimeMS - 1;
PEP_lifetimeVarianceMS.setValue($ParticleEditor::currParticle.lifetimeVarianceMS);
}
$ParticleEditor::currParticle.spinSpeed = PEP_spinSpeed.getValue();
$ParticleEditor::currParticle.spinRandomMin = PEP_spinRandomMin.getValue();
$ParticleEditor::currParticle.spinRandomMax = PEP_spinRandomMax.getValue();
$ParticleEditor::currParticle.framesPerSec = PEP_framesPerSec.getValue();
$ParticleEditor::currParticle.useInvAlpha = PEP_useInvAlpha.getValue();
$ParticleEditor::currParticle.animateTexture = PEP_animateTexture.getValue();
$ParticleEditor::currParticle.times[0] = PEP_times0.getValue();
$ParticleEditor::currParticle.times[1] = PEP_times1.getValue();
$ParticleEditor::currParticle.times[2] = PEP_times2.getValue();
$ParticleEditor::currParticle.times[3] = PEP_times3.getValue();
$ParticleEditor::currParticle.sizes[0] = PEP_sizes0.getValue();
$ParticleEditor::currParticle.sizes[1] = PEP_sizes1.getValue();
$ParticleEditor::currParticle.sizes[2] = PEP_sizes2.getValue();
$ParticleEditor::currParticle.sizes[3] = PEP_sizes3.getValue();
$ParticleEditor::currParticle.colors[0] = PEP_colors0.getValue();
$ParticleEditor::currParticle.colors[1] = PEP_colors1.getValue();
$ParticleEditor::currParticle.colors[2] = PEP_colors2.getValue();
$ParticleEditor::currParticle.colors[3] = PEP_colors3.getValue();
$ParticleEditor::currParticle.textureName = PEP_textureName.getValue();
$ParticleEditor::currParticle.reload();
}
function PE_EmitterEditor::onNewEmitter(%this)
{
ParticleEditor.updateEmitterNode();
PE_EmitterEditor.updateControls();
}
function PE_ParticleEditor::onNewParticle(%this)
{
PE_ParticleEditor.updateControls();
}
function ParticleEditor::resetEmitterNode(%this)
{
%tform = ServerConnection.getControlObject().getEyeTransform();
%vec = VectorNormalize(ServerConnection.getControlObject().getForwardVector());
%vec = VectorScale(%vec, 4);
%tform = setWord(%tform, 0, getWord(%tform, 0) + getWord(%vec, 0));
%tform = setWord(%tform, 1, getWord(%tform, 1) + getWord(%vec, 1));
%tform = setWord(%tform, 2, getWord(%tform, 2) + getWord(%vec, 2));
if (!isObject($ParticleEditor::emitterNode))
{
if (!isObject(TestEmitterNodeData))
{
datablock ParticleEmitterNodeData(TestEmitterNodeData)
{
timeMultiple = 1;
};
}
$ParticleEditor::emitterNode = new ParticleEmitterNode()
{
emitter = PEE_EmitterSelector.getText();
velocity = 1;
position = getWords(%tform, 0, 2);
rotation = getWords(%tform, 3, 6);
datablock = TestEmitterNodeData;
};
//grab the client-side emitter node so we can reload the emitter datablock
$ParticleEditor::clientEmitterNode = $ParticleEditor::emitterNode+1;
}
else
{
$ParticleEditor::clientEmitterNode.setTransform(%tform);
ParticleEditor.updateEmitterNode();
}
}
function ParticleEditor::updateEmitterNode()
{
$ParticleEditor::clientEmitterNode.setEmitterDataBlock(PEE_EmitterSelector.getText().getId());
}
function PE_EmitterEditor::save(%this)
{
%mod = $currentMod;
if (%mod $= "")
{
warn("Warning: No mod detected, saving in common.");
%mod = "common";
}
%filename = %mod @ "/" @ $ParticleEditor::currEmitter @ ".cs";
$ParticleEditor::currEmitter.save(%filename);
}
function PE_ParticleEditor::save(%this)
{
%mod = $currentMod;
if (%mod $= "")
{
warn("Warning: No mod detected, saving in common.");
%mod = "common";
}
%filename = %mod @ "/" @ $ParticleEditor::currParticle @ ".cs";
$ParticleEditor::currParticle.save(%filename);
}

26
example/creator/main.cs Executable file
View File

@ -0,0 +1,26 @@
//-----------------------------------------------------------------------------
// Torque Engine
// Copyright (c) GarageGames.Com
//-----------------------------------------------------------------------------
loadDir("common");
package Creator
{
function onStart()
{
Parent::onStart();
echo( "\n--------- Initializing: Torque Creator ---------" );
// Scripts
exec("./editor/editor.cs");
exec("./editor/particleEditor.cs");
exec("./scripts/scriptDoc.cs");
// Gui's
exec("./ui/creatorProfiles.cs");
exec("./ui/InspectDlg.gui");
exec("./ui/GuiEditorGui.gui");
}
};
activatePackage( Creator );

View File

@ -0,0 +1,20 @@
//-----------------------------------------------------------------------------
// Torque Engine
// Copyright (c) GarageGames.Com
//-----------------------------------------------------------------------------
// Writes out all script functions to a file
function writeOutFunctions()
{
new ConsoleLogger( logger, "scriptFunctions.txt", false );
dumpConsoleFunctions();
logger.delete();
}
// Writes out all script classes to a file
function writeOutClasses()
{
new ConsoleLogger( logger, "scriptClasses.txt", false );
dumpConsoleClasses();
logger.delete();
}

View File

@ -0,0 +1,656 @@
//----------------------------------------------------------------
new GuiControlProfile (BackFillProfile)
{
opaque = true;
fillColor = "0 94 94";
border = true;
borderColor = "255 128 128";
fontType = "Arial";
fontSize = 12;
fontColor = "0 0 0";
fontColorHL = "32 100 100";
fixedExtent = true;
justify = "center";
};
new GuiControl(GuiEditorGui) {
profile = GuiDefaultProfile;
position = "0 0";
extent = "800 600";
helpPage = "3. Gui Editor";
new GuiMenuBar(GuiEditorMenuBar) {
profile = "GuiMenuBarProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "0 0";
extent = "800 22";
minExtent = "8 8";
visible = "1";
helpTag = "0";
};
new GuiFrameSetCtrl()
{
position = "0 22";
extent = "800 578";
profile = "GuiButtonProfile";
horizSizing = "width";
vertSizing = "height";
columns = "0 640";
rows = "0";
new GuiControl() {
position = "0 0";
extent = "640 578";
minExtent = "64 64";
horizSizing = "width";
vertSizing = "height";
profile = GuiDefaultProfile;
//----------------------------------------
// toolbar
new GuiControl() {
profile = "GuiWindowProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "0 0";
extent = "640 28";
new GuiControlListPopup(GuiEditorClassPopup)
{
profile = "GuiEditorClassProfile";
position = "8 6";
extent = "180 16";
};
new GuiPopUpMenuCtrl(GuiEditorContentList)
{
profile = "GuiEditorClassProfile";
position = "196 6";
extent = "180 16";
};
new GuiPopUpMenuCtrl(GuiEditorResList)
{
profile = "GuiEditorClassProfile";
position = "382 6";
extent = "180 16";
};
};
new GuiEditorRuler(GuiEditorTopRuler) {
position = "10 28";
extent = "630 10";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiButtonProfile";
refCtrl = GuiEditorScroll;
};
new GuiEditorRuler(GuiEditorLeftRuler) {
position = "0 38";
extent = "10 540";
horizSizing = "right";
vertSizing = "height";
profile = "GuiButtonProfile";
refCtrl = GuiEditorScroll;
};
new GuiScrollCtrl(GuiEditorScroll)
{
profile = "GuiScrollProfile";
position = "10 38";
extent = "630 540";
horizSizing = "width";
vertSizing = "height";
vScrollBar = "dynamic";
hScrollBar = "dynamic";
new GuiControl(GuiEditorRegion)
{
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
new GuiControl() // background
{
profile = "BackFillProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "640 480";
};
new GuiControl(GuiEditorContent)
{
profile = "GuiDefaultProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "640 480";
};
new GuiEditCtrl(GuiEditor)
{
profile = "GuiTextEditProfile"; // so it's tabable
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "640 480";
};
};
};
};
new GuiFrameSetCtrl()
{
position = "640 0";
minExtent = "128 64";
extent = "160 600";
profile = "GuiButtonProfile";
horizSizing = "width";
vertSizing = "height";
columns = "0";
rows = "0 300";
//----------------------------------------
// Tree View
new GuiScrollCtrl()
{
profile = "GuiScrollProfile";
minExtent = "72 64";
position = "0 0";
extent = "160 300";
horizSizing = "width";
vertSizing = "height";
vScrollBar = "alwaysOn";
hScrollBar = "dynamic";
new GuiTreeViewCtrl(GuiEditorTreeView)
{
profile = "GuiTreeViewProfile";
position = "0 0";
horizSizing = "width";
};
};
//----------------------------------------
// Inspector
new GuiControl() {
profile = "GuiInspectorBackgroundProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "160 300";
minExtent = "64 64";
fillColor = "128 128 128";
new GuiButtonCtrl () {
profile = "GuiInspectorTypeFileNameProfile";
position = "6 3";
border = 5;
extent = "40 20";
text = "Apply";
command = "GuiEditorInspectApply();";
};
new GuiTextCtrl() {
profile = "GuiInspectorFieldProfile";
position = "52 4";
extent = "42 16";
text = "Name:";
};
new GuiTextEditCtrl (GuiEditorInspectName) {
profile = "GuiInspectorBackgroundProfile";
position = "97 4";
extent = "62 18";
text = "";
horizSizing = "width";
AltCommand = "GuiEditorInspectApply();";
vertSizing = "bottom";
autoSizeWidth = false;
autoSizeHeight = true;
textOffset = "0 2";
};
new GuiScrollCtrl() {
profile = "GuiScrollProfile";
position = "0 26";
extent = "160 274";
horizSizing = "width";
vertSizing = "height";
vScrollBar = "alwaysOn";
hScrollBar = "alwaysOff";
new GuiInspector (GuiEditorInspectFields) {
useFieldGrouping = false;
profile = "GuiDefaultProfile";
position = "0 0";
extent = "140 0";
horizSizing = "width";
vertSizing = "bottom";
};
};
};
};
};
};
//----------------------------------------
new GuiControl(NewGuiDialog)
{
profile = "GuiDialogProfile";
position = "0 0";
extent = "640 480";
new GuiWindowCtrl()
{
profile = "GuiWindowProfile";
position = "220 146";
extent = "200 188";
text = "Create new GUI";
canMove = "false";
canClose = "false";
canMinimize = "false";
canMaximize = "false";
horizSizing = "center";
vertSizing = "center";
new GuiTextCtrl()
{
profile = "GuiTextProfile";
position = "20 28";
text = "GUI Name:";
};
new GuiTextEditCtrl(NewGuiDialogName)
{
profile = "GuiTextEditProfile";
position = "20 44";
extent = "160 20";
};
new GuiTextCtrl()
{
profile = "GuiTextProfile";
position = "20 68";
text = "Class:";
};
new GuiControlListPopup(NewGuiDialogClass)
{
profile = "GuiControlListPopupProfile";
position = "20 84";
extent = "160 20";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
position = "56 156";
extent = "40 16";
text = "Create";
command = "GuiEditorCreate();";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
position = "104 156";
extent = "40 16";
text = "Cancel";
command = "Canvas.popDialog(NewGuiDialog);";
};
};
};
//----------------------------------------
function GuiEditorStartCreate()
{
NewGuiDialogClass.setText("GuiControl");
NewGuiDialogClass.sort();
NewGuiDialogName.setValue("NewGui");
Canvas.pushDialog(NewGuiDialog);
}
//----------------------------------------
function GuiEditorCreate()
{
%name = NewGuiDialogName.getValue();
%class = NewGuiDialogClass.getText();
Canvas.popDialog(NewGuiDialog);
%obj = eval("return new " @ %class @ "(" @ %name @ ");");
GuiEditorOpen(%obj);
}
//----------------------------------------
function GuiEditorSaveGui()
{
%obj = GuiEditorContent.getObject(0);
if(%obj == -1 || %obj.getName() $= "")
return;
%name = %obj.getName() @ ".gui";
if ($BlockSave!=1) {
getSaveFilename("*.gui", "GuiEditorSaveGuiCallback", %name);
} else {
echo("To enable gui saving, make \$BlockSave=1.");
MessageBoxOK("Save Function Disabled","The Save GUI function has been disabled for this demo walkthrough.\n\n If you are sure you want to make permanent GUI changes, go to the console (tilde \"~\" key) and type \"$BlockSave=0;\" first.");
}
}
function GuiEditorSaveGuiCallback(%name)
{
%obj = GuiEditorContent.getObject(0);
// make sure it is saved...
if(!%obj.save(%name))
{
MessageBoxOK("GuiEditor Save Failure", "Failed to save '" @ %name @ "'. The file may be read-only.");
}
}
//----------------------------------------
function GuiEdit(%val)
{
if(%val != 0)
return;
%content = Canvas.getContent();
if(%content == GuiEditorGui.getId())
{
//GlobalActionMap.bind(mouse, button1, mouselook);
%obj = GuiEditorContent.getObject(0);
if(%obj != -1)
{
GuiGroup.add(%obj);
//Canvas.setContent(%obj);
Canvas.setContent($previousContent);
}
echo("Exporting Gui Editor Prefs");
export( "$Pref::GuiEditor::*", "./prefs.cs", false );
GlobalActionMap.unbind( keyboard, "delete" );
}
else
{
$previousContent = %content;
exec("./prefs.cs");
//GlobalActionMap.unbind(mouse, button1);
GuiEditorOpen(%content);
}
}
package GuiEditor_BlockDialogs
{
function GuiCanvas::pushDialog()
{
}
function GuiCanvas::popDialog()
{
}
};
//----------------------------------------
function GuiEditorOpen(%content)
{
GuiEditorMenuBar.clearMenus();
GuiEditorMenuBar.addMenu("File", 0);
GuiEditorMenuBar.addMenuItem("File", "New GUI...", 1);
GuiEditorMenuBar.scriptCommand["File", 1] = "GuiEditorStartCreate();";
GuiEditorMenuBar.addMenuItem("File", "Save GUI...", 2);
GuiEditorMenuBar.scriptCommand["File", 2] = "GuiEditorSaveGui();";
GuiEditorMenuBar.addMenuItem("File", "-", 0);
GuiEditorMenuBar.addMenuItem("File", "GUI Editor Help...", 3, "F1");
GuiEditorMenuBar.scriptCommand["File", 3] = "getHelp(\"3. Gui Editor\");";
GuiEditorMenuBar.addMenuItem("File", "Toggle GUI Editor...", 4, "F10");
GuiEditorMenuBar.scriptCommand["File", 4] = "GuiEdit(0);";
GuiEditorMenuBar.addMenu("Edit", 1);
GuiEditorMenuBar.addMenuItem("Edit", "Cut", 3, "Ctrl X");
GuiEditorMenuBar.scriptCommand["Edit", 3] = "GuiEditor.saveSelection($GUI::clipboardFile); GuiEditor.deleteSelection();";
GuiEditorMenuBar.setMenuItemBitmap("Edit", "Cut", 3);
GuiEditorMenuBar.addMenuItem("Edit", "Copy", 4, "Ctrl C");
GuiEditorMenuBar.scriptCommand["Edit", 4] = "GuiEditor.saveSelection($GUI::clipboardFile);";
GuiEditorMenuBar.setMenuItemBitmap("Edit", "Copy", 4);
GuiEditorMenuBar.addMenuItem("Edit", "Paste", 5, "Ctrl V");
GuiEditorMenuBar.scriptCommand["Edit", 5] = "GuiEditor.loadSelection($GUI::clipboardFile);";
GuiEditorMenuBar.setMenuItemBitmap("Edit", "Paste", 5);
GuiEditorMenuBar.addMenuItem("Edit", "-", 0);
GuiEditorMenuBar.addMenuItem("Edit", "Select All", 6, "Ctrl A");
GuiEditorMenuBar.scriptCommand["Edit", 6] = "GuiEditor.selectAll();";
GuiEditorMenuBar.addMenu("Layout", 2);
GuiEditorMenuBar.addMenuItem("Layout", "Align Left", 1, "Ctrl L");
GuiEditorMenuBar.scriptCommand["Layout", 1] = "GuiEditor.Justify(0);";
GuiEditorMenuBar.addMenuItem("Layout", "Align Right", 2, "Ctrl R");
GuiEditorMenuBar.scriptCommand["Layout", 2] = "GuiEditor.Justify(2);";
GuiEditorMenuBar.addMenuItem("Layout", "Align Top", 3, "Ctrl T");
GuiEditorMenuBar.scriptCommand["Layout", 3] = "GuiEditor.Justify(3);";
GuiEditorMenuBar.addMenuItem("Layout", "Align Bottom", 4, "Ctrl B");
GuiEditorMenuBar.scriptCommand["Layout", 4] = "GuiEditor.Justify(4);";
GuiEditorMenuBar.addMenuItem("Layout", "-", 0);
GuiEditorMenuBar.addMenuItem("Layout", "Center Horizontally", 5);
GuiEditorMenuBar.scriptCommand["Layout", 5] = "GuiEditor.Justify(1);";
GuiEditorMenuBar.addMenuItem("Layout", "Space Vertically", 6);
GuiEditorMenuBar.scriptCommand["Layout", 6] = "GuiEditor.Justify(5);";
GuiEditorMenuBar.addMenuItem("Layout", "Space Horizontally", 7);
GuiEditorMenuBar.scriptCommand["Layout", 7] = "GuiEditor.Justify(6);";
GuiEditorMenuBar.addMenuItem("Layout", "-", 0);
GuiEditorMenuBar.addMenuItem("Layout", "Bring to Front", 8);
GuiEditorMenuBar.scriptCommand["Layout", 8] = "GuiEditor.BringToFront();";
GuiEditorMenuBar.addMenuItem("Layout", "Send to Back", 9);
GuiEditorMenuBar.scriptCommand["Layout", 9] = "GuiEditor.PushToBack();";
GuiEditorMenuBar.addMenuItem("Layout", "Lock Selection", 10);
GuiEditorMenuBar.scriptCommand["Layout",10] = "GuiEditorTreeView.lockSelection(true);";
GuiEditorMenuBar.addMenuItem("Layout", "Unlock Selection", 11);
GuiEditorMenuBar.scriptCommand["Layout",11] = "GuiEditorTreeView.lockSelection(false);";
GuiEditorMenuBar.addMenu("Move", 3);
GuiEditorMenuBar.addMenuItem("Move", "Nudge Left", 1, "Left");
GuiEditorMenuBar.scriptCommand["Move", 1] = "GuiEditor.moveSelection(-1,0);";
GuiEditorMenuBar.addMenuItem("Move", "Nudge Right", 2, "Right");
GuiEditorMenuBar.scriptCommand["Move", 2] = "GuiEditor.moveSelection(1,0);";
GuiEditorMenuBar.addMenuItem("Move", "Nudge Up", 3, "Up");
GuiEditorMenuBar.scriptCommand["Move", 3] = "GuiEditor.moveSelection(0,-1);";
GuiEditorMenuBar.addMenuItem("Move", "Nudge Down", 4, "Down");
GuiEditorMenuBar.scriptCommand["Move", 4] = "GuiEditor.moveSelection(0,1);";
GuiEditorMenuBar.addMenuItem("Move", "-", 0);
GuiEditorMenuBar.addMenuItem("Move", "Big Nudge Left", 5, "Shift Left");
GuiEditorMenuBar.scriptCommand["Move", 5] = "GuiEditor.moveSelection(-10,0);";
GuiEditorMenuBar.addMenuItem("Move", "Big Nudge Right", 6, "Shift Right");
GuiEditorMenuBar.scriptCommand["Move", 6] = "GuiEditor.moveSelection(10,0);";
GuiEditorMenuBar.addMenuItem("Move", "Big Nudge Up", 7, "Shift Up");
GuiEditorMenuBar.scriptCommand["Move", 7] = "GuiEditor.moveSelection(0,-10);";
GuiEditorMenuBar.addMenuItem("Move", "Big Nudge Down", 8, "Shift Down");
GuiEditorMenuBar.scriptCommand["Move", 8] = "GuiEditor.moveSelection(0,10);";
Canvas.setContent(GuiEditorGui);
while((%obj = GuiEditorContent.getObject(0)) != -1)
GuiGroup.add(%obj); // get rid of anything being edited
%i = 0;
GuiEditorContentList.clear();
while((%obj = GuiGroup.getObject(%i)) != -1)
{
if(%obj.getName() !$= Canvas)
{
if(%obj.getName() $= "")
%name = "(unnamed) - " @ %obj;
else
%name = %obj.getName() @ " - " @ %obj;
GuiEditorContentList.add(%name, %obj);
}
%i++;
activatePackage(GuiEditor_BlockDialogs);
GuiEditorContent.add(%content);
deactivatePackage(GuiEditor_BlockDialogs);
GuiEditorContentList.sort();
}
GuiEditorClassPopup.sort();
GuiEditorResList.clear();
GuiEditorResList.add("640 x 480", 640);
GuiEditorResList.add("800 x 600", 800);
GuiEditorResList.add("1024 x 768", 1024);
%ext = $Pref::GuiEditor::PreviewResolution;
if( %ext $= "" )
{
%ext = GuiEditorRegion.getExtent();
echo("extent is " @ %ext );
switch(getWord(%ext, 0))
{
case 640:
GuiEditorResList.setText("640 x 480");
case 800:
GuiEditorResList.setText("800 x 600");
case 1024:
GuiEditorResList.setText("1024 x 768");
}
}
else
{
GuiEditorResList.setText( getWord(%ext,0) @ " x " @ getWord(%ext, 1) );
}
if(%content.getName() $= "")
%name = "(unnamed) - " @ %content;
else
%name = %content.getName() @ " - " @ %content;
GuiEditorContentList.setText(%name);
GuiEditorClassPopup.setText("New Control");
GuiEditor.setRoot(%content);
GuiEditorRegion.resize(0,0,getWord(%ext,0), getWord(%ext, 1));
GuiEditorContent.getObject(0).resize(0,0,getWord(%ext,0), getWord(%ext, 1));
// %content.resize(0,0,getWord(%ext,0), getWord(%ext, 1));
GuiEditorTreeView.open(%content);
}
function GuiEditorMenuBar::onMenuItemSelect(%this, %menuId, %menu, %itemId, %item)
{
if(%this.scriptCommand[%menu, %itemId] !$= "")
eval(%this.scriptCommand[%menu, %itemId]);
else
error("No script command defined for menu " @ %menu @ " item " @ %item);
}
//----------------------------------------
function GuiEditorContentList::onSelect(%this, %id)
{
GuiEditorOpen(%id);
}
//----------------------------------------
function GuiEditorClassPopup::onSelect(%this, %id)
{
%class = %this.getText();
%obj = eval("return new " @ %class @ "();");
GuiEditor.addNewCtrl(%obj);
GuiEditorClassPopup.setText("New Control");
}
function GuiEditorResList::onSelect(%this, %id)
{
switch(%id)
{
case 640:
GuiEditorRegion.resize(0,0,640,480);
GuiEditorContent.getObject(0).resize(0,0,640,480);
$Pref::GuiEditor::PreviewResolution = "640 480";
case 800:
GuiEditorRegion.resize(0,0,800,600);
GuiEditorContent.getObject(0).resize(0,0,800,600);
$Pref::GuiEditor::PreviewResolution = "800 600";
case 1024:
GuiEditorRegion.resize(0,0,1024,768);
GuiEditorContent.getObject(0).resize(0,0,1024,768);
$Pref::GuiEditor::PreviewResolution = "1024 768";
}
}
//----------------------------------------
// defines the icons to be used in the tree view control
// provide the paths to each icon minus the file extension
// seperate them with :
// the order of the icons must correspond to the bit array defined
// in the GuiTreeViewCtrl.h
function GuiEditorTreeView::onDefineIcons(%this)
{
//%icons = "common/ui/shll_icon_passworded_hi:common/ui/shll_icon_passworded:common/ui/shll_icon_notqueried_hi:common/ui/shll_icon_notqueried:common/ui/shll_icon_favorite_hi:common/ui/shll_icon_default:";
//GuiEditorTreeView.buildIconTable(%icons);
}
function GuiEditorTreeView::onRightMouseDown(%this, %item, %pts, %obj)
{
if(%obj)
{
GuiEditor.setCurrentAddSet(%obj);
}
}
function GuiEditorTreeView::onAddSelection(%this,%ctrl)
{
GuiEditor.addSelection(%ctrl);
}
function GuiEditorTreeView::onRemoveSelection(%this,%ctrl)
{
GuiEditorTreeView.removeSelection(%ctrl);
}
function GuiEditor::onClearSelected(%this)
{
GuiEditorTreeView.clearSelection();
}
function GuiEditor::onAddSelected(%this,%ctrl)
{
GuiEditorTreeView.addSelection(%ctrl);
}
function GuiEditor::onRemoveSelected(%this,%ctrl)
{
GuiEditorTreeView.removeSelection(%ctrl);
}
function GuiEditor::onDelete(%this)
{
GuiEditorTreeView.deleteSelection();
}
function GuiEditorTreeView::onDeleteSelection(%this)
{
GuiEditor.clearSelection();
}
function GuiEditorTreeView::onSelect(%this, %obj)
{
if(isObject(%obj))
{
GuiEditorInspectFields.inspect(%obj);
GuiEditorInspectName.setValue(%obj.getName());
GuiEditor.select(%obj);
}
}
//----------------------------------------
function GuiEditorInspectApply()
{
GuiEditorInspectFields.setName(GuiEditorInspectName.getValue());
}
//----------------------------------------
function GuiEditor::onSelect(%this, %ctrl)
{
GuiEditorInspectFields.inspect(%ctrl);
GuiEditorInspectName.setValue(%ctrl.getName());
GuiEditor.clearSelection();
GuiEditor.select(%ctrl);
GuiEditorTreeView.addSelection(%ctrl);
}
//----------------------------------------
//function GuiEditorDeleteSelected( %val ) {
// if( %val )
// GuiEditor.deleteSelection();
//}
GlobalActionMap.bind(keyboard, "f10", GuiEdit);

View File

@ -0,0 +1,103 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(InspectAddFieldDlg) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiWindowCtrl() {
profile = "GuiWindowProfile";
horizSizing = "center";
vertSizing = "center";
position = "209 177";
extent = "221 125";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Add dynamic field...";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "1";
canMinimize = "1";
canMaximize = "1";
minSize = "50 50";
closeCommand = "Canvas.popDialog(InspectAddFieldDlg);";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "22 32";
extent = "30 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Name:";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "21 58";
extent = "31 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Value:";
};
new GuiTextEditCtrl(InspectAddFieldValue) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "62 58";
extent = "146 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
historySize = "0";
maxLength = "255";
};
new GuiTextEditCtrl(InspectAddFieldName) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "62 32";
extent = "146 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
historySize = "0";
maxLength = "255";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "25 88";
extent = "73 20";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "OK";
command = "canvas.popDialog(InspectAddFieldDlg);InspectAddFieldDlg.doAction();";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "125 88";
extent = "73 20";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "CANCEL";
command = "canvas.popDialog(InspectAddFieldDlg);";
};
};
};
//--- OBJECT WRITE END ---

204
example/creator/ui/InspectDlg.gui Executable file
View File

@ -0,0 +1,204 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(InspectDlg) {
profile = "GuiDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "False";
helpTag = "0";
new GuiWindowCtrl(InspectTitle) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 20";
extent = "200 400";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
resizeWidth = "True";
resizeHeight = "True";
canMove = "True";
canClose = "True";
canMinimize = "True";
canMaximize = "True";
minSize = "50 50";
closeCommand = "Canvas.popDialog(InspectDlg);";
font = "12 244 Arial";
selectfillColor = "253";
fillColor = "250";
opaque = "true";
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "8 24";
extent = "40 16";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
command = "InspectApply();";
helpTag = "0";
text = "APPLY";
selectBorderColor = "255";
borderColor = "249";
fillColor = "249";
fontHL = "12 253 Arial";
font = "12 252 Arial";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "56 24";
extent = "29 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "Name:";
font = "12 244 Arial";
};
new GuiTextEditCtrl(InspectObjectName) {
profile = "GuiTextEditProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "98 23";
extent = "72 18";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
historySize = "0";
};
new GuiScrollCtrl() {
profile = "GuiScrollProfile";
horizSizing = "width";
vertSizing = "height";
position = "8 44";
extent = "184 348";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
willFirstRespond = "True";
hScrollBar = "alwaysOff";
vScrollBar = "alwaysOn";
constantThumbHeight = "False";
new GuiInspector(InspectFields) {
profile = "GuiDefaultProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "0 0";
extent = "184 8";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
};
};
};
new GuiWindowCtrl(InspectTreeTitle) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "232 20";
extent = "200 400";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
text = "TREE VIEW";
resizeWidth = "True";
resizeHeight = "True";
canMove = "True";
canClose = "True";
canMinimize = "True";
canMaximize = "True";
minSize = "50 50";
closeCommand = "Canvas.popDialog(InspectDlg);";
new GuiScrollCtrl() {
profile = "GuiScrollProfile";
horizSizing = "width";
vertSizing = "height";
position = "8 24";
extent = "184 368";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
willFirstRespond = "True";
hScrollBar = "dynamic";
vScrollBar = "alwaysOn";
constantThumbHeight = "False";
new GuiTreeViewCtrl(InspectTreeView) {
profile = "GuiTreeViewProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "0 0";
extent = "64 64";
minExtent = "8 8";
visible = "True";
setFirstResponder = "False";
modal = "True";
helpTag = "0";
destroyTreeOnSleep = false;
};
};
};
};
//--- OBJECT WRITE END ---
function Inspect(%obj)
{
Canvas.popDialog("InspectDlg");
Canvas.pushDialog("InspectDlg", 30);
InspectFields.inspect(%obj);
InspectObjectName.setValue(%obj.getName());
InspectTitle.setValue(%obj.getId() @ ": " @ %obj.getName());
}
function InspectApply()
{
InspectFields.apply(InspectObjectName.getValue());
}
function InspectTreeView::onSelect(%this, %obj)
{
Inspect(%obj);
}
function Tree(%obj)
{
Canvas.popDialog("InspectDlg");
Canvas.pushDialog("InspectDlg", 35);
InspectTreeView.open(%obj);
}
function InspectAddFieldDlg::doAction(%this)
{
if(InspectAddFieldName.getValue() $= "" || InspectAddFieldValue.getValue() $= "")
return;
eval(%this.object @ "." @ firstWord(InspectAddFieldName.getValue()) @ " = " @ InspectAddFieldValue.getValue() @ ";");
%this.inspector.inspect(%this.object);
}

View File

@ -0,0 +1,57 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
if(!isObject(EditorToolButtonProfile)) new GuiControlProfile (EditorToolButtonProfile)
{
opaque = true;
border = 2;
};
if(!isObject(EditorTextProfile)) new GuiControlProfile (EditorTextProfile)
{
fontType = "Arial Bold";
fontColor = "0 0 0";
autoSizeWidth = true;
autoSizeHeight = true;
};
if(!isObject(EditorTextProfileWhite)) new GuiControlProfile (EditorTextProfileWhite)
{
fontType = "Arial Bold";
fontColor = "255 255 255";
autoSizeWidth = true;
autoSizeHeight = true;
};
if(!isObject(MissionEditorProfile)) new GuiControlProfile (MissionEditorProfile)
{
canKeyFocus = true;
};
if(!isObject(EditorScrollProfile)) new GuiControlProfile (EditorScrollProfile)
{
opaque = true;
fillColor = "192 192 192 192";
border = 3;
borderThickness = 2;
borderColor = "0 0 0";
bitmap = "common/ui/darkScroll";
hasBitmapArray = true;
};
if(!isObject(GuiEditorClassProfile)) new GuiControlProfile (GuiEditorClassProfile)
{
opaque = true;
fillColor = "232 232 232";
border = true;
borderColor = "0 0 0";
borderColorHL = "127 127 127";
fontColor = "0 0 0";
fontColorHL = "32 100 100";
fixedExtent = true;
justify = "center";
bitmap = ($platform $= "macos") ? "common/ui/osxScroll" : "common/ui/darkScroll";
hasBitmapArray = true;
};