- Timestamp:
- Sep 14, 2024, 11:02:08 AM (3 months ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/CityScreen.pas
r592 r613 144 144 hZoomMap = 124; 145 145 wZoomEnvironment = 68; 146 CaptionX = 42; 147 CaptionY = 7; 146 148 147 149 ImpPosition: array [28 .. nImp - 1] of Integer = ( … … 408 410 begin 409 411 Assert(cix < 0); 410 Exit 412 Exit; 411 413 end; 412 414 Total := TileInfo.Food + TileInfo.Prod + TileInfo.Trade; … … 444 446 end; 445 447 var 446 Line, MessageCount: Integer; 448 Line: Integer; 449 MessageCount: Integer; 447 450 448 451 procedure CheckMessage(Flag: Integer); … … 472 475 473 476 S := CityEventName(I); 474 { if Flag =chNoGrowthWarning then475 if C.Built[imAqueduct] =0 then476 S :=Format(S,[Phrases.Lookup('IMPROVEMENTS',imAqueduct)])477 else S :=Format(S,[Phrases.Lookup('IMPROVEMENTS',imSewer)]); }477 { if Flag = chNoGrowthWarning then 478 if C.Built[imAqueduct] = 0 then 479 S := Format(S, [Phrases.Lookup('IMPROVEMENTS', imAqueduct)]) 480 else S := Format(S, [Phrases.Lookup('IMPROVEMENTS', imSewer)]); } 478 481 RisedTextOut(Offscreen.Canvas, xmOpt + 40, ymOpt - 1 - 8 * MessageCount + 479 482 16 * Line, S); … … 528 531 BitBltBitmap(Offscreen, 0, 0, 640, 480, Back, 0, 0); 529 532 533 // Show city size and name 530 534 Offscreen.Canvas.Font.Assign(UniFont[ftCaption]); 531 RisedTextOut(Offscreen.Canvas, 42, 7, Caption); 532 with Offscreen.Canvas do 533 begin // city size 535 536 S := Caption; 537 J := Offscreen.Canvas.TextWidth('...'); 538 if (Length(S) > 1) and (Offscreen.Canvas.TextWidth(S) > PrevCityBtn.Left - CaptionX) then begin 539 while (Length(S) > 1) and (Offscreen.Canvas.TextWidth(S) > PrevCityBtn.Left - CaptionX - J) do 540 SetLength(S, Length(S) - 1); 541 S := S + '...'; 542 end; 543 544 RisedTextOut(Offscreen.Canvas, CaptionX, CaptionY, S); 545 with Offscreen.Canvas do begin // city size 534 546 Brush.Color := $000000; 535 547 FillRect(Rect(8 + 1, 7 + 1, 36 + 1, 32 + 1)); … … 1161 1173 Exit; // Not an own city 1162 1174 1175 if (ssRight in Shift) then begin 1176 // Allow to rename city with right mouse click 1177 if (X >= CaptionX) and (Y >= CaptionY) and (X <= PrevCityBtn.Left) and 1178 (Y <= NextCityBtn.Top + NextCityBtn.Height) then 1179 if Term.MainScreen.ListDlg.RenameCity(cix) then begin 1180 SmartUpdateContent; 1181 Term.MainScreen.RepaintAll; 1182 end; 1183 end else 1163 1184 if (ssLeft in Shift) then 1164 1185 if (ClientMode < scContact) and (X >= xView) and (Y >= yView) and … … 1249 1270 ShowModal; 1250 1271 if ModalResult <> mrOK then 1251 iix := -1 1272 iix := -1; 1252 1273 end 1253 1274 else … … 1270 1291 ShowModal; 1271 1292 if ModalResult <> mrOK then 1272 iix := -1 1293 iix := -1; 1273 1294 end; 1274 1295 if iix >= 0 then -
trunk/LocalPlayer/Diplomacy.pas
r468 r613 29 29 Result := Tribe[P].TPhrase('PRICE_MAP'); 30 30 opTreaty: 31 { if Price -opTreaty<Treaty then31 { if Price - opTreaty < Treaty then 32 32 case Treaty of 33 trPeace: Result:=Phrases.Lookup('FRENDTREATY_PEACE');34 trFriendlyContact: Result:=Phrases.Lookup('FRENDTREATY_FRIENDLY');35 trAlliance: Result:=Phrases.Lookup('FRENDTREATY_ALLIANCE');33 trPeace: Result := Phrases.Lookup('FRENDTREATY_PEACE'); 34 trFriendlyContact: Result := Phrases.Lookup('FRENDTREATY_FRIENDLY'); 35 trAlliance: Result := Phrases.Lookup('FRENDTREATY_ALLIANCE'); 36 36 end 37 37 else } Result := Phrases.Lookup('TREATY', Price - opTreaty); … … 61 61 Result := Tribe[P].TPhrase('PRICE_ALLMODEL'); 62 62 { opCity: 63 Result :=Format(TPhrase('PRICE_CITY',P),[CityName(Price-opCity)]); }64 end 63 Result := Format(TPhrase('PRICE_CITY', P), [CityName(Price - opCity)]); } 64 end; 65 65 end; 66 66 … … 92 92 (Integer(OppOffer.Price[0] - opTreaty) > Treaty) then 93 93 // simple treaty offer 94 { if OppOffer.Price[0] -opTreaty=trCeaseFire then95 Result :=Tribe[pTarget].TPhrase('FRACCEPTCEASEFIRE')94 { if OppOffer.Price[0] - opTreaty = trCeaseFire then 95 Result := Tribe[pTarget].TPhrase('FRACCEPTCEASEFIRE') 96 96 else } Result := Tribe[pTarget].TPhrase('FRACCEPTTREATY') 97 97 else if OppOffer.nDeliver = 0 then … … 132 132 sDeliver := sAdd 133 133 else 134 sDeliver := Format(Phrases.Lookup('PRICE_CONCAT'), [sDeliver, sAdd]) 134 sDeliver := Format(Phrases.Lookup('PRICE_CONCAT'), [sDeliver, sAdd]); 135 135 end; 136 136 sCost := ''; … … 141 141 sCost := sAdd 142 142 else 143 sCost := Format(Phrases.Lookup('PRICE_CONCAT'), [sCost, sAdd]) 143 sCost := Format(Phrases.Lookup('PRICE_CONCAT'), [sCost, sAdd]); 144 144 end; 145 145 … … 167 167 end; 168 168 Result := Result + Phrases.Lookup('FRDONE'); 169 DoIntro := False 170 end 169 DoIntro := False; 170 end; 171 171 end 172 172 else if (Offer.nDeliver + Offer.nCost = 1) and … … 183 183 trAlliance: 184 184 Result := Result + Tribe[pTarget].TPhrase('FRALLIANCE'); 185 end 185 end; 186 186 end 187 187 else if Offer.nDeliver = 0 then // demand … … 196 196 Result := Result + 197 197 Format(Tribe[pTarget].TPhrase('FRDEMAND_STRONG'), [sCost]); 198 DoIntro := False 199 end 198 DoIntro := False; 199 end; 200 200 end 201 201 else if Offer.nCost = 0 then // present … … 216 216 Result := Tribe[pSender].TPhrase('FRSTART_NOTREATY') + ' ' + Result 217 217 else 218 Result := Tribe[pSender].TPhrase('FRSTART_PEACE') + ' ' + Result 218 Result := Tribe[pSender].TPhrase('FRSTART_PEACE') + ' ' + Result; 219 219 end; 220 220 -
trunk/LocalPlayer/Select.pas
r558 r613 69 69 procedure InitLines; 70 70 procedure Line(ca: TCanvas; L: Integer; NonText, lit: Boolean); 71 function RenameCity(cix: Integer): Boolean;72 71 function RenameModel(mix: Integer): Boolean; 73 72 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; … … 75 74 public 76 75 Result: Integer; 76 function RenameCity(cix: Integer): Boolean; 77 77 function OnlyChoice(TestKind: TListKind): Integer; 78 78 // -2=empty, -1=ambiguous, other=only choice … … 248 248 if ScrollBar.Position + L >= FirstShrinkedLine[Layer] then 249 249 ofs := (ScrollBar.Position + L - FirstShrinkedLine[Layer]) and 1 * 33 250 else { if FirstShrinkedLine[Layer] <Lines[Layer] then }250 else { if FirstShrinkedLine[Layer] < Lines[Layer] then } 251 251 ofs := 33; 252 252 … … 973 973 case Kind of 974 974 kCities, kCityEvents: 975 if RenameCity(lix) then 975 if RenameCity(lix) then begin 976 976 SmartUpdateContent; 977 Term.MainScreen.RepaintAll; 978 end; 977 979 kModels: 978 if RenameModel(lix) then 980 if RenameModel(lix) then begin 979 981 SmartUpdateContent; 982 Term.MainScreen.RepaintAll; 983 end; 980 984 end; 981 985 end; -
trunk/LocalPlayer/Term.pas
r612 r613 442 442 procedure UpdateViews(UpdateCityScreen: Boolean = False); 443 443 function ContactRefused(P: Integer; Item: String): Boolean; 444 procedure RepaintAll; 444 445 // Forms 445 446 property WondersDlg: TWondersDlg read GetWondersDlg; … … 4406 4407 MessgText := Format(Phrases.Lookup(MsgItem), [CityName(ID)]); 4407 4408 Kind := mkYesNo; 4408 // BigIcon :=29;4409 // BigIcon := 29; 4409 4410 ShowModal; 4410 4411 Zoom := ModalResult <> mrOK; … … 4787 4788 MiniMapPaint; 4788 4789 PanelPaint; 4790 end; 4791 4792 procedure TMainScreen.RepaintAll; 4793 begin 4794 RectInvalidate(0, TopBarHeight, Width, TopBarHeight + MapHeight); 4795 MapValid := False; 4796 PaintAll; 4789 4797 end; 4790 4798 … … 8378 8386 ManagementArea.Top := TopBarHeight + MapHeight - Overlap + yPalace; 8379 8387 ArrangeMidPanel; 8380 if RepaintOnResize then begin 8381 RectInvalidate(0, TopBarHeight, Width, TopBarHeight + MapHeight); 8382 MapValid := False; 8383 PaintAll; 8384 end; 8388 if RepaintOnResize then RepaintAll; 8385 8389 end; 8386 8390
Note:
See TracChangeset
for help on using the changeset viewer.