hedgewars/uLocale.pas
changeset 108 08f1fe6f21f8
parent 83 207c85fbef51
child 175 d226d976d836
equal deleted inserted replaced
107:b08ce0293a51 108:08f1fe6f21f8
    35 interface
    35 interface
    36 type TAmmoStrId = (sidGrenade, sidClusterBomb, sidBazooka, sidUFO, sidShotgun,
    36 type TAmmoStrId = (sidGrenade, sidClusterBomb, sidBazooka, sidUFO, sidShotgun,
    37                    sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle,
    37                    sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle,
    38                    sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds);
    38                    sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds);
    39      TMsgStrId = (sidStartFight, sidDraw, sidWinner);
    39      TMsgStrId = (sidStartFight, sidDraw, sidWinner);
    40 var trammo: array[TAmmoStrId] of shortstring;
    40 var trammo: array[TAmmoStrId] of string;
    41     trmsg: array[TMsgStrId] of shortstring;
    41     trmsg: array[TMsgStrId] of string;
    42 
    42 
    43 procedure LoadLocale(FileName: string);
    43 procedure LoadLocale(FileName: string);
    44 function Format(fmt: shortstring; var arg: shortstring): shortstring;
    44 function Format(fmt: shortstring; var arg: shortstring): shortstring;
    45 
    45 
    46 implementation
    46 implementation
    50 var s: shortstring;
    50 var s: shortstring;
    51     f: textfile;
    51     f: textfile;
    52     a, b, c: integer;
    52     a, b, c: integer;
    53 begin
    53 begin
    54 {$I-}
    54 {$I-}
    55 assignfile(f, FileName);
    55 AssignFile(f, FileName);
    56 reset(f);
    56 reset(f);
    57 TryDo(IOResult = 0, 'Cannot load locale "' + FileName + '"', true);
    57 TryDo(IOResult = 0, 'Cannot load locale "' + FileName + '"', true);
    58 while not eof(f) do
    58 while not eof(f) do
    59       begin
    59       begin
    60       readln(f, s);
    60       readln(f, s);