hedgewars/uFLGameConfig.pas
branchqmlfrontend
changeset 11437 6e641b5453f9
parent 11434 23912c93935a
child 11438 1a6148b4de3b
equal deleted inserted replaced
11436:f7fa429e42ab 11437:6e641b5453f9
    24 procedure netSetFeatureSize(fsize: LongInt);
    24 procedure netSetFeatureSize(fsize: LongInt);
    25 procedure netSetMapGen(mapgen: LongInt);
    25 procedure netSetMapGen(mapgen: LongInt);
    26 procedure netSetMap(map: shortstring);
    26 procedure netSetMap(map: shortstring);
    27 procedure netSetMazeSize(mazesize: LongInt);
    27 procedure netSetMazeSize(mazesize: LongInt);
    28 procedure netSetTemplate(template: LongInt);
    28 procedure netSetTemplate(template: LongInt);
       
    29 procedure netSetAmmo(name: shortstring; definition: ansistring);
    29 procedure updatePreviewIfNeeded;
    30 procedure updatePreviewIfNeeded;
    30 
    31 
    31 procedure sendConfig(config: PGameConfig);
    32 procedure sendConfig(config: PGameConfig);
    32 
    33 
    33 implementation
    34 implementation
    68             sendSchemeConfig(scheme);
    69             sendSchemeConfig(scheme);
    69 
    70 
    70             i:= 0;
    71             i:= 0;
    71             while (i < 8) and (teams[i].hogsNumber > 0) do
    72             while (i < 8) and (teams[i].hogsNumber > 0) do
    72                 begin
    73                 begin
       
    74                     sendTeamConfig(teams[i]);
    73                     sendAmmoConfig(config^.ammo);
    75                     sendAmmoConfig(config^.ammo);
    74                     ipcToEngine('eammstore');
       
    75                     sendTeamConfig(teams[i]);
       
    76                     inc(i)
    76                     inc(i)
    77                 end;
    77                 end;
    78         end;
    78         end;
    79     end;
    79     end;
    80 
    80 
   255 
   255 
   256 
   256 
   257 procedure changeTeamColor(teamName: PChar; dir: LongInt); cdecl;
   257 procedure changeTeamColor(teamName: PChar; dir: LongInt); cdecl;
   258 var i, dc: Longword;
   258 var i, dc: Longword;
   259     tn: shortstring;
   259     tn: shortstring;
   260     msg: ansistring;
   260     msg:  ansistring;
   261 begin
   261 begin
   262     with currentConfig do
   262     with currentConfig do
   263     begin
   263     begin
   264         i:= 0;
   264         i:= 0;
   265         tn:= teamName;
   265         tn:= teamName;
   391 begin
   391 begin
   392     if previewNeedsUpdate then
   392     if previewNeedsUpdate then
   393         getPreview
   393         getPreview
   394 end;
   394 end;
   395 
   395 
       
   396 procedure netSetAmmo(name: shortstring; definition: ansistring);
       
   397 var ammo: TAmmo;
       
   398     i: LongInt;
       
   399 begin
       
   400     ammo.ammoName:= name;
       
   401     i:= length(definition) div 4;
       
   402     ammo.a:= copy(definition, 1, i);
       
   403     ammo.b:= copy(definition, i + 1, i);
       
   404     ammo.c:= copy(definition, i * 2 + 1, i);
       
   405     ammo.d:= copy(definition, i * 3 + 1, i);
       
   406 
       
   407     currentConfig.ammo:= ammo;
       
   408     sendUI(mtAmmo, @name[1], length(name))
       
   409 end;
       
   410 
   396 end.
   411 end.