Changeset 531
- Timestamp:
- Mar 27, 2024, 12:31:14 PM (8 months ago)
- Location:
- trunk
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/AI.pas
r522 r531 93 93 TPersistentData = record 94 94 LastResearchTech, BehaviorFlags, TheologyPartner: Integer; 95 RejectTurn: array[Suggestion, 0..15] of smallint;95 RejectTurn: array[Suggestion, 0..15] of SmallInt; 96 96 RequestedTechs: array[0..nRequestedTechs - 1] of Integer; 97 97 // ad + p shl 8 + Turn shl 16 … … 196 196 else 197 197 BehaviorFlags := bMale; 198 DebugMessage(1, 'Gender:=' + char(48 + BehaviorFlags and bGender));198 DebugMessage(1, 'Gender:=' + Char(48 + BehaviorFlags and bGender)); 199 199 TheologyPartner := -1; 200 200 FillChar(RejectTurn, SizeOf(RejectTurn), $FF); 201 Fill char(RequestedTechs, SizeOf(RequestedTechs), $FF);201 FillChar(RequestedTechs, SizeOf(RequestedTechs), $FF); 202 202 end; 203 203 end; … … 324 324 mi: TModelInfo; 325 325 Entry: array[0..nAdv - 1] of Boolean; 326 ok: Boolean;326 Ok: Boolean; 327 327 328 328 function MarkEntry(ad: Integer): Boolean; … … 540 540 ((EarliestNeeded < 0) or (Advancedness[ad] < Advancedness[EarliestNeeded])) then 541 541 begin 542 ok := False;542 Ok := False; 543 543 for iad := 0 to nResearchOrder - 1 do 544 544 if ResearchOrder[Data.BehaviorFlags and bGender, iad] = ad then 545 545 begin 546 ok := True;546 Ok := True; 547 547 Break; 548 548 end; 549 if not ok then549 if not Ok then 550 550 begin 551 551 EarliestNeeded := ad; … … 1406 1406 begin 1407 1407 Data.BehaviorFlags := Data.BehaviorFlags and not bGender or NewGender; 1408 DebugMessage(1, 'Gender:=' + char(48 + NewGender));1408 DebugMessage(1, 'Gender:=' + Char(48 + NewGender)); 1409 1409 end; 1410 1410 end; … … 2427 2427 Total := Total + CityResult[cix]; 2428 2428 if Total = 0 then 2429 continue; // district does not exist2429 Continue; // district does not exist 2430 2430 2431 2431 Share := 0; -
trunk/AI/StdAI/Barbarina.pas
r522 r531 34 34 TBarbarina = class(TToolAI) 35 35 constructor Create(Nation: Integer); override; 36 37 36 protected 38 37 ColonyShipPlan: TColonyShipPlan; … … 47 46 procedure Barbarina_DoNegotiation; 48 47 procedure MakeColonyShipPlan; 49 50 48 private 51 49 TurnOfMapAnalysis, Neighbours: Integer; … … 173 171 Moved: array[0..numax - 1] of Boolean; 174 172 UnitPresence: array[0..lxmax * lymax - 1] of Byte; 175 euixMap: array[0..lxmax * lymax - 1] of smallint;176 uixAttack: array[0..neumax - 1] of smallint;173 euixMap: array[0..lxmax * lymax - 1] of SmallInt; 174 uixAttack: array[0..neumax - 1] of SmallInt; 177 175 AttackScore: array[0..neumax - 1] of Integer; 178 176 … … 1599 1597 end; 1600 1598 if (City_CurrentImprovementProject(cix) = imCourt) and 1601 (Built[imTownHall] > 0) and ( prod >= imp[imCourt].cost *1599 (Built[imTownHall] > 0) and (Prod >= imp[imCourt].Cost * 1602 1600 BuildCostMod[G.Difficulty[Me]] div 12 - 1603 ( imp[imTownHall].cost * BuildCostMod[G.Difficulty[Me]] div 12) *1601 (Imp[imTownHall].Cost * BuildCostMod[G.Difficulty[Me]] div 12) * 1604 1602 2 div 3) then 1605 1603 City_RebuildImprovement(cix, imTownHall) … … 1622 1620 var 1623 1621 nPreq, rmix, rmixChosen, I, MaxWeight, MaxDefense, ChosenPreq: Integer; 1624 NeedSeaUnits, ready: Boolean;1622 NeedSeaUnits, Ready: Boolean; 1625 1623 ModelExists: set of 0..nModelCategory - 1; 1626 known: array[0..nAdv - 1] of Integer;1624 Known: array[0..nAdv - 1] of Integer; 1627 1625 1628 1626 procedure ChoosePreq(ad: Integer); … … 1632 1630 begin 1633 1631 Assert(RO.Tech[ad] < tsApplicable); 1634 if known[ad] = 0 then1632 if Known[ad] = 0 then 1635 1633 begin 1636 known[ad] := 1;1634 Known[ad] := 1; 1637 1635 PreqOk := True; 1638 1636 if not (ad in [adScience, adMassProduction]) and (RO.Tech[ad] < tsSeen) then … … 1695 1693 if IsResearched(adSteel) then 1696 1694 Inc(MaxDefense); 1697 ready := (MaxWeight >= Weight) and (MaxDefense >= Cap[mcDefense]);1698 if ready then1695 Ready := (MaxWeight >= Weight) and (MaxDefense >= Cap[mcDefense]); 1696 if Ready then 1699 1697 for I := 0 to nFeature - 1 do 1700 1698 if (Cap[I] > 0) and (Feature[I].Preq <> preNone) and 1701 1699 ((Feature[I].Preq < 0) or not IsResearched(Feature[I].Preq)) then 1702 ready := False;1703 if ready then1700 Ready := False; 1701 if Ready then 1704 1702 begin 1705 1703 for I := 0 to nUpgrade - 1 do 1706 1704 if (Upgrades and (1 shl I) <> 0) and not 1707 1705 IsResearched(Upgrade[Domain, I].Preq) then 1708 ready := False;1709 end; 1710 if ready then1706 Ready := False; 1707 end; 1708 if Ready then 1711 1709 begin 1712 1710 Include(ModelExists, Category); … … 1736 1734 I := 0; 1737 1735 while (I < nResearchOrder) and (not NeedSeaUnits and (ResearchOrder[I] < 0) or 1738 1739 Inc(I);1736 IsResearched(Abs(ResearchOrder[I]))) do 1737 Inc(I); 1740 1738 if I >= nResearchOrder then // list done, continue with future tech 1741 1739 begin … … 1747 1745 else 1748 1746 begin 1749 FillChar( known, SizeOf(known), 0);1747 FillChar(Known, SizeOf(Known), 0); 1750 1748 nPreq := 0; 1751 1749 ChosenPreq := -1; … … 1835 1833 (MyModel[mix].Domain <> dSea)) then 1836 1834 begin 1837 DebugMessage(1, 'Declare war on P' + char(48 + Nation));1835 DebugMessage(1, 'Declare war on P' + Char(48 + Nation)); 1838 1836 NegoCause := CancelTreaty; 1839 1837 Result := True; … … 1858 1856 procedure TBarbarina.MakeColonyShipPlan; 1859 1857 var 1860 I, V21, V21C, CityLoc, Loc1, part, cix, BestValue, TestValue, FoodCount,1858 I, V21, V21C, CityLoc, Loc1, Part, cix, BestValue, TestValue, FoodCount, 1861 1859 ProdCount, ProdExtra, Score, BestScore: Integer; 1862 1860 Tile: Cardinal; 1863 ok, check: Boolean;1861 Ok, Check: Boolean; 1864 1862 Radius, RadiusC: TVicinity21Loc; 1865 1863 begin 1866 for part := 0 to nShipPart - 1 do1864 for Part := 0 to nShipPart - 1 do 1867 1865 begin 1868 ColonyShipPlan[ part].cixProducing := -1;1869 ColonyShipPlan[ part].nLocResource := 0;1870 ColonyShipPlan[ part].nLocFoundCity := 0;1866 ColonyShipPlan[Part].cixProducing := -1; 1867 ColonyShipPlan[Part].nLocResource := 0; 1868 ColonyShipPlan[Part].nLocFoundCity := 0; 1871 1869 end; 1872 1870 if RO.Tech[adMassProduction] >= tsApplicable then // able to recognize ressources yet 1873 1871 begin 1874 // check already existing cities1872 // Check already existing cities 1875 1873 for cix := 0 to RO.nCity - 1 do 1876 1874 with MyCity[cix] do … … 1886 1884 if Tile and fModern <> 0 then 1887 1885 begin 1888 part := (Tile and fModern) shr 25 - 1;1889 if RO.Ship[Me].Parts[ part] < ShipNeed[part] then1886 Part := (Tile and fModern) shr 25 - 1; 1887 if RO.Ship[Me].Parts[Part] < ShipNeed[Part] then 1890 1888 // not enough of this kind already 1891 1889 begin 1892 ok := True;1893 if ColonyShipPlan[ part].cixProducing >= 0 then1890 Ok := True; 1891 if ColonyShipPlan[Part].cixProducing >= 0 then 1894 1892 begin // another city is already assigned to this ship part, choose one of the two 1895 1893 TestValue := (ID and $FFF) shl 4 + ((ID shr 12) + 15 - Me) and $F; 1896 1894 BestValue := 1897 (MyCity[ColonyShipPlan[ part].cixProducing].ID and $FFF) shl1898 4 + ((MyCity[ColonyShipPlan[ part].cixProducing].ID shr 12) +1895 (MyCity[ColonyShipPlan[Part].cixProducing].ID and $FFF) shl 1896 4 + ((MyCity[ColonyShipPlan[Part].cixProducing].ID shr 12) + 1899 1897 15 - Me) and $F; 1900 1898 if TestValue <= BestValue then 1901 ok := False;1899 Ok := False; 1902 1900 end; 1903 if ok then1901 if Ok then 1904 1902 ColonyShipPlan[part].cixProducing := cix; 1905 1903 end; … … 1910 1908 1911 1909 // for parts without existing city, look for location of city to found 1912 check := False;1913 for part := 0 to nShipPart - 1 do1914 if (RO.Ship[Me].Parts[ part] < ShipNeed[part]) // not enough of this kind already1915 and (ColonyShipPlan[ part].cixProducing < 0) then // no city to produce1916 check := True;1917 if check then1910 Check := False; 1911 for Part := 0 to nShipPart - 1 do 1912 if (RO.Ship[Me].Parts[Part] < ShipNeed[Part]) // not enough of this kind already 1913 and (ColonyShipPlan[Part].cixProducing < 0) then // no city to produce 1914 Check := True; 1915 if Check then 1918 1916 begin 1919 1917 for Loc1 := 0 to MapSize - 1 do … … 1922 1920 if Tile and fModern <> 0 then 1923 1921 begin 1924 part := (Tile and fModern) shr 25 - 1;1925 if ColonyShipPlan[ part].nLocResource < maxModern then1926 begin 1927 ColonyShipPlan[ part].LocResource[ColonyShipPlan[part].nLocResource] := Loc1;1928 Inc(ColonyShipPlan[ part].nLocResource);1929 end; 1930 end; 1931 end; 1932 for part := 0 to nShipPart - 1 do1933 if (RO.Ship[Me].Parts[ part] < ShipNeed[part]) // not enough of this kind already1934 and (ColonyShipPlan[ part].cixProducing < 0) // no city to produce1935 and (ColonyShipPlan[ part].nLocResource > 0) then // resource is known1936 begin 1937 for I := 0 to ColonyShipPlan[ part].nLocResource - 1 do1922 Part := (Tile and fModern) shr 25 - 1; 1923 if ColonyShipPlan[Part].nLocResource < maxModern then 1924 begin 1925 ColonyShipPlan[Part].LocResource[ColonyShipPlan[Part].nLocResource] := Loc1; 1926 Inc(ColonyShipPlan[Part].nLocResource); 1927 end; 1928 end; 1929 end; 1930 for Part := 0 to nShipPart - 1 do 1931 if (RO.Ship[Me].Parts[Part] < ShipNeed[Part]) // not enough of this kind already 1932 and (ColonyShipPlan[Part].cixProducing < 0) // no city to produce 1933 and (ColonyShipPlan[Part].nLocResource > 0) then // resource is known 1934 begin 1935 for I := 0 to ColonyShipPlan[Part].nLocResource - 1 do 1938 1936 begin 1939 1937 BestScore := 0; 1940 V21_to_Loc(ColonyShipPlan[ part].LocResource[I], Radius);1938 V21_to_Loc(ColonyShipPlan[Part].LocResource[I], Radius); 1941 1939 for V21 := 1 to 26 do 1942 begin // check all potential cities in range1940 begin // Check all potential cities in range 1943 1941 CityLoc := Radius[V21]; 1944 1942 if CityLoc >= 0 then … … 1990 1988 begin 1991 1989 BestScore := Score; 1992 ColonyShipPlan[ part].LocFoundCity[1993 ColonyShipPlan[ part].nLocFoundCity] :=1990 ColonyShipPlan[Part].LocFoundCity[ 1991 ColonyShipPlan[Part].nLocFoundCity] := 1994 1992 CityLoc; 1995 1993 end; … … 1998 1996 end; 1999 1997 if BestScore > 0 then 2000 Inc(ColonyShipPlan[ part].nLocFoundCity);1998 Inc(ColonyShipPlan[Part].nLocFoundCity); 2001 1999 end; 2002 2000 end; -
trunk/AI/StdAI/CustomAI.pas
r522 r531 682 682 function TCustomAI.DebugMessage(Level: Integer; Text: string): Boolean; 683 683 begin 684 Text := Copy('P' + char(48 + Me) + ' ' + Text, 1, 254);684 Text := Copy('P' + Char(48 + Me) + ' ' + Text, 1, 254); 685 685 Server(sMessage, Me, Level, PChar(Text)^); 686 686 -
trunk/AI/StdAI/CustomAI_Reload.pas
r522 r531 639 639 function TCustomAI.DebugMessage(Level: Integer; Text: string): Boolean; 640 640 begin 641 Text := Copy('P' + char(48 + Me) + ' ' + Text, 1, 254);641 Text := Copy('P' + Char(48 + Me) + ' ' + Text, 1, 254); 642 642 Server(sMessage, Me, Level, PChar(Text)^); 643 643 -
trunk/AI/StdAI/ToolAI.pas
r522 r531 355 355 UnitsToAssign: Boolean; 356 356 Adjacent: TVicinity8Loc; 357 SettlerOfJobLoc, DistToLoc: array[0..lxmax * lymax - 1] of smallint;357 SettlerOfJobLoc, DistToLoc: array[0..lxmax * lymax - 1] of SmallInt; 358 358 // DistToLoc is only defined where SettlerOfJobLoc>=0 359 359 TileChecked: array[0..lxmax * lymax - 1] of Boolean; … … 471 471 I, J, Loc, Loc1, V8, Count, Kind, MostIndex: Integer; 472 472 Adjacent: TVicinity8Loc; 473 IndexOfID: array[0..lxmax * lymax - 1] of smallint;474 IDOfIndex: array[0..lxmax * lymax div 2 - 1] of smallint;473 IndexOfID: array[0..lxmax * lymax - 1] of SmallInt; 474 IDOfIndex: array[0..lxmax * lymax div 2 - 1] of SmallInt; 475 475 begin 476 476 FillChar(District, MapSize * 4, $FF); … … 1107 1107 nSelectedLoad, F, OriginContinent, A, B: Integer; 1108 1108 CompleteFlag, NotReachedFlag, ContinueUnit: Cardinal; 1109 IsComplete, ok, IsFirstLoc: Boolean;1109 IsComplete, Ok, IsFirstLoc: Boolean; 1110 1110 StartLocPtr, ArrivedEnd: pinteger; 1111 1111 Adjacent: TVicinity8Loc; … … 1113 1113 tuixSelectedLoad: array[0..15] of Integer; 1114 1114 Arrived: array[0..lxmax * lymax] of Cardinal; 1115 ResponsibleTransport: array[0..lxmax * lymax - 1] of smallint;1115 ResponsibleTransport: array[0..lxmax * lymax - 1] of SmallInt; 1116 1116 TurnsBeforeLoad: array[0..lxmax * lymax - 1] of ShortInt; 1117 1117 GroupComplete: array[0..lxmax * lymax - 1] of Boolean; … … 1191 1191 FillChar(ResponsibleTransport, MapSize * 2, $FF); // -1 1192 1192 FillChar(TurnsBeforeLoad, MapSize, $FF); // -1 1193 ok := False;1193 Ok := False; 1194 1194 for uix := 0 to RO.nUn - 1 do 1195 1195 if TransportAvailable[uix] > 0 then 1196 1196 begin 1197 ok := True;1197 Ok := True; 1198 1198 Pile.Put(MyUnit[uix].Loc, ($800 - MyUnit[uix].Movement) shl 12 + uix); 1199 1199 end; 1200 if not ok then // no transports1200 if not Ok then // no transports 1201 1201 begin 1202 1202 TransportPlan.LoadLoc := -1; … … 1392 1392 begin 1393 1393 Arrived[Loc0] := (Arrived[Loc0] or CompleteFlag) and not NotReachedFlag; 1394 continue;1394 Continue; 1395 1395 end; 1396 1396 IsComplete := True; … … 1400 1400 if Loc1 >= 0 then 1401 1401 begin 1402 ok := False;1402 Ok := False; 1403 1403 case CheckStep(MoveStyle, Time0, V8 and 1, ArriveTime, 1404 1404 RecoverTurns, Map[Loc0], Map[Loc1], False) of 1405 csOk: ok := True;1405 csOk: Ok := True; 1406 1406 csForbiddenTile: 1407 1407 ;// !!! don't check moving there again 1408 1408 csCheckTerritory: 1409 ok := RO.Territory[Loc1] = RO.Territory[Loc0];1409 Ok := RO.Territory[Loc1] = RO.Territory[Loc0]; 1410 1410 end; 1411 if ok and Pile.TestPut(Loc1, ArriveTime) then1411 if Ok and Pile.TestPut(Loc1, ArriveTime) then 1412 1412 if ArriveTime < $2000 then 1413 1413 Pile.Put(Loc1, ArriveTime) -
trunk/Database.pas
r522 r531 559 559 procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc); 560 560 var 561 dx, dy, bit, y0, xComp, yComp, xComp0, xCompSwitch: Integer;562 dst: ^Integer;561 dx, dy, Bit, y0, xComp, yComp, xComp0, xCompSwitch: Integer; 562 Dst: ^Integer; 563 563 begin 564 564 y0 := Loc0 div lx; … … 571 571 xCompSwitch := xCompSwitch xor xComp0; 572 572 yComp := lx * (y0 - 3); 573 dst := @VicinityLoc;574 bit := 1;573 Dst := @VicinityLoc; 574 Bit := 1; 575 575 for dy := 0 to 6 do 576 576 begin … … 579 579 for dx := 0 to 3 do 580 580 begin 581 if bit and $67F7F76 <> 0 then582 dst^ := xComp + yComp581 if Bit and $67F7F76 <> 0 then 582 Dst^ := xComp + yComp 583 583 else 584 dst^ := -1;584 Dst^ := -1; 585 585 Inc(xComp); 586 586 if xComp >= lx then 587 587 Dec(xComp, lx); 588 Inc( dst);589 bit := bit shl 1;588 Inc(Dst); 589 Bit := Bit shl 1; 590 590 end; 591 591 Inc(yComp, lx); … … 1317 1317 Radius: TVicinity21Loc; 1318 1318 Adjacent: TVicinity8Loc; 1319 ok: Boolean;1319 Ok: Boolean; 1320 1320 1321 1321 begin … … 1414 1414 end; 1415 1415 1416 ok := True;1416 Ok := True; 1417 1417 for C := 1 to nsc do 1418 1418 if nCityLoc[C] < sccount[C] * (8 - MinGood) div (7 - MinGood) then 1419 ok := False;1420 until ok;1419 Ok := False; 1420 until Ok; 1421 1421 1422 1422 FineDistSQR := MapSize * LandMass * 9 div (nAlive * 100); … … 1478 1478 end; 1479 1479 end; 1480 p1 := p1 + sccount[C] 1480 p1 := p1 + sccount[C]; 1481 1481 end; 1482 1482 … … 1603 1603 I, p1, Loc1, nAlive, nStartLoc0, nPrefStartLoc0, imax: Integer; 1604 1604 StartLoc0: array [0 .. lxmax * lymax - 1] of Integer; 1605 ishuman: Boolean;1605 IsHuman: Boolean; 1606 1606 begin 1607 1607 nAlive := 0; … … 1636 1636 1637 1637 StartLoc[0] := 0; 1638 for ishuman := True downto False do1638 for IsHuman := True downto False do 1639 1639 for p1 := 0 to nPl - 1 do 1640 if (1 shl p1 and GAlive <> 0) and ((1 shl p1 and Human <> 0) = ishuman)1640 if (1 shl p1 and GAlive <> 0) and ((1 shl p1 and Human <> 0) = IsHuman) 1641 1641 then 1642 1642 begin … … 1790 1790 1791 1791 TerritoryCount[nPl] := MapSize; 1792 // fillchar(NewContact, sizeof(NewContact), false);1792 // FillChar(NewContact, SizeOf(NewContact), False); 1793 1793 end; 1794 1794 … … 3487 3487 I: Integer; 3488 3488 miSender, miTarget: TModelInfo; 3489 ok: Boolean;3489 Ok: Boolean; 3490 3490 begin 3491 3491 // only if target doesn't already have a model like this 3492 ok := RW[pTarget].nModel < nmmax;3492 Ok := RW[pTarget].nModel < nmmax; 3493 3493 MakeModelInfo(pSender, mix, RW[pSender].Model[mix], miSender); 3494 3494 for I := 0 to RW[pTarget].nModel - 1 do … … 3496 3496 MakeModelInfo(pTarget, I, RW[pTarget].Model[I], miTarget); 3497 3497 if IsSameModel(miSender, miTarget) then 3498 ok := False;3499 end; 3500 if ok then3498 Ok := False; 3499 end; 3500 if Ok then 3501 3501 begin 3502 3502 RW[pTarget].Model[RW[pTarget].nModel] := RW[pSender].Model[mix]; -
trunk/GameServer.pas
r496 r531 2697 2697 ShowShipChange: TShowShipChange; 2698 2698 ShowNegoData: TShowNegoData; 2699 logged, ok, HasShipChanged, AllHumansDead, OfferFullySupported: Boolean;2699 Logged, Ok, HasShipChanged, AllHumansDead, OfferFullySupported: Boolean; 2700 2700 begin 2701 2701 if Command = sTurn then … … 2779 2779 FormerCLState := CL.State; 2780 2780 CL.Put(Command, Player, Subject, @Data); 2781 logged := True;2781 Logged := True; 2782 2782 end 2783 2783 else 2784 logged := False;2784 Logged := False; 2785 2785 2786 2786 case Command of … … 3222 3222 if Command = sReload then 3223 3223 begin 3224 ok := (Difficulty[0] = 0) and (bix[0].Kind <> btNoTerm) and3224 Ok := (Difficulty[0] = 0) and (bix[0].Kind <> btNoTerm) and 3225 3225 (Integer(Data) >= 0) and (Integer(Data) < GTurn); 3226 3226 for p1 := 1 to nPl - 1 do 3227 3227 if bix[p1].Kind = btTerm then 3228 ok := False;3228 Ok := False; 3229 3229 // allow reload in AI-only games only 3230 3230 end 3231 3231 else 3232 ok := Player = 0;3233 if ok then3232 Ok := Player = 0; 3233 if Ok then 3234 3234 begin 3235 3235 if (Command = sBreak) or (Command = sResign) then … … 3351 3351 p1 := pTurn; 3352 3352 if (Command and not sExecute = scDipBreak and not sExecute) and 3353 (LastEndClientCommand <> scDipBreak) then // ok3353 (LastEndClientCommand <> scDipBreak) then // Ok 3354 3354 else if (Command and not sExecute = scDipNotice and not sExecute) and 3355 3355 ((LastEndClientCommand = scDipCancelTreaty) or 3356 (LastEndClientCommand = scDipBreak)) then // ok3356 (LastEndClientCommand = scDipBreak)) then // Ok 3357 3357 else if (Command and not sExecute = scDipAccept and not sExecute) and 3358 3358 (LastEndClientCommand = scDipOffer) then … … 3691 3691 if (Mode = moPlaying) and (Subject = adMilitary) then 3692 3692 IntServer(sIntSetDevModel, Player, 0, DevModel.Kind); 3693 // save DevModel, because sctModel commands are not logged3693 // save DevModel, because sctModel commands are not Logged 3694 3694 ResearchTech := Subject; 3695 3695 end; … … 4478 4478 else 4479 4479 begin 4480 if logged then4480 if Logged then 4481 4481 CL.State := FormerCLState; 4482 4482 if (Result < rExecuted) and (Command >= sExecute) then -
trunk/LocalPlayer/CityType.pas
r530 r531 23 23 procedure FormClose(Sender: TObject; var Action: TCloseAction); 24 24 procedure DeleteBtnClick(Sender: TObject); 25 public26 procedure ShowNewContent(NewMode: TWindowMode);27 25 protected 28 26 procedure OffscreenPaint; override; … … 30 28 nPool, dragiix, ctype: Integer; 31 29 Pooliix: array [0 .. nImp - 1] of Integer; 32 listed: Set of 0 .. nImp;30 Listed: set of 0 .. nImp; 33 31 Changed: Boolean; 34 32 procedure LoadType(NewType: Integer); 35 33 procedure SaveType; 34 public 35 procedure ShowNewContent(NewMode: TWindowMode); 36 36 end; 37 37 … … 158 158 nPool := 0; 159 159 for iix := nWonder to nImp - 1 do 160 if not(iix in listed) and (Imp[iix].Kind = ikCommon) and (iix <> imTrGoods)160 if not(iix in Listed) and (Imp[iix].Kind = ikCommon) and (iix <> imTrGoods) 161 161 and (Imp[iix].Preq <> preNA) and 162 162 ((Imp[iix].Preq = preNone) or (MyRO.Tech[Imp[iix].Preq] >= tsApplicable)) … … 195 195 begin 196 196 ctype := NewType; 197 listed := [];197 Listed := []; 198 198 I := 0; 199 199 while MyData.ImpOrder[ctype, I] >= 0 do 200 200 begin 201 Include( listed, MyData.ImpOrder[ctype, I]);201 Include(Listed, MyData.ImpOrder[ctype, I]); 202 202 Inc(I); 203 203 end; … … 295 295 Assert(MyData.ImpOrder[ctype, I] = iix); 296 296 Move(MyData.ImpOrder[ctype, I + 1], MyData.ImpOrder[ctype, I], nImp - I); 297 Exclude( listed, iix);297 Exclude(Listed, iix); 298 298 end; 299 299 … … 308 308 (Y < yList + nListRow * 32) then 309 309 begin 310 if dragiix in listed then310 if dragiix in Listed then 311 311 UnList(dragiix); 312 312 I := (X - xList) div 42 + (Y - yList) div 32 * nListCol; … … 316 316 nImp - I - 1); 317 317 MyData.ImpOrder[ctype, I] := dragiix; 318 Include( listed, dragiix);318 Include(Listed, dragiix); 319 319 Changed := True; 320 320 end 321 else if (dragiix in listed) and (X >= xPool) and (X < xPool + nPoolCol * 42)321 else if (dragiix in Listed) and (X >= xPool) and (X < xPool + nPoolCol * 42) 322 322 and (Y >= yPool) and (Y < yPool + nPoolRow * 32) then 323 323 begin … … 340 340 begin 341 341 FillChar(MyData.ImpOrder[ctype], SizeOf(MyData.ImpOrder[ctype]), Byte(-1)); 342 listed := [];342 Listed := []; 343 343 Changed := True; 344 344 SmartUpdateContent; -
trunk/LocalPlayer/ClientTools.pas
r522 r531 446 446 eDied - job done and died (thurst) } 447 447 var 448 stage, NextJob, Tile: Integer;449 Done: set of jNone ..jPoll;448 Stage, NextJob, Tile: Integer; 449 Done: set of jNone..jPoll; 450 450 begin 451 451 Done := []; … … 470 470 while (Result <> eOK) and (Result <> eDied) do 471 471 begin 472 stage := -1;472 Stage := -1; 473 473 repeat 474 if stage = -1 then474 if Stage = -1 then 475 475 NextJob := jPoll 476 476 else 477 NextJob := Jobs[Tile and fTerrain, stage];477 NextJob := Jobs[Tile and fTerrain, Stage]; 478 478 if (NextJob = jNone) or not (NextJob in Done) then 479 479 Break; 480 Inc( stage);481 until stage = 5;482 if ( stage = 5) or (NextJob = jNone) then480 Inc(Stage); 481 until Stage = 5; 482 if (Stage = 5) or (NextJob = jNone) then 483 483 begin 484 484 Result := eJobDone; -
trunk/LocalPlayer/Draft.pas
r530 r531 27 27 procedure PaintBox1MouseUp(Sender: TObject; Button: TMouseButton; 28 28 Shift: TShiftState; X, Y: Integer); 29 public30 procedure ShowNewContent(NewMode: TWindowMode);31 protected32 procedure OffscreenPaint; override;33 29 private 34 30 Domain, MaxLines, Lines, Cut, yDomain, yFeature, yWeight, yTotal, yView, … … 38 34 function IsFeatureInList(D, I: Integer): Boolean; 39 35 procedure SetDomain(D: Integer); 36 protected 37 procedure OffscreenPaint; override; 38 public 39 procedure ShowNewContent(NewMode: TWindowMode); 40 40 end; 41 41 … … 211 211 Y := yTotal + 76; 212 212 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, Y, 213 Phrases.Lookup('COSTDIFF' + char(48 + G.Difficulty[Me])));213 Phrases.Lookup('COSTDIFF' + Char(48 + G.Difficulty[Me]))); 214 214 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, 215 215 xTotal2 + 148 + 30, Y, '='); -
trunk/LocalPlayer/Enhance.pas
r496 r531 39 39 private 40 40 NoMap: TIsoMap; 41 public42 procedure ShowNewContent(NewMode: TWindowMode; TerrType: Integer = -1);43 41 protected 44 42 Page: Integer; 45 43 procedure OffscreenPaint; override; 44 public 45 procedure ShowNewContent(NewMode: TWindowMode; TerrType: Integer = -1); 46 46 end; 47 47 -
trunk/LocalPlayer/Help.pas
r530 r531 113 113 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 114 114 procedure SearchBtnClick(Sender: TObject); 115 protected116 procedure OffscreenPaint; override;117 115 private 118 116 Kind: TLinkCategory; … … 141 139 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 142 140 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; 141 protected 142 procedure OffscreenPaint; override; 143 143 public 144 144 HistItems: THistItems; -
trunk/LocalPlayer/NatStat.pas
r530 r531 32 32 procedure ScrollDownBtnClick(Sender: TObject); 33 33 procedure TellAIBtnClick(Sender: TObject); 34 public35 procedure CheckAge;36 procedure ShowNewContent(NewMode: TWindowMode; P: Integer = -1);37 procedure EcoChange;38 34 protected 39 35 procedure OffscreenPaint; override; … … 50 46 ReportText: TStringList; 51 47 procedure GenerateReportText; 48 public 49 procedure CheckAge; 50 procedure ShowNewContent(NewMode: TWindowMode; P: Integer = -1); 51 procedure EcoChange; 52 52 end; 53 53 … … 244 244 if ExtinctPart then 245 245 S := '(' + S + ')'; 246 ReportText.Add( char(48 + Treaty) + S);246 ReportText.Add(Char(48 + Treaty) + S); 247 247 end; 248 248 end; -
trunk/LocalPlayer/Nego.pas
r522 r531 481 481 procedure TNegoDlg.OffscreenPaint; 482 482 var 483 I, cred: Integer;483 I, Cred: Integer; 484 484 S: string; 485 485 OkEnabled: Boolean; … … 600 600 // show credibility 601 601 Offscreen.Canvas.Font.Assign(UniFont[ftTiny]); 602 cred := MyRO.EnemyReport[DipMem[Me].pContact].Credibility;603 case cred of602 Cred := MyRO.EnemyReport[DipMem[Me].pContact].Credibility; 603 case Cred of 604 604 0 .. 49: 605 605 I := 3; … … 609 609 I := 1; 610 610 end; 611 PaintProgressBar(Offscreen.Canvas, I, xCred0, yCred0 + 17, ( cred + 2) div 5,611 PaintProgressBar(Offscreen.Canvas, I, xCred0, yCred0 + 17, (Cred + 2) div 5, 612 612 0, 20, MainTexture); 613 S := IntToStr( cred);613 S := IntToStr(Cred); 614 614 RisedTextOut(Offscreen.Canvas, xCred0 + 10 - 615 615 (BiColorTextWidth(Offscreen.Canvas, S) + 1) div 2, yCred0, S); -
trunk/LocalPlayer/Rates.pas
r530 r531 45 45 procedure TRatesDlg.OffscreenPaint; 46 46 var 47 P, X, Y, current, Max, I: Integer;47 P, X, Y, Current, Max, I: Integer; 48 48 S, s1: string; 49 49 begin … … 112 112 X := 16; 113 113 Y := 81; 114 current := (100 - MyRO.LuxRate - MyRO.TaxRate) * 120 div 100;114 Current := (100 - MyRO.LuxRate - MyRO.TaxRate) * 120 div 100; 115 115 Max := 120; 116 116 Frame(Offscreen.Canvas, X - 1, Y - 1, X + Max, Y + 7, $000000, $000000); … … 119 119 with Offscreen.Canvas do 120 120 begin 121 for I := 0 to current div 8 - 1 do121 for I := 0 to Current div 8 - 1 do 122 122 BitBltBitmap(Offscreen, X + Max - 8 - I * 8, Y, 8, 7, 123 123 HGrSystem.Data, 104, 9 + 8 * 2); 124 BitBltBitmap(Offscreen, X + Max - current, Y, current - 8 * (current div 8), 7,124 BitBltBitmap(Offscreen, X + Max - Current, Y, Current - 8 * (Current div 8), 7, 125 125 HGrSystem.Data, 104, 9 + 8 * 2); 126 126 Brush.Color := $000000; 127 FillRect(Rect(X, Y, X + Max - current, Y + 7));127 FillRect(Rect(X, Y, X + Max - Current, Y + 7)); 128 128 Brush.Style := TBrushStyle.bsClear; 129 129 end; -
trunk/LocalPlayer/Select.pas
r530 r531 1073 1073 PPicture, PTestPicture: ^TModelPicture; 1074 1074 ModelOk: array [0 .. 4095] of Boolean; 1075 ok: Boolean;1075 Ok: Boolean; 1076 1076 begin 1077 1077 for I := 0 to MaxLayer - 1 do … … 1108 1108 begin 1109 1109 { if MyModel[i].Kind=mkSlaves then 1110 ok:= MyRO.Wonder[woPyramids].EffectiveOwner=Me1110 Ok:= MyRO.Wonder[woPyramids].EffectiveOwner=Me 1111 1111 else } if MyModel[I].Domain = dSea then 1112 1112 begin 1113 ok := False;1113 Ok := False; 1114 1114 for dx := -2 to 2 do 1115 1115 for dy := -2 to 2 do … … 1120 1120 ((MyMap[Loc1] and fTerrain = fShore) or 1121 1121 (MyMap[Loc1] and fCanal > 0)) then 1122 ok := True;1122 Ok := True; 1123 1123 end; 1124 1124 end 1125 1125 else 1126 ok := True;1127 if ok then1126 Ok := True; 1127 if Ok then 1128 1128 begin 1129 1129 if MyModel[I].Status and msObsolete = 0 then … … 1163 1163 Inc(Lines[0]); 1164 1164 end; 1165 ok := False;1165 Ok := False; 1166 1166 for I := 0 to nDomains - 1 do 1167 1167 if (upgrade[I, 0].Preq = preNone) or 1168 1168 (MyRO.Tech[upgrade[I, 0].Preq] >= tsApplicable) then 1169 ok := True;1170 if ok then { new unit class }1169 Ok := True; 1170 if Ok then { new unit class } 1171 1171 begin 1172 1172 Code[0, Lines[0]] := adMilitary; … … 1255 1255 for I := 0 to nAdv - 1 do 1256 1256 begin 1257 ok := (MyRO.Tech[I] <> tsNA) or (MyRO.ResearchTech = I);1257 Ok := (MyRO.Tech[I] <> tsNA) or (MyRO.ResearchTech = I); 1258 1258 for J := 1 to nColumn - 1 do 1259 1259 with MyRO.EnemyReport[Column[J]]^ do 1260 1260 if (Tech[I] <> tsNA) or (TurnOfCivilReport >= 0) and 1261 1261 (ResearchTech = I) then 1262 ok := True;1263 if ok then1262 Ok := True; 1263 if Ok then 1264 1264 begin 1265 1265 Code[0, Lines[0]] := I; … … 1269 1269 SortTechs; 1270 1270 1271 ok := MyRO.ResearchTech = adMilitary;1271 Ok := MyRO.ResearchTech = adMilitary; 1272 1272 for J := 1 to nColumn - 1 do 1273 1273 with MyRO.EnemyReport[Column[J]]^ do 1274 1274 if (MyRO.Alive and (1 shl Column[J]) <> 0) and 1275 1275 (TurnOfCivilReport >= 0) and (ResearchTech = adMilitary) then 1276 ok := True;1277 if ok then1276 Ok := True; 1277 if Ok then 1278 1278 begin 1279 1279 Code[0, Lines[0]] := adMilitary; … … 1330 1330 begin // check if opponent already has this model 1331 1331 MakeModelInfo(Me, mix, MyModel[mix], mi); 1332 ok := True;1332 Ok := True; 1333 1333 for emix := 0 to MyRO.nEnemyModel - 1 do 1334 1334 if (MyRO.EnemyModel[emix].Owner = DipMem[Me].pContact) and 1335 1335 IsSameModel(MyRO.EnemyModel[emix], mi) then 1336 ok := False;1337 if ok then1336 Ok := False; 1337 if Ok then 1338 1338 begin 1339 1339 Code[0, Lines[0]] := mix; … … 1414 1414 if not Assigned(PPicture.HGr) then 1415 1415 InitEnemyModel(emix); 1416 ok := True;1416 Ok := True; 1417 1417 if MainScreen.mNames.Checked then 1418 1418 for J := 0 to Lines[0] - 1 do … … 1426 1426 begin 1427 1427 Code[1, J] := 1; 1428 ok := False;1428 Ok := False; 1429 1429 Break; 1430 1430 end; 1431 1431 end; 1432 if ok then1432 if Ok then 1433 1433 begin 1434 1434 Code[0, Lines[0]] := emix; -
trunk/LocalPlayer/Term.pas
r530 r531 421 421 procedure UpdateKeyShortcuts; 422 422 procedure SetFullScreen(Active: Boolean); 423 procedure PaintZoomedTile( dst: TBitmap; X, Y, Loc: Integer);423 procedure PaintZoomedTile(Dst: TBitmap; X, Y, Loc: Integer); 424 424 public 425 425 UsedOffscreenWidth: Integer; … … 850 850 function AttackSound(Code: Integer): string; 851 851 begin 852 Result := 'ATTACK_' + char(48 + Code div 100 mod 10) +853 char(48 + Code div 10 mod 10) + char(48 + Code mod 10);852 Result := 'ATTACK_' + Char(48 + Code div 100 mod 10) + 853 Char(48 + Code div 10 mod 10) + Char(48 + Code mod 10); 854 854 end; 855 855 … … 931 931 else OpenSound:=AttackSound(ModelCode(mi)); } 932 932 if MyModel[MyData.ToldModels].Kind = mkSelfDeveloped then 933 OpenSound := 'NEWMODEL_' + char(48 + Age);933 OpenSound := 'NEWMODEL_' + Char(48 + Age); 934 934 MessgText := Phrases.Lookup('MODELAVAILABLE'); 935 935 if GameMode = cMovie then … … 989 989 end; 990 990 991 procedure TMainScreen.PaintZoomedTile( dst: TBitmap; X, Y, Loc: Integer);991 procedure TMainScreen.PaintZoomedTile(Dst: TBitmap; X, Y, Loc: Integer); 992 992 993 993 procedure TSprite(xDst, yDst, xSrc, ySrc: Integer); 994 994 begin 995 995 with NoMapPanel do 996 Sprite( dst, HGrTerrain, X + xDst, Y + yDst, xxt * 2, yyt * 3,996 Sprite(Dst, HGrTerrain, X + xDst, Y + yDst, xxt * 2, yyt * 3, 997 997 1 + xSrc * (xxt * 2 + 1), 1 + ySrc * (yyt * 3 + 1)); 998 998 end; … … 1001 1001 begin 1002 1002 with NoMapPanel do begin 1003 Sprite( dst, HGrTerrain, X + xxt, Y + yyt + 2, xxt * 2, yyt * 2 - 2,1003 Sprite(Dst, HGrTerrain, X + xxt, Y + yyt + 2, xxt * 2, yyt * 2 - 2, 1004 1004 1 + xSrc * (xxt * 2 + 1), 3 + yyt + ySrc * (yyt * 3 + 1)); 1005 Sprite( dst, HGrTerrain, X + 4, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,1005 Sprite(Dst, HGrTerrain, X + 4, Y + 2 * yyt, xxt * 2 - 4, yyt * 2, 1006 1006 5 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1)); 1007 Sprite( dst, HGrTerrain, X + xxt * 2, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,1007 Sprite(Dst, HGrTerrain, X + xxt * 2, Y + 2 * yyt, xxt * 2 - 4, yyt * 2, 1008 1008 1 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1)); 1009 Sprite( dst, HGrTerrain, X + xxt, Y + yyt * 3, xxt * 2, yyt * 2 - 2,1009 Sprite(Dst, HGrTerrain, X + xxt, Y + yyt * 3, xxt * 2, yyt * 2 - 2, 1010 1010 1 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1)); 1011 1011 end; … … 1519 1519 Color: TColor; 1520 1520 Name: string; 1521 ok: Boolean;1521 Ok: Boolean; 1522 1522 begin 1523 1523 UnusedTribeFiles.Clear; 1524 ok := FindFirst(LocalizedFilePath('Tribes') + DirectorySeparator + '*' + CevoTribeExt,1524 Ok := FindFirst(LocalizedFilePath('Tribes') + DirectorySeparator + '*' + CevoTribeExt, 1525 1525 faArchive + faReadOnly, SearchRec) = 0; 1526 if not ok then1526 if not Ok then 1527 1527 begin 1528 1528 FindClose(SearchRec); 1529 ok := FindFirst(LocalizedFilePath('Tribes' + DirectorySeparator + '*' + CevoTribeExt),1529 Ok := FindFirst(LocalizedFilePath('Tribes' + DirectorySeparator + '*' + CevoTribeExt), 1530 1530 faArchive + faReadOnly, SearchRec) = 0; 1531 1531 end; 1532 if ok then1532 if Ok then 1533 1533 repeat 1534 1534 SearchRec.Name := Copy(SearchRec.Name, 1, Length(SearchRec.Name) - Length(CevoTribeExt)); … … 2078 2078 else 2079 2079 begin 2080 S := Tribe[Me].TPhrase('AGE' + char(48 + Age));2080 S := Tribe[Me].TPhrase('AGE' + Char(48 + Age)); 2081 2081 MessgText := Format(S, [TurnToString(MyRO.Turn)]); 2082 2082 end; … … 2086 2086 { else begin Kind:=mkOkHelp; HelpKind:=hkAdv; HelpNo:=AgePreq[age]; end }; 2087 2087 CenterTo := NewAgeCenterTo; 2088 OpenSound := 'AGE_' + char(48 + Age);2088 OpenSound := 'AGE_' + Char(48 + Age); 2089 2089 Application.ProcessMessages; 2090 2090 ShowModal; … … 2250 2250 Item := 'RESEARCH_GENERAL'; 2251 2251 if GameMode <> cMovie then 2252 OpenSound := 'NEWADVANCE_' + char(48 + Age);2252 OpenSound := 'NEWADVANCE_' + Char(48 + Age); 2253 2253 Item2 := Phrases.Lookup('ADVANCES', ad); 2254 2254 if ad in FutureTech then … … 2444 2444 begin // !!! Shinkansen 2445 2445 MoveResult := eOK; 2446 ok := True;2446 Ok := True; 2447 2447 for I := 0 to MoveAdviceData.nStep - 1 do 2448 2448 begin … … 2454 2454 // don't attack during auto move 2455 2455 begin 2456 ok := False;2457 Break 2456 Ok := False; 2457 Break; 2458 2458 end 2459 2459 else … … 2471 2471 then 2472 2472 begin 2473 ok := False;2473 Ok := False; 2474 2474 Break; 2475 2475 end; … … 2478 2478 Stop := not ok or (Loc = MoveAdviceData.ToLoc) or 2479 2479 (MoveAdviceData.ToLoc = maNextCity) and 2480 (MyMap[Loc] and fCity <> 0) 2480 (MyMap[Loc] and fCity <> 0); 2481 2481 end 2482 2482 else … … 2977 2977 with MessgExDlg do 2978 2978 begin 2979 OpenSound := 'CONTACT_' + char(48 + MyRO.EnemyReport[Integer(Data)2979 OpenSound := 'CONTACT_' + Char(48 + MyRO.EnemyReport[Integer(Data) 2980 2980 ].Attitude); 2981 2981 MessgText := Tribe[Integer(Data)].TPhrase('FRCONTACT'); … … 3005 3005 InitTurn(NewPlayer); 3006 3006 if Command = scDipStart then 3007 Play('CONTACT_' + char(48 + MyRO.Attitude[DipMem[NewPlayer]3007 Play('CONTACT_' + Char(48 + MyRO.Attitude[DipMem[NewPlayer] 3008 3008 .pContact])) 3009 3009 else if Command = scDipCancelTreaty then … … 4718 4718 var 4719 4719 ProcessOptions: Integer; 4720 rec: TRect;4720 Rec: TRect; 4721 4721 DoInvalidate: Boolean; 4722 4722 begin … … 4759 4759 Exit; { map window not moved } 4760 4760 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 4761 rec := Rect(0, 0, MapWidth, MapHeight);4761 Rec := Rect(0, 0, MapWidth, MapHeight); 4762 4762 {$IFDEF WINDOWS} 4763 4763 ScrollDC(Offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, … … 4766 4766 {$IFDEF UNIX} 4767 4767 ScrollDC(Offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, 4768 rec, rec, 0, nil);4768 Rec, Rec, 0, nil); 4769 4769 {$ENDIF} 4770 4770 for DoInvalidate := False to FastScrolling do begin 4771 4771 if DoInvalidate then begin 4772 rec.Bottom := MapHeight - Overlap;4772 Rec.Bottom := MapHeight - Overlap; 4773 4773 {$IFDEF WINDOWS} 4774 4774 ScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec, … … 4777 4777 {$IFDEF UNIX} 4778 4778 ScrollDC(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, 4779 rec, rec, 0, nil);4779 Rec, Rec, 0, nil); 4780 4780 {$ENDIF} 4781 4781 ProcessOptions := prInvalidate; … … 7153 7153 else if BHelp.Test(ShortCut) then mHelp.Click; 7154 7154 (*if Shift = [ssCtrl] then 7155 case char(Key) of7155 case Char(Key) of 7156 7156 'A': 7157 7157 begin // auto symmetry -
trunk/LocalPlayer/Tribes.pas
r468 r531 430 430 I := 0; 431 431 while (I < Count) and (Copy(Strings[I], 1, 6) <> 432 '#AGE' + char(48 + Age) + ' ') do432 '#AGE' + Char(48 + Age) + ' ') do 433 433 Inc(I); 434 434 if I < Count then … … 489 489 var 490 490 I: Integer; 491 ok: Boolean;491 Ok: Boolean; 492 492 begin 493 493 with Info do … … 516 516 517 517 // read model name from tribe script 518 ok := False;518 Ok := False; 519 519 for I := 0 to Script.Count - 1 do 520 520 begin 521 521 Input := Script[I]; 522 522 if Input = '#UNITS ' + ExtractFileNameOnly(GrName) then 523 ok := True523 Ok := True 524 524 else if (Input <> '') and (Input[1] = '#') then 525 ok := False526 else if ok and (GetNum = pix) then525 Ok := False 526 else if Ok and (GetNum = pix) then 527 527 begin 528 528 Get; -
trunk/LocalPlayer/UnitStat.pas
r530 r531 293 293 end; 294 294 295 procedure FeatureBar( dst: TBitmap; X, Y: Integer; const mi: TModelInfo;295 procedure FeatureBar(Dst: TBitmap; X, Y: Integer; const mi: TModelInfo; 296 296 T: TTexture); 297 297 var 298 I, W, dx, num: Integer;298 I, W, dx, Num: Integer; 299 299 S: string; 300 300 begin 301 DarkGradient( dst.Canvas, X - 6, Y + 1, 180, 1);302 with dst.Canvas do301 DarkGradient(Dst.Canvas, X - 6, Y + 1, 180, 1); 302 with Dst.Canvas do 303 303 if mi.Kind >= $10 then 304 304 begin … … 315 315 for I := 3 to nFeature - 1 do 316 316 begin 317 num := 0;317 Num := 0; 318 318 case I of 319 319 mcSeaTrans: 320 320 if mi.Domain = dSea then 321 num := mi.TTrans;321 Num := mi.TTrans; 322 322 mcCarrier: 323 323 if mi.Domain = dSea then 324 num := mi.ATrans_Fuel;324 Num := mi.ATrans_Fuel; 325 325 mcBombs: 326 num := mi.Bombs;326 Num := mi.Bombs; 327 327 mcFuel: 328 328 if mi.Domain = dAir then 329 num := mi.ATrans_Fuel;329 Num := mi.ATrans_Fuel; 330 330 mcAirTrans: 331 331 if mi.Domain = dAir then 332 num := mi.TTrans;332 Num := mi.TTrans; 333 333 mcFirstNonCap .. nFeature - 1: 334 334 if mi.Cap and (1 shl (I - mcFirstNonCap)) <> 0 then 335 num := 1;335 Num := 1; 336 336 end; 337 if ( num > 0) and337 if (Num > 0) and 338 338 ((I <> mcSE) or (mi.Cap and (1 shl (mcNP - mcFirstNonCap)) = 0)) 339 339 then 340 340 begin 341 if num > 1 then341 if Num > 1 then 342 342 begin 343 S := IntToStr( num);343 S := IntToStr(Num); 344 344 W := TextWidth(S); 345 345 Brush.Color := $FFFFFF; … … 352 352 FrameRect(Rect(X - 3 + dx, Y + 2, X + 11 + dx, Y + 16)); 353 353 Brush.Style := TBrushStyle.bsClear; 354 Sprite( dst, HGrSystem, X - 1 + dx, Y + 4, 10, 10,354 Sprite(Dst, HGrSystem, X - 1 + dx, Y + 4, 10, 10, 355 355 66 + I mod 11 * 11, 137 + I div 11 * 11); 356 356 Inc(dx, 15); … … 360 360 end; 361 361 362 procedure NumberBarS( dst: TBitmap; X, Y: Integer; Cap, S: string; T: TTexture);363 begin 364 DLine( dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade, T.ColorBevelLight);365 LoweredTextOut( dst.Canvas, -1, T, X - 2, Y, Cap);366 RisedTextout( dst.Canvas, X + 170 - BiColorTextWidth(dst.Canvas, S), Y, S);362 procedure NumberBarS(Dst: TBitmap; X, Y: Integer; Cap, S: string; T: TTexture); 363 begin 364 DLine(Dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade, T.ColorBevelLight); 365 LoweredTextOut(Dst.Canvas, -1, T, X - 2, Y, Cap); 366 RisedTextout(Dst.Canvas, X + 170 - BiColorTextWidth(Dst.Canvas, S), Y, S); 367 367 end; 368 368 -
trunk/Log.pas
r468 r531 73 73 if List.Lines.Count = MaxLines then 74 74 List.Lines.Delete(0); 75 List.Lines.Add( char(48 + Turn div 100 mod 10) +76 char(48 + Turn div 10 mod 10) + char(48 + Turn mod 10) + ' ' + Text);75 List.Lines.Add(Char(48 + Turn div 100 mod 10) + 76 Char(48 + Turn div 10 mod 10) + Char(48 + Turn mod 10) + ' ' + Text); 77 77 PostMessage(List.Handle, WM_VSCROLL, SB_BOTTOM, 0); 78 78 Update; -
trunk/NoTerm.pas
r471 r531 386 386 Shift: TShiftState); 387 387 begin 388 if ( char(Key) = 'M') and (ssCtrl in Shift) then388 if (Char(Key) = 'M') and (ssCtrl in Shift) then 389 389 if LogDlg.Visible then 390 390 LogDlg.Close -
trunk/Packages/CevoComponents/ButtonA.pas
r471 r531 14 14 procedure SetCaption(Text: string); 15 15 procedure SetFont(const Font: TFont); 16 protected 17 procedure Paint; override; 18 public 19 property Font: TFont write SetFont; 16 20 published 17 21 property Visible; 18 22 property Caption: string read FCaption write SetCaption; 19 23 property OnClick; 20 public21 property Font: TFont write SetFont;22 protected23 procedure Paint; override;24 24 end; 25 25 -
trunk/Packages/CevoComponents/ButtonB.pas
r471 r531 14 14 FIndex: Integer; 15 15 procedure SetIndex(Text: Integer); 16 protected 17 procedure Paint; override; 16 18 public 17 19 property Mask: TBitmap read FMask write FMask; … … 20 22 property ButtonIndex: Integer read FIndex write SetIndex; 21 23 property OnClick; 22 protected23 procedure Paint; override;24 24 end; 25 25 -
trunk/Packages/CevoComponents/ButtonBase.pas
r496 r531 140 140 // procedure TButtonBase.PlayDownSound; 141 141 // begin 142 // if DownSound<>'' then SndPlaySound( pchar(DownSound),SND_ASYNC)142 // if DownSound<>'' then SndPlaySound(PChar(DownSound),SND_ASYNC) 143 143 // end; 144 144 145 145 // procedure TButtonBase.PlayUpSound; 146 146 // begin 147 // if UpSound<>'' then SndPlaySound( pchar(UpSound),SND_ASYNC)147 // if UpSound<>'' then SndPlaySound(PChar(UpSound),SND_ASYNC) 148 148 // end; 149 149 -
trunk/Packages/CevoComponents/ButtonC.pas
r447 r531 12 12 FIndex: Integer; 13 13 procedure SetIndex(Text: Integer); 14 protected 15 procedure Paint; override; 14 16 published 15 17 property Visible; 16 18 property ButtonIndex: Integer read FIndex write SetIndex; 17 19 property OnClick; 18 protected19 procedure Paint; override;20 20 end; 21 21 -
trunk/Packages/CevoComponents/ButtonN.pas
r505 r531 20 20 procedure SetIndex(X: Integer); 21 21 procedure SetSmartHint(X: string); 22 protected 23 procedure Paint; override; 24 procedure MouseDown(Button: TMouseButton; Shift: TShiftState; 25 X, Y: Integer); override; 22 26 published 23 27 property Possible: Boolean read FPossible write SetPossible; … … 29 33 property ButtonIndex: Integer read FIndex write SetIndex; 30 34 property OnClick: TNotifyEvent read ChangeProc write ChangeProc; 31 protected32 procedure Paint; override;33 procedure MouseDown(Button: TMouseButton; Shift: TShiftState;34 X, Y: Integer); override;35 35 end; 36 36 -
trunk/Packages/CevoComponents/DrawDlg.pas
r527 r531 43 43 procedure FormCreate(Sender: TObject); 44 44 procedure FormPaint(Sender: TObject); 45 public46 MessgText: string;47 45 protected 48 46 Lines: Integer; … … 50 48 procedure SplitText(Preview: Boolean); 51 49 procedure CorrectHeight; 50 public 51 MessgText: string; 52 52 end; 53 53 -
trunk/Packages/CevoComponents/EOTButton.pas
r530 r531 17 17 // EndOfTurn button 18 18 TEOTButton = class(TButtonBase) 19 private 20 FTemplate: TBitmap; 21 FIndex: Integer; 22 procedure SetIndex(X: Integer); 23 protected 24 Buffer, Back: TBitmap; 25 procedure Paint; override; 19 26 public 20 27 constructor Create(aOwner: TComponent); override; … … 22 29 procedure SetButtonIndexFast(X: Integer); 23 30 procedure SetBack(Canvas: TCanvas; X, Y: Integer); 24 private25 FTemplate: TBitmap;26 FIndex: Integer;27 procedure SetIndex(X: Integer);28 public29 31 property Template: TBitmap read FTemplate write FTemplate; 30 32 published … … 32 34 property ButtonIndex: Integer read FIndex write SetIndex; 33 35 property OnClick; 34 protected35 Buffer, Back: TBitmap;36 procedure Paint; override;37 36 end; 38 37 -
trunk/Packages/CevoComponents/ScreenTools.pas
r530 r531 1040 1040 else begin 1041 1041 DstPtr.NextPixel; 1042 continue;1042 Continue; 1043 1043 end; 1044 1044 if R = 0 then -
trunk/Packages/CevoComponents/Sound.pas
r447 r531 315 315 Result := (WavFileName <> '') and (WavFileName[1] <> '[') and (WavFileName <> '*'); 316 316 if Result then 317 // SndPlaySound( pchar(GetSoundsDir + DirectorySeparator + WavFileName + '.wav'), SND_ASYNC)317 // SndPlaySound(PChar(GetSoundsDir + DirectorySeparator + WavFileName + '.wav'), SND_ASYNC) 318 318 PlaySound(GetSoundsDir + DirectorySeparator + WavFileName); 319 319 end; -
trunk/Packages/Common/Common.pas
r456 r531 184 184 (*function DelTree(DirName : string): Boolean; 185 185 var 186 SHFileOpStruct 187 DirBuf 186 SHFileOpStruct: TSHFileOpStruct; 187 DirBuf: array [0..255] of char; 188 188 begin 189 189 DirName := UTF8Decode(DirName); 190 190 try 191 Fill char(SHFileOpStruct,Sizeof(SHFileOpStruct),0);192 FillChar(DirBuf, Sizeof(DirBuf), 0 ) 193 StrPCopy(DirBuf, DirName) 191 FillChar(SHFileOpStruct, Sizeof(SHFileOpStruct), 0); 192 FillChar(DirBuf, Sizeof(DirBuf), 0 ); 193 StrPCopy(DirBuf, DirName); 194 194 with SHFileOpStruct do begin 195 195 Wnd := 0; … … 200 200 fFlags := fFlags or FOF_SILENT; 201 201 end; 202 Result := (SHFileOperation(SHFileOpStruct) = 0) 202 Result := (SHFileOperation(SHFileOpStruct) = 0); 203 203 except 204 204 Result := False; 205 205 end; 206 206 end;*) -
trunk/Start.pas
r520 r531 1623 1623 NewName: string; 1624 1624 F: file; 1625 ok: Boolean;1625 Ok: Boolean; 1626 1626 MapPictureFileName: string; 1627 1627 begin … … 1652 1652 AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] + 1653 1653 CevoMapExt); 1654 ok := True;1654 Ok := True; 1655 1655 try 1656 1656 if Page = pgLoad then … … 1660 1660 except 1661 1661 // Play('INVALID'); 1662 ok := False;1662 Ok := False; 1663 1663 end; 1664 1664 if Page <> pgLoad then begin … … 1674 1674 end; 1675 1675 end; 1676 if ok then begin1676 if Ok then begin 1677 1677 if Page = pgLoad then 1678 1678 FormerGames[List.ItemIndex] := NewName
Note:
See TracChangeset
for help on using the changeset viewer.