Ignore:
Timestamp:
Nov 28, 2023, 3:16:24 PM (12 months ago)
Author:
chronos
Message:
  • Modified: Do not initialize all local player windows at the start of the game but later when they are really opened. This also fixes window initialization under Qt5 widgetset.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/CityScreen.pas

    r456 r460  
    66uses
    77  {$IFDEF UNIX}LMessages,{$ENDIF}
    8   Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin,
    9   LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
    10   ButtonA, ButtonC, Area, GraphType, Texture;
     8  Protocol, ClientTools, ScreenTools, IsoEngine, BaseWin, LCLIntf, LCLType,
     9  Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, ButtonA,
     10  ButtonC, Area, GraphType, Texture;
    1111
    1212const
     
    4949    procedure PrevCityBtnClick(Sender: TObject);
    5050    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    51     // procedure AdviceBtnClick(Sender: TObject);
    5251    procedure PageUpBtnClick(Sender: TObject);
    5352    procedure PageDownBtnClick(Sender: TObject);
     
    101100  end;
    102101
    103 var
    104   CityDlg: TCityDlg;
    105 
    106102
    107103implementation
    108104
    109105uses
    110   Select, Messg, MessgEx, Help, Tribes, Directories, Math, Sound;
     106  Select, Messg, MessgEx, Help, Tribes, Directories, Math, Sound, Term;
    111107
    112108{$R *.lfm}
     
    205201  AreaMap.SetPaintBounds(xmArea - 192, ymArea - 96 - 32, xmArea + 192,
    206202    ymArea + 96);
    207   SmallMapMode := smImprovements;
    208   ZoomArea := 1;
     203  Reset;
    209204  ProdHint := False;
    210205  RestoreUnFocus := -1;
     
    11711166      (X < xView + 73) and (Y < yView + 50) then
    11721167      if cGov = gAnarchy then
    1173         with MessgExDlg do
     1168        with MainScreen.MessgExDlg do
    11741169        begin
    11751170          { MessgText:=Phrases.Lookup('OUTOFCONTROL');
     
    12041199        if iix >= 0 then
    12051200          if ssShift in Shift then
    1206             HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, iix)
     1201            MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, iix)
    12071202          else if (ClientMode < scContact) then
    1208             with MessgExDlg do
     1203            with MainScreen.MessgExDlg do
    12091204            begin
    12101205              IconKind := mikImp;
     
    13431338          if C.Status and csResourceWeightsMask <> 0 then
    13441339          begin
    1345             with MessgExDlg do
     1340            with MainScreen.MessgExDlg do
    13461341            begin
    13471342              MessgText := Phrases.Lookup('CITYMANAGEOFF');
     
    13511346              ShowModal;
    13521347            end;
    1353             if MessgExDlg.ModalResult = mrOK then
     1348            if MainScreen.MessgExDlg.ModalResult = mrOK then
    13541349            begin
    13551350              MyCity[cix].Status := MyCity[cix].Status and
     
    14501445begin
    14511446  Assert(not Supervising);
    1452   ModalSelectDlg.ShowNewContent_CityProject(wmModal, cix);
    1453   if ModalSelectDlg.Result <> -1 then
    1454   begin
    1455     if ModalSelectDlg.Result and cpType <> 0 then
     1447  MainScreen.ModalSelectDlg.ShowNewContent_CityProject(wmModal, cix);
     1448  if MainScreen.ModalSelectDlg.Result <> -1 then
     1449  begin
     1450    if MainScreen.ModalSelectDlg.Result and cpType <> 0 then
    14561451    begin
    14571452      MyCity[cix].Status := MyCity[cix].Status and not 7 or
    1458         (1 + ModalSelectDlg.Result and cpIndex);
    1459       AutoBuild(cix, MyData.ImpOrder[ModalSelectDlg.Result and cpIndex]);
     1453        (1 + MainScreen.ModalSelectDlg.Result and cpIndex);
     1454      AutoBuild(cix, MyData.ImpOrder[MainScreen.ModalSelectDlg.Result and cpIndex]);
    14601455    end
    14611456    else
    14621457    begin
    1463       NewProject := ModalSelectDlg.Result;
     1458      NewProject := MainScreen.ModalSelectDlg.Result;
    14641459      QueryOk := True;
    14651460      if (NewProject and cpImp <> 0) and (NewProject and cpIndex >= 28) and
    14661461        (MyRO.NatBuilt[NewProject and cpIndex] > 0) then
    1467         with MessgExDlg do
     1462        with MainScreen.MessgExDlg do
    14681463        begin
    14691464          cix1 := MyRO.nCity - 1;
     
    15421537  if (cix < 0) or (ClientMode >= scContact) then
    15431538    Exit;
    1544   with MyCity[cix], MessgExDlg do
     1539  with MyCity[cix], MainScreen.MessgExDlg do
    15451540  begin
    15461541    Cost := Report.ProjectCost;
     
    17431738end;
    17441739
    1745 { procedure TCityDlg.AdviceBtnClick(Sender: TObject);
    1746   begin
    1747   AdvisorDlg.GiveCityAdvice(cix);
    1748   end; }
    1749 
    17501740procedure TCityDlg.PageUpBtnClick(Sender: TObject);
    17511741begin
Note: See TracChangeset for help on using the changeset viewer.