Changeset 613 for trunk/LocalPlayer/CityScreen.pas
- Timestamp:
- Sep 14, 2024, 11:02:08 AM (2 months ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.