Ignore:
Timestamp:
Jun 10, 2018, 12:18:28 PM (6 years ago)
Author:
chronos
Message:
  • Added: Allow to toggle Fog of war in debug mode from Debug menu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGameProtocol.pas

    r215 r220  
    1010type
    1111  TCommand = (cmdTextMessage, cmdTurnStart, cmdTurnEnd, cmdGameStart, cmdGameEnd,
    12     cmdSurrender, cmdNextPlayer);
     12    cmdSurrender, cmdNextPlayer, cmdParametersChanged);
    1313  TCommandEvent = procedure (Command: TCommand; DataIn, DataOut: TStream);
    1414
     
    2424    FOnGameStart: TNotifyEvent;
    2525    FOnNextPlayer: TNotifyEvent;
     26    FOnParametersChanged: TNotifyEvent;
    2627    FOnTurnStart: TNotifyEvent;
    2728    procedure Receive(Sender: TCommPin; Stream: TListByte);
     
    3839    property OnTurnStart: TNotifyEvent read FOnTurnStart write FOnTurnStart;
    3940    property OnNextPlayer: TNotifyEvent read FOnNextPlayer write FOnNextPlayer;
     41    property OnParametersChanged: TNotifyEvent read FOnParametersChanged
     42      write FOnParametersChanged;
    4043  end;
    4144
     
    5861    procedure GameEnd;
    5962    procedure TurnStart;
     63    procedure ParametersChanged;
    6064    procedure NextPlayer;
    6165    property OnSendMessage: TSendMessageEvent read FOnSendMessage
     
    139143end;
    140144
     145procedure TGameProtocolServer.ParametersChanged;
     146begin
     147  SendCmd(cmdParametersChanged);
     148end;
     149
    141150procedure TGameProtocolServer.NextPlayer;
    142151begin
     
    167176    if Command = Integer(cmdNextPlayer) then begin
    168177      if Assigned(FOnNextPlayer) then FOnNextPlayer(Self);
     178    end else
     179    if Command = Integer(cmdParametersChanged) then begin
     180      if Assigned(FOnParametersChanged) then FOnParametersChanged(Self);
    169181    end;
    170182  finally
Note: See TracChangeset for help on using the changeset viewer.