Changeset 55 for trunk/UCore.pas


Ignore:
Timestamp:
Aug 18, 2014, 9:34:15 AM (10 years ago)
Author:
chronos
Message:
  • Fixed: More translation of TGroupBox and TComboBox items.
  • Fixed: Shape of hexagon was not regular due to rounding error in polygon generation and drawing. Cells are now generated internally as bigger to avoid rounding error.
  • Fixed: After game end do not allow to execute End turn and End game actions.
  • Added: Preparation for random voronoi map. So far hidden in developer mode as algorithm is missing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r43 r55  
    5151    Game: TGame;
    5252    UseSingleView: Boolean;
     53    DevelMode: Boolean;
    5354    LastMapFileName: string;
    5455    View: TView;
     56    procedure UpdateActions;
    5557    procedure Init;
    5658    property Initialized: Boolean read FInitialized;
     
    6668
    6769uses
    68   UFormMove, UFormMain, UFormNew, UFormSettings, UFormAbout;
     70  UFormMove, UFormMain, UFormNew, UFormSettings, UFormAbout, UFormPlayer;
    6971
    7072resourcestring
     
    98100end;
    99101
     102procedure TCore.UpdateActions;
     103begin
     104  Core.AGameEndTurn.Enabled := Core.Game.Running;
     105  Core.AGameEnd.Enabled := Core.Game.Running;
     106end;
     107
    100108procedure TCore.AExitExecute(Sender: TObject);
    101109begin
     
    113121  Game.Running := False;
    114122  FormMain.Redraw;
     123  UpdateActions;
    115124end;
    116125
     
    127136    Sleep(1);
    128137  end;
     138  UpdateActions;
    129139end;
    130140
     
    147157    Game.Running := True;
    148158    FormMain.AZoomAll.Execute;
     159    UpdateActions;
    149160  end;
    150161end;
     
    154165  Game.New;
    155166  Game.Running := True;
     167  FormMain.AZoomAll.Execute;
    156168  FormMain.Redraw;
     169  UpdateActions;
    157170end;
    158171
     
    178191begin
    179192  UGame.InitStrings;
     193  FormNew.Translate;
     194  FormPlayer.Translate;
    180195end;
    181196
     
    192207  XMLConfig1.SetValue('Language', CoolTranslator1.Language.Code);
    193208  XMLConfig1.SetValue('LastMapFileName', LastMapFileName);
     209  XMLConfig1.SetValue('DevelMode', DevelMode);
    194210  FreeAndNil(Game);
    195211end;
     
    201217  FInitialized := True;
    202218  LastMapFileName := XMLConfig1.GetValue('LastMapFileName', '');
     219  DevelMode := XMLConfig1.GetValue('DevelMode', false);
    203220  CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(XMLConfig1.GetValue('Language', ''));
    204221  for I := 0 to Game.Players.Count - 1 do
Note: See TracChangeset for help on using the changeset viewer.