Shuttleu
2010-07-12 19:02:54
i think this function in NewAutoColor.scar should have its name changed
and this one should be called srl_AutoGetColors
thoughts?
~shut
{*******************************************************************************
function srl_AutoGetColors(Name: string): TIntegerarray;
By: Wizzup?, Sumilion, XcanadamanX
Description:
*******************************************************************************}
function srl_AutoGetColors(Name: string): TIntegerarray;
var
I, C: Integer;
begin
SetLength(Result, 0);
if Length(srl_refColors) = 0 then
begin
SetupNewAutoColor;
srl_Warn('SetAutoColorReference', 'do not forget to call SetupNewAutoColor once.', warn_Warning);
end;
if not NAC_RefSet then
begin
srl_Warn('srl_AutoGetColor', 'No reference has been set yet.', warn_AllVersions);
Exit;
end;
I := NAC_NTI(Name);
if I > -1 then
begin
if Length(srl_refColors[I].eColors) = 0 then
Exit;
SetLength(Result, Length(srl_refColors[I].eColors) + 1);
Result[0] := NAC_Colors[I];
for C := Low(srl_refColors[I].eColors) to High(srl_refColors[I].eColors) do
begin
if srl_refColors[I].Color > srl_refColors[I].eColors[C] then
Result[C + 1] := Result[0] - iAbs(srl_refColors[I].Color - srl_refColors[I].eColors[C])
else
Result[C + 1] := Result[0] + iAbs(srl_refColors[I].Color - srl_refColors[I].eColors[C]);
{$IFDEF DEBUGNAC}WriteLn('Colors['+InttoStr(C + 1) + ']: ' + InttoStr(Result[C + 1]));{$ENDIF}
end;
end;
end; and this one should be called srl_AutoGetColors
{*******************************************************************************
function srl_AutoGetColors(Name: string): TIntegerarray;
By: Shuttleu
Description:
*******************************************************************************}
function srl_AutoGetColors(Names: TStringArray): TIntegerArray;
var
i: Integer;
begin
for i:=0 to High(Names) do
begin
SetLength(Result, Length(Result)+1);
Result[i]:= srl_AutoGetColor(Names[i]);
end;
end;thoughts?
~shut