Initial commit

This commit is contained in:
Eagle517
2026-01-14 10:27:57 -06:00
commit c1576fee30
11290 changed files with 1552799 additions and 0 deletions

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

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

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

Binary file not shown.

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);", "");

Binary file not shown.

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);

Binary file not shown.

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);
// }
//}

Binary file not shown.

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);
}