Changeset 318 for trunk/LocalPlayer/Select.pas
- Timestamp:
- Mar 19, 2021, 12:32:32 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Select.pas
r315 r318 53 53 Column: array [0 .. nPl - 1] of integer; 54 54 Closable, MultiPage: boolean; 55 ScienceNationDot : TBitmap;55 ScienceNationDotBuffer: TBitmap; 56 56 procedure ScrollBarUpdate(Sender: TObject); 57 57 procedure InitLines; … … 110 110 Layer1Btn.Hint := Phrases.Lookup('BTN_WONDERS'); 111 111 Layer2Btn.Hint := Phrases.Lookup('BTN_CLASSES'); 112 ScienceNationDot := TBitmap.Create;113 ScienceNationDot .PixelFormat := pf24bit;114 ScienceNationDot .SetSize(17, 17);115 ScienceNationDot .Canvas.FillRect(0, 0, ScienceNationDot.Width, ScienceNationDot.Height);112 ScienceNationDotBuffer := TBitmap.Create; 113 ScienceNationDotBuffer.PixelFormat := pf24bit; 114 ScienceNationDotBuffer.SetSize(17, 17); 115 ScienceNationDotBuffer.Canvas.FillRect(0, 0, ScienceNationDotBuffer.Width, ScienceNationDotBuffer.Height); 116 116 end; 117 117 … … 119 119 begin 120 120 FreeAndNil(sb); 121 FreeAndNil(ScienceNationDot );121 FreeAndNil(ScienceNationDotBuffer); 122 122 end; 123 123 … … 817 817 LoweredTextOut(Canvas, -1, MainTexture, xScreen + 10, 818 818 ClientHeight - 29, s); 819 BitBltCanvas(ScienceNationDot .Canvas, 0, 0, 17, 17, Canvas,820 xScreen - 10, ClientHeight - 27);821 ImageOp_BCC(ScienceNationDot , Templates.Data, 0, 0, 114, 211, 17, 17,822 MainTexture.clBevelShade, Tribe[ScienceNation].Color);823 BitBltCanvas(Canvas, xScreen - 10, ClientHeight - 27, 17, 17,824 ScienceNationDot. Canvas, 0, 0);825 end; 826 end 819 BitBltCanvas(ScienceNationDotBuffer.Canvas, 0, 0, ScienceNationDot.Width, 820 ScienceNationDot.Height, Canvas, xScreen - 10, ClientHeight - 27); 821 ImageOp_BCC(ScienceNationDotBuffer, Templates.Data, Point(0, 0), 822 ScienceNationDot.BoundsRect, MainTexture.clBevelShade, Tribe[ScienceNation].Color); 823 BitBltCanvas(Canvas, xScreen - 10, ClientHeight - 27, ScienceNationDot.Width, 824 ScienceNationDot.Height, ScienceNationDotBuffer.Canvas, 0, 0); 825 end; 826 end; 827 827 end; 828 828 end; … … 855 855 begin 856 856 CityDlg.FormShow(nil); 857 CityDlg.Invalidate 857 CityDlg.Invalidate; 858 858 end; 859 result := true 859 result := true; 860 860 end 861 861 else 862 result := false 862 result := false; 863 863 end; 864 864 … … 881 881 begin 882 882 UnitStatDlg.FormShow(nil); 883 UnitStatDlg.Invalidate 883 UnitStatDlg.Invalidate; 884 884 end; 885 result := true 885 result := true; 886 886 end 887 887 else 888 result := false 888 result := false; 889 889 end; 890 890 … … 905 905 result := lix; 906 906 Closable := true; 907 Close 908 end 907 Close; 908 end; 909 909 end 910 910 else if (ssLeft in Shift) and (ssShift in Shift) then … … 949 949 kShipPart, kEShipPart: 950 950 ; 951 end 951 end; 952 952 end 953 953 else if ssRight in Shift then … … 961 961 if RenameModel(lix) then 962 962 SmartUpdateContent; 963 end 964 end 963 end; 964 end; 965 965 end; 966 966 … … 991 991 swap := code[0, i]; 992 992 code[0, i] := code[0, j]; 993 code[0, j] := swap 993 code[0, j] := swap; 994 994 end; 995 995 end; … … 1006 1006 swap := code[0, i]; 1007 1007 code[0, i] := code[0, j]; 1008 code[0, j] := swap 1008 code[0, j] := swap; 1009 1009 end; 1010 1010 end; … … 1047 1047 if (AdvPreq[i, 1] >= 0) then 1048 1048 MarkPreqs(AdvPreq[i, 1]); 1049 end 1049 end; 1050 1050 end; 1051 1051 … … 1060 1060 begin 1061 1061 Lines[i] := 0; 1062 FirstShrinkedLine[i] := MaxInt 1062 FirstShrinkedLine[i] := MaxInt; 1063 1063 end; 1064 1064 case Kind of … … 1103 1103 (MyMap[Loc1] and fCanal > 0)) then 1104 1104 ok := true; 1105 end 1105 end; 1106 1106 end 1107 1107 else … … 1112 1112 begin 1113 1113 code[2, Lines[2]] := i; 1114 inc(Lines[2]) 1114 inc(Lines[2]); 1115 1115 end; 1116 1116 if MyModel[i].Status and msAllowConscripts <> 0 then 1117 1117 begin 1118 1118 code[2, Lines[2]] := i + cpConscripts; 1119 inc(Lines[2]) 1119 inc(Lines[2]); 1120 1120 end; 1121 1121 end; … … 1153 1153 begin 1154 1154 code[0, Lines[0]] := adMilitary; 1155 inc(Lines[0]) 1155 inc(Lines[0]); 1156 1156 end; 1157 1157 end; … … 1270 1270 begin 1271 1271 code[0, Lines[0]] := i; 1272 inc(Lines[0]) 1272 inc(Lines[0]); 1273 1273 end; 1274 1274 SortCities; … … 1282 1282 begin 1283 1283 code[0, Lines[0]] := i; 1284 inc(Lines[0]) 1284 inc(Lines[0]); 1285 1285 end; 1286 1286 SortCities; 1287 FirstShrinkedLine[0] := 0 1287 FirstShrinkedLine[0] := 0; 1288 1288 end; 1289 1289 { kChooseECity: … … 1305 1305 Lines[0] := MyRO.nModel; 1306 1306 SortModels; 1307 FirstShrinkedLine[0] := 0 1307 FirstShrinkedLine[0] := 0; 1308 1308 end; 1309 1309 kChooseModel: … … 1329 1329 begin 1330 1330 code[0, Lines[0]] := mixAll; 1331 inc(Lines[0]); 1332 end; 1333 FirstShrinkedLine[0] := 0 1331 inc(Lines[0]);; 1332 end; 1333 FirstShrinkedLine[0] := 0; 1334 1334 end; 1335 1335 kChooseEModel: … … 1349 1349 if ModelOk[emix] then 1350 1350 begin 1351 if Tribe[DipMem[me].pContact].ModelPicture1352 [MyRO.EnemyModel[emix].mix].HGr = HGrSystemthen1351 if not Assigned(Tribe[DipMem[me].pContact].ModelPicture 1352 [MyRO.EnemyModel[emix].mix].HGr) then 1353 1353 InitEnemyModel(emix); 1354 1354 code[0, Lines[0]] := emix; … … 1362 1362 inc(Lines[0]); 1363 1363 end; 1364 FirstShrinkedLine[0] := 0 1364 FirstShrinkedLine[0] := 0; 1365 1365 end; 1366 1366 kEModels: … … 1373 1373 (MyRO.EnemyModel[code[1, Lines[0]]].mix = i)) do 1374 1374 dec(code[1, Lines[0]]); 1375 if Tribe[pView].ModelPicture[i].HGr = HGrSystemthen1375 if not Assigned(Tribe[pView].ModelPicture[i].HGr) then 1376 1376 InitEnemyModel(code[1, Lines[0]]); 1377 1377 code[0, Lines[0]] := i; … … 1381 1381 end; 1382 1382 SortModels; 1383 FirstShrinkedLine[0] := 0 1383 FirstShrinkedLine[0] := 0; 1384 1384 end; 1385 1385 kAllEModels: … … 1394 1394 PPicture := @Tribe[MyRO.EnemyModel[emix].Owner].ModelPicture 1395 1395 [MyRO.EnemyModel[emix].mix]; 1396 if PPicture.HGr = HGrSystemthen1396 if not Assigned(PPicture.HGr) then 1397 1397 InitEnemyModel(emix); 1398 1398 ok := true; … … 1409 1409 code[1, j] := 1; 1410 1410 ok := false; 1411 Break 1411 Break; 1412 1412 end; 1413 1413 end; … … 1418 1418 code[2, Lines[0]] := ModelSortValue(MyRO.EnemyModel[emix], true); 1419 1419 inc(Lines[0]); 1420 end 1420 end; 1421 1421 end; 1422 1422 SortModels; … … 1427 1427 begin 1428 1428 code[0, Lines[0]] := i; 1429 inc(Lines[0]) 1429 inc(Lines[0]); 1430 1430 end; 1431 1431 (* kDeliver: … … 1472 1472 begin 1473 1473 code[0, Lines[0]] := i; 1474 inc(Lines[0]) 1474 inc(Lines[0]); 1475 1475 end; 1476 1476 kMission: … … 1478 1478 begin 1479 1479 code[0, Lines[0]] := i; 1480 inc(Lines[0]) 1480 inc(Lines[0]); 1481 1481 end; 1482 1482 end; … … 1586 1586 TechNameSpace := TechNameSpace + 640 - InnerWidth - 2 * SideFrame; 1587 1587 InnerWidth := 640 - 2 * SideFrame 1588 end 1588 end; 1589 1589 end; 1590 1590 kAdvance, kFarAdvance: … … 1695 1695 begin 1696 1696 ToggleBtn.ButtonIndex := 13; 1697 ToggleBtn.Hint := Phrases.Lookup('FARTECH') 1697 ToggleBtn.Hint := Phrases.Lookup('FARTECH'); 1698 1698 end 1699 1699 else if Kind = kCities then 1700 1700 begin 1701 1701 ToggleBtn.ButtonIndex := 15; 1702 ToggleBtn.Hint := Phrases.Lookup('BTN_PAGE') 1702 ToggleBtn.Hint := Phrases.Lookup('BTN_PAGE'); 1703 1703 end 1704 1704 else 1705 1705 begin 1706 1706 ToggleBtn.ButtonIndex := 28; 1707 ToggleBtn.Hint := Phrases.Lookup('BTN_SELECT') 1707 ToggleBtn.Hint := Phrases.Lookup('BTN_SELECT'); 1708 1708 end; 1709 1709 … … 1740 1740 ShowNewContent(NewMode, kModels) 1741 1741 else 1742 ShowNewContent(NewMode, kEModels) 1742 ShowNewContent(NewMode, kEModels); 1743 1743 end; 1744 1744 … … 1756 1756 sb.Init(Lines[Layer] - 1, DispLines); 1757 1757 OffscreenPaint; 1758 Invalidate 1758 Invalidate; 1759 1759 end; 1760 1760 … … 1768 1768 Sel := -2; 1769 1769 sb.Init(Lines[Layer] - 1, DispLines); 1770 SmartUpdateContent 1770 SmartUpdateContent; 1771 1771 end; 1772 1772 … … 1781 1781 result := adFar; 1782 1782 Closable := true; 1783 Close 1783 Close; 1784 1784 end; 1785 1785 kCities, kCityEvents: … … 1821 1821 Popup.Popup(Left + ToggleBtn.Left, Top + ToggleBtn.Top + 1822 1822 ToggleBtn.Height); 1823 end 1824 end 1823 end; 1824 end; 1825 1825 end; 1826 1826 … … 1835 1835 // prevent closing 1836 1836 else 1837 inherited 1837 inherited; 1838 1838 end; 1839 1839 … … 1841 1841 begin 1842 1842 if Visible and (Kind = kCities) then 1843 SmartUpdateContent 1843 SmartUpdateContent; 1844 1844 end; 1845 1845
Note:
See TracChangeset
for help on using the changeset viewer.