Ignore:
Timestamp:
Jan 30, 2019, 8:08:44 AM (6 years ago)
Author:
chronos
Message:
  • Added: Show units shape to see in which cell units are placed.
  • Fixed: Do not place units with zero power in zero power cells.
  • Fixed: Better checks of cell power if cell is without unit.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r268 r273  
    1818
    1919  TFormMain = class(TForm)
     20    AUnitShapeVisible: TAction;
    2021    AMapGridVisible: TAction;
    2122    AStatusBarVisible: TAction;
     
    4950    MenuItem32: TMenuItem;
    5051    MenuItem33: TMenuItem;
     52    MenuItem34: TMenuItem;
     53    MenuItem35: TMenuItem;
    5154    MenuItemDebug: TMenuItem;
    5255    MenuItem31: TMenuItem;
     
    7679    procedure AToolBarBigIconsExecute(Sender: TObject);
    7780    procedure AToolBarVisibleExecute(Sender: TObject);
     81    procedure AUnitShapeVisibleExecute(Sender: TObject);
    7882    procedure FormActivate(Sender: TObject);
    7983    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     
    201205end;
    202206
     207procedure TFormMain.AUnitShapeVisibleExecute(Sender: TObject);
     208begin
     209  AUnitShapeVisible.Checked := not AUnitShapeVisible.Checked;
     210  UpdateClientForms;
     211end;
     212
    203213procedure TFormMain.FormActivate(Sender: TObject);
    204214begin
     
    220230  Core.PersistentForm.Save(Self);
    221231  SaveConfig(Core.XMLConfig1, 'FormMain');
    222   Core.ShowCellGrid := AMapGridVisible.Checked;
     232  Core.CellGridVisible := AMapGridVisible.Checked;
     233  Core.UnitShapeVisible := AUnitShapeVisible.Checked;
    223234  Core.Done;
    224235end;
     
    244255  FormClient.AStatusBarVisible.Checked := AStatusBarVisible.Checked;
    245256  FormClient.AStatusBarVisible.Update;
    246   Core.ShowCellGrid := AMapGridVisible.Checked;
    247   if Assigned(FormClient.Client) then
    248     FormClient.Client.ShowCellGrid := Core.ShowCellGrid;
     257  Core.CellGridVisible := AMapGridVisible.Checked;
     258  Core.UnitShapeVisible := AUnitShapeVisible.Checked;
     259  if Assigned(FormClient.Client) then begin
     260    FormClient.Client.CellGridVisible := Core.CellGridVisible;
     261    FormClient.Client.UnitShapeVisible := Core.UnitShapeVisible;
     262  end;
    249263  FormClient.Redraw;
    250264  for I := 0 to Core.FormClients.Count - 1 do begin
     
    255269    Core.FormClients[I].AStatusBarVisible.Checked := AStatusBarVisible.Checked;
    256270    Core.FormClients[I].AStatusBarVisible.Update;
    257     if Assigned(Core.FormClients[I].Client) then
    258       Core.FormClients[I].Client.ShowCellGrid := Core.ShowCellGrid;
     271    if Assigned(Core.FormClients[I].Client) then begin
     272      Core.FormClients[I].Client.CellGridVisible := Core.CellGridVisible;
     273      Core.FormClients[I].Client.UnitShapeVisible := Core.UnitShapeVisible;
     274    end;
    259275    Core.FormClients[I].Redraw;
    260276  end;
     
    265281  if not FormShown then begin
    266282    Core.LoadConfig;
    267     AMapGridVisible.Checked := Core.ShowCellGrid;
     283    AMapGridVisible.Checked := Core.CellGridVisible;
     284    AUnitShapeVisible.Checked := Core.UnitShapeVisible;
    268285    Core.ScaleDPI;
    269286    Core.PersistentForm.Load(Self, True);
Note: See TracChangeset for help on using the changeset viewer.