Changeset 731


Ignore:
Timestamp:
Jan 17, 2026, 9:14:41 AM (6 hours ago)
Author:
chronos
Message:
  • Modified: Initialize Log dialog later from Term and NoTerm forms.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Integrated.lpr

    r725 r731  
    3838  Application.CreateForm(TStartDlg, StartDlg);
    3939  Application.CreateForm(TBackground, Background);
    40   Application.CreateForm(TLogDlg, LogDlg);
    4140  Application.Run;
    4241  ScreenTools.UnitDone;
  • trunk/LocalPlayer/Term.pas

    r716 r731  
    1313  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    1414  LCLIntf, LCLType, Menus, SysUtils, Classes, DrawDlg, Types, Math,
    15   DateUtils, Platform, ButtonB, ButtonC, EOTButton, Area, Help,
     15  DateUtils, Platform, ButtonB, ButtonC, EOTButton, Area, Help, Log,
    1616  GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType,
    1717  Diagram, CityScreen, Rates, Battle, NatStat, UnitStat, Draft, Select, MessgEx,
     
    357357    FMessgExDlg: TMessgExDlg;
    358358    FHelpDlg: THelpDlg;
     359    FLogDlg: TLogDlg;
    359360    procedure ProcessMessagesWithDisabledKeyboard;
    360361    procedure ResizeControls;
     
    363364    function ChooseUnusedTribe: Integer;
    364365    function DoJob(j0: Integer): Integer;
     366    function GetLogDlg: TLogDlg;
    365367    function GetBattleDlg: TBattleDlg;
    366368    function GetCityDlg: TCityDlg;
     
    470472    property MessgExDlg: TMessgExDlg read GetMessgExDlg;
    471473    property HelpDlg: THelpDlg read GetHelpDlg;
     474    property LogDlg: TLogDlg read GetLogDlg;
    472475  end;
    473476
     
    661664
    662665uses
    663   Directories, Log, Sound, Registry, Global, KeyBindings, CmdList, Music;
     666  Directories, Sound, Registry, Global, KeyBindings, CmdList, Music;
    664667
    665668{$R *.lfm}
     
    36423645  if Assigned(FMessgExDlg) then FreeAndNil(FMessgExDlg);
    36433646  if Assigned(FHelpDlg) then FreeAndNil(FHelpDlg);
     3647  if Assigned(FLogDlg) then FreeAndNil(FLogDlg);
    36443648
    36453649  MainFormKeyDown := nil;
     
    65666570  end;
    65676571  {$ENDIF}
     6572end;
     6573
     6574function TMainScreen.GetLogDlg: TLogDlg;
     6575begin
     6576  if not Assigned(FLogDlg) then FLogDlg := TLogDlg.Create(nil);
     6577  Result := FLogDlg;
    65686578end;
    65696579
  • trunk/Log.pas

    r531 r731  
    3333      Shift: TShiftState; X, Y: Integer);
    3434    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     35  private
     36    MaxLevel: Integer;
    3537  public
    3638    Host: TForm;
    3739    procedure Add(Level, Turn: Integer; Text: PChar);
    38   private
    39     MaxLevel: Integer;
    4040  end;
    41 
    42 var
    43   LogDlg: TLogDlg;
    4441
    4542
  • trunk/NoTerm.lfm

    r629 r731  
    1313  Font.Name = 'MS Sans Serif'
    1414  OnCreate = FormCreate
     15  OnDestroy = FormDestroy
    1516  OnKeyDown = FormKeyDown
    1617  OnPaint = FormPaint
  • trunk/NoTerm.pas

    r725 r731  
    66uses
    77  ScreenTools, Protocol, Messg, LCLIntf, LCLType, DateUtils, Platform,
    8   SysUtils, Classes, ButtonB, DrawDlg,
     8  SysUtils, Classes, ButtonB, DrawDlg, Log,
    99  {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.Common, System.UITypes{$ELSE}
    1010  Graphics, Controls, Forms{$ENDIF};
     
    1212type
    1313  TRunMode = (rmStop, rmStopped, rmRunning, rmQuit);
     14
     15  { TNoTermDlg }
    1416
    1517  TNoTermDlg = class(TDrawDlg)
     
    2022    procedure FormPaint(Sender: TObject);
    2123    procedure FormCreate(Sender: TObject);
     24    procedure FormDestroy(Sender: TObject);
    2225    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
     26  private
     27    function GetLogDlg: TLogDlg;
    2328  public
    2429    procedure Client(Command, Player: Integer; var Data);
     
    4348    TimeStat: array [0 .. nPl - 1] of Extended;
    4449    Mode: TRunMode;
     50    FLogDlg: TLogDlg;
    4551    procedure NewStat;
    4652    procedure EndPlaying;
    4753    procedure ShowActive(P: Integer; Active: Boolean);
    4854    procedure ShowYear;
     55    property LogDlg: TLogDlg read GetLogDlg;
    4956  end;
    5057
     
    5865
    5966uses
    60   GameServer, Log;
     67  GameServer;
    6168
    6269{$R *.lfm}
     
    95102  InitButtons;
    96103  LastShowYearTime := 0;
     104end;
     105
     106procedure TNoTermDlg.FormDestroy(Sender: TObject);
     107begin
     108  if Assigned(FLogDlg) then FreeAndNil(FLogDlg);
    97109end;
    98110
     
    397409end;
    398410
     411function TNoTermDlg.GetLogDlg: TLogDlg;
     412begin
     413  if not Assigned(FLogDlg) then FLogDlg := TLogDlg.Create(nil);
     414  Result := FLogDlg;
     415end;
     416
    399417initialization
    400418
Note: See TracChangeset for help on using the changeset viewer.