mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
file saving
This commit is contained in:
parent
ca31e4c2c9
commit
ace243171e
|
|
@ -68,7 +68,7 @@ $guiContent = new GuiControl(classPrototyping) {
|
|||
extent = "22 22";
|
||||
horizSizing = "left";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
command = "SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, \"setAssetTargetUpdatePath\");\nSelectAssetPathWindow.selectWindow();";
|
||||
command = "SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, \"setProtoTypeFilePath\");\nSelectAssetPathWindow.selectWindow();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "New Module";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ function PrototypeClass(%classInstance)
|
|||
function classPrototyping::fillClasslist(%this, %classInstance)
|
||||
{
|
||||
ClassInheritanceListCtrl.deleteAllObjects();
|
||||
%this.inst = %classInstance;
|
||||
%this.instanceName = %classInstance.getName();
|
||||
|
||||
//get potentially scripted namespaces
|
||||
|
|
@ -86,6 +85,11 @@ function classPrototyping::fillMethodlist(%this, %nameSpaceUsed)
|
|||
}
|
||||
}
|
||||
|
||||
function setProtoTypeFilePath(%targetPath)
|
||||
{
|
||||
classPrototyping-->targetPath.text = %targetPath;
|
||||
}
|
||||
|
||||
function classPrototyping::writeResults(%this)
|
||||
{
|
||||
%namespaceUsed = "";
|
||||
|
|
@ -96,33 +100,42 @@ function classPrototyping::writeResults(%this)
|
|||
if (%obj.isStateOn())
|
||||
%namespaceUsed = getWord(%this.classlist,%inheritanceOrder);
|
||||
}
|
||||
echo(%namespaceUsed);
|
||||
for (%i=0; %i<%this.methodCount; %i++)
|
||||
%file = new FileObject();
|
||||
%filename = classPrototyping-->targetPath.text @"/"@ %namespaceUsed @"."@ $TorqueScriptFileExtension;
|
||||
if(%file.openForWrite(%filename))
|
||||
{
|
||||
%obj = "ProtoMethodSelect"@ %i;
|
||||
if (%obj.isStateOn())
|
||||
echo(strreplace(%this.methodArray.getValue(%i),%this.instanceName,%namespaceUsed));
|
||||
}
|
||||
|
||||
if (ReportCommands.isStateOn())
|
||||
{
|
||||
%this.commandArray = getMethodSigsNS(%this.nameSpaceUsed,true);
|
||||
%this.commandCount = %this.commandArray.count();
|
||||
echo("/* Available Commands:");
|
||||
for (%i=0; %i< %this.commandCount; %i++)
|
||||
for (%i=0; %i<%this.methodCount; %i++)
|
||||
{
|
||||
echo(getRecord(%this.commandArray.getValue(%i),0));
|
||||
%obj = "ProtoMethodSelect"@ %i;
|
||||
if (%obj.isStateOn())
|
||||
%file.writeLine(strreplace(%this.methodArray.getValue(%i),%this.instanceName,%namespaceUsed));
|
||||
}
|
||||
echo("*/");
|
||||
}
|
||||
|
||||
if (ReportVariables.isStateOn())
|
||||
{
|
||||
echo("/* HardCoded Variables");
|
||||
for (%i=0; %i< getFieldCountNS(%this.nameSpaceUsed); %i++)
|
||||
if (ReportCommands.isStateOn())
|
||||
{
|
||||
echo(getFieldNS(%this.nameSpaceUsed,%i));
|
||||
%this.commandArray = getMethodSigsNS(%this.nameSpaceUsed,true);
|
||||
%this.commandCount = %this.commandArray.count();
|
||||
%file.writeLine("/* Available Commands:");
|
||||
for (%i=0; %i< %this.commandCount; %i++)
|
||||
{
|
||||
%file.writeLine(getRecord(%this.commandArray.getValue(%i),0));
|
||||
}
|
||||
%file.writeLine("*/");
|
||||
}
|
||||
|
||||
if (ReportVariables.isStateOn())
|
||||
{
|
||||
%file.writeLine("/* HardCoded Variables");
|
||||
for (%i=0; %i< getFieldCountNS(%this.nameSpaceUsed); %i++)
|
||||
{
|
||||
%file.writeLine(getFieldNS(%this.nameSpaceUsed,%i));
|
||||
}
|
||||
%file.writeLine("*/");
|
||||
}
|
||||
echo("*/");
|
||||
}
|
||||
else
|
||||
{
|
||||
error( "Failed to open " @ %filename @ " for writing" );
|
||||
}
|
||||
%file.delete();
|
||||
}
|
||||
Loading…
Reference in a new issue