Place in SRL\SRL\core\Globals.scar - Line 89:
SCAR Code:
const
//Bank screen edge points
BSX1 = 25;
BSX2 = 480;
BSY1 = 85;
BSY2 = 295;
//Bank screen centre point
BSCX = 252;
BSCY = 190;
//Bank screen tab edge points
BTX1 = 25;
BTX2 = 255;
BTY1 = 50;
BTY2 = 85;
Place in SRL\SRL\core\Bank.scar - Line 28:
SCAR Code:
// * function TabCoord(i: Integer): TBox; // * by Dan's The Man
{*******************************************************************************
function TabCoord(i: Integer): TBox;
By: Dan's The Man
Description: Returns a TBox in which bank tab I is situated.
*******************************************************************************}
function TabCoord(i: Integer): TBox;
var
bIX, bIY: Integer;
begin
bIX := 50 * (i - 1);
Result.X1 := BTX1 + bIX + 5;
Result.X2 := BTX1 + bIX + 10;
Result.Y1 := BTY1 + 10;
Result.Y2 := BTY2 - 10;
end;
Descriptions:
The added constants in Globals.scar are as follows:
Code:
BSX1 == Bank Screen Top Left Corner (X Axis)
BSX2 == Bank Screen Bottom Right Corner (X Axis)
BSY1 == Bank Screen Top Left Corner (Y Axis)
BSY2 == Bank Screen Bottom Right Corner (Y Axis)
BSCX == Bank Screen Centre Point (X Axis)
BSCY == Bank Screen Centre Point (Y Axis)
BTX1 == Bank Tab Area Top Left Corner (X Axis)
BTX2 == Bank Tab Area Bottom Right Corner (X Axis)
BTY1 == Bank Tab Area Top Left Corner (Y Axis)
BTY2 == Bank Tab Area Bottom Right Corner (Y Axis)
The added function, TabCoord (situated in Bank.scar), returns a box which surrounds the specified bank tab (by local identifier I: Integer). To click on the specified tab, you could do the following:
With MouseBox -
SCAR Code:
var
TB: TBox;
begin
TB := TabCoord(6);
MouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, 1);
end.
With Mouse -
SCAR Code:
var
TB: TBox;
begin
TB := TabCoord(6);
Mouse(TB.X1, TB.Y1, 4, 4, True);
end.
Both those examples above click on tab 6.
This function has been tested thoroughly and works well