SRL Archive - SRL Suggestions

Function CloseAllWindows;


Tickyy

2012-01-30 16:36:53

Function CloseAllScreens: boolean;
var
I: Integer;
begin
for I := 0 to 4 do
begin
case I of
0: Result := BankScreen;
1: Result := DepositScreen;
2: Result := ShopScreen;
3: Result := ToolBeltScreen;
4: Result := PinScreen;
end;

if Result then
CloseWindow;
end;
end;

Just a small function … Didn't test it with everything though, it should work i guess…

Made this because when i use Closewindow sometimes if there are some similar colors that closewindow uses… and it Keep'd moving the mouse.

Narcle

2012-01-30 16:40:52

Well it does cover the major ones.

Function CloseAllScreens: boolean;
var
I: Integer;
begin
for I := 0 to 4 do
begin
case I of
0: Result := BankScreen;
1: Result := DepositScreen;
2: Result := ShopScreen;
3: Result := ToolBeltScreen;
4: Result := PinScreen;
end;

if Result then
if CloseWindow then
begin
Result := true;
Exit;
end else
Result := false;
end;
end;

Lets you know that you DID close a window. Also need to check if CloseWindow confirms there is no window open as well if one wasn't closed.

Coh3n

2012-02-03 03:02:34

Kind of related, I think CloseWindow is broken for the new skill information windows. Also, if you call CloseWindow and a window isn't open, it'll move the mouse around the main screen (if the colors are found). I know this happens in Varrock West Bank.

E: Added for the next version.