Changeset 281
- Timestamp:
- Sep 30, 2020, 11:17:11 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/CityScreen.pas
r227 r281 1397 1397 1398 1398 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; 1399 type 1400 TProjectType = ( 1401 ptSelect = 0, 1402 ptTrGoods = 1, 1403 ptUn = 2, 1404 ptCaravan = 3, 1405 ptImp = 4, 1406 ptWonder = 6, 1407 ptShip = 7, 1408 ptInvalid = 8 1409 ); 1410 1411 function ProjectType(Project: integer): TProjectType; 1410 1412 begin 1411 1413 if Project and cpCompleted <> 0 then 1412 result := ptSelect1414 Result := ptSelect 1413 1415 else if Project and (cpImp + cpIndex) = cpImp + imTrGoods then 1414 result := ptTrGoods1415 else if Project and cpImp = 0 then 1416 Result := ptTrGoods 1417 else if Project and cpImp = 0 then begin 1416 1418 if MyModel[Project and cpIndex].Kind = mkCaravan then 1417 result := ptCaravan1418 else 1419 result := ptUn1419 Result := ptCaravan 1420 else Result := ptUn; 1421 end 1420 1422 else if Project and cpIndex >= nImp then 1421 result := ptInvalid1423 Result := ptInvalid 1422 1424 else if Imp[Project and cpIndex].Kind = ikWonder then 1423 result := ptWonder1425 Result := ptWonder 1424 1426 else if Imp[Project and cpIndex].Kind = ikShipPart then 1425 result := ptShip1426 else 1427 result := ptImp1427 Result := ptShip 1428 else 1429 Result := ptImp; 1428 1430 end; 1429 1431 1430 1432 var 1431 NewProject, OldMoney, pt0, pt1, cix1: integer; 1433 NewProject, OldMoney, cix1: integer; 1434 pt0, pt1: TProjectType; 1432 1435 QueryOk: boolean; 1433 1436 begin 1434 assert(not supervising);1437 Assert(not supervising); 1435 1438 ModalSelectDlg.ShowNewContent_CityProject(wmModal, cix); 1436 1439 if ModalSelectDlg.result <> -1 then … … 1444 1447 else 1445 1448 begin 1446 NewProject := ModalSelectDlg. result;1447 QueryOk := true;1449 NewProject := ModalSelectDlg.Result; 1450 QueryOk := True; 1448 1451 if (NewProject and cpImp <> 0) and (NewProject and cpIndex >= 28) and 1449 1452 (MyRO.NatBuilt[NewProject and cpIndex] > 0) then … … 1453 1456 while (cix1 >= 0) and 1454 1457 (MyCity[cix1].Built[NewProject and cpIndex] = 0) do 1455 dec(cix1);1458 Dec(cix1); 1456 1459 MessgText := Format(Phrases.Lookup('DOUBLESTATEIMP'), 1457 1460 [Phrases.Lookup('IMPROVEMENTS', NewProject and cpIndex), … … 1465 1468 end; 1466 1469 if not QueryOk then 1467 exit;1470 Exit; 1468 1471 1469 1472 if (MyCity[cix].Prod > 0) then … … 1482 1485 MyCity[cix].Prod0]), 'MSG_DEFAULT') = mrOK 1483 1486 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 1487 .Project0 and (cpImp or cpIndex) then begin 1488 Application.ProcessMessages; // TODO: Needed for Gtk2, Lazarus gtk2 bug? 1489 QueryOk := SimpleQuery(mkOkCancel, Phrases.Lookup('LOSEMAT3'), 1490 'MSG_DEFAULT') = mrOK; 1491 end; 1487 1492 end; 1488 1493 end; 1489 1494 end; 1490 1495 if not QueryOk then 1491 exit;1496 Exit; 1492 1497 1493 1498 OldMoney := MyRO.Money;
Note:
See TracChangeset
for help on using the changeset viewer.