Changeset 273 for trunk/Forms


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.
Location:
trunk/Forms
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.pas

    r269 r273  
    347347    FClient.OnNextPlayer := DoNextPlayer;
    348348    FClient.View.DestRect := TRect.CreateBounds(TPoint.Create(0, 0), TPoint.Create(PaintBox1.Width, PaintBox1.Height));
    349     FClient.ShowCellGrid := Core.ShowCellGrid;
     349    FClient.CellGridVisible := Core.CellGridVisible;
     350    FClient.UnitShapeVisible := Core.UnitShapeVisible;
    350351  end;
    351352  Redraw;
  • trunk/Forms/UFormMain.lfm

    r268 r273  
    149149        Action = AMapGridVisible
    150150      end
     151      object MenuItem34: TMenuItem
     152        Action = AUnitShapeVisible
     153      end
     154      object MenuItem35: TMenuItem
     155        Caption = '-'
     156      end
    151157      object MenuItem21: TMenuItem
    152158        Action = AToolBarVisible
     
    225231      OnExecute = AMapGridVisibleExecute
    226232    end
     233    object AUnitShapeVisible: TAction
     234      Caption = 'Unit shape visible'
     235      OnExecute = AUnitShapeVisibleExecute
     236    end
    227237  end
    228238  object PopupMenuToolbar: TPopupMenu
  • 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);
  • trunk/Forms/UFormNew.lfm

    r270 r273  
    2121    Top = 4
    2222    Width = 806
    23     ActivePage = TabSheetMap
     23    ActivePage = TabSheetRules
    2424    Align = alClient
    2525    BorderSpacing.Around = 4
    26     TabIndex = 2
     26    TabIndex = 3
    2727    TabOrder = 0
    2828    OnChange = PageControl1Change
     
    326326        object ComboBoxGridType: TComboBox
    327327          Left = 146
    328           Height = 38
     328          Height = 42
    329329          Top = 104
    330330          Width = 208
     
    343343        object ComboBoxMapShape: TComboBox
    344344          Left = 146
    345           Height = 38
     345          Height = 42
    346346          Top = 144
    347347          Width = 208
     
    546546      object Panel4: TPanel
    547547        Left = 0
    548         Height = 655
     548        Height = 652
    549549        Top = 0
    550         Width = 739
     550        Width = 796
    551551        Align = alClient
    552552        BevelOuter = bvNone
    553         ClientHeight = 655
    554         ClientWidth = 739
     553        ClientHeight = 652
     554        ClientWidth = 796
    555555        TabOrder = 0
    556556        object RadioGroupGrowCells: TRadioGroup
     
    587587        object ComboBoxWinObjective: TComboBox
    588588          Left = 224
    589           Height = 38
     589          Height = 42
    590590          Top = 244
    591591          Width = 328
     
    635635          Height = 78
    636636          Top = 290
    637           Width = 716
     637          Width = 773
    638638          ActivePage = TabSheetCaptureEntireMap
    639639          Anchors = [akTop, akLeft, akRight]
     
    647647          object TabSheetCaptureCells: TTabSheet
    648648            ClientHeight = 74
    649             ClientWidth = 712
     649            ClientWidth = 763
    650650            object Label14: TLabel
    651651              Left = 8
     
    669669          object TabSheetStayAliveTurns: TTabSheet
    670670            ClientHeight = 74
    671             ClientWidth = 712
     671            ClientWidth = 763
    672672            object Label13: TLabel
    673673              Left = 8
  • trunk/Forms/UFormNew.pas

    r271 r273  
    417417  Client.View.ZoomAll;
    418418  //Client.ControlPlayer := GamePreview.Players.First;
    419   Client.ShowCellGrid := True;
     419  Client.CellGridVisible := True;
    420420  Bitmap.Canvas.Brush.Color := MapBackgroundColor; //clBackground; //PaintBox1.GetColorResolvingParent;
    421421  Bitmap.Canvas.FillRect(0, 0, Bitmap.Width, Bitmap.Height);
Note: See TracChangeset for help on using the changeset viewer.