Ignore:
Timestamp:
Apr 12, 2024, 8:58:58 PM (7 months ago)
Author:
chronos
Message:
  • Fixed: Eliminated unwanted second map resize and redraw during displaying of the main game window.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r531 r533  
    245245    procedure FormResize(Sender: TObject);
    246246    procedure PanelBtnClick(Sender: TObject);
    247     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    248247    procedure Toggle(Sender: TObject);
    249248    procedure PanelBoxMouseMove(Sender: TObject; Shift: TShiftState;
     
    260259      Shift: TShiftState; X, Y: Integer);
    261260    procedure FormPaint(Sender: TObject);
     261    procedure FormClose(Sender: TObject; var Action: TCloseAction);
     262    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     263    procedure FormShow(Sender: TObject);
    262264    procedure mRepClicked(Sender: TObject);
    263265    procedure mLogClick(Sender: TObject);
    264     procedure FormClose(Sender: TObject; var Action: TCloseAction);
    265     procedure FormShow(Sender: TObject);
    266266    procedure Radio(Sender: TObject);
    267267    procedure mManipClick(Sender: TObject);
     
    329329    NoMap: TIsoMap;
    330330    NoMapPanel: TIsoMap;
     331    LastResizeWidth: Integer;
     332    LastResizeHeight: Integer;
     333    LastWindowState: TWindowState;
    331334    // Forms
    332335    FWondersDlg: TWondersDlg;
     
    28152818          Brush.Style := TBrushStyle.bsClear;
    28162819        end;
    2817         FormResize(nil); // place mini map correctly according to its size
    28182820        Show;
    28192821        Update;
     
    41974199  MiniFrame, MaxMapWidth: Integer;
    41984200begin
     4201  if (LastResizeWidth = Width) and (LastResizeHeight = Height) and
     4202    (LastWindowState = WindowState) then Exit
     4203  else begin
     4204    LastResizeWidth := Width;
     4205    LastResizeHeight := Height;
     4206    LastWindowState := WindowState;
     4207  end;
     4208
    41994209  SmallScreen := Width < 1024;
    42004210  with MainMap do begin
     
    70917101    if not Active and (CurrentWindowState = TWindowState.wsFullScreen) then begin
    70927102      if PrevWindowState = TWindowState.wsMaximized then begin
    7093         CurrentWindowState := TWindowState.wsMaximized;
     7103        CurrentWindowState := TWindowState.wsNormal;
    70947104        WindowState := CurrentWindowState;
    70957105      end else begin
    7096         CurrentWindowState := TWindowState.wsNormal;
     7106        CurrentWindowState := PrevWindowState;
    70977107        WindowState := CurrentWindowState;
    70987108        WindowState := TWindowState.wsFullScreen;
     
    81068116procedure TMainScreen.FormShow(Sender: TObject);
    81078117begin
     8118  if FullScreen then BoundsRect := Bounds(0, 0, Screen.Width, Screen.Height)
     8119    else BoundsRect := TermBounds;
    81088120  SetFullScreen(FullScreen);
     8121  FormResize(nil); // place mini map correctly according to its size
    81098122  Timer1.Enabled := True;
    81108123end;
     
    81128125procedure TMainScreen.FormClose(Sender: TObject; var Action: TCloseAction);
    81138126begin
     8127  TermBounds := BoundsRect;
    81148128  Timer1.Enabled := False;
    81158129end;
Note: See TracChangeset for help on using the changeset viewer.