Changeset 283 for trunk/Forms


Ignore:
Timestamp:
Mar 10, 2019, 5:33:06 PM (6 years ago)
Author:
chronos
Message:
  • Added: Allow to manage nations for each game system.
Location:
trunk/Forms
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormGameSystem.lfm

    r277 r283  
    5858    Top = 16
    5959    Width = 744
    60     ActivePage = TabSheetUnits
     60    ActivePage = TabSheetNations
    6161    Anchors = [akTop, akLeft, akRight, akBottom]
    62     TabIndex = 1
     62    TabIndex = 2
    6363    TabOrder = 4
    6464    object TabSheetGeneral: TTabSheet
     
    9494      Caption = 'Units'
    9595    end
     96    object TabSheetNations: TTabSheet
     97      Caption = 'Nations'
     98    end
    9699  end
    97100  object OpenDialog1: TOpenDialog
  • trunk/Forms/UFormGameSystem.pas

    r278 r283  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, UGameSystem, UFormUnitKinds;
     9  ComCtrls, UGameSystem, UFormUnitKinds, UFormNations;
    1010
    1111type
     
    2424    PageControl1: TPageControl;
    2525    SaveDialog1: TSaveDialog;
     26    TabSheetNations: TTabSheet;
    2627    TabSheetGeneral: TTabSheet;
    2728    TabSheetUnits: TTabSheet;
     
    3536    FGameSystem: TGameSystem;
    3637    FormUnitKinds: TFormUnitKinds;
     38    FormNations: TFormNations;
    3739    procedure SetGameSystem(AValue: TGameSystem);
    3840  public
     
    9496  FormUnitKinds.Align := alClient;
    9597  FormUnitKinds.Visible := True;
     98  FormNations := TFormNations.Create(nil);
     99  FormNations.ManualDock(TabSheetNations, nil, alClient);
     100  FormNations.Align := alClient;
     101  FormNations.Visible := True;
    96102end;
    97103
     
    99105begin
    100106  GameSystem := nil;
     107  FreeAndNil(FormNations);
    101108  FreeAndNil(FormUnitKinds);
    102109end;
     
    110117begin
    111118  if FGameSystem = AValue then Exit;
    112   if Assigned(FGameSystem) then FormUnitKinds.UnitKinds := nil;
     119  if Assigned(FGameSystem) then begin
     120    FormUnitKinds.UnitKinds := nil;
     121    FormNations.Nations := nil;
     122  end;
    113123  FGameSystem := AValue;
    114   if Assigned(FGameSystem) then FormUnitKinds.UnitKinds := GameSystem.UnitKinds;
     124  if Assigned(FGameSystem) then begin
     125    FormUnitKinds.UnitKinds := GameSystem.UnitKinds;
     126    FormNations.Nations := GameSystem.Nations;
     127  end;
    115128end;
    116129
     
    121134  CheckBoxUnitsSplitMerge.Checked := GameSystem.UnitsSplitMerge;
    122135  CheckBoxUnitsMoveImmediately.Checked := GameSystem.UnitsMoveImmediately;
     136  FormNations.UpdateList;
     137  FormNations.UpdateInterface;
     138  FormUnitKinds.UpdateList;
     139  FormUnitKinds.UpdateInterface;
    123140end;
    124141
Note: See TracChangeset for help on using the changeset viewer.