Changeset 284 for trunk/Forms


Ignore:
Timestamp:
Mar 10, 2019, 6:19:51 PM (6 years ago)
Author:
chronos
Message:
  • Modified: TNation and TNations classes now uses generic TItem and TItemList classes.
  • Added: Translation files for LCL.
Location:
trunk/Forms
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormGameSystem.pas

    r283 r284  
    138138  FormUnitKinds.UpdateList;
    139139  FormUnitKinds.UpdateInterface;
     140  Caption := ExtractFileName(Self.GameSystem.FileName) + ' - ' + SGameSystem;
    140141end;
    141142
  • trunk/Forms/UFormNation.pas

    r283 r284  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Spin, ColorBox, UNation;
     9  ColorBox, UNation;
    1010
    1111type
     
    3030  FormNation: TFormNation;
    3131
     32
    3233implementation
    3334
     
    4041  EditName.Text := Nation.Name;
    4142  ColorBoxColor.Selected := Nation.Color;
     43  Caption := Nation.Name + ' - ' + SNation;
    4244end;
    4345
  • trunk/Forms/UFormNations.lfm

    r283 r284  
    9595      Caption = 'Clone'
    9696      ImageIndex = 17
     97      OnExecute = ACloneExecute
    9798    end
    9899    object ASelectAll: TAction
  • trunk/Forms/UFormNations.pas

    r283 r284  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ActnList, Menus, UGameSystem, UNation;
     9  ActnList, Menus, UNation;
    1010
    1111type
     
    3333    ToolButton4: TToolButton;
    3434    procedure AAddExecute(Sender: TObject);
     35    procedure ACloneExecute(Sender: TObject);
    3536    procedure AModifyExecute(Sender: TObject);
    3637    procedure ARemoveExecute(Sender: TObject);
     
    137138end;
    138139
     140procedure TFormNations.ACloneExecute(Sender: TObject);
     141var
     142  TempEntry: TNation;
     143begin
     144  if Assigned(ListView1.Selected) then
     145  with TNation(ListView1.Selected.Data) do begin
     146    TempEntry := TNation.Create;
     147    TempEntry.Assign(TNation(ListView1.Selected.Data));
     148    FormNation := TFormNation.Create(Self);
     149    try
     150      TempEntry.Name := Nations.GetNextAvailableName(TempEntry.Name);
     151      FormNation.Load(TempEntry);
     152      if FormNation.ShowModal = mrOk then begin
     153        FormNation.Save(TempEntry);
     154        Nations.Add(TempEntry);
     155        TempEntry := nil;
     156        UpdateList;
     157        UpdateInterface;
     158      end;
     159    finally
     160      FreeAndNil(FormNation);
     161    end;
     162    TempEntry.Free;
     163  end;
     164end;
     165
    139166procedure TFormNations.ASelectAllExecute(Sender: TObject);
    140167var
  • trunk/Forms/UFormPlayers.pas

    r282 r284  
    6969
    7070uses
    71   UCore, UFormPlayer, UGame;
     71  UCore, UFormPlayer, UGame, UNation;
    7272
    7373resourcestring
     
    131131    TempEntry.Id := Players.GetNewId;
    132132    TempEntry.Name := SPlayer + ' ' + IntToStr(TempEntry.Id);
    133     TempEntry.Nation := Core.Game.GameSystem.Nations.First;
     133    TempEntry.Nation := TNation(Core.Game.GameSystem.Nations.First);
    134134    TempEntry.Color := TempEntry.Nation.Color;
    135135    TempEntry.Mode := pmComputer;
    136136    TempEntry.Agressivity := caMedium;
     137    TempEntry.Game := Players.Game;
    137138    FormPlayer.LoadData(TempEntry);
    138139    if FormPlayer.ShowModal = mrOk then begin
  • trunk/Forms/UFormUnitKinds.pas

    r277 r284  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ActnList, Menus, UGameSystem, UUnit;
     9  ActnList, Menus, UUnit;
    1010
    1111type
Note: See TracChangeset for help on using the changeset viewer.