Changeset 367 for trunk/Start.pas


Ignore:
Timestamp:
Apr 14, 2021, 9:12:03 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Enable in development network game only if NetworkEnabled registry value is activated.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Start.pas

    r364 r367  
    360360  I: Integer;
    361361  S: string;
     362  {$IFDEF WINDOWS}
    362363  ResolutionX, ResolutionY, ResolutionBPP, ResolutionFreq: Integer;
     364  {$ENDIF}
    363365  ScreenMode: Integer;
    364366begin
     
    398400    if ValueExists('LastGame') then LastGame := Reg.ReadString('LastGame')
    399401       else LastGame := '';
     402    if ValueExists('NetworkEnabled') then NetworkEnabled := Reg.ReadBool('NetworkEnabled')
     403       else NetworkEnabled := False;
    400404
    401405    if ValueExists('ScreenMode') then
     
    403407      else ScreenMode := 1;
    404408    FullScreen := ScreenMode > 0;
     409    if ValueExists('MultiControl') then
     410      MultiControl := ReadInteger('MultiControl')
     411      else MultiControl := 0;
     412    {$IFDEF WINDOWS}
    405413    if ValueExists('ResolutionX') then
    406414      ResolutionX := ReadInteger('ResolutionX');
     
    411419    if ValueExists('ResolutionFreq') then
    412420      ResolutionFreq := ReadInteger('ResolutionFreq');
    413     if ValueExists('MultiControl') then
    414       MultiControl := ReadInteger('MultiControl')
    415       else MultiControl := 0;
    416     {$IFDEF WINDOWS}
    417421    if ScreenMode = 2 then
    418422      ChangeResolution(ResolutionX, ResolutionY, ResolutionBPP,
     
    440444    WriteInteger('StartTab', Integer(ShowTab));
    441445    WriteString('LastGame', LastGame);
     446    WriteBool('NetworkEnabled', NetworkEnabled);
    442447  finally
    443448    Free;
     
    924929    FormerGames.Delete(I);
    925930    if ListIndex[tbNew] = I then
    926       ListIndex[tbNew] := 0
     931      ListIndex[tbNew] := 0;
    927932  end;
    928933end;
     
    11831188  EmptyMenu(PopupMenu1.Items);
    11841189  if PlayerPopupIndex < 0 then begin // select default AI
    1185     OfferBrain(BrainNetworkClient, FixedLines);
    1186     Inc(FixedLines);
     1190    if NetworkEnabled then begin
     1191      OfferBrain(BrainNetworkClient, FixedLines);
     1192      Inc(FixedLines);
     1193    end;
    11871194
    11881195    MenuItem := TMenuItem.Create(PopupMenu1);
     
    12131220      end;
    12141221    if PlayerPopupIndex > 0 then begin
    1215       OfferBrain(BrainNetworkServer, FixedLines);
    1216       Inc(FixedLines);
     1222      if NetworkEnabled then begin
     1223        OfferBrain(BrainNetworkServer, FixedLines);
     1224        Inc(FixedLines);
     1225      end;
    12171226
    12181227      MenuItem := TMenuItem.Create(PopupMenu1);
Note: See TracChangeset for help on using the changeset viewer.