Bad Boy JH
2010-12-03 09:26:36
This little thing gathers debugs all the Objects on the screen and shows their IDs on the SMART client. Not sure if this should go here or somewhere else, perhaps a special section for script development tools would be a good idea.
procedure DebugItemIDs(ObjType: Integer);
var
I, X, Y, height: integer;
Temp, tpa: tpointarray;
MyPos: TTile;
TheObject: TRSObject;
ScreenPoint: TPoint;
begin
MyPos := GetMyPos;
for X := MyPos.x - 10 to MyPos.x + 10 do
for Y := MyPos.y - 10 to MyPos.y + 10 do
if TileOnMS(Tile(X, Y), 0) then
begin
ScreenPoint := TileToMS(Tile(X, Y), 0);
TheObject := GetObjectAt(Tile(X, Y), ObjType);
if TheObject = NULL_RSObject then
Continue;
Temp := LoadTextTPA('. ' + IntToStr(TheObject.ID), UpChars, height);
for i:= 0 to High(temp) do
begin
Temp[i].x := Temp[i].x + ScreenPoint.x - Height;
Temp[i].y := Temp[i].y + ScreenPoint.y - Height;
end;
TPA := CombineTPA(TPA, Temp);
end;
SMART_DrawDots(TPA);
end;