SRL Archive - Discussions and Debates

InvBox broken?


Runescapian321

2009-07-11 23:31:15

EDIT: N1ke fixed it - http://www.villavu.com/forum/showthread.php?p=599955#post599955

R_DropAllExcept was misclicking for me, and that seemed to be InvBox's fault. I looked at the code:

{*******************************************************************************
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 := 518 + (row * 42); // First X coord - 42 - 5 for proper Tbox
Result.y1 := 172 + (col * 36); // First Y coord - 36 - 5 for proper Tbox
Result.x2 := 560 + (row * 42);
Result.y2 := 210 + (col * 36);
end;

And from that I guess that before the update there were no empty spaces between items? Well now there are 4 pixels between rows of items, and 10 pixels between columns of items.

EDIT: Or perhaps the inventory was just shifted up slightly, not sure yet.

Not that tough of a fix, but I found it kind of weird that no one has noticed yet, seeing as all MouseItem-like functions should be broken, and just so everyone would be aware :)

Naike

2009-07-11 23:59:55

I've mention this a very long time ago…
No one listened, hope they do it now.

Runescapian321

2009-07-12 00:02:09

Oh, I searched (Briefly) and couldn't find anything :p

I'm currently trying to fix it myself, but without much success thus far -.-

Naike

2009-07-12 00:11:59


{*******************************************************************************
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;

Will post in puplic svn, so it gets around.

Edit: http://www.villavu.com/forum/showthread.php?p=599940#post599940