Changeset 580 for trunk/LocalPlayer/Term.pas
- Timestamp:
- May 23, 2024, 8:19:21 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Term.pas
r561 r580 324 324 HaveStrategyAdvice: Boolean; 325 325 FirstMovieTurn: Boolean; 326 PrevWindowState: TWindowState; 327 CurrentWindowState: TWindowState; 326 FormFullScreen: Boolean; 327 FormRestoredSize: TRect; 328 FormWindowState: TWindowState; 328 329 MainMap: TIsoMap; 329 330 NoMap: TIsoMap; … … 7023 7024 7024 7025 procedure TMainScreen.SetFullScreen(Active: Boolean); 7025 begin 7026 if Active and (CurrentWindowState <> TWindowState.wsFullScreen) then begin 7027 PrevWindowState := WindowState; 7028 CurrentWindowState := TWindowState.wsFullScreen; 7029 WindowState := CurrentWindowState; 7026 var 7027 Form: TForm; 7028 begin 7029 Form := Self; 7030 if Active then begin 7031 FormFullScreen := True; 7032 if Form.WindowState = TWindowState.wsMaximized then begin 7033 FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth, 7034 Form.RestoredHeight); 7035 end else 7036 if Form.WindowState = TWindowState.wsNormal then begin 7037 FormRestoredSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height); 7038 end; 7039 FormWindowState := Form.WindowState; 7040 Form.WindowState := TWindowState.wsMaximized; 7041 Form.WindowState := TWindowState.wsNormal; 7042 ShowWindow(Form.Handle, SW_SHOWFULLSCREEN); 7030 7043 {$IFDEF WINDOWS} 7031 BorderStyle := TBorderStyle.bsNone;7044 Form.BorderStyle := TBorderStyle.bsNone; 7032 7045 {$ENDIF} 7033 BorderIcons := []; 7034 end else 7035 if not Active and (CurrentWindowState = TWindowState.wsFullScreen) then begin 7036 if PrevWindowState = TWindowState.wsMaximized then begin 7037 CurrentWindowState := TWindowState.wsNormal; 7038 WindowState := CurrentWindowState; 7039 end else begin 7040 CurrentWindowState := PrevWindowState; 7041 WindowState := CurrentWindowState; 7042 WindowState := TWindowState.wsFullScreen; 7043 WindowState := CurrentWindowState; 7044 end; 7046 end else begin 7047 FormFullScreen := False; 7045 7048 {$IFDEF WINDOWS} 7046 BorderStyle := TBorderStyle.bsSizeable;7049 Form.BorderStyle := TBorderStyle.bsSizeable; 7047 7050 {$ENDIF} 7048 BorderIcons := [TBorderIcon.biSystemMenu, TBorderIcon.biMinimize, 7049 TBorderIcon.biMaximize]; 7050 if Left < 0 then Left := 0; 7051 if Top < 0 then Top := 0; 7051 ShowWindow(Form.Handle, SW_SHOWNORMAL); 7052 if FormWindowState = TWindowState.wsNormal then begin 7053 Form.WindowState := TWindowState.wsNormal; 7054 Form.BoundsRect := FormRestoredSize; 7055 end else 7056 if FormWindowState = TWindowState.wsMaximized then begin 7057 Form.BoundsRect := FormRestoredSize; 7058 Form.WindowState := TWindowState.wsMaximized; 7059 end; 7052 7060 end; 7053 7061 end; … … 8058 8066 if FullScreen then BoundsRect := Bounds(0, 0, Screen.Width, Screen.Height) 8059 8067 else BoundsRect := TermBounds; 8068 FormRestoredSize := TermBounds; 8060 8069 SetFullScreen(FullScreen); 8061 8070 FormResize(nil); // place mini map correctly according to its size … … 8065 8074 procedure TMainScreen.FormClose(Sender: TObject; var Action: TCloseAction); 8066 8075 begin 8067 TermBounds := BoundsRect; 8076 if FullScreen then TermBounds := FormRestoredSize 8077 else TermBounds := BoundsRect; 8068 8078 Timer1.Enabled := False; 8069 8079 end;
Note:
See TracChangeset
for help on using the changeset viewer.