Changeset 317 for trunk/Forms/FormNew.pas
- Timestamp:
- Jun 21, 2024, 12:44:53 PM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormNew.pas
r316 r317 1 unit UFormNew;1 unit FormNew; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 ComCtrls, Spin, ExtCtrls, ActnList, ExtDlgs, Menus, UGame, UGeometry, UPlayer,8 UGameServer, UServerList, UMap, UGameSystem, UFormList;7 ComCtrls, Spin, ExtCtrls, ActnList, ExtDlgs, Menus, Game, Geometry, Player, 8 GameServer, ServerList, Map, GameSystem, FormList, FormEx, FormChat; 9 9 10 10 type … … 12 12 { TFormNew } 13 13 14 TFormNew = class(TForm )14 TFormNew = class(TFormEx) 15 15 ActionList1: TActionList; 16 16 AServerAdd: TAction; … … 115 115 procedure ComboBoxWinObjectiveChange(Sender: TObject); 116 116 procedure EditImageFileChange(Sender: TObject); 117 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);118 117 procedure FormCreate(Sender: TObject); 119 118 procedure FormDestroy(Sender: TObject); … … 143 142 NewRandSeed: Cardinal; 144 143 FormPlayers: TFormList; 144 FormChat: TFormChat; 145 145 procedure LoadGame(Game: TGame); 146 146 procedure SaveGame(Game: TGame); … … 158 158 end; 159 159 160 var161 FormNew: TFormNew;162 163 160 164 161 implementation … … 167 164 168 165 uses 169 UFormChat, UCore, UFormServer, UClientGUI, UFormClient, 170 UFormGameSystems, UMapType; 166 Core, FormServer, ClientGUI, FormClient, FormGameSystems, MapType; 171 167 172 168 resourcestring … … 350 346 ComboBoxGameSystem.Items.BeginUpdate; 351 347 try 352 while ComboBoxGameSystem.Items.Count > Core. GameSystems.Count do348 while ComboBoxGameSystem.Items.Count > Core.Core.GameSystems.Count do 353 349 ComboBoxGameSystem.Items.Delete(ComboBoxGameSystem.Items.Count - 1); 354 while ComboBoxGameSystem.Items.Count < Core. GameSystems.Count do350 while ComboBoxGameSystem.Items.Count < Core.Core.GameSystems.Count do 355 351 ComboBoxGameSystem.Items.Add(''); 356 for I := 0 to Core. GameSystems.Count - 1 do begin357 ComboBoxGameSystem.Items[I] := Core. GameSystems[I].GetName;358 ComboBoxGameSystem.Items.Objects[I] := Core. GameSystems[I];352 for I := 0 to Core.Core.GameSystems.Count - 1 do begin 353 ComboBoxGameSystem.Items[I] := Core.Core.GameSystems[I].GetName; 354 ComboBoxGameSystem.Items.Objects[I] := Core.Core.GameSystems[I]; 359 355 end; 360 356 if Assigned(LastSystem) then … … 457 453 ItemIndex := LastIndex; 458 454 end; 459 Core.Co olTranslator1.TranslateComponentRecursive(Self);455 Core.Core.Translator1.TranslateComponentRecursive(Self); 460 456 end; 461 457 … … 500 496 Randomize; 501 497 NewRandSeed := RandSeed; 502 Core.PersistentForm.Load(Self);503 Core.ThemeManager1.UseTheme(Self);504 498 ReloadView; 505 499 //Height := Trunc(1.5 * Height); … … 583 577 end; 584 578 585 procedure TFormNew.FormClose(Sender: TObject; var CloseAction: TCloseAction);586 begin587 Core.PersistentForm.Save(Self);588 end;589 590 579 procedure TFormNew.AServerAddExecute(Sender: TObject); 591 580 var 592 581 NewServerInfo: TServerInfo; 582 FormServer: TFormServer; 593 583 begin 594 584 FormServer := TFormServer.Create(nil); 595 NewServerInfo := TServerInfo.Create; 596 FormServer.ServerInfo := NewServerInfo; 597 if FormServer.ShowModal = mrOK then begin 598 ServerList.Items.Add(NewServerInfo); 599 ReloadView; 600 end else NewServerInfo.Free; 601 FormServer.Free; 585 try 586 NewServerInfo := TServerInfo.Create; 587 FormServer.ServerInfo := NewServerInfo; 588 if FormServer.ShowModal = mrOK then begin 589 ServerList.Items.Add(NewServerInfo); 590 ReloadView; 591 end else NewServerInfo.Free; 592 finally 593 FormServer.Free; 594 end; 602 595 end; 603 596 … … 605 598 var 606 599 ServerInfo: TServerInfo; 600 FormServer: TFormServer; 607 601 begin 608 602 FormServer := TFormServer.Create(nil); 609 ServerInfo := TServerInfo(ListViewServers.Selected.Data); 610 FormServer.ServerInfo := ServerInfo; 611 if FormServer.ShowModal = mrOK then begin 612 ReloadView; 613 end; 614 FormServer.Free; 603 try 604 ServerInfo := TServerInfo(ListViewServers.Selected.Data); 605 FormServer.ServerInfo := ServerInfo; 606 if FormServer.ShowModal = mrOK then begin 607 ReloadView; 608 end; 609 finally 610 FormServer.Free; 611 end; 615 612 end; 616 613 … … 629 626 630 627 procedure TFormNew.ButtonGameSystemsClick(Sender: TObject); 628 var 629 FormGameSystems: TFormGameSystems; 631 630 begin 632 631 FormGameSystems := TFormGameSystems.Create(nil); 633 632 try 634 FormGameSystems.GameSystems := Core. GameSystems;633 FormGameSystems.GameSystems := Core.Core.GameSystems; 635 634 FormGameSystems.ShowModal; 636 635 ReloadGameSystemsMenu; … … 683 682 SpinEditServerPort.Value := LocalNetworkPort; 684 683 end; 685 ServerList.Assign(Core. ServerList);684 ServerList.Assign(Core.Core.ServerList); 686 685 LoadGame(Server.Game); 687 686 end; … … 703 702 end; 704 703 end; 705 Core. ServerList.Assign(ServerList);704 Core.Core.ServerList.Assign(ServerList); 706 705 SaveGame(Server.Game); 707 706 end;
Note:
See TracChangeset
for help on using the changeset viewer.