BobboHobbo
2010-07-12 06:31:40
Well I found it sooo annoying trying to check the progressreport while the script keeps spitting out so much debug ;D. We should have a SMART paint canvas.
Like this:

I was thinking of making it like you press F12 or something and it switches between details of the canvas report on screen.
I stole the SMART canvas painting off naikes pest control script, So not sure if were even allowed to use it but.. heres the code i used to make it work..
And this in the progress report func:
I dunno if its the best way to do it, just it was the quickiest and easiest at the time.
Like this:

I was thinking of making it like you press F12 or something and it switches between details of the canvas report on screen.
I stole the SMART canvas painting off naikes pest control script, So not sure if were even allowed to use it but.. heres the code i used to make it work..
procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour, Shadow: integer);
var
mx, my, Pic, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
Canvas: TCanvas;
begin
SmartSetDebug(True);
GetClientDimensions(mx,my);
Pic := BitmapFromString(mx,my,'');
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], SmallChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1, Shadow);
FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
end;
end;
Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
FreeBitmap(Pic);
end;
And this in the progress report func:
with ProgressReportArray[CurrentPlayer] do
begin
for j := 0 to High(ScriptInfo) do //scriptInfo
with ScriptInfo[j] do
begin
for l := 0 to High(MSI_Players[i].Items[j][k]) do
begin
PrintOnSmart([' Basic Progress Report'],Point(22, 30), 62207, 131072);
PrintOnSmart([
'Time Running: ' + TimeRunning,
'Players active: ' + ToStr(PlayersActive) + '/' + ToStr(HowManyPlayers),
'Time: ' + MsToTime(scriptRuntime, Time_Short),
'Loads: ' + IntToStr(playerLoads),
'Amount: '+ GroupDigits(PlayerItemAmounts[k][l], ','),
'Exp: ' + GroupDigits(playerGainedExp, ','),
''], Point(30, 60), 1959605, 131072);
end;
end;
end;
I dunno if its the best way to do it, just it was the quickiest and easiest at the time.
Hmm what do you think?