Changeset 303 for branches/highdpi/LocalPlayer/CityScreen.pas
- Timestamp:
- Mar 9, 2021, 9:19:49 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/CityScreen.pas
r246 r303 216 216 Template := TDpiBitmap.Create; 217 217 Template.PixelFormat := pf24bit; 218 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'City.png', gfNoGamma); 218 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'City.png', 219 [gfNoGamma]); 219 220 CityMapTemplate := TDpiBitmap.Create; 220 221 CityMapTemplate.PixelFormat := pf24bit; 221 LoadGraphicFile(CityMapTemplate, GetGraphicsDir + DirectorySeparator + 'BigCityMap.png', gfNoGamma); 222 LoadGraphicFile(CityMapTemplate, GetGraphicsDir + DirectorySeparator + 'BigCityMap.png', 223 [gfNoGamma]); 222 224 SmallCityMapTemplate := TDpiBitmap.Create; 223 225 SmallCityMapTemplate.PixelFormat := pf24bit; 224 226 LoadGraphicFile(SmallCityMapTemplate, GetGraphicsDir + DirectorySeparator + 'SmallCityMap.png', 225 gfNoGamma);227 [gfNoGamma]); 226 228 SmallCityMap := TDpiBitmap.Create; 227 229 SmallCityMap.PixelFormat := pf24bit; … … 1397 1399 1398 1400 procedure TCityDlg.ChooseProject; 1399 const 1400 ptSelect = 0; 1401 ptTrGoods = 1; 1402 ptUn = 2; 1403 ptCaravan = 3; 1404 ptImp = 4; 1405 ptWonder = 6; 1406 ptShip = 7; 1407 ptInvalid = 8; 1408 1409 function ProjectType(Project: integer): integer; 1401 type 1402 TProjectType = ( 1403 ptSelect = 0, 1404 ptTrGoods = 1, 1405 ptUn = 2, 1406 ptCaravan = 3, 1407 ptImp = 4, 1408 ptWonder = 6, 1409 ptShip = 7, 1410 ptInvalid = 8 1411 ); 1412 1413 function ProjectType(Project: integer): TProjectType; 1410 1414 begin 1411 1415 if Project and cpCompleted <> 0 then 1412 result := ptSelect1416 Result := ptSelect 1413 1417 else if Project and (cpImp + cpIndex) = cpImp + imTrGoods then 1414 result := ptTrGoods1415 else if Project and cpImp = 0 then 1418 Result := ptTrGoods 1419 else if Project and cpImp = 0 then begin 1416 1420 if MyModel[Project and cpIndex].Kind = mkCaravan then 1417 result := ptCaravan1418 else 1419 result := ptUn1421 Result := ptCaravan 1422 else Result := ptUn; 1423 end 1420 1424 else if Project and cpIndex >= nImp then 1421 result := ptInvalid1425 Result := ptInvalid 1422 1426 else if Imp[Project and cpIndex].Kind = ikWonder then 1423 result := ptWonder1427 Result := ptWonder 1424 1428 else if Imp[Project and cpIndex].Kind = ikShipPart then 1425 result := ptShip1426 else 1427 result := ptImp1429 Result := ptShip 1430 else 1431 Result := ptImp; 1428 1432 end; 1429 1433 1430 1434 var 1431 NewProject, OldMoney, pt0, pt1, cix1: integer; 1435 NewProject, OldMoney, cix1: integer; 1436 pt0, pt1: TProjectType; 1432 1437 QueryOk: boolean; 1433 1438 begin 1434 assert(not supervising);1439 Assert(not supervising); 1435 1440 ModalSelectDlg.ShowNewContent_CityProject(wmModal, cix); 1436 1441 if ModalSelectDlg.result <> -1 then … … 1444 1449 else 1445 1450 begin 1446 NewProject := ModalSelectDlg. result;1447 QueryOk := true;1451 NewProject := ModalSelectDlg.Result; 1452 QueryOk := True; 1448 1453 if (NewProject and cpImp <> 0) and (NewProject and cpIndex >= 28) and 1449 1454 (MyRO.NatBuilt[NewProject and cpIndex] > 0) then … … 1453 1458 while (cix1 >= 0) and 1454 1459 (MyCity[cix1].Built[NewProject and cpIndex] = 0) do 1455 dec(cix1);1460 Dec(cix1); 1456 1461 MessgText := Format(Phrases.Lookup('DOUBLESTATEIMP'), 1457 1462 [Phrases.Lookup('IMPROVEMENTS', NewProject and cpIndex), … … 1465 1470 end; 1466 1471 if not QueryOk then 1467 exit;1472 Exit; 1468 1473 1469 1474 if (MyCity[cix].Prod > 0) then … … 1476 1481 (cpImp or cpIndex) then 1477 1482 begin // loss of material -- do query 1483 DpiApplication.ProcessMessages; // TODO: Needed for Gtk2, Lazarus gtk2 bug? 1478 1484 if (pt1 = ptTrGoods) or (pt1 = ptShip) or (pt1 <> pt0) and 1479 (pt0 <> ptCaravan) then 1485 (pt0 <> ptCaravan) then begin 1480 1486 QueryOk := SimpleQuery(mkOkCancel, 1481 1487 Format(Phrases.Lookup('LOSEMAT'), [MyCity[cix].Prod0, 1482 1488 MyCity[cix].Prod0]), 'MSG_DEFAULT') = mrOK 1483 else if MyCity[cix].Project and (cpImp or cpIndex) = MyCity[cix] 1484 .Project0 and (cpImp or cpIndex) then 1485 QueryOk := SimpleQuery(mkOkCancel, Phrases.Lookup('LOSEMAT3'), 1486 'MSG_DEFAULT') = mrOK 1489 end else 1490 if MyCity[cix].Project and (cpImp or cpIndex) = MyCity[cix] 1491 .Project0 and (cpImp or cpIndex) then begin 1492 QueryOk := SimpleQuery(mkOkCancel, Phrases.Lookup('LOSEMAT3'), 1493 'MSG_DEFAULT') = mrOK; 1494 end; 1487 1495 end; 1488 1496 end; 1489 1497 end; 1490 1498 if not QueryOk then 1491 exit;1499 Exit; 1492 1500 1493 1501 OldMoney := MyRO.Money;
Note:
See TracChangeset
for help on using the changeset viewer.