Changeset 132 for trunk/UCore.pas


Ignore:
Timestamp:
Jun 19, 2017, 10:06:50 AM (7 years ago)
Author:
chronos
Message:
  • Fixed: Some application states were not stored/restored correctly after application restart.
  • Fixed: Default maximized form state for PersistentForm.
  • Fixed: Do not scale up maximized forms according DPI settings.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r130 r132  
    224224      FormNew.Show;
    225225      FormNew.Hide;
    226       for I := 0 to Screen.FormCount - 1 do begin
     226      for I := 0 to Screen.FormCount - 1 do
     227      if (Screen.Forms[I].WindowState = wsNormal) or
     228        (Screen.Forms[I].WindowState = wsMinimized) then begin
    227229        StoreDimensions(Screen.Forms[I], StoredDimension);
    228230        ScaleDimensions(Screen.Forms[I], StoredDimension);
     
    436438procedure TCore.Init;
    437439begin
    438   {$IFDEF Linux}
    439   // If installed in Linux system then use installation directory for po files
    440   if Application.ExeName = '/usr/bin/xtactics' then
    441     CoolTranslator1.POFilesFolder := '/usr/share/xtactics/languages';
    442   {$ENDIF}
    443   FInitialized := True;
    444 
    445   LoadConfig;
    446   Game.LoadConfig(XMLConfig1, 'Game');
    447 
    448   // Update translated default player names
    449   TPlayer(Game.Players[0]).Name := SPlayer + ' 1';
    450   TPlayer(Game.Players[1]).Name := SPlayer + ' 2';
    451 
    452   CommandLineParams;
    453   ScaleDPI;
    454 
    455   if Game.FileName = '' then StartNewGame;
     440  if not Core.Initialized then begin
     441    {$IFDEF Linux}
     442    // If installed in Linux system then use installation directory for po files
     443    if Application.ExeName = '/usr/bin/xtactics' then
     444      CoolTranslator1.POFilesFolder := '/usr/share/xtactics/languages';
     445    {$ENDIF}
     446    FInitialized := True;
     447
     448    LoadConfig;
     449    Game.LoadConfig(XMLConfig1, 'Game');
     450
     451    // Update translated default player names
     452    TPlayer(Game.Players[0]).Name := SPlayer + ' 1';
     453    TPlayer(Game.Players[1]).Name := SPlayer + ' 2';
     454
     455    CommandLineParams;
     456    ScaleDPI;
     457
     458    if Game.FileName = '' then StartNewGame;
     459  end;
    456460end;
    457461
Note: See TracChangeset for help on using the changeset viewer.