Ignore:
Timestamp:
Jan 13, 2026, 4:01:26 PM (8 weeks ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Nego.pas

    r674 r725  
    715715  A, I, Max: Integer;
    716716  Price: Cardinal;
     717  InputDlg: TInputDlg;
    717718begin
    718719  if (Page <> History[Me].N) or (ClientMode = scDipCancelTreaty) or
     
    737738      opMoney:
    738739        begin // choose amount
    739           InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
    740           InputDlg.EditInput.Text := '';
    741           InputDlg.CenterToRect(BoundsRect);
    742           InputDlg.ShowModal;
    743           if InputDlg.ModalResult <> mrOK then
    744             Exit;
    745           Val(InputDlg.EditInput.Text, A, I);
    746           if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
    747             Exit;
    748           Inc(Price, A);
     740          InputDlg := TInputDlg.Create(nil);
     741          try
     742            InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
     743            InputDlg.EditInput.Text := '';
     744            InputDlg.CenterToRect(BoundsRect);
     745            InputDlg.ShowModal;
     746            if InputDlg.ModalResult <> mrOK then
     747              Exit;
     748            Val(InputDlg.EditInput.Text, A, I);
     749            if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
     750              Exit;
     751            Inc(Price, A);
     752          finally
     753            InputDlg.Free;
     754          end;
    749755        end;
    750756      opShipParts:
     
    828834  A, I, Max: Integer;
    829835  Price: Cardinal;
     836  InputDlg: TInputDlg;
    830837begin
    831838  if (Page <> History[Me].N) or (ClientMode = scDipCancelTreaty) or
     
    849856      opMoney:
    850857        begin // choose amount
    851           InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
    852           InputDlg.EditInput.Text := '';
    853           InputDlg.CenterToRect(BoundsRect);
    854           InputDlg.ShowModal;
    855           if InputDlg.ModalResult <> mrOK then
    856             Exit;
    857           Val(InputDlg.EditInput.Text, A, I);
    858           if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
    859             Exit;
    860           if (Price = opMoney) and (A > MyRO.Money) then
    861             A := MyRO.Money;
    862           Inc(Price, A);
     858          InputDlg := TInputDlg.Create(nil);
     859          try
     860            InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
     861            InputDlg.EditInput.Text := '';
     862            InputDlg.CenterToRect(BoundsRect);
     863            InputDlg.ShowModal;
     864            if InputDlg.ModalResult <> mrOK then
     865              Exit;
     866            Val(InputDlg.EditInput.Text, A, I);
     867            if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
     868              Exit;
     869            if (Price = opMoney) and (A > MyRO.Money) then
     870              A := MyRO.Money;
     871            Inc(Price, A);
     872          finally
     873            InputDlg.Free;
     874          end;
    863875        end;
    864876      opShipParts:
     
    869881          Inc(Price, MainScreen.ModalSelectDlg.Result shl 16);
    870882          Max := MyRO.Ship[Me].Parts[MainScreen.ModalSelectDlg.Result];
    871           InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER');
    872           InputDlg.EditInput.Text := '';
    873           InputDlg.CenterToRect(BoundsRect);
    874           Gtk2Fix;
    875           InputDlg.ShowModal;
    876           if InputDlg.ModalResult <> mrOK then
    877             Exit;
    878           Val(InputDlg.EditInput.Text, A, I);
    879           if (I <> 0) or (A <= 0) then
    880             Exit;
    881           if A > Max then
    882             A := Max;
    883           if A > MaxShipPartPrice then
    884             A := MaxShipPartPrice;
    885           Inc(Price, A);
     883          InputDlg := TInputDlg.Create(nil);
     884          try
     885            InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER');
     886            InputDlg.EditInput.Text := '';
     887            InputDlg.CenterToRect(BoundsRect);
     888            Gtk2Fix;
     889            InputDlg.ShowModal;
     890            if InputDlg.ModalResult <> mrOK then
     891              Exit;
     892            Val(InputDlg.EditInput.Text, A, I);
     893            if (I <> 0) or (A <= 0) then
     894              Exit;
     895            if A > Max then
     896              A := Max;
     897            if A > MaxShipPartPrice then
     898              A := MaxShipPartPrice;
     899            Inc(Price, A);
     900          finally
     901            InputDlg.Free;
     902          end;
    886903        end;
    887904      opAllTech:
Note: See TracChangeset for help on using the changeset viewer.