Naike
2009-07-12 00:13:11
InvBox was broken since long back, runscapian brought it up once again
so I made a new try to get this changed :)
Note: Only the cords have been changed.
so I made a new try to get this changed :)
Note: Only the cords have been changed.
{*******************************************************************************
Function InvBox(i :Integer): TBox;
By: WT-Fakawi/Wizzup?
Description: Returns TBox of surrounding Inventory SlotBox
1-2-3-4
5-6-7-8
etc.
*******************************************************************************}
Function InvBox(i :Integer): TBox;
var
row, col: Integer;
begin
if not InRange(I, 1, 28) then
begin
srl_Warn('InvBox', 'Incorrect index: ' + IntToStr(i), warn_AllVersions);
exit;
end;
row :=i mod 4; if row = 0 then row := 4;
col := i / 4 ; if i mod 4 <> 0 then Inc(col);
Result.x1 := 523 + (row * 42); // First X coord - 42 - 5 for proper Tbox
Result.y1 := 177 + (col * 36); // First Y coord - 36 - 5 for proper Tbox
Result.x2 := 547 + (row * 42);
Result.y2 := 205 + (col * 36);
end;
Using N1ke's InvBox:
