Ignore:
Timestamp:
Aug 18, 2021, 4:02:44 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Use correct game data files directory on Linux.
  • Fixed: Copy Systems and Maps with with package.
  • Modified: Use fullscreen mode switching from Common package PersistentForm class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UCommon.pas

    r308 r310  
    4040{$ENDIF}
    4141
    42 function IntToBin(Data: Int64; Count: Byte): string;
     42function AddLeadingZeroes(const aNumber, Length : integer) : string;
    4343function BinToInt(BinStr: string): Int64;
    44 function TryHexToInt(Data: string; var Value: Integer): Boolean;
    45 function TryBinToInt(Data: string; var Value: Integer): Boolean;
    4644function BinToHexString(Source: AnsiString): string;
    4745//function DelTree(DirName : string): Boolean;
     
    4947function BCDToInt(Value: Byte): Byte;
    5048function CompareByteArray(Data1, Data2: TArrayOfByte): Boolean;
     49procedure CopyStringArray(Dest: TStringArray; Source: array of string);
     50function CombinePaths(Path1, Path2: string): string;
     51function ComputerName: string;
     52procedure DeleteFiles(APath, AFileSpec: string);
     53procedure ExecuteProgram(Executable: string; Parameters: array of string);
     54procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog);
     55procedure FreeThenNil(var Obj);
     56function GetDirCount(Dir: string): Integer;
    5157function GetUserName: string;
    52 function LoggedOnUserNameEx(Format: TUserNameFormat): string;
    53 function SplitString(var Text: string; Count: Word): string;
    5458function GetBitCount(Variable: QWord; MaxIndex: Integer): Integer;
    5559function GetBit(Variable: QWord; Index: Byte): Boolean;
     60function GetStringPart(var Text: string; Separator: string): string;
     61function GenerateNewName(OldName: string): string;
     62function GetFileFilterItemExt(Filter: string; Index: Integer): string;
     63function IntToBin(Data: Int64; Count: Byte): string;
     64function LastPos(const SubStr: String; const S: String): Integer;
     65function LoadFileToStr(const FileName: TFileName): AnsiString;
     66function LoggedOnUserNameEx(Format: TUserNameFormat): string;
     67function MergeArray(A, B: array of string): TArrayOfString;
     68function OccurenceOfChar(What: Char; Where: string): Integer;
     69procedure OpenWebPage(URL: string);
     70procedure OpenFileInShell(FileName: string);
     71function PosFromIndex(SubStr: string; Text: string;
     72  StartIndex: Integer): Integer;
     73function PosFromIndexReverse(SubStr: string; Text: string;
     74  StartIndex: Integer): Integer;
     75function RemoveQuotes(Text: string): string;
     76procedure SaveStringToFile(S, FileName: string);
    5677procedure SetBit(var Variable: Int64; Index: Byte; State: Boolean); overload;
    5778procedure SetBit(var Variable: QWord; Index: Byte; State: Boolean); overload;
    5879procedure SetBit(var Variable: Cardinal; Index: Byte; State: Boolean); overload;
    5980procedure SetBit(var Variable: Word; Index: Byte; State: Boolean); overload;
    60 function AddLeadingZeroes(const aNumber, Length : integer) : string;
    61 function LastPos(const SubStr: String; const S: String): Integer;
    62 function GenerateNewName(OldName: string): string;
    63 function GetFileFilterItemExt(Filter: string; Index: Integer): string;
    64 procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog);
    65 procedure DeleteFiles(APath, AFileSpec: string);
    66 procedure OpenWebPage(URL: string);
    67 procedure OpenFileInShell(FileName: string);
    68 procedure ExecuteProgram(Executable: string; Parameters: array of string);
    69 procedure FreeThenNil(var Obj);
    70 function RemoveQuotes(Text: string): string;
    71 function ComputerName: string;
    72 function OccurenceOfChar(What: Char; Where: string): Integer;
    73 function GetDirCount(Dir: string): Integer;
    74 function MergeArray(A, B: array of string): TArrayOfString;
    75 function LoadFileToStr(const FileName: TFileName): AnsiString;
    76 procedure SaveStringToFile(S, FileName: string);
    7781procedure SearchFiles(AList: TStrings; Dir: string;
    7882  FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil);
    79 function GetStringPart(var Text: string; Separator: string): string;
     83function SplitString(var Text: string; Count: Word): string;
    8084function StripTags(const S: string): string;
    81 function PosFromIndex(SubStr: string; Text: string;
    82   StartIndex: Integer): Integer;
    83 function PosFromIndexReverse(SubStr: string; Text: string;
    84   StartIndex: Integer): Integer;
    85 procedure CopyStringArray(Dest: TStringArray; Source: array of string);
     85function TryHexToInt(Data: string; var Value: Integer): Boolean;
     86function TryBinToInt(Data: string; var Value: Integer): Boolean;
    8687
    8788
     
    669670end;
    670671
     672function CombinePaths(Path1, Path2: string): string;
     673begin
     674  Result := Path1;
     675  if Result <> '' then Result := Result + DirectorySeparator + Path2
     676    else Result := Path2;
     677end;
     678
    671679
    672680initialization
Note: See TracChangeset for help on using the changeset viewer.