Changeset 460 for trunk/LocalPlayer/Nego.pas
- Timestamp:
- Nov 28, 2023, 3:16:24 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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:
Note:
See TracChangeset
for help on using the changeset viewer.