Ignore:
Timestamp:
Nov 28, 2023, 3:16:24 PM (6 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/Select.pas

    r457 r460  
    55
    66uses
    7   Protocol, ClientTools, Term, ScreenTools, PVSB, BaseWin,
     7  Protocol, ClientTools, ScreenTools, PVSB, BaseWin,
    88  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    99  ExtCtrls, ButtonB, ButtonBase, Menus, Types;
     
    9292  adAll = $10000;
    9393
    94 var
    95   ListDlg: TListDlg;
    96   ModalSelectDlg: TModalSelectDlg;
    97 
    9894
    9995implementation
    10096
    10197uses
    102   CityScreen, Help, UnitStat, Tribes, Inp, CmdList;
     98  Term, CityScreen, Help, UnitStat, Tribes, Inp, CmdList;
    10399
    104100{$R *.lfm}
     
    871867    Server(CommandWithData(cSetCityName, CityNameInfo.GetCommandDataSize),
    872868      Me, 0, CityNameInfo);
    873     if CityDlg.Visible then
     869    if MainScreen.CityDlg.Visible then
    874870    begin
    875       CityDlg.FormShow(nil);
    876       CityDlg.Invalidate;
     871      MainScreen.CityDlg.FormShow(nil);
     872      MainScreen.CityDlg.Invalidate;
    877873    end;
    878874    Result := True;
     
    900896    Server(CommandWithData(cSetModelName, ModelNameInfo.GetCommandDataSize),
    901897      Me, 0, ModelNameInfo);
    902     if UnitStatDlg.Visible then
     898    if MainScreen.UnitStatDlg.Visible then
    903899    begin
    904       UnitStatDlg.FormShow(nil);
    905       UnitStatDlg.Invalidate;
     900      MainScreen.UnitStatDlg.FormShow(nil);
     901      MainScreen.UnitStatDlg.Invalidate;
    906902    end;
    907903    Result := True;
     
    941937        kModels, kChooseModel:
    942938          if lix <> mixAll then
    943             UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, lix);
     939            MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, lix);
    944940        kEModels:
    945           UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent,
     941          MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent,
    946942            Code[1, ScrollBar.Position + Selected]);
    947943        kAllEModels, kChooseEModel:
    948944          if lix <> mixAll then
    949             UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, lix);
     945            MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, lix);
    950946        kAdvance, kFarAdvance, kScience, kChooseTech, kChooseETech, kStealTech:
    951947          if lix = adMilitary then
    952             HelpDlg.ShowNewContent(wmPersistent, hkText,
    953               HelpDlg.TextIndex('MILRES'))
     948            MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkText,
     949              MainScreen.HelpDlg.TextIndex('MILRES'))
    954950          else if lix < adMilitary then
    955             HelpDlg.ShowNewContent(wmPersistent, hkAdv, lix);
     951            MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkAdv, lix);
    956952        kProject:
    957953          if lix = cpImp + imTrGoods then
    958             HelpDlg.ShowNewContent(wmPersistent, hkText,
    959               HelpDlg.TextIndex('TRADINGGOODS'))
     954            MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkText,
     955              MainScreen.HelpDlg.TextIndex('TRADINGGOODS'))
    960956          else if lix and (cpImp + cpType) = 0 then
    961             UnitStatDlg.ShowNewContent_OwnModel(wmPersistent,
     957            MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmPersistent,
    962958              lix and cpIndex)
    963959          else if (lix and cpType = 0) and (lix <> cpImp + imTrGoods) then
    964             HelpDlg.ShowNewContent(wmPersistent, hkImp,
     960            MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkImp,
    965961              lix and cpIndex);
    966962        kGov:
    967           HelpDlg.ShowNewContent(wmPersistent, hkMisc,
     963          MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkMisc,
    968964            Integer(miscGovList));
    969965        kShipPart, kEShipPart:
     
    18871883procedure TListDlg.RemoveUnit;
    18881884begin
    1889   if ListDlg.Visible and (Kind = kModels) then
     1885  if Visible and (Kind = kModels) then
    18901886    SmartUpdateContent;
    18911887end;
Note: See TracChangeset for help on using the changeset viewer.