Changeset 460 for trunk/LocalPlayer
- Timestamp:
- Nov 28, 2023, 3:16:24 PM (12 months ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Battle.pas
r447 r460 35 35 end; 36 36 37 var38 BattleDlg: TBattleDlg;39 40 37 41 38 implementation -
trunk/LocalPlayer/CityScreen.pas
r456 r460 6 6 uses 7 7 {$IFDEF UNIX}LMessages,{$ENDIF} 8 Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin,9 LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,10 Button A, ButtonC, Area, GraphType, Texture;8 Protocol, ClientTools, ScreenTools, IsoEngine, BaseWin, LCLIntf, LCLType, 9 Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, ButtonA, 10 ButtonC, Area, GraphType, Texture; 11 11 12 12 const … … 49 49 procedure PrevCityBtnClick(Sender: TObject); 50 50 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 51 // procedure AdviceBtnClick(Sender: TObject);52 51 procedure PageUpBtnClick(Sender: TObject); 53 52 procedure PageDownBtnClick(Sender: TObject); … … 101 100 end; 102 101 103 var104 CityDlg: TCityDlg;105 106 102 107 103 implementation 108 104 109 105 uses 110 Select, Messg, MessgEx, Help, Tribes, Directories, Math, Sound ;106 Select, Messg, MessgEx, Help, Tribes, Directories, Math, Sound, Term; 111 107 112 108 {$R *.lfm} … … 205 201 AreaMap.SetPaintBounds(xmArea - 192, ymArea - 96 - 32, xmArea + 192, 206 202 ymArea + 96); 207 SmallMapMode := smImprovements; 208 ZoomArea := 1; 203 Reset; 209 204 ProdHint := False; 210 205 RestoreUnFocus := -1; … … 1171 1166 (X < xView + 73) and (Y < yView + 50) then 1172 1167 if cGov = gAnarchy then 1173 with M essgExDlg do1168 with MainScreen.MessgExDlg do 1174 1169 begin 1175 1170 { MessgText:=Phrases.Lookup('OUTOFCONTROL'); … … 1204 1199 if iix >= 0 then 1205 1200 if ssShift in Shift then 1206 HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, iix)1201 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, iix) 1207 1202 else if (ClientMode < scContact) then 1208 with M essgExDlg do1203 with MainScreen.MessgExDlg do 1209 1204 begin 1210 1205 IconKind := mikImp; … … 1343 1338 if C.Status and csResourceWeightsMask <> 0 then 1344 1339 begin 1345 with M essgExDlg do1340 with MainScreen.MessgExDlg do 1346 1341 begin 1347 1342 MessgText := Phrases.Lookup('CITYMANAGEOFF'); … … 1351 1346 ShowModal; 1352 1347 end; 1353 if M essgExDlg.ModalResult = mrOK then1348 if MainScreen.MessgExDlg.ModalResult = mrOK then 1354 1349 begin 1355 1350 MyCity[cix].Status := MyCity[cix].Status and … … 1450 1445 begin 1451 1446 Assert(not Supervising); 1452 M odalSelectDlg.ShowNewContent_CityProject(wmModal, cix);1453 if M odalSelectDlg.Result <> -1 then1454 begin 1455 if M odalSelectDlg.Result and cpType <> 0 then1447 MainScreen.ModalSelectDlg.ShowNewContent_CityProject(wmModal, cix); 1448 if MainScreen.ModalSelectDlg.Result <> -1 then 1449 begin 1450 if MainScreen.ModalSelectDlg.Result and cpType <> 0 then 1456 1451 begin 1457 1452 MyCity[cix].Status := MyCity[cix].Status and not 7 or 1458 (1 + M odalSelectDlg.Result and cpIndex);1459 AutoBuild(cix, MyData.ImpOrder[M odalSelectDlg.Result and cpIndex]);1453 (1 + MainScreen.ModalSelectDlg.Result and cpIndex); 1454 AutoBuild(cix, MyData.ImpOrder[MainScreen.ModalSelectDlg.Result and cpIndex]); 1460 1455 end 1461 1456 else 1462 1457 begin 1463 NewProject := M odalSelectDlg.Result;1458 NewProject := MainScreen.ModalSelectDlg.Result; 1464 1459 QueryOk := True; 1465 1460 if (NewProject and cpImp <> 0) and (NewProject and cpIndex >= 28) and 1466 1461 (MyRO.NatBuilt[NewProject and cpIndex] > 0) then 1467 with M essgExDlg do1462 with MainScreen.MessgExDlg do 1468 1463 begin 1469 1464 cix1 := MyRO.nCity - 1; … … 1542 1537 if (cix < 0) or (ClientMode >= scContact) then 1543 1538 Exit; 1544 with MyCity[cix], M essgExDlg do1539 with MyCity[cix], MainScreen.MessgExDlg do 1545 1540 begin 1546 1541 Cost := Report.ProjectCost; … … 1743 1738 end; 1744 1739 1745 { procedure TCityDlg.AdviceBtnClick(Sender: TObject);1746 begin1747 AdvisorDlg.GiveCityAdvice(cix);1748 end; }1749 1750 1740 procedure TCityDlg.PageUpBtnClick(Sender: TObject); 1751 1741 begin -
trunk/LocalPlayer/CityType.pas
r447 r460 5 5 6 6 uses 7 Protocol, ClientTools, Term, ScreenTools, BaseWin, LCLIntf, LCLType, 8 SysUtils, Classes, Graphics, Controls, Forms, 9 ButtonB, ExtCtrls; 7 Protocol, ClientTools, ScreenTools, BaseWin, LCLIntf, LCLType, 8 SysUtils, Classes, Graphics, Controls, Forms, ButtonB, ExtCtrls; 10 9 11 10 type … … 36 35 end; 37 36 38 var39 CityTypeDlg: TCityTypeDlg;40 37 41 38 implementation 42 39 43 uses Help; 40 uses 41 Help, Term; 44 42 45 43 {$R *.lfm} … … 246 244 begin 247 245 if ssShift in Shift then 248 HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp,246 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, 249 247 MyData.ImpOrder[ctype, I]) 250 248 else … … 263 261 begin 264 262 if ssShift in Shift then 265 HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, Pooliix[I])263 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, Pooliix[I]) 266 264 else 267 265 begin -
trunk/LocalPlayer/Diagram.pas
r447 r460 9 9 10 10 type 11 TDiagramKind = (dkChart, dkShip); 12 11 13 TDiaDlg = class(TFramedDlg) 12 14 CloseBtn: TButtonB; … … 20 22 procedure PlayerClick(Sender: TObject); 21 23 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 22 23 24 public 24 25 procedure OffscreenPaint; override; 25 26 procedure ShowNewContent_Charts(NewMode: TWindowMode); 26 27 procedure ShowNewContent_Ship(NewMode: TWindowMode; P: Integer = -1); 27 28 28 private 29 Kind: (dkChart, dkShip); 30 Player, Mode: Integer; 31 end; 32 33 var 34 DiaDlg: TDiaDlg; 29 Kind: TDiagramKind; 30 Player: Integer; 31 Mode: Integer; 32 end; 35 33 36 34 procedure PaintColonyShip(Canvas: TCanvas; Player, Left, Width, Top: Integer); 35 37 36 38 37 implementation -
trunk/LocalPlayer/Draft.pas
r447 r460 5 5 6 6 uses 7 Protocol, ClientTools, Term,ScreenTools, BaseWin, LCLIntf, LCLType, SysUtils,7 Protocol, ClientTools, ScreenTools, BaseWin, LCLIntf, LCLType, SysUtils, 8 8 Classes, Graphics, Controls, Forms, ExtCtrls, ButtonA, ButtonB, Area; 9 9 … … 37 37 end; 38 38 39 var40 DraftDlg: TDraftDlg;41 42 39 43 40 implementation 44 41 45 42 uses 46 Help, Tribes, Directories;43 Term, Help, Tribes, Directories; 47 44 48 45 {$R *.lfm} … … 531 528 I := (Y - yFeature) div LinePitch; 532 529 if (X >= xFeature - 21) and (X < ClientWidth) and (ssShift in Shift) then 533 HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkFeature, Code[I])530 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkFeature, Code[I]) 534 531 else if not(Code[I] in AutoFeature) then 535 532 begin -
trunk/LocalPlayer/Enhance.pas
r457 r460 5 5 6 6 uses 7 ScreenTools, BaseWin, Protocol, ClientTools, Term,LCLIntf, LCLType, SysUtils,7 ScreenTools, BaseWin, Protocol, ClientTools, LCLIntf, LCLType, SysUtils, 8 8 Classes, Graphics, Controls, Forms, IsoEngine, ButtonB, ButtonC, Menus; 9 9 … … 43 43 end; 44 44 45 var46 EnhanceDlg: TEnhanceDlg;47 48 45 49 46 implementation 50 47 51 48 uses 52 Help, KeyBindings ;49 Help, KeyBindings, Term; 53 50 54 51 {$R *.lfm} … … 382 379 ShortCut := KeyToShortCut(Key, Shift); 383 380 if BHelp.Test(ShortCut) then 384 HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkText,385 HelpDlg.TextIndex('MACRO'))381 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkText, 382 MainScreen.HelpDlg.TextIndex('MACRO')) 386 383 end; 387 384 -
trunk/LocalPlayer/Help.pas
r457 r460 147 147 end; 148 148 149 var150 HelpDlg: THelpDlg;151 152 149 153 150 implementation … … 315 312 HelpContext: string); 316 313 begin 317 HelpDlg.ShowNewContent(NewMode, hkText, 318 HelpDlg.TextIndex(HelpContext)) 314 ShowNewContent(NewMode, hkText, TextIndex(HelpContext)); 319 315 end; 320 316 -
trunk/LocalPlayer/LocalPlayer.pas
r447 r460 10 10 11 11 uses 12 Term, CityScreen, Draft, MessgEx, Select, CityType, Help, UnitStat, Diagram, 13 NatStat, Wonders, Nego, Enhance, BaseWin, Battle, Rates, TechTree, Forms; 12 Term, CityScreen, Nego, BaseWin, Forms; 14 13 15 14 var … … 24 23 // Application.MainForm := MainScreen; 25 24 Application.CreateForm(TMainScreen, MainScreen); 26 Application.CreateForm(TCityDlg, CityDlg);27 Application.CreateForm(TModalSelectDlg, ModalSelectDlg);28 Application.CreateForm(TListDlg, ListDlg);29 Application.CreateForm(TMessgExDlg, MessgExDlg);30 Application.CreateForm(TDraftDlg, DraftDlg);31 Application.CreateForm(TCityTypeDlg, CityTypeDlg);32 Application.CreateForm(THelpDlg, HelpDlg);33 Application.CreateForm(TUnitStatDlg, UnitStatDlg);34 Application.CreateForm(TDiaDlg, DiaDlg);35 Application.CreateForm(TNatStatDlg, NatStatDlg);36 Application.CreateForm(TWondersDlg, WondersDlg);37 Application.CreateForm(TNegoDlg, NegoDlg);38 Application.CreateForm(TEnhanceDlg, EnhanceDlg);39 Application.CreateForm(TBattleDlg, BattleDlg);40 // Application.CreateForm(TAdvisorDlg, AdvisorDlg);41 Application.CreateForm(TRatesDlg, RatesDlg);42 Application.CreateForm(TTechTreeDlg, TechTreeDlg);43 25 end; 44 26 MainScreen.Client(Command, Player, Data); -
trunk/LocalPlayer/MessgEx.pas
r457 r460 49 49 end; 50 50 51 var52 MessgExDlg: TMessgExDlg;53 51 54 52 procedure SoundMessageEx(SimpleText, SoundItem: string); … … 458 456 begin 459 457 if Kind = mkOkHelp then 460 HelpDlg.ShowNewContent(wmSubmodal, HelpKind, HelpNo)458 MainScreen.HelpDlg.ShowNewContent(wmSubmodal, HelpKind, HelpNo) 461 459 else if Kind = mkModel then 462 UnitStatDlg.ShowNewContent_OwnModel(wmSubmodal, IconIndex)460 MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmSubmodal, IconIndex) 463 461 else 464 462 ModalResult := mrIgnore; … … 489 487 // because Messg.SoundMessage not capable of movie mode 490 488 begin 491 with M essgExDlg do489 with MainScreen.MessgExDlg do 492 490 begin 493 491 MessgText := SimpleText; … … 500 498 procedure TribeMessage(P: Integer; SimpleText, SoundItem: string); 501 499 begin 502 with M essgExDlg do500 with MainScreen.MessgExDlg do 503 501 begin 504 502 OpenSound := SoundItem; … … 514 512 : Integer; 515 513 begin 516 with M essgExDlg do514 with MainScreen.MessgExDlg do 517 515 begin 518 516 MessgText := SimpleText; … … 527 525 ContextKind: TLinkCategory; ContextNo: Integer); 528 526 begin 529 with M essgExDlg do527 with MainScreen.MessgExDlg do 530 528 begin 531 529 MessgText := SimpleText; -
trunk/LocalPlayer/NatStat.pas
r447 r460 5 5 6 6 uses 7 Protocol, ClientTools, Term,ScreenTools, BaseWin, LCLIntf, LCLType, SysUtils,7 Protocol, ClientTools, ScreenTools, BaseWin, LCLIntf, LCLType, SysUtils, 8 8 Classes, Graphics, Controls, Forms, ButtonB, ButtonC, Menus, EOTButton; 9 9 … … 37 37 procedure OffscreenPaint; override; 38 38 private 39 pView, AgePrepared, LinesDown: Integer; 40 SelfReport, CurrentReport: PEnemyReport; 41 ShowContact, ContactEnabled: Boolean; 42 Back, Template: TBitmap; 39 pView: Integer; 40 AgePrepared: Integer; 41 LinesDown: Integer; 42 SelfReport: PEnemyReport; 43 CurrentReport: PEnemyReport; 44 ShowContact: Boolean; 45 ContactEnabled: Boolean; 46 Back: TBitmap; 47 Template: TBitmap; 43 48 ReportText: TStringList; 44 49 procedure GenerateReportText; 45 50 end; 46 51 47 var48 NatStatDlg: TNatStatDlg;49 50 52 51 53 implementation … … 54 56 55 57 uses 56 Messg, Tribes, Directories;58 Term, Messg, Tribes, Directories; 57 59 58 60 const … … 193 195 [I * 100 div (G.lx * G.ly)]); 194 196 end; 195 end 197 end; 196 198 end; 197 199 … … 254 256 ps: PChar; 255 257 Extinct: Boolean; 256 257 258 begin 258 259 inherited; … … 279 280 1 + Tribe[pView].facepix mod 10 * 65, 280 281 1 + Tribe[pView].facepix div 10 * 49); 281 frame(Offscreen.Canvas, 18 - 1, yIcon - 4 - 1, 18 + 64, yIcon - 4 + 48,282 Frame(Offscreen.Canvas, 18 - 1, yIcon - 4 - 1, 18 + 64, yIcon - 4 + 48, 282 283 $000000, $000000); 283 284 end; … … 392 393 Phrases2.Lookup('MENU_TELLAI')); 393 394 end; 395 394 396 ContactBtn.SetBack(Offscreen.Canvas, ContactBtn.Left, ContactBtn.Top); 395 397 -
trunk/LocalPlayer/Nego.pas
r457 r460 5 5 6 6 uses 7 ScreenTools, BaseWin, Protocol, Term,LCLType, SysUtils, Classes, Graphics,7 ScreenTools, BaseWin, Protocol, LCLType, SysUtils, Classes, Graphics, 8 8 Controls, Forms, ButtonA, ButtonB, ButtonN; 9 9 … … 20 20 21 21 TCommandAllowedEnum = scDipNoticeStart..scDipBreakStart; 22 TPriceSet = set of $00..$FF; 22 23 23 24 { TNegoDlg } … … 69 70 procedure OfferClick(Sender: TObject); 70 71 procedure FastBtnClick(Sender: TObject); 71 72 72 public 73 73 procedure Initiate; // first turn of negotiation, initiate … … 76 76 procedure OffscreenPaint; override; 77 77 procedure ShowNewContent(NewMode: TWindowMode); 78 79 78 private 80 79 Page, DipCommand: Integer; … … 93 92 end; 94 93 95 var96 NegoDlg: TNegoDlg;97 98 94 99 95 implementation 100 96 101 97 uses 102 Messg, ClientTools, Diplomacy, Inp, Select, NatStat, Tribes, MessgEx ;98 Messg, ClientTools, Diplomacy, Inp, Select, NatStat, Tribes, MessgEx, Term; 103 99 104 100 {$R *.lfm} … … 392 388 else 393 389 begin 394 if M odalSelectDlg.OnlyChoice(kChooseModel) <> mixAll then390 if MainScreen.ModalSelectDlg.OnlyChoice(kChooseModel) <> mixAll then 395 391 MyAllowed := MyAllowed + [opAllModel shr 24]; 396 if M odalSelectDlg.OnlyChoice(kChooseEModel) <> mixAll then392 if MainScreen.ModalSelectDlg.OnlyChoice(kChooseEModel) <> mixAll then 397 393 OppoAllowed := OppoAllowed + [opAllModel shr 24]; 398 394 end; … … 649 645 if (X >= xNationPicture0) and (X < xNationPicture0 + 64) and 650 646 (Y >= yNationPicture) and (Y < yNationPicture + 48) then 651 NatStatDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), DipMem[Me].pContact)647 MainScreen.NatStatDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), DipMem[Me].pContact) 652 648 else if (X >= xNationPicture1) and (X < xNationPicture1 + 64) and 653 649 (Y >= yNationPicture) and (Y < yNationPicture + 48) then 654 NatStatDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), Me)650 MainScreen.NatStatDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), Me) 655 651 end; 656 652 … … 756 752 begin // choose type and number 757 753 if MyRO.NatBuilt[imSpacePort] = 0 then 758 with M essgExDlg do754 with MainScreen.MessgExDlg do 759 755 begin 760 756 OpenSound := 'WARNING_LOWSUPPORT'; … … 767 763 Exit; 768 764 end; 769 M odalSelectDlg.ShowNewContent(wmModal, kEShipPart);770 if M odalSelectDlg.Result < 0 then771 Exit; 772 Inc(Price, M odalSelectDlg.Result shl 16);773 Max := MyRO.Ship[DipMem[Me].pContact].Parts[M odalSelectDlg.Result];765 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kEShipPart); 766 if MainScreen.ModalSelectDlg.Result < 0 then 767 Exit; 768 Inc(Price, MainScreen.ModalSelectDlg.Result shl 16); 769 Max := MyRO.Ship[DipMem[Me].pContact].Parts[MainScreen.ModalSelectDlg.Result]; 774 770 InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER'); 775 771 InputDlg.EInput.Text := ''; … … 789 785 opAllTech: 790 786 begin // choose technology 791 M odalSelectDlg.ShowNewContent(wmModal, kChooseETech);792 if M odalSelectDlg.Result < 0 then793 Exit; 794 if M odalSelectDlg.Result = adAll then787 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseETech); 788 if MainScreen.ModalSelectDlg.Result < 0 then 789 Exit; 790 if MainScreen.ModalSelectDlg.Result = adAll then 795 791 Price := opAllTech 796 792 else 797 Price := OpTech + M odalSelectDlg.Result;793 Price := OpTech + MainScreen.ModalSelectDlg.Result; 798 794 end; 799 795 opAllModel: 800 796 begin // choose model 801 M odalSelectDlg.ShowNewContent(wmModal, kChooseEModel);802 if M odalSelectDlg.Result < 0 then803 Exit; 804 if M odalSelectDlg.Result = mixAll then797 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseEModel); 798 if MainScreen.ModalSelectDlg.Result < 0 then 799 Exit; 800 if MainScreen.ModalSelectDlg.Result = mixAll then 805 801 Price := opAllModel 806 802 else 807 Price := OpModel + MyRO.EnemyModel[M odalSelectDlg.Result].mix;803 Price := OpModel + MyRO.EnemyModel[MainScreen.ModalSelectDlg.Result].mix; 808 804 end; 809 805 opTreaty: … … 869 865 opShipParts: 870 866 begin // choose type and number 871 M odalSelectDlg.ShowNewContent(wmModal, kShipPart);872 if M odalSelectDlg.Result < 0 then873 Exit; 874 Inc(Price, M odalSelectDlg.Result shl 16);875 Max := MyRO.Ship[Me].Parts[M odalSelectDlg.Result];867 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kShipPart); 868 if MainScreen.ModalSelectDlg.Result < 0 then 869 Exit; 870 Inc(Price, MainScreen.ModalSelectDlg.Result shl 16); 871 Max := MyRO.Ship[Me].Parts[MainScreen.ModalSelectDlg.Result]; 876 872 InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER'); 877 873 InputDlg.EInput.Text := ''; … … 891 887 opAllTech: 892 888 begin // choose technology 893 M odalSelectDlg.ShowNewContent(wmModal, kChooseTech);894 if M odalSelectDlg.Result < 0 then895 Exit; 896 if M odalSelectDlg.Result = adAll then889 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseTech); 890 if MainScreen.ModalSelectDlg.Result < 0 then 891 Exit; 892 if MainScreen.ModalSelectDlg.Result = adAll then 897 893 Price := opAllTech 898 894 else 899 Price := OpTech + M odalSelectDlg.Result;895 Price := OpTech + MainScreen.ModalSelectDlg.Result; 900 896 end; 901 897 opAllModel: 902 898 begin // choose model 903 M odalSelectDlg.ShowNewContent(wmModal, kChooseModel);904 if M odalSelectDlg.Result < 0 then905 Exit; 906 if M odalSelectDlg.Result = mixAll then899 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseModel); 900 if MainScreen.ModalSelectDlg.Result < 0 then 901 Exit; 902 if MainScreen.ModalSelectDlg.Result = mixAll then 907 903 Price := opAllModel 908 904 else 909 Price := OpModel + M odalSelectDlg.Result;905 Price := OpModel + MainScreen.ModalSelectDlg.Result; 910 906 end; 911 907 opTreaty: -
trunk/LocalPlayer/Rates.pas
r447 r460 23 23 procedure ShowNewContent(NewMode: TWindowMode); 24 24 end; 25 26 var27 RatesDlg: TRatesDlg;28 25 29 26 -
trunk/LocalPlayer/Select.pas
r457 r460 5 5 6 6 uses 7 Protocol, ClientTools, Term,ScreenTools, PVSB, BaseWin,7 Protocol, ClientTools, ScreenTools, PVSB, BaseWin, 8 8 LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, 9 9 ExtCtrls, ButtonB, ButtonBase, Menus, Types; … … 92 92 adAll = $10000; 93 93 94 var95 ListDlg: TListDlg;96 ModalSelectDlg: TModalSelectDlg;97 98 94 99 95 implementation 100 96 101 97 uses 102 CityScreen, Help, UnitStat, Tribes, Inp, CmdList;98 Term, CityScreen, Help, UnitStat, Tribes, Inp, CmdList; 103 99 104 100 {$R *.lfm} … … 871 867 Server(CommandWithData(cSetCityName, CityNameInfo.GetCommandDataSize), 872 868 Me, 0, CityNameInfo); 873 if CityDlg.Visible then869 if MainScreen.CityDlg.Visible then 874 870 begin 875 CityDlg.FormShow(nil);876 CityDlg.Invalidate;871 MainScreen.CityDlg.FormShow(nil); 872 MainScreen.CityDlg.Invalidate; 877 873 end; 878 874 Result := True; … … 900 896 Server(CommandWithData(cSetModelName, ModelNameInfo.GetCommandDataSize), 901 897 Me, 0, ModelNameInfo); 902 if UnitStatDlg.Visible then898 if MainScreen.UnitStatDlg.Visible then 903 899 begin 904 UnitStatDlg.FormShow(nil);905 UnitStatDlg.Invalidate;900 MainScreen.UnitStatDlg.FormShow(nil); 901 MainScreen.UnitStatDlg.Invalidate; 906 902 end; 907 903 Result := True; … … 941 937 kModels, kChooseModel: 942 938 if lix <> mixAll then 943 UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, lix);939 MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, lix); 944 940 kEModels: 945 UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent,941 MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, 946 942 Code[1, ScrollBar.Position + Selected]); 947 943 kAllEModels, kChooseEModel: 948 944 if lix <> mixAll then 949 UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, lix);945 MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, lix); 950 946 kAdvance, kFarAdvance, kScience, kChooseTech, kChooseETech, kStealTech: 951 947 if lix = adMilitary then 952 HelpDlg.ShowNewContent(wmPersistent, hkText,953 HelpDlg.TextIndex('MILRES'))948 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkText, 949 MainScreen.HelpDlg.TextIndex('MILRES')) 954 950 else if lix < adMilitary then 955 HelpDlg.ShowNewContent(wmPersistent, hkAdv, lix);951 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkAdv, lix); 956 952 kProject: 957 953 if lix = cpImp + imTrGoods then 958 HelpDlg.ShowNewContent(wmPersistent, hkText,959 HelpDlg.TextIndex('TRADINGGOODS'))954 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkText, 955 MainScreen.HelpDlg.TextIndex('TRADINGGOODS')) 960 956 else if lix and (cpImp + cpType) = 0 then 961 UnitStatDlg.ShowNewContent_OwnModel(wmPersistent,957 MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, 962 958 lix and cpIndex) 963 959 else if (lix and cpType = 0) and (lix <> cpImp + imTrGoods) then 964 HelpDlg.ShowNewContent(wmPersistent, hkImp,960 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkImp, 965 961 lix and cpIndex); 966 962 kGov: 967 HelpDlg.ShowNewContent(wmPersistent, hkMisc,963 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkMisc, 968 964 Integer(miscGovList)); 969 965 kShipPart, kEShipPart: … … 1887 1883 procedure TListDlg.RemoveUnit; 1888 1884 begin 1889 if ListDlg.Visible and (Kind = kModels) then1885 if Visible and (Kind = kModels) then 1890 1886 SmartUpdateContent; 1891 1887 end; -
trunk/LocalPlayer/TechTree.pas
r457 r460 29 29 Dragging: Boolean; 30 30 end; 31 32 var33 TechTreeDlg: TTechTreeDlg;34 31 35 32 -
trunk/LocalPlayer/Term.pas
r457 r460 14 14 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, DrawDlg, Types, 15 15 Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area, 16 GraphicSet, MiniMap, IsoEngine; 16 GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType, 17 Diagram, CityScreen, Rates, Battle, NatStat, UnitStat, Draft, Select, MessgEx, 18 Help; 17 19 18 20 const … … 324 326 NoMap: TIsoMap; 325 327 NoMapPanel: TIsoMap; 328 // Forms 329 FWondersDlg: TWondersDlg; 330 FTechTreeDlg: TTechTreeDlg; 331 FEnhanceDlg: TEnhanceDlg; 332 FNegoDlg: TNegoDlg; 333 FCityTypeDlg: TCityTypeDlg; 334 FDiaDlg: TDiaDlg; 335 FCityDlg: TCityDlg; 336 FRatesDlg: TRatesDlg; 337 FBattleDlg: TBattleDlg; 338 FNatStatDlg: TNatStatDlg; 339 FUnitStatDlg: TUnitStatDlg; 340 FDraftDlg: TDraftDlg; 341 FModalSelectDlg: TModalSelectDlg; 342 FListDlg: TListDlg; 343 FMessgExDlg: TMessgExDlg; 344 FHelpDlg: THelpDlg; 345 procedure ArrangeDialogs; 346 procedure ArrangeDialog(Form: TBufferedDrawDlg); 326 347 function ChooseUnusedTribe: Integer; 327 348 function DoJob(j0: Integer): Integer; 349 function GetBattleDlg: TBattleDlg; 350 function GetCityDlg: TCityDlg; 351 function GetCityTypeDlg: TCityTypeDlg; 352 function GetDiaDlg: TDiaDlg; 353 function GetDraftDlg: TDraftDlg; 354 function GetEnhanceDlg: TEnhanceDlg; 355 function GetHelpDlg: THelpDlg; 356 function GetListDlg: TListDlg; 357 function GetMessgExDlg: TMessgExDlg; 358 function GetModalSelectDlg: TModalSelectDlg; 359 function GetNatStatDlg: TNatStatDlg; 360 function GetNegoDlg: TNegoDlg; 361 function GetRatesDlg: TRatesDlg; 362 function GetTechTreeDlg: TTechTreeDlg; 328 363 procedure GetTribeList; 364 function GetUnitStatDlg: TUnitStatDlg; 365 function GetWondersDlg: TWondersDlg; 329 366 procedure InitModule; 330 367 procedure DoneModule; … … 397 434 procedure UpdateViews(UpdateCityScreen: Boolean = False); 398 435 function ContactRefused(P: Integer; Item: String): Boolean; 436 // Forms 437 property WondersDlg: TWondersDlg read GetWondersDlg; 438 property TechTreeDlg: TTechTreeDlg read GetTechTreeDlg; 439 property EnhanceDlg: TEnhanceDlg read GetEnhanceDlg; 440 property NegoDlg: TNegoDlg read GetNegoDlg; 441 property CityTypeDlg: TCityTypeDlg read GetCityTypeDlg; 442 property DiaDlg: TDiaDlg read GetDiaDlg; 443 property CityDlg: TCityDlg read GetCityDlg; 444 property RatesDlg: TRatesDlg read GetRatesDlg; 445 property BattleDlg: TBattleDlg read GetBattleDlg; 446 property NatStatDlg: TNatStatDlg read GetNatStatDlg; 447 property UnitStatDlg: TUnitStatDlg read GetUnitStatDlg; 448 property DraftDlg: TDraftDlg read GetDraftDlg; 449 property ModalSelectDlg: TModalSelectDlg read GetModalSelectDlg; 450 property ListDlg: TListDlg read GetListDlg; 451 property MessgExDlg: TMessgExDlg read GetMessgExDlg; 452 property HelpDlg: THelpDlg read GetHelpDlg; 399 453 end; 400 454 … … 428 482 end; 429 483 430 TPriceSet = set of $00 .. $FF;431 484 TFormAction = (faClose, faEnable, faDisable, faUpdate, faSmartUpdateContent); 432 485 … … 579 632 function InitEnemyModel(emix: Integer): Boolean; 580 633 procedure InitAllEnemyModels; 581 procedure InitMyModel( mix: Integer; final: Boolean);634 procedure InitMyModel(Mix: Integer; Final: Boolean); 582 635 583 636 procedure ImpImage(ca: TCanvas; X, Y, iix: Integer; Government: Integer = -1; … … 590 643 591 644 uses 592 Directories, CityScreen, Draft, MessgEx, Select, CityType, Help, 593 UnitStat, Log, Diagram, NatStat, Wonders, Enhance, Nego, PixelPointer, Sound, 594 Battle, Rates, TechTree, Registry, Global, KeyBindings, CmdList; 645 Directories, Log, PixelPointer, Sound, Registry, Global, KeyBindings, CmdList; 595 646 596 647 {$R *.lfm} … … 762 813 begin 763 814 if MyMap[Loc] and fDeadLands <> 0 then 764 HelpDlg.ShowNewContent(NewMode, hkTer, 3 * 12)815 MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, 3 * 12) 765 816 else if (MyMap[Loc] and fTerrain = fForest) and IsJungle(Loc div G.lx) then 766 HelpDlg.ShowNewContent(NewMode, hkTer,817 MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, 767 818 fJungle + (MyMap[Loc] shr 5 and 3) * 12) 768 819 else 769 HelpDlg.ShowNewContent(NewMode, hkTer, MyMap[Loc] and fTerrain +820 MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, MyMap[Loc] and fTerrain + 770 821 (MyMap[Loc] shr 5 and 3) * 12); 771 822 end; … … 864 915 end; 865 916 866 procedure InitMyModel( mix: Integer; final: Boolean);917 procedure InitMyModel(Mix: Integer; Final: Boolean); 867 918 var 868 919 mi: TModelInfo; … … 871 922 Exit; 872 923 // don't exit for special units because cSetModelPicture comes after TellNewModels 873 MakeModelInfo(Me, mix, MyModel[mix], mi);874 ChooseModelPicture(Me, mix, ModelCode(mi), ModelHash(mi), MyRO.Turn,875 False, final);924 MakeModelInfo(Me, Mix, MyModel[mix], mi); 925 ChooseModelPicture(Me, Mix, ModelCode(mi), ModelHash(mi), MyRO.Turn, 926 False, Final); 876 927 end; 877 928 … … 953 1004 InitMyModel(MyData.ToldModels, True); 954 1005 { only run if no researched model } 955 with M essgExDlg do1006 with MainScreen.MessgExDlg do 956 1007 begin 957 1008 { MakeModelInfo(me,MyData.ToldModels,MyModel[MyData.ToldModels],mi); … … 1157 1208 { research complete -- select new } 1158 1209 repeat 1159 M odalSelectDlg.ShowNewContent(wmModal, kAdvance);1160 if M odalSelectDlg.Result < 0 then1210 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kAdvance); 1211 if MainScreen.ModalSelectDlg.Result < 0 then 1161 1212 begin 1162 1213 Result := False; 1163 1214 Exit; 1164 1215 end; 1165 ChosenResearch := M odalSelectDlg.Result;1216 ChosenResearch := MainScreen.ModalSelectDlg.Result; 1166 1217 if ChosenResearch = adMilitary then 1167 1218 begin 1168 DraftDlg.ShowNewContent(wmModal);1169 if DraftDlg.ModalResult <> mrOK then1219 MainScreen.DraftDlg.ShowNewContent(wmModal); 1220 if MainScreen.DraftDlg.ModalResult <> mrOK then 1170 1221 Tribe[Me].ModelPicture[MyRO.nModel].HGr := nil; 1171 1222 end; 1172 until (ChosenResearch <> adMilitary) or ( DraftDlg.ModalResult = mrOK);1223 until (ChosenResearch <> adMilitary) or (MainScreen.DraftDlg.ModalResult = mrOK); 1173 1224 1174 1225 if ChosenResearch = adMilitary then … … 1176 1227 else if ChosenResearch = adFar then 1177 1228 begin 1178 M odalSelectDlg.ShowNewContent(wmModal, kFarAdvance);1179 if M odalSelectDlg.Result >= 0 then1180 if (M odalSelectDlg.Result = adNone) or1181 (Server(sSetResearch - sExecute, Me, M odalSelectDlg.Result, nil^) <1229 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kFarAdvance); 1230 if MainScreen.ModalSelectDlg.Result >= 0 then 1231 if (MainScreen.ModalSelectDlg.Result = adNone) or 1232 (Server(sSetResearch - sExecute, Me, MainScreen.ModalSelectDlg.Result, nil^) < 1182 1233 rExecuted) then 1183 MyData.FarTech := M odalSelectDlg.Result1234 MyData.FarTech := MainScreen.ModalSelectDlg.Result 1184 1235 else 1185 1236 begin 1186 ChosenResearch := M odalSelectDlg.Result;1237 ChosenResearch := MainScreen.ModalSelectDlg.Result; 1187 1238 // can be researched immediately 1188 1239 MyData.FarTech := adNone; … … 1194 1245 else 1195 1246 Server(sSetResearch, Me, ChosenResearch, nil^); 1196 ListDlg.TechChange;1247 MainScreen.ListDlg.TechChange; 1197 1248 Result := True; 1198 1249 end; … … 1565 1616 until FindNext(SearchRec) <> 0; 1566 1617 FindClose(SearchRec); 1618 end; 1619 1620 function TMainScreen.GetUnitStatDlg: TUnitStatDlg; 1621 begin 1622 if not Assigned(FUnitStatDlg) then begin 1623 FUnitStatDlg := TUnitStatDlg.Create(nil); 1624 ArrangeDialog(FUnitStatDlg); 1625 FUnitStatDlg.CheckAge; 1626 end; 1627 Result := FUnitStatDlg; 1628 end; 1629 1630 function TMainScreen.GetWondersDlg: TWondersDlg; 1631 begin 1632 if not Assigned(FWondersDlg) then FWondersDlg := TWondersDlg.Create(nil); 1633 Result := FWondersDlg; 1567 1634 end; 1568 1635 … … 1758 1825 FreeAndNil(UnusedTribeFiles); 1759 1826 FreeAndNil(TribeNames); 1760 // AdvisorDlg.DeInit;1761 1827 end; 1762 1828 … … 1866 1932 end; 1867 1933 InitCityMark(MainTexture); 1868 CityDlg.CheckAge;1869 NatStatDlg.CheckAge;1870 UnitStatDlg.CheckAge;1871 HelpDlg.Difficulty := G.Difficulty[Me];1934 if Assigned(FCityDlg) then FCityDlg.CheckAge; 1935 if Assigned(FNatStatDlg) then FNatStatDlg.CheckAge; 1936 if Assigned(FUnitStatDlg) then FUnitStatDlg.CheckAge; 1937 if Assigned(FHelpDlg) then FHelpDlg.Difficulty := G.Difficulty[Me]; 1872 1938 1873 1939 UnFocus := -1; … … 2521 2587 2522 2588 HaveStrategyAdvice := False; 2523 // (GameMode<>cMovie) and not supervising2524 // and AdvisorDlg.HaveStrategyAdvice;2525 2589 GoOnPhase := True; 2526 2590 if Supervising or (GameMode = cMovie) then … … 2628 2692 begin 2629 2693 Server := TInitModuleData(Data).Server; 2630 // AdvisorDlg.Init;2631 2694 InitModule; 2632 2695 TInitModuleData(Data).DataSize := SizeOf(TPersistentData); … … 2642 2705 MainTexture.Age := -1; 2643 2706 Tribes.Init; 2644 HelpDlg.UserLeft := (Screen. width - HelpDlg.width) div 2;2645 HelpDlg.UserTop := (Screen. height - HelpDlg.height) div 2;2707 HelpDlg.UserLeft := (Screen.Width - HelpDlg.Width) div 2; 2708 HelpDlg.UserTop := (Screen.Height - HelpDlg.Height) div 2; 2646 2709 HelpDlg.Difficulty := 0; 2647 2710 if Command = cStartCredits then … … 2654 2717 cNewGame, cLoadGame, cMovie, cNewMap: 2655 2718 begin 2656 { if (Command=cNewGame) or (Command=cLoadGame) then2657 AdvisorDlg.NewGame(Data); }2658 2719 GenerateNames := mNames.Checked; 2659 2720 GameOK := True; … … 2695 2756 begin 2696 2757 CityID := -1; 2697 EffectiveOwner := -1 2758 EffectiveOwner := -1; 2698 2759 end; 2699 2760 FillChar(ToldTech, SizeOf(ToldTech), Byte(tsNA)); … … 2702 2763 end; 2703 2764 2704 // arrange dialogs 2705 ListDlg.UserLeft := 8; 2706 ListDlg.UserTop := TopBarHeight + 8; 2707 HelpDlg.UserLeft := Screen.width - HelpDlg.width - 8; 2708 HelpDlg.UserTop := TopBarHeight + 8; 2709 UnitStatDlg.UserLeft := 397; 2710 UnitStatDlg.UserTop := TopBarHeight + 64; 2711 DiaDlg.UserLeft := (Screen.width - DiaDlg.width) div 2; 2712 DiaDlg.UserTop := (Screen.height - DiaDlg.height) div 2; 2713 NatStatDlg.UserLeft := Screen.width - NatStatDlg.width - 8; 2714 NatStatDlg.UserTop := Screen.height - PanelHeight - 2715 NatStatDlg.height - 8; 2716 if NatStatDlg.UserTop < 8 then 2717 NatStatDlg.UserTop := 8; 2765 ArrangeDialogs; 2718 2766 2719 2767 Age := 0; 2720 2768 MovieSpeed := 1; 2721 2769 LogDlg.mSlot.Visible := True; 2722 LogDlg.Host := self;2723 HelpDlg.ClearHistory;2724 CityDlg.Reset;2770 LogDlg.Host := Self; 2771 if Assigned(FHelpDlg) then FHelpDlg.ClearHistory; 2772 if Assigned(FCityDlg) then FCityDlg.Reset; 2725 2773 2726 2774 MiniMap.Size := Point(G.lx, G.ly); … … 2831 2879 Closable := True; 2832 2880 Close; 2833 { if (GameMode=cNewGame) or (GameMode=cLoadGame) then2834 AdvisorDlg.BreakGame; }2835 2881 end; 2836 2882 … … 2858 2904 begin 2859 2905 StayOnTop_Ensured := True; 2860 CityDlg.StayOnTop_Workaround;2861 CityTypeDlg.StayOnTop_Workaround;2862 DiaDlg.StayOnTop_Workaround;2863 DraftDlg.StayOnTop_Workaround;2864 EnhanceDlg.StayOnTop_Workaround;2865 HelpDlg.StayOnTop_Workaround;2866 NatStatDlg.StayOnTop_Workaround;2867 NegoDlg.StayOnTop_Workaround;2868 ModalSelectDlg.StayOnTop_Workaround;2869 ListDlg.StayOnTop_Workaround;2870 UnitStatDlg.StayOnTop_Workaround;2871 WondersDlg.StayOnTop_Workaround;2872 RatesDlg.StayOnTop_Workaround;2906 //CityDlg.StayOnTop_Workaround; 2907 //CityTypeDlg.StayOnTop_Workaround; 2908 //DiaDlg.StayOnTop_Workaround; 2909 //DraftDlg.StayOnTop_Workaround; 2910 //EnhanceDlg.StayOnTop_Workaround; 2911 //HelpDlg.StayOnTop_Workaround; 2912 //NatStatDlg.StayOnTop_Workaround; 2913 //NegoDlg.StayOnTop_Workaround; 2914 //ModalSelectDlg.StayOnTop_Workaround; 2915 //ListDlg.StayOnTop_Workaround; 2916 //UnitStatDlg.StayOnTop_Workaround; 2917 //WondersDlg.StayOnTop_Workaround; 2918 //RatesDlg.StayOnTop_Workaround; 2873 2919 end; 2874 2920 end; … … 2934 2980 NegoDlg.Visible then 2935 2981 NegoDlg.Close; 2936 skipped := False; // always show my moves during my turn2982 Skipped := False; // always show my moves during my turn 2937 2983 Idle := True; 2938 2984 InitTurn(NewPlayer); … … 2953 2999 pTurn := NewPlayer; 2954 3000 pLogo := -1; 2955 skipped := False; // always show my moves during my turn3001 Skipped := False; // always show my moves during my turn 2956 3002 Idle := True; 2957 3003 if FirstMovieTurn then … … 2978 3024 ClientMode := -1; 2979 3025 Idle := False; 2980 skipped := False;3026 Skipped := False; 2981 3027 end; 2982 3028 … … 3632 3678 I: Integer; 3633 3679 begin 3680 if Assigned(FWondersDlg) then FreeAndNil(FWondersDlg); 3681 if Assigned(FTechTreeDlg) then FreeAndNil(FTechTreeDlg); 3682 if Assigned(FEnhanceDlg) then FreeAndNil(FEnhanceDlg); 3683 if Assigned(FNegoDlg) then FreeAndNil(FNegoDlg); 3684 if Assigned(FCityTypeDlg) then FreeAndNil(FCityTypeDlg); 3685 if Assigned(FDiaDlg) then FreeAndNil(FDiaDlg); 3686 if Assigned(FCityDlg) then FreeAndNil(FCityDlg); 3687 if Assigned(FRatesDlg) then FreeAndNil(FRatesDlg); 3688 if Assigned(FBattleDlg) then FreeAndNil(FBattleDlg); 3689 if Assigned(FNatStatDlg) then FreeAndNil(FNatStatDlg); 3690 if Assigned(FUnitStatDlg) then FreeAndNil(FUnitStatDlg); 3691 if Assigned(FDraftDlg) then FreeAndNil(FDraftDlg); 3692 if Assigned(FModalSelectDlg) then FreeAndNil(FModalSelectDlg); 3693 if Assigned(FListDlg) then FreeAndNil(FListDlg); 3694 if Assigned(FMessgExDlg) then FreeAndNil(FMessgExDlg); 3695 if Assigned(FHelpDlg) then FreeAndNil(FHelpDlg); 3696 3634 3697 MainFormKeyDown := nil; 3635 3698 FreeAndNil(sb); … … 4340 4403 end 4341 4404 else if ClientMode < 0 then 4342 skipped := True4405 Skipped := True 4343 4406 else if ClientMode >= scContact then 4344 4407 NegoDlg.ShowNewContent(wmPersistent) … … 4590 4653 ClientMode := -1; 4591 4654 Idle := False; 4592 skipped := WasSkipped;4655 Skipped := WasSkipped; 4593 4656 for p1 := 1 to nPl - 1 do 4594 4657 if G.RO[p1] <> nil then 4595 skipped := True; // don't show enemy moves in hotseat mode4658 Skipped := True; // don't show enemy moves in hotseat mode 4596 4659 end 4597 4660 else … … 4604 4667 NegoDlg.Close; 4605 4668 HaveStrategyAdvice := False; 4606 // AdvisorDlg.HaveStrategyAdvice;4607 // negotiation might have changed advices4608 4669 EOT.ButtonIndex := eotCancel; 4609 4670 EOT.Visible := True; … … 5816 5877 Exit; 5817 5878 5818 if CityDlg.Visible then5879 if Assigned(FCityDlg) and CityDlg.Visible then 5819 5880 CityDlg.Close; 5820 if UnitStatDlg.Visible then5881 if Assigned(FUnitStatDlg) and UnitStatDlg.Visible then 5821 5882 UnitStatDlg.Close; 5822 5883 MouseLoc := LocationOfScreenPixel(X, Y); … … 7381 7442 end; 7382 7443 7444 function TMainScreen.GetBattleDlg: TBattleDlg; 7445 begin 7446 if not Assigned(FBattleDlg) then FBattleDlg := TBattleDlg.Create(nil); 7447 Result := FBattleDlg; 7448 end; 7449 7450 function TMainScreen.GetCityDlg: TCityDlg; 7451 begin 7452 if not Assigned(FCityDlg) then begin 7453 FCityDlg := TCityDlg.Create(nil); 7454 FCityDlg.CheckAge; 7455 end; 7456 Result := FCityDlg; 7457 end; 7458 7459 function TMainScreen.GetCityTypeDlg: TCityTypeDlg; 7460 begin 7461 if not Assigned(FCityTypeDlg) then FCityTypeDlg := TCityTypeDlg.Create(nil); 7462 Result := FCityTypeDlg; 7463 end; 7464 7465 function TMainScreen.GetDiaDlg: TDiaDlg; 7466 begin 7467 if not Assigned(FDiaDlg) then begin 7468 FDiaDlg := TDiaDlg.Create(nil); 7469 ArrangeDialog(FDiaDlg); 7470 end; 7471 Result := FDiaDlg; 7472 end; 7473 7474 function TMainScreen.GetDraftDlg: TDraftDlg; 7475 begin 7476 if not Assigned(FDraftDlg) then FDraftDlg := TDraftDlg.Create(nil); 7477 Result := FDraftDlg; 7478 end; 7479 7480 function TMainScreen.GetEnhanceDlg: TEnhanceDlg; 7481 begin 7482 if not Assigned(FEnhanceDlg) then FEnhanceDlg := TEnhanceDlg.Create(nil); 7483 Result := FEnhanceDlg; 7484 end; 7485 7486 function TMainScreen.GetHelpDlg: THelpDlg; 7487 begin 7488 if not Assigned(FHelpDlg) then begin 7489 FHelpDlg := THelpDlg.Create(nil); 7490 ArrangeDialog(FHelpDlg); 7491 FHelpDlg.Difficulty := G.Difficulty[Me]; 7492 end; 7493 Result := FHelpDlg; 7494 end; 7495 7496 function TMainScreen.GetListDlg: TListDlg; 7497 begin 7498 if not Assigned(FListDlg) then begin 7499 FListDlg := TListDlg.Create(nil); 7500 ArrangeDialog(FListDlg); 7501 end; 7502 Result := FListDlg; 7503 end; 7504 7505 function TMainScreen.GetMessgExDlg: TMessgExDlg; 7506 begin 7507 if not Assigned(FMessgExDlg) then FMessgExDlg := TMessgExDlg.Create(nil); 7508 Result := FMessgExDlg; 7509 end; 7510 7511 function TMainScreen.GetModalSelectDlg: TModalSelectDlg; 7512 begin 7513 if not Assigned(FModalSelectDlg) then FModalSelectDlg := TModalSelectDlg.Create(nil); 7514 Result := FModalSelectDlg; 7515 end; 7516 7517 function TMainScreen.GetNatStatDlg: TNatStatDlg; 7518 begin 7519 if not Assigned(FNatStatDlg) then begin 7520 FNatStatDlg := TNatStatDlg.Create(nil); 7521 ArrangeDialog(FNatStatDlg); 7522 FNatStatDlg.CheckAge; 7523 end; 7524 Result := FNatStatDlg; 7525 end; 7526 7527 function TMainScreen.GetNegoDlg: TNegoDlg; 7528 begin 7529 if not Assigned(FNegoDlg) then FNegoDlg := TNegoDlg.Create(nil); 7530 Result := FNegoDlg; 7531 end; 7532 7533 function TMainScreen.GetRatesDlg: TRatesDlg; 7534 begin 7535 if not Assigned(FRatesDlg) then FRatesDlg := TRatesDlg.Create(nil); 7536 Result := FRatesDlg; 7537 end; 7538 7539 function TMainScreen.GetTechTreeDlg: TTechTreeDlg; 7540 begin 7541 if not Assigned(FTechTreeDlg) then FTechTreeDlg := TTechTreeDlg.Create(nil); 7542 Result := FTechTreeDlg; 7543 end; 7544 7383 7545 procedure TMainScreen.mDisbandOrUtilizeClick(Sender: TObject); 7384 7546 var … … 8177 8339 end; 8178 8340 8179 { procedure TMainScreen.AdviceBtnClick;8180 var8181 OldAdviceLoc: Integer;8182 begin8183 DestinationMarkON:=False;8184 PaintDestination;8185 AdvisorDlg.GiveStrategyAdvice;8186 OldAdviceLoc:=MainMap.AdviceLoc;8187 MainMap.AdviceLoc:=-1;8188 PaintLoc(OldAdviceLoc);8189 end; }8190 8191 { procedure TMainScreen.SetAdviceLoc(Loc: integer; AvoidRect: TRect);8192 var8193 OldAdviceLoc,X,Y: Integer;8194 begin8195 if Loc<>MainMap.AdviceLoc then8196 begin8197 if Loc>=0 then8198 begin // center8199 Y:=Loc div G.lx;8200 X:=(Loc+G.lx - AvoidRect.Right div (2*66)) mod G.lx;8201 Centre(Y*G.lx+X);8202 PaintAllMaps;8203 end;8204 OldAdviceLoc:=MainMap.AdviceLoc;8205 MainMap.AdviceLoc:=Loc;8206 PaintLoc(OldAdviceLoc);8207 PaintLoc(MainMap.AdviceLoc);8208 end;8209 end; }8210 8211 8341 procedure TMainScreen.UnitInfoBtnClick(Sender: TObject); 8212 8342 begin … … 8294 8424 end; 8295 8425 8426 procedure TMainScreen.ArrangeDialogs; 8427 begin 8428 ArrangeDialog(FListDlg); 8429 ArrangeDialog(FHelpDlg); 8430 ArrangeDialog(FUnitStatDlg); 8431 ArrangeDialog(FDiaDlg); 8432 ArrangeDialog(FNatStatDlg); 8433 end; 8434 8435 procedure TMainScreen.ArrangeDialog(Form: TBufferedDrawDlg); 8436 begin 8437 if not Assigned(Form) then Exit; 8438 8439 if Form is TListDlg then begin; 8440 ListDlg.UserLeft := 8; 8441 ListDlg.UserTop := TopBarHeight + 8; 8442 end; 8443 if Form is THelpDlg then begin 8444 HelpDlg.UserLeft := Screen.Width - HelpDlg.Width - 8; 8445 HelpDlg.UserTop := TopBarHeight + 8; 8446 end; 8447 if Form is TUnitStatDlg then begin 8448 UnitStatDlg.UserLeft := 397; 8449 UnitStatDlg.UserTop := TopBarHeight + 64; 8450 end; 8451 if Form is TDiaDlg then begin 8452 DiaDlg.UserLeft := (Screen.Width - DiaDlg.Width) div 2; 8453 DiaDlg.UserTop := (Screen.Height - DiaDlg.Height) div 2; 8454 end; 8455 if Form is TNatStatDlg then begin 8456 NatStatDlg.UserLeft := Screen.Width - NatStatDlg.Width - 8; 8457 NatStatDlg.UserTop := Screen.Height - PanelHeight - NatStatDlg.Height - 8; 8458 if NatStatDlg.UserTop < 8 then 8459 NatStatDlg.UserTop := 8; 8460 end; 8461 end; 8462 8296 8463 procedure TMainScreen.ScrollBarUpdate(Sender: TObject); 8297 8464 begin -
trunk/LocalPlayer/UnitStat.pas
r456 r460 5 5 6 6 uses 7 Protocol, ClientTools, Term, ScreenTools, BaseWin, 8 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, 9 ButtonB, ButtonC, IsoEngine; 7 Protocol, ClientTools, ScreenTools, BaseWin, LCLIntf, LCLType, SysUtils, 8 Classes, Graphics, Controls, Forms, ButtonB, ButtonC, IsoEngine; 10 9 11 10 type 11 TUnitStatDialogKind = (dkOwnModel, dkOwnUnit, dkEnemyModel, dkEnemyUnit, 12 dkEnemyCityDefense, dkEnemyCity); 13 12 14 TUnitStatDlg = class(TBufferedDrawDlg) 13 15 SwitchBtn: TButtonB; … … 26 28 private 27 29 NoMap: TIsoMap; 30 protected 31 mixShow, // for dkOwnModel 32 uixShow, euixShow, ecixShow, UnitLoc, AgePrepared: Integer; 33 // for dkEnemyUnit, euixShow=-1 -> 34 mox: ^TModelInfo; // for dkEnemyModel 35 Kind: TUnitStatDialogKind; 36 Back: TBitmap; 37 Template: TBitmap; 38 procedure OffscreenPaint; override; 28 39 public 29 40 procedure CheckAge; … … 34 45 procedure ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: Integer); 35 46 procedure ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: Integer); 36 37 protected 38 mixShow, // for dkOwnModel 39 uixShow, euixShow, ecixShow, UnitLoc, AgePrepared: Integer; 40 // for dkEnemyUnit, euixShow=-1 -> 41 mox: ^TModelInfo; // for dkEnemyModel 42 Kind: (dkOwnModel, dkOwnUnit, dkEnemyModel, dkEnemyUnit, dkEnemyCityDefense, 43 dkEnemyCity); 44 Back, Template: TBitmap; 45 procedure OffscreenPaint; override; 46 end; 47 48 var 49 UnitStatDlg: TUnitStatDlg; 47 end; 48 50 49 51 50 implementation 52 51 53 52 uses 54 T ribes, Help, Directories, Texture;53 Term, Tribes, Help, Directories, Texture; 55 54 56 55 {$R *.lfm} … … 82 81 Back.PixelFormat := pf24bit; 83 82 Back.SetSize(5 * wCommon, hMax); 84 Back.Canvas.FillRect(0, 0, Back.Width, Back.Height);83 Back.Canvas.FillRect(0, 0, Back.Width, Back.Height); 85 84 Template := TBitmap.Create; 86 85 Template.PixelFormat := pf24bit; … … 121 120 procedure TUnitStatDlg.FormShow(Sender: TObject); 122 121 var 123 owner, mix: Integer;122 Owner, mix: Integer; 124 123 IsSpecialUnit: Boolean; 125 124 begin … … 138 137 begin 139 138 mox := @MyRO.EnemyModel[emix]; 140 if not Assigned(Tribe[ owner].ModelPicture[mix].HGr) then139 if not Assigned(Tribe[Owner].ModelPicture[mix].HGr) then 141 140 InitEnemyModel(emix); 142 end 141 end; 143 142 end 144 143 else … … 153 152 end; 154 153 case Kind of 155 dkOwnModel: 156 ClientHeight := hOwnModel; 157 dkOwnUnit: 158 ClientHeight := hEnemyUnit; 159 dkEnemyModel: 160 ClientHeight := hEnemyModel; 161 dkEnemyUnit: 162 ClientHeight := hEnemyUnit; 163 dkEnemyCityDefense: 164 ClientHeight := hEnemyCityDefense; 165 dkEnemyCity: 166 ClientHeight := hEnemyCity; 154 dkOwnModel: ClientHeight := hOwnModel; 155 dkOwnUnit: ClientHeight := hEnemyUnit; 156 dkEnemyModel: ClientHeight := hEnemyModel; 157 dkEnemyUnit: ClientHeight := hEnemyUnit; 158 dkEnemyCityDefense: ClientHeight := hEnemyCityDefense; 159 dkEnemyCity: ClientHeight := hEnemyCity; 167 160 end; 168 161 … … 171 164 Left := UserLeft; 172 165 Top := UserTop; 173 end 174 else 175 begin 166 end else begin 176 167 Left := (Screen.Width - Width) div 2; 177 168 Top := (Screen.Height - Height) div 2; … … 188 179 begin 189 180 case Kind of 190 dkOwnModel: 191 begin 192 owner := Me; 193 mix := mixShow; 194 IsSpecialUnit := MyModel[mix].Kind >= $10; 195 end; 196 dkOwnUnit: 197 begin 198 owner := Me; 199 mix := MyUn[uixShow].mix; 200 IsSpecialUnit := MyModel[mix].Kind >= $10; 201 end 202 else 203 begin 204 owner := mox.owner; 181 dkOwnModel: begin 182 Owner := Me; 183 mix := mixShow; 184 IsSpecialUnit := MyModel[mix].Kind >= $10; 185 end; 186 dkOwnUnit: begin 187 Owner := Me; 188 mix := MyUn[uixShow].mix; 189 IsSpecialUnit := MyModel[mix].Kind >= $10; 190 end; 191 else begin 192 Owner := mox.Owner; 205 193 mix := mox.mix; 206 194 IsSpecialUnit := mox.Kind >= $10; … … 271 259 begin 272 260 UserLeft := Left; 273 UserTop := Top 274 end; 275 if OffscreenUser = self then261 UserTop := Top; 262 end; 263 if OffscreenUser = Self then 276 264 OffscreenUser := nil; 277 265 end; … … 343 331 mcFirstNonCap .. nFeature - 1: 344 332 if mi.Cap and (1 shl (I - mcFirstNonCap)) <> 0 then 345 num := 1 333 num := 1; 346 334 end; 347 335 if (num > 0) and … … 357 345 Brush.Style := bsClear; 358 346 Textout(X - 3 + dx + 1, Y, S); 359 Inc(dx, W + 1) 347 Inc(dx, W + 1); 360 348 end; 361 349 Brush.Color := $C0C0C0; … … 364 352 Sprite(dst, HGrSystem, X - 1 + dx, Y + 4, 10, 10, 365 353 66 + I mod 11 * 11, 137 + I div 11 * 11); 366 Inc(dx, 15) 354 Inc(dx, 15); 367 355 end; 368 356 end; 369 357 end; 370 end; { featurebar }358 end; 371 359 372 360 procedure NumberBarS(dst: TBitmap; X, Y: Integer; Cap, S: string; T: TTexture); … … 387 375 388 376 case Kind of 389 dkOwnModel: 390 begin 391 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hOwnModel, 392 Back.Canvas, 0, 0); 393 yView := 13; 394 yTotal := 92; 395 end; 396 dkEnemyModel: 397 begin 398 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyModel, 399 Back.Canvas, wCommon, 0); 400 yView := 13; 401 yTotal := 92; 402 end; 403 dkEnemyUnit, dkOwnUnit: 404 begin 405 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyUnit, 406 Back.Canvas, 2 * wCommon, 0); 407 yView := 13; 408 yTotal := 123; 409 end; 410 dkEnemyCityDefense: 411 begin 412 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyCityDefense, 413 Back.Canvas, 3 * wCommon, 0); 414 yView := 171; 415 yTotal := 231; 416 end; 417 dkEnemyCity: 418 begin 419 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyCity, 420 Back.Canvas, 4 * wCommon, 0); 421 end; 377 dkOwnModel: begin 378 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hOwnModel, 379 Back.Canvas, 0, 0); 380 yView := 13; 381 yTotal := 92; 382 end; 383 dkEnemyModel: begin 384 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyModel, 385 Back.Canvas, wCommon, 0); 386 yView := 13; 387 yTotal := 92; 388 end; 389 dkEnemyUnit, dkOwnUnit: begin 390 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyUnit, 391 Back.Canvas, 2 * wCommon, 0); 392 yView := 13; 393 yTotal := 123; 394 end; 395 dkEnemyCityDefense: begin 396 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyCityDefense, 397 Back.Canvas, 3 * wCommon, 0); 398 yView := 171; 399 yTotal := 231; 400 end; 401 dkEnemyCity: begin 402 BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyCity, 403 Back.Canvas, 4 * wCommon, 0); 404 end; 422 405 end; 423 406 MarkUsedOffscreen(ClientWidth, ClientHeight); … … 438 421 1: J := imCoastalFort; 439 422 2: J := imMissileBat; 440 3: J := imBunker 423 3: J := imBunker; 441 424 end; 442 425 Frame(Offscreen.Canvas, X - 1, yImp - 1, X + xSizeSmall, … … 734 717 procedure TUnitStatDlg.HelpBtnClick(Sender: TObject); 735 718 begin 736 HelpDlg.ShowNewContent(wmPersistent, hkModel, 0);719 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkModel, 0); 737 720 end; 738 721 -
trunk/LocalPlayer/Wonders.pas
r456 r460 30 30 procedure ShowNewContent(NewMode: TWindowMode); 31 31 end; 32 33 var34 WondersDlg: TWondersDlg;35 32 36 33 … … 351 348 begin 352 349 if Selection >= 0 then 353 HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, Selection);350 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, Selection); 354 351 end; 355 352
Note:
See TracChangeset
for help on using the changeset viewer.