Changeset 327


Ignore:
Timestamp:
Jul 16, 2024, 10:58:45 PM (5 months ago)
Author:
chronos
Message:
  • Fixed: Keep full screen info on single place.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Core.pas

    r319 r327  
    7171    GameLoaded: Boolean;
    7272    FormNewTabIndex: Integer;
    73     FullScreen: Boolean;
    7473    GameFilesDir: string;
    7574    procedure LoadRecentExecute(Sender: TObject);
     
    8786    procedure FormClientActions;
    8887    procedure LoadGameSystems;
    89     procedure ToggleFullscreen;
    9088  public
    9189    Game: TGame;
     
    294292procedure TCore.UpdateInterface;
    295293begin
    296   Core.AGameEnd.Enabled := Core.Game.Running;
     294  Core.AGameEnd.Enabled := Game.Running;
     295  Core.AFullscreen.Checked := FormMain.FullScreen;
    297296end;
    298297
     
    306305procedure TCore.AFullscreenExecute(Sender: TObject);
    307306begin
    308   ToggleFullscreen;
     307  FormMain.ToggleFullscreen;
     308  UpdateInterface;
    309309end;
    310310
     
    657657end;
    658658
    659 procedure TCore.ToggleFullscreen;
    660 begin
    661   FullScreen := not FullScreen;
    662   PersistentForm1.Form := FormMain;
    663   PersistentForm1.SetFullScreen(FullScreen);
    664   UpdateInterface;
    665 end;
    666 
    667659procedure TCore.ReopenGameOnInit;
    668660begin
  • trunk/Forms/FormMain.pas

    r319 r327  
    9090    FormActivated: Boolean;
    9191    FormShown: Boolean;
    92     FullScreen: Boolean;
    9392    procedure ApplicationStart(Ptr: IntPtr);
    9493    procedure UpdateClientForms;
     
    9998    FormUnitMoves: TFormUnitMoves;
    10099    FormCharts: TFormCharts;
     100    FullScreen: Boolean;
    101101    procedure LoadConfig(Config: TXmlConfig; Path: string);
    102102    procedure SaveConfig(Config: TXmlConfig; Path: string);
    103103    procedure ReloadView;
     104    procedure ToggleFullscreen;
    104105  end;
    105106
     
    167168  end;
    168169  ToolBar1.Visible := AToolBarVisible.Checked;
     170end;
     171
     172procedure TFormMain.ToggleFullscreen;
     173begin
     174  FullScreen := not FullScreen;
     175  TFormEx.PersistentForm.Form := Self;
     176  TFormEx.PersistentForm.SetFullScreen(FullScreen);
    169177end;
    170178
     
    287295    AUnitShapeVisible.Checked := Core.Core.UnitShapeVisible;
    288296    Core.Core.ScaleDPI;
     297    Core.Core.PersistentForm1.Load(Self);
    289298    FullScreen := Core.Core.PersistentForm1.FormFullScreen;
    290299    Core.Core.Init;
Note: See TracChangeset for help on using the changeset viewer.