Ignore:
Timestamp:
Feb 5, 2019, 11:17:27 PM (6 years ago)
Author:
chronos
Message:
  • Added: Forms for list of unit kinds and unit kind.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormGameSystem.pas

    r276 r277  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, UGameSystem;
     9  ComCtrls, UGameSystem, UFormUnitKinds;
    1010
    1111type
     
    3030    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3131    procedure FormCreate(Sender: TObject);
     32    procedure FormDestroy(Sender: TObject);
    3233    procedure FormShow(Sender: TObject);
    3334  private
    3435    FGameSystem: TGameSystem;
     36    FormUnitKinds: TFormUnitKinds;
    3537    procedure SetGameSystem(AValue: TGameSystem);
    36 
    3738  public
    3839    property GameSystem: TGameSystem read FGameSystem write SetGameSystem;
     
    8990  Core.ThemeManager1.UseTheme(Self);
    9091  Core.CoolTranslator1.TranslateComponentRecursive(Self);
     92  FormUnitKinds := TFormUnitKinds.Create(nil);
     93  FormUnitKinds.ManualDock(TabSheetUnits, nil, alClient);
     94  FormUnitKinds.Align := alClient;
     95  FormUnitKinds.Visible := True;
     96end;
     97
     98procedure TFormGameSystem.FormDestroy(Sender: TObject);
     99begin
     100  FormUnitKinds.Free;
    91101end;
    92102
     
    99109begin
    100110  if FGameSystem = AValue then Exit;
     111  if Assigned(FGameSystem) then FormUnitKinds.UnitKinds := nil;
    101112  FGameSystem := AValue;
     113  if Assigned(FGameSystem) then FormUnitKinds.UnitKinds := GameSystem.UnitKinds;
    102114end;
    103115
Note: See TracChangeset for help on using the changeset viewer.