Janilabo

Untitled

Mar 30th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.47 KB | None | 0 0
  1. function RS07_GetBankPinButtonDigits: TIntArray;
  2. {==============================================================================]  
  3.   Created: February 25th, 2013.
  4.   Updated: March 30th, 2013.
  5.   Contributors: Janilabo
  6.   Explanation: Returns the bank pin screens button digits as TIntArray.          
  7. [==============================================================================}
  8. var
  9.   t: TIntArray;
  10.   x, y, i, l, r: Integer;
  11. begin
  12.   if (RS07_BankPinScreenOpen and (not RS07_ChooseOptionFailsafe or RS07_PreventChooseOptionCollisions(RS07_BankPinDigitButtons))) then
  13.   begin
  14.     t := [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
  15.     l := Length(t);
  16.     SetLength(Result, l);
  17.     FillTIA(Result, -1);
  18.     for r := 0 to 9 do  
  19.       for i := 0 to (l - 1) do
  20.         if FindBitmap(x, y, RS07_BankPinDigitButtonNumbers[t[i]], RS07_BankPinDigitButtons[r].X1, RS07_BankPinDigitButtons[r].Y1, RS07_BankPinDigitButtons[r].X2, RS07_BankPinDigitButtons[r].Y2) then
  21.         begin
  22.           Result[r] := StrToIntDef(GetTextAtEx(x, y, 0, RS07_MainFont, False, False, 0, 0, 32767, 1, True, tr_AllChars), -1);
  23.           if (Result[r] > -1) then
  24.           begin
  25.             TIARemove(t, Result[r]);
  26.             l := Length(t);
  27.           end;
  28.         end;
  29.     l := Length(t);
  30.     if (l > 0) then
  31.     begin
  32.       case (l = 1) of              
  33.         True: TIAReplace(Result, -1, t[0]);
  34.         False: SetLength(Result, 0);
  35.       end;    
  36.       SetLength(t, 0);
  37.     end;
  38.   end;
  39. end;
Advertisement
Add Comment
Please, Sign In to add comment