new function: VariationName(index)

This commit is contained in:
zueuk 2006-12-09 13:37:51 +00:00
parent a85f275faf
commit 8e035eac58

View File

@ -401,6 +401,7 @@ type
procedure SetVariableStr(AMachine: TatVirtualMachine); procedure SetVariableStr(AMachine: TatVirtualMachine);
} }
procedure VariationIndexProc(AMachine: TatVirtualMachine); procedure VariationIndexProc(AMachine: TatVirtualMachine);
procedure VariationNameProc(AMachine: TatVirtualMachine);
procedure GetPivotModeProc(AMachine: TatVirtualMachine); procedure GetPivotModeProc(AMachine: TatVirtualMachine);
procedure SetPivotModeProc(AMachine: TatVirtualMachine); procedure SetPivotModeProc(AMachine: TatVirtualMachine);
procedure GetPivotXProc(AMachine: TatVirtualMachine); procedure GetPivotXProc(AMachine: TatVirtualMachine);
@ -1221,6 +1222,7 @@ begin
} }
Scripter.AddConstant('ProgramVersionString', AppVersionString); Scripter.AddConstant('ProgramVersionString', AppVersionString);
Scripter.DefineMethod('VariationIndex', 1, tkInteger, nil, VariationIndexProc); Scripter.DefineMethod('VariationIndex', 1, tkInteger, nil, VariationIndexProc);
Scripter.DefineMethod('VariationName', 1, tkString, nil, VariationNameProc);
Scripter.DefineMethod('GetPivotMode', 0, tkInteger, nil, GetPivotModeProc); Scripter.DefineMethod('GetPivotMode', 0, tkInteger, nil, GetPivotModeProc);
Scripter.DefineMethod('SetPivotMode', 1, tkNone, nil, SetPivotModeProc); Scripter.DefineMethod('SetPivotMode', 1, tkNone, nil, SetPivotModeProc);
@ -1851,6 +1853,20 @@ begin
end; end;
end; end;
procedure TOperationLibrary.VariationNameProc(AMachine: TatVirtualMachine);
var
i: integer;
str: string;
begin
with AMachine do begin
i := GetInputArgAsInteger(0);
if (i >= 0) and (i < NRVAR) then
ReturnOutputArg(varnames(i))
else
ReturnOutputArg('');
end;
end;
procedure TOperationLibrary.FileCountProc(AMachine: TatVirtualMachine); procedure TOperationLibrary.FileCountProc(AMachine: TatVirtualMachine);
begin begin
with AMachine do with AMachine do
@ -2700,7 +2716,7 @@ begin
with AMachine do with AMachine do
begin begin
v := GetInputArgAsFloat(0); v := GetInputArgAsFloat(0);
if (v > 0) and (v < 256) then if (v > 0) and (v <= MAX_WEIGHT) then
cp.xform[ActiveTransform].density := v; cp.xform[ActiveTransform].density := v;
end; end;
end; end;
@ -2867,7 +2883,10 @@ end;
procedure TScriptEditor.TransformClearProc(AMachine: TatVirtualMachine); procedure TScriptEditor.TransformClearProc(AMachine: TatVirtualMachine);
begin begin
cp.xform[ActiveTransform].Clear; cp.xform[ActiveTransform].Clear;
cp.xform[ActiveTransform].density := 0.5; if ActiveTransform < Transforms then
cp.xform[ActiveTransform].density := 0.5
else
cp.xform[ActiveTransform].symmetry := 1;
end; end;
procedure TScriptEditor.TransformRotateOriginProc(AMachine: TatVirtualMachine); procedure TScriptEditor.TransformRotateOriginProc(AMachine: TatVirtualMachine);