1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607: 608: 609: 610: 611: 612: 613: 614: 615: 616: 617: 618: 619: 620: 621: 622: 623: 624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637: 638: 639: 640: 641: 642: 643: 644: 645: 646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659: 660: 661: 662: 663: 664: 665: 666: 667: 668: 669: 670: 671: 672: 673: 674: 675: 676: 677: 678: 679: 680: 681: 682: 683: 684: 685: 686: 687: 688: 689: 690: 691: 692: 693: 694: 695: 696: 697: 698: 699: 700: 701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711: 712: 713: 714: 715: 716: 717: 718: 719: 720: 721: 722: 723: 724: 725: 726: 727: 728: 729: 730: 731: 732: 733: 734: 735: 736: 737: 738: 739: 740: 741: 742: 743: 744: 745: 746: 747: 748: 749: 750: 751: 752: 753: 754: 755: 756: 757: 758: 759: 760: 761: 762: 763: 764: 765: 766: 767: 768: 769: 770: 771: 772: 773: 774: 775: 776: 777: 778: 779: 780: 781: 782: 783: 784: 785: 786: 787: 788: 789: 790: 791: 792: 793: 794: 795: 796: 797: 798: 799: 800: 801: 802: 803: 804: 805: 806: 807: 808: 809: 810: 811: 812: 813: 814: 815: 816: 817: 818: 819: 820: 821: 822: 823: 824: 825: 826: 827: 828: 829: 830: 831: 832: 833: 834: 835: 836: 837: 838: 839: 840: 841: 842: 843: 844: 845: 846: 847: 848: 849: 850: 851: 852: 853: 854: 855: 856: 857: 858: 859: 860: 861: 862: 863: 864: 865: 866: 867: 868: 869: 870: 871: 872: 873: 874: 875: 876: 877: 878: 879: 880: 881: 882: 883: 884: 885: 886: 887: 888: 889: 890: 891: 892: 893: 894: 895: 896: 897: 898: 899: 900: 901: 902: 903: 904: 905: 906: 907: 908: 909: 910: 911: 912: 913: 914: 915: 916: 917: 918: 919: 920: 921: 922: 923: 924: 925: 926: 927: 928: 929: 930: 931: 932: 933: 934: 935: 936: 937: 938: 939: 940: 941: 942: 943: 944: 945: 946: 947: 948: 949: 950: 951: 952: 953: 954: 955: 956: 957: 958: 959: 960: 961: 962: 963: 964: 965: 966: 967: 968: 969: 970: 971: 972: 973: 974: 975: 976: 977: 978: 979: 980: 981: 982: 983: 984: 985: 986: 987: 988: 989: 990: 991: 992: 993: 994: 995: 996: 997: 998: 999: 1000: 1001: 1002: 1003: 1004: 1005: 1006: 1007: 1008: 1009: 1010: 1011: 1012: 1013: 1014: 1015: 1016: 1017: 1018: 1019: 1020: 1021: 1022: 1023: 1024: 1025: 1026: 1027: 1028: 1029: 1030: 1031: 1032: 1033: 1034: 1035: 1036: 1037: 1038: 1039: 1040: 1041: 1042: 1043: 1044: 1045: 1046: 1047: 1048: 1049: 1050: 1051: 1052: 1053: 1054: 1055: 1056: 1057: 1058: 1059: 1060: 1061: 1062: 1063: 1064: 1065: 1066: 1067: 1068: 1069: 1070: 1071: 1072: 1073: 1074: 1075: 1076: 1077: 1078: 1079: 1080: 1081: 1082: 1083: 1084: 1085: 1086: 1087: 1088: 1089: 1090: 1091: 1092: 1093: 1094: 1095: 1096: 1097: 1098: 1099: 1100: 1101: 1102: 1103: 1104: 1105: 1106: 1107: 1108: 1109: 1110: 1111: 1112: 1113: 1114: 1115: 1116: 1117: 1118: 1119: 1120: 1121: 1122: 1123: 1124: 1125: 1126: 1127: 1128: 1129: 1130: 1131: 1132: 1133: 1134: 1135: 1136: 1137: 1138: 1139: 1140: 1141: 1142: 1143: 1144: 1145: 1146: 1147: 1148: 1149: 1150: 1151: 1152: 1153: 1154: 1155: 1156: 1157: 1158: 1159: 1160: 1161: 1162: 1163: 1164: 1165: 1166: 1167: 1168: 1169: 1170: 1171: 1172: 1173: 1174: 1175: 1176: 1177: 1178: 1179: 1180: 1181: 1182: 1183: 1184: 1185: 1186: 1187: 1188: 1189: 1190: 1191: 1192: 1193: 1194: 1195: 1196: 1197: 1198: 1199: 1200: 1201: 1202: 1203: 1204: 1205: 1206: 1207: 1208: 1209: 1210: 1211: 1212: 1213: 1214: 1215: 1216: 1217: 1218: 1219: 1220: 1221: 1222: 1223: 1224: 1225: 1226: 1227: 1228: 1229: 1230: 1231: 1232: 1233: 1234: 1235: 1236: 1237: 1238: 1239: 1240: 1241: 1242: 1243: 1244: 1245: 1246: 1247: 1248: 1249: 1250: 1251: 1252: 1253: 1254: 1255: 1256: 1257: 1258: 1259: 1260: 1261: 1262: 1263: 1264: 1265: 1266: 1267: 1268: 1269: 1270: 1271: 1272: 1273: 1274: 1275: 1276: 1277: 1278: 1279: 1280: 1281: 1282: 1283: 1284: 1285: 1286: 1287: 1288: 1289: 1290: 1291: 1292: 1293: 1294: 1295: 1296: 1297: 1298: 1299: 1300: 1301: 1302: 1303: 1304: 1305: 1306: 1307: 1308: 1309: 1310: 1311: 1312: 1313: 1314: 1315: 1316: 1317: 1318: 1319: 1320: 1321: 1322: 1323: 1324: 1325: 1326: 1327: 1328: 1329: 1330: 1331: 1332: 1333: 1334: 1335: 1336: 1337: 1338: 1339: 1340: 1341: 1342: 1343: 1344: 1345: 1346: 1347: 1348: 1349: 1350: 1351: 1352: 1353: 1354: 1355: 1356: 1357: 1358: 1359: 1360: 1361: 1362: 1363: 1364: 1365: 1366: 1367: 1368: 1369: 1370: 1371: 1372: 1373: 1374: 1375: 1376: 1377: 1378: 1379: 1380: 1381: 1382: 1383: 1384: 1385: 1386: 1387: 1388: 1389: 1390: 1391: 1392: 1393: 1394: 1395: 1396: 1397: 1398: 1399: 1400: 1401: 1402: 1403: 1404: 1405: 1406: 1407: 1408: 1409: 1410: 1411: 1412: 1413: 1414: 1415: 1416: 1417: 1418: 1419: 1420: 1421: 1422: 1423: 1424: 1425: 1426: 1427: 1428: 1429: 1430: 1431: 1432: 1433: 1434: 1435: 1436: 1437: 1438: 1439: 1440: 1441: 1442: 1443: 1444: 1445: 1446: 1447: 1448: 1449: 1450: 1451: 1452: 1453: 1454: 1455: 1456: 1457: 1458: 1459: 1460: 1461: 1462: 1463: 1464: 1465: 1466: 1467: 1468: 1469: 1470: 1471: 1472: 1473: 1474: 1475: 1476: 1477: 1478: 1479: 1480: 1481: 1482: 1483: 1484: 1485: 1486: 1487: 1488: 1489: 1490: 1491: 1492: 1493: 1494: 1495: 1496: 1497: 1498: 1499: 1500: 1501: 1502: 1503: 1504: 1505: 1506: 1507: 1508: 1509: 1510: 1511: 1512: 1513: 1514: 1515: 1516: 1517: 1518: 1519: 1520: 1521: 1522: 1523: 1524: 1525: 1526: 1527: 1528: 1529: 1530: 1531: 1532: 1533: 1534: 1535: 1536: 1537: 1538: 1539: 1540: 1541: 1542: 1543: 1544: 1545: 1546: 1547: 1548: 1549: 1550: 1551: 1552: 1553: 1554:
| unit Unit1;
interface
uses .....
type TForm1 = class(TForm) ship: TImage; p1: TImage; p17: TImage; p18: TImage; p2: TImage; p3: TImage; p4: TImage; p6: TImage; p5: TImage; p12: TImage; p11: TImage; p10: TImage; p9: TImage; p8: TImage; p7: TImage; p14: TImage; p15: TImage; p16: TImage; p13: TImage; shipgrid: TImage; GroupBox1: TGroupBox; GroupBox2: TGroupBox; Panel1: TPanel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; w1: TLabel; w2: TLabel; w3: TLabel; w4: TLabel; w5: TLabel; w6: TLabel; w7: TLabel; w8: TLabel; w9: TLabel; w10: TLabel; w12: TLabel; w11: TLabel; w13: TLabel; techgrid: TImage; Bevel1: TBevel; beenden: TPanel; Edit1: TEdit; gp: TGroupBox; m: TMemo; Panel2: TPanel; Panel3: TPanel; Label14: TLabel; Label15: TLabel; u: TLabel; Panel4: TPanel; Panel5: TPanel; od: TOpenDialog; sd: TSaveDialog; cb1: TComboBox; ScrollBox1: TScrollBox; ScrollBox2: TScrollBox; Label16: TLabel; w14: TLabel; SpeedButton1: TSpeedButton; SpeedButton2: TSpeedButton; SpeedButton3: TSpeedButton; SpeedButton4: TSpeedButton; SpeedButton5: TSpeedButton; GroupBox3: TGroupBox; Label17: TLabel; Label18: TLabel; Label19: TLabel; Label20: TLabel; Label21: TLabel; Label22: TLabel; Bevel2: TBevel; vpg: TLabel; SpinButton1: TSpinButton; SpinButton2: TSpinButton; SpinButton3: TSpinButton; SpinButton4: TSpinButton; SpinButton5: TSpinButton; ep: TLabel; mp: TLabel; kp: TLabel; wp: TLabel; ap: TLabel; Panel6: TPanel; Label23: TLabel; w15: TLabel; Label25: TLabel; fp: TLabel; SpinButton6: TSpinButton; Image1: TImage; Image2: TImage; Image3: TImage; Image4: TImage; Image5: TImage; Image6: TImage; Image8: TImage; Image7: TImage; GroupBox4: TGroupBox; Label30: TLabel; Label24: TLabel; Label26: TLabel; Label27: TLabel; Label28: TLabel; fr: TLabel; fefr: TLabel; id: TLabel; kd: TLabel; tw: TLabel; id2: TLabel; kd2: TLabel; Label29: TLabel; sp: TLabel; IWLink1: TIWLink; Image9: TImage; Image10: TImage; Image11: TImage; Image12: TImage; Image13: TImage; Image14: TImage; Image15: TImage; Image16: TImage; Image17: TImage; Image18: TImage; Image19: TImage; Image20: TImage; Image21: TImage; Image22: TImage; Image23: TImage; wras: TLabel; Image24: TImage; procedure winclose(Sender: TObject; var Action: TCloseAction); procedure Image7Click(Sender: TObject); procedure Image8Click(Sender: TObject); procedure SpinButton6UpClick(Sender: TObject); procedure SpinButton6DownClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure techgridMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure shipgridMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure akt; procedure pods; procedure owi; Procedure loaddata2(hilf : integer); Procedure loadData(hilf : integer); procedure techlistload(hilf: integer); procedure p1Click(Sender: TObject); procedure p2Click(Sender: TObject); procedure p3Click(Sender: TObject); procedure p4Click(Sender: TObject); procedure p5Click(Sender: TObject); procedure p6Click(Sender: TObject); procedure p7Click(Sender: TObject); procedure p8Click(Sender: TObject); procedure p9Click(Sender: TObject); procedure p10Click(Sender: TObject); procedure p11Click(Sender: TObject); procedure p12Click(Sender: TObject); procedure p13Click(Sender: TObject); procedure p14Click(Sender: TObject); procedure p15Click(Sender: TObject); procedure p16Click(Sender: TObject); procedure p17Click(Sender: TObject); procedure p18Click(Sender: TObject); procedure beendenClick(Sender: TObject); procedure Panel1Click(Sender: TObject); procedure Panel2Click(Sender: TObject); function getpodtech(index : integer;line : integer) : integer; procedure Panel4Click(Sender: TObject); procedure Panel5Click(Sender: TObject); procedure cb1Change(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); procedure SpeedButton3Click(Sender: TObject); procedure SpeedButton4Click(Sender: TObject); procedure SpeedButton5Click(Sender: TObject); procedure SpinButton1DownClick(Sender: TObject); procedure SpinButton1UpClick(Sender: TObject); procedure SpinButton2DownClick(Sender: TObject); procedure SpinButton2UpClick(Sender: TObject); procedure SpinButton3DownClick(Sender: TObject); procedure SpinButton3UpClick(Sender: TObject); procedure SpinButton4DownClick(Sender: TObject); procedure SpinButton4UpClick(Sender: TObject); procedure SpinButton5DownClick(Sender: TObject); procedure SpinButton5UpClick(Sender: TObject); procedure Panel6Click(Sender: TObject); private public end;
var Form1: TForm1; rectold : trect; techlist : tstringlist; shiplist : tstringlist; atech : integer; alist : tstringlist; aslist : tstringlist; schiffgewaehlt : boolean; apod : timage; bit : tpicture; werte : array[1..19] of integer; rasse : array[1..20] of integer; ow : array[1..18,1..19] of integer; shipg : boolean; podsav : array[1..18] of integer; sh : integer; save : boolean; oplist : tstringlist; ras : integer; hit : integer; pe,pm,pk,pw,pa,pf : integer; list : integer; listarray : array[1..18] of integer; path : string; pod : string;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject); var i : integer; begin path := ExtractFilePath(Application.ExeName);
TPicture.RegisterFileFormat('jpg', 'JPG Files', TJPEGImage); TPicture.RegisterFileFormat('jpeg', 'JPG Files', TJPEGImage); pod := path+'Techs\a.jpeg'; ras := 1; oplist := tstringlist.Create; alist := tstringlist.Create; aslist := tstringlist.Create; atech := 0; techgrid.Refresh; techlist := tstringlist.Create; bit := tpicture.Create; techlist.LoadFromFile(path+'Angriff.txt'); techgrid.picture.LoadFromFile(techlist.Strings[0]); bit := techgrid.Picture; techgrid.refresh; techgrid.Picture := bit; techgrid.Stretch := true; techgrid.Height := techgrid.Height div 2; techgrid.Width := techgrid.Width div 2;
image23.Picture.LoadFromFile(path+'OSe.jpg'); shipgrid.Refresh; shiplist := tstringlist.Create; shiplist.loadfromfile(path+'Schiffverzeichnisse.txt'); shipgrid.Picture.LoadFromFile(path+'Schiffe\Schiffliste.jpg');
rectold.Right := 0; rectold.Top := 0; rectold.Left := 100; rectold.Bottom := 90; owi; shipg := false;
for i := 1 to 18 do podsav[i] := -1; for i := 1 to 18 do listarray[i] := -1; for i := 1 to 20 do rasse[i] := 0;
save := true;
cb1.SelText := ''; cb1.seltext := 'Menschen (3,0%)';
ras := 1; pe := 3; pm := 3; pw := 3; pk := 3; pf := 3; pa := 25;
list := 1; akt;
end;
procedure TForm1.techgridMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var s : integer; hx, hy : integer; begin hx := 0; hy := (y div 90)*90; techgrid.picture.Bitmap.Canvas.Brush.Style := bsclear; s := y div 90+1; aslist.LoadFromFile(path+techlist.Strings[s]); atech := y div 90+2; techgrid.picture.Bitmap.Canvas.Pen.color := clblack; techgrid.picture.Bitmap.Canvas.Rectangle(rectold); techgrid.picture.Bitmap.Canvas.pen.color := clyellow; techgrid.picture.Bitmap.Canvas.rectangle(hx,hy,hx+100,hy+90); rectold.Right := hx; rectold.Top := hy; rectold.Left := hx+100; rectold.Bottom := hy+90;; end;
procedure TForm1.shipgridMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var hx,hy,i : integer; s : string; begin image23.Visible:=false; wras.Visible:=true; hx := x div 125; hy := y div 75+1; if (6*(hy-1)+hx <> 24) then begin alist.LoadFromFile(path+shiplist.Strings[6*(hy-1)+hx]); for i := 1 to 13 do begin werte[i] := strtoint(alist.Strings[i]); end; for i:=14 to 19 do begin werte[i] :=0; end; for i:=1 to 20 do begin rasse[i] := 0; end; rasse[19] := strtoint(alist.Strings[16]); s := shiplist.Strings[6*(hy-1)+hx]; delete(s,length(s)-2,3); s := path+s+'jpg'; sh := 6*(hy-1)+hx; ship.Picture.LoadFromFile(s); hit := strtoint(alist.Strings[15]); akt; pods; owi; shipg := true; for i := 1 to 18 do podsav[i] := -1; for i := 1 to 18 do listarray[i] := -1; end else showmessage('Kommt erst wenn die Werte verfügbar sind.'); end;
procedure tform1.akt; var st : real; day,hour,min,sec:real; str :string; i : integer; r :array[0..6] of boolean; begin w1.Caption := inttostr(werte[1]); w2.Caption := inttostr(werte[2]); w3.Caption := inttostr(werte[3]); w4.Caption := inttostr(werte[4]); w5.Caption := inttostr(werte[5]); w6.Caption := inttostr(werte[6]); if werte[7]< werte[8] then begin w8.Font.Color:=clred; end else begin w8.Font.Color:=clWhite; end; w7.Caption := inttostr(werte[7]); w8.Caption := inttostr(werte[8]); w9.Caption := inttostr(werte[9]); w10.Caption := inttostr(werte[10]); w11.Caption := inttostr(werte[11]); w12.Caption := inttostr(werte[12]); w13.Caption := inttostr(werte[13]); w15.Caption := inttostr(werte[14]); fr.Caption := inttostr(werte[15])+' k'; fefr.Caption := inttostr(werte[16])+' k'; id2.Caption :=inttostr(werte[17]); kd2.Caption :=inttostr(werte[18]); if werte[17]>0 then begin st:=((strtofloat(inttostr(werte[17])))/1000); sec:=(132/(st))*3600; min:=int(sec/60); sec:=int(sec-(min*60)); hour:=int(min/60); min:=int(min-(hour*60)); day:=int(hour/24); hour:=hour-(day*24); str:=floattostr(day)+':'+floattostr(hour)+':'+floattostr(min)+':'+floattostr(sec);; id.Caption :=str; end else begin id.Caption:='n/a'; end; if werte[18]>0 then begin st:=strtofloat(inttostr(werte[18])); sec:=(120/(st))*3600; min:=int(sec/60); sec:=int(sec-(min*60)); hour:=int(min/60); min:=int(min-(hour*60)); day:=int(hour/24); hour:=hour-(day*24); str:=floattostr(day)+':'+floattostr(hour)+':'+floattostr(min)+':'+floattostr(sec);; kd.Caption :=str; end else begin kd.Caption:='n/a'; end; tw.Caption := inttostr(werte[19])+' k'; sp.Caption :=floattostr(round((strtofloat(inttostr(werte[7] + werte[2] + (werte[3]*3)+(werte[5] *2)+ werte[4] + werte[6] + werte[18])) +( (strtofloat(inttostr(werte[17])))/1000))/2)); wras.Font.Color:=clwhite; for i:=0 to 6 do r[i]:=false; for i:=1 to 19 do begin case rasse[i] of 0: r[0]:=true; 1: r[1]:=true; 2: r[2]:=true; 3: r[3]:=true; 4: r[4]:=true; 5: r[5]:=true; 6: r[6]:=true; 99: begin r[1]:=true; r[2]:=true; end; end; end; if ((r[0]= true) and (r[1]= false) and (r[2]= false) and (r[3]= false) and (r[4]= false) and (r[5]= false) and (r[6] = false)) then rasse[20]:=0 else if ((r[1]=true) and (r[2]= false) and (r[3]= false) and (r[4]= false) and (r[5]= false) and (r[6] = false)) then rasse[20]:=1 else if ((r[2]=true) and (r[1]= false) and (r[3]= false) and (r[4]= false) and (r[5]= false) and (r[6] = false)) then rasse[20]:=2 else if ((r[3]=true) and (r[2]= false) and (r[1]= false) and (r[4]= false) and (r[5]= false) and (r[6] = false)) then rasse[20]:=3 else if ((r[4]=true) and (r[2]= false) and (r[3]= false) and (r[1]= false) and (r[5]= false) and (r[6] = false)) then rasse[20]:=4 else if ((r[5]=true) and (r[2]= false) and (r[3]= false) and (r[4]= false) and (r[1]= false) and (r[6] = false)) then rasse[20]:=5 else if ((r[6]=true) and (r[2]= false) and (r[3]= false) and (r[4]= false) and (r[5]= false) and (r[1] = false)) then rasse[20]:=6 else rasse[20]:=99; wras.Visible:=true; case rasse[20] of 0 : begin wras.Caption :=''; wras.Visible :=false; end; 1 : wras.Caption :='Nur Menschen können dieses Schiff bauen!'; 2 : wras.Caption :='Nur Ti-Roc können dieses Schiff baunen!'; 3 : wras.Caption :='Nur Myridianer können dieses Schiff bauen!'; 4 : wras.Caption :='Nur Beraluten können dieses Schiff bauen!'; 5 : wras.Caption :='Nur Tradoner können dieses Schiff bauen!'; 6 : wras.Caption :='Nur Se´ze Lux können dieses Schiff baunen!' else begin wras.Font.Color:= clred; wras.Caption :='Keiner kann dieses Schiff baunen!'; end; end; case ras of 1 : u.Caption := inttostr(round((werte[13] div 100)*3.0)); 2 : u.Caption := inttostr(round((werte[13] div 100)*2.85)); 3 : u.Caption := inttostr(round((werte[13] div 100)*2.7)); 4 : u.Caption := inttostr(round((werte[13] div 100)*3.3)); 5 : u.Caption := inttostr(round((werte[13] div 100)*3.9)); 6 : u.Caption := inttostr(round((werte[13] div 100)*3.15)); end; ep.Caption := inttostr(pe); mp.Caption := inttostr(pm); kp.Caption := inttostr(pk); wp.Caption := inttostr(pw); fp.Caption := inttostr(pf); ap.caption := inttostr(pa); w14.Caption := inttostr(hit); vpg.Caption := inttostr(((werte[13]+((werte[9] div 10)*pe)+((werte[10] div 10)*pm)+((werte[11] div 10)*pk)+((werte[14] div 10)*pf)+((werte[12] div 10)*pw)) div 100) * (100+pa)); save := false; end;
procedure tform1.loaddata(hilf: integer); var i: integer; begin podsav[hilf] := atech; for i := 1 to 19 do begin werte[i] := werte[i]-ow[hilf,i]; werte[i] := werte[i]+strtoint(aslist.Strings[i]); ow[hilf,i] := strtoint(aslist.Strings[i]); end; rasse[hilf]:=strtoint(aslist.Strings[20]); akt; listarray[hilf] := list; end;
procedure tform1.pods; begin if strtoint(alist.Strings[14])>0 then begin p1.Picture.LoadFromFile(pod); p1.Visible:=true; end else p1.Visible:=false; if strtoint(alist.Strings[14])>1 then begin p2.Picture.LoadFromFile(pod); p2.Visible:=true; end else p2.Visible:=false; if strtoint(alist.Strings[14])>2 then begin p3.Picture.LoadFromFile(pod); p3.Visible:=true; end else p3.Visible:=false; if strtoint(alist.Strings[14])>3 then begin p4.Picture.LoadFromFile(pod); p4.Visible:=true; end else p4.Visible:=false; if strtoint(alist.Strings[14])>4 then begin p5.Picture.LoadFromFile(pod); p5.Visible:=true; end else p5.Visible:=false; if strtoint(alist.Strings[14])>5 then begin p6.Picture.LoadFromFile(pod); p6.Visible:=true; end else p6.Visible:=false; if strtoint(alist.Strings[14])>6 then begin p7.Picture.LoadFromFile(pod); p7.Visible:=true; end else p7.Visible:=false; if strtoint(alist.Strings[14])>7 then begin p8.Picture.LoadFromFile(pod); p8.Visible:=true; end else p8.Visible:=false; if strtoint(alist.Strings[14])>8 then begin p9.Picture.LoadFromFile(pod); p9.Visible:=true; end else p9.Visible:=false; if strtoint(alist.Strings[14])>9 then begin p10.Picture.LoadFromFile(pod); p10.Visible:=true; end else p10.Visible:=false; if strtoint(alist.Strings[14])>10 then begin p11.Picture.LoadFromFile(pod); p11.Visible:=true; end else p11.Visible:=false; if strtoint(alist.Strings[14])>11 then begin p12.Picture.LoadFromFile(pod); p12.Visible:=true; end else p12.Visible:=false; if strtoint(alist.Strings[14])>12 then begin p13.Picture.LoadFromFile(pod); p13.Visible:=true; end else p13.Visible:=false; if strtoint(alist.Strings[14])>13 then begin p14.Picture.LoadFromFile(pod); p14.Visible:=true; end else p14.Visible:=false; if strtoint(alist.Strings[14])>14 then begin p15.Picture.LoadFromFile(pod); p15.Visible:=true; end else p15.Visible:=false; if strtoint(alist.Strings[14])>15 then begin p16.Picture.LoadFromFile(pod); p16.Visible:=true; end else p16.Visible:=false; if strtoint(alist.Strings[14])>16 then begin p17.Picture.LoadFromFile(pod); p17.Visible:=true; end else p17.Visible:=false; if strtoint(alist.Strings[14])>17 then begin p18.Picture.LoadFromFile(pod); p18.Visible:=true; end else p18.Visible:=false; end;
procedure TForm1.p1Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>0) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p1.Picture.LoadFromFile(s); loaddata(1); end; end;
procedure TForm1.p2Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>1) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p2.Picture.LoadFromFile(s); loaddata(2); end; end;
procedure TForm1.p3Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>2) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p3.Picture.LoadFromFile(s); loaddata(3); end; end;
procedure TForm1.p4Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>3) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p4.Picture.LoadFromFile(s); loaddata(4); end; end;
procedure TForm1.p5Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>4) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p5.Picture.LoadFromFile(s); loaddata(5); end; end;
procedure TForm1.p6Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>5) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p6.Picture.LoadFromFile(s); loaddata(6); end; end;
procedure TForm1.p7Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>6) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p7.Picture.LoadFromFile(s); loaddata(7); end; end;
procedure TForm1.p8Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>7) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p8.Picture.LoadFromFile(s); loaddata(8); end; end;
procedure TForm1.p9Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>8) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p9.Picture.LoadFromFile(s); loaddata(9); end; end;
procedure TForm1.p10Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>9) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p10.Picture.LoadFromFile(s); loaddata(10); end; end;
procedure TForm1.p11Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>10) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p11.Picture.LoadFromFile(s); loaddata(11); end; end;
procedure TForm1.p12Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>11) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p12.Picture.LoadFromFile(s); loaddata(12); end; end;
procedure TForm1.p13Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>12) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p13.Picture.LoadFromFile(s); loaddata(13); end; end;
procedure TForm1.p14Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>13) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p14.Picture.LoadFromFile(s); loaddata(14); end; end;
procedure TForm1.p15Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>14) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p15.Picture.LoadFromFile(s); loaddata(15); end; end;
procedure TForm1.p16Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>15) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p16.Picture.LoadFromFile(s); loaddata(16); end; end;
procedure TForm1.p17Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>16) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p17.Picture.LoadFromFile(s); loaddata(17); end; end;
procedure TForm1.p18Click(Sender: TObject); var s : string; begin if shipg then if (strtoint(alist.Strings[14])>17) then begin aslist.LoadFromFile(path+techlist.Strings[atech-1]); s := techlist.Strings[atech-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p18.Picture.LoadFromFile(s); loaddata(18); end; end;
procedure tform1.owi; var x,y : integer; begin for x := 1 to 18 do begin for y := 1 to 19 do begin ow[x,y] := 0; end; end; end;
procedure TForm1.beendenClick(Sender: TObject); begin close; end;
procedure TForm1.Panel1Click(Sender: TObject); var i : integer; s : string; begin if shipg then begin m.lines.Clear; gp.Visible := true; m.lines.Add(edit1.text); s := ''; for i := 1 to 18 do begin s := s+';'+inttostr(podsav[i]); end; m.lines.Add(inttostr(sh)+s); s := ''; for i := 1 to 18 do begin s := s+';'+inttostr(listarray[i]); end; m.lines.Add(inttostr(sh)+s); m.lines.Add(inttostr(pe)+';'+inttostr(pm)+';'+inttostr(pk)+';'+inttostr(pw)+';'+inttostr(pa)+';'+inttostr(pf)); end else begin m.lines.Clear; m.lines.add('Statt diesem Text bitte einen Schifftext einfügen!'); gp.Visible := true; end; end;
Procedure tform1.loaddata2(hilf : integer); var i:integer; begin podsav[hilf] := getpodtech(hilf,1); for i := 1 to 19 do begin werte[i] := werte[i]-ow[hilf,i]; werte[i] := werte[i]+strtoint(aslist.Strings[i]); ow[hilf,i] := strtoint(aslist.Strings[i]); end; rasse[hilf]:=strtoint(aslist.Strings[20]); akt; end;
procedure tform1.techlistload(hilf: integer); begin case getpodtech(hilf,2) of 1 : techlist.LoadFromFile(path+'Angriff.txt'); 2 : techlist.LoadFromFile(path+'Verteidigung.txt'); 3 : techlist.LoadFromFile(path+'Energie.txt'); 4 : techlist.LoadFromFile(path+'Antrieb.txt'); 5 : techlist.LoadFromFile(path+'Sonstiges.txt'); end; end;
procedure TForm1.Panel2Click(Sender: TObject); var i : integer; s,ss : string; begin try gp.visible := false; edit1.Text := m.lines.Strings[0]; ss := m.lines.strings[1]; i := pos(';',ss); delete(ss,i,length(ss)); alist.LoadFromFile(path+shiplist.Strings[strtoint(ss)]); for i := 1 to 13 do begin werte[i] := strtoint(alist.Strings[i]); end; for i := 14 to 19 do begin werte[i] := 0; end; s := shiplist.Strings[strtoint(ss)]; delete(s,length(s)-2,3); s := path+s+'jpg'; sh := strtoint(ss); ship.Picture.loadfromfile(s); akt; pods; owi; shipg := true;
if shipg then if (strtoint(alist.Strings[14])>0) then if getpodtech(1,1) <> -1 then begin techlistload(1); aslist.LoadFromFile(path+techlist.Strings[getpodtech(1,1)-1]); s := techlist.Strings[getpodtech(1,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p1.Picture.LoadFromFile(s); loaddata2(1); end else begin p1.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>1) then if getpodtech(2,1) <> -1 then begin techlistload(2); aslist.LoadFromFile(path+techlist.Strings[getpodtech(2,1)-1]); s := techlist.Strings[getpodtech(2,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p2.Picture.LoadFromFile(s); loaddata2(2); end else begin p2.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>2) then if getpodtech(3,1) <> -1 then begin techlistload(3); aslist.LoadFromFile(path+techlist.Strings[getpodtech(3,1)-1]); s := techlist.Strings[getpodtech(3,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p3.Picture.LoadFromFile(s); loaddata2(3); end else begin p3.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>3) then if getpodtech(4,1) <> -1 then begin techlistload(4); aslist.LoadFromFile(path+techlist.Strings[getpodtech(4,1)-1]); s := techlist.Strings[getpodtech(4,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p4.Picture.LoadFromFile(s); loaddata2(4); end else begin p4.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>4) then if getpodtech(5,1) <> -1 then begin techlistload(5); aslist.LoadFromFile(path+techlist.Strings[getpodtech(5,1)-1]); s := techlist.Strings[getpodtech(5,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p5.Picture.LoadFromFile(s); loaddata2(5); end else begin p5.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>5) then if getpodtech(6,1) <> -1 then begin techlistload(6); aslist.LoadFromFile(path+techlist.Strings[getpodtech(6,1)-1]); s := techlist.Strings[getpodtech(6,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p6.Picture.LoadFromFile(s); loaddata2(6); end else begin p6.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>6) then if getpodtech(7,1) <> -1 then begin techlistload(7); aslist.LoadFromFile(path+techlist.Strings[getpodtech(7,1)-1]); s := techlist.Strings[getpodtech(7,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p7.Picture.LoadFromFile(s); loaddata2(7); end else begin p7.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>7) then if getpodtech(8,1) <> -1 then begin techlistload(8); aslist.LoadFromFile(path+techlist.Strings[getpodtech(8,1)-1]); s := techlist.Strings[getpodtech(8,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p8.Picture.LoadFromFile(s); loaddata2(8); end else begin p8.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>8) then if getpodtech(9,1) <> -1 then begin techlistload(9); aslist.LoadFromFile(path+techlist.Strings[getpodtech(9,1)-1]); s := techlist.Strings[getpodtech(9,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p9.Picture.LoadFromFile(s); loaddata2(9); end else begin p9.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>9) then if getpodtech(10,1) <> -1 then begin techlistload(10); aslist.LoadFromFile(path+techlist.Strings[getpodtech(10,1)-1]); s := techlist.Strings[getpodtech(10,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p10.Picture.LoadFromFile(s); loaddata2(10); end else begin p10.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>10) then if getpodtech(11,1) <> -1 then begin techlistload(11); aslist.LoadFromFile(path+techlist.Strings[getpodtech(11,1)-1]); s := techlist.Strings[getpodtech(11,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p11.Picture.LoadFromFile(s); loaddata2(11); end else begin p11.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>11) then if getpodtech(12,1) <> -1 then begin techlistload(12); aslist.LoadFromFile(path+techlist.Strings[getpodtech(12,1)-1]); s := techlist.Strings[getpodtech(12,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p12.Picture.LoadFromFile(s); loaddata2(12); end else begin p12.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>12) then if getpodtech(13,1) <> -1 then begin techlistload(13); aslist.LoadFromFile(path+techlist.Strings[getpodtech(13,1)-1]); s := techlist.Strings[getpodtech(13,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p13.Picture.LoadFromFile(s); loaddata2(13); end else begin p13.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>13) then if getpodtech(14,1) <> -1 then begin techlistload(14); aslist.LoadFromFile(path+techlist.Strings[getpodtech(14,1)-1]); s := techlist.Strings[getpodtech(14,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p14.Picture.LoadFromFile(s); loaddata2(14); end else begin p14.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>14) then if getpodtech(15,1) <> -1 then begin techlistload(15); aslist.LoadFromFile(path+techlist.Strings[getpodtech(15,1)-1]); s := techlist.Strings[getpodtech(15,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p15.Picture.LoadFromFile(s); loaddata2(15); end else begin p15.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>15) then if getpodtech(16,1) <> -1 then begin techlistload(16); aslist.LoadFromFile(path+techlist.Strings[getpodtech(16,1)-1]); s := techlist.Strings[getpodtech(16,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p16.Picture.LoadFromFile(s); loaddata2(16); end else begin p16.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>16) then if getpodtech(17,1) <> -1 then begin techlistload(17); aslist.LoadFromFile(path+techlist.Strings[getpodtech(17,1)-1]); s := techlist.Strings[getpodtech(17,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p17.Picture.LoadFromFile(s); loaddata2(17); end else begin p17.Picture.LoadFromFile(pod); end;
if shipg then if (strtoint(alist.Strings[14])>17) then if getpodtech(18,1) <> -1 then begin techlistload(18); aslist.LoadFromFile(path+techlist.Strings[getpodtech(18,1)-1]); s := techlist.Strings[getpodtech(18,1)-1]; delete(s,length(s)-2,3); s := path+s+'jpg'; p18.Picture.LoadFromFile(s); loaddata2(18); end else begin p18.Picture.LoadFromFile(pod); end;
pe := getpodtech(0,3); pm := getpodtech(1,3); pk := getpodtech(2,3); pw := getpodtech(3,3); pa := getpodtech(4,3); pf := getpodtech(5,3); akt;
case list of 1 : techlist.LoadFromFile(path+'Angriff.txt'); 2 : techlist.LoadFromFile(path+'Verteidigung.txt'); 3 : techlist.LoadFromFile(path+'Energie.txt'); 4 : techlist.LoadFromFile(path+'Antrieb.txt'); 5 : techlist.LoadFromFile(path+'Sonstiges.txt'); end;
except showmessage('Der Text mit Schiffsdaten muss einen Fehler enthalten haben.'); alist.Strings[14] := '0'; pods; shipg := false; for i := 1 to 19 do werte[i] := 0; akt; ship.Picture.Destroy; end; end;
function tform1.getpodtech(index : integer;line : integer) : integer; var s : string; i,p : integer; begin try s := m.lines.strings[line]; for i := 1 to index do begin p := pos(';',s); delete(s,1,p); end; if index <> 18 then begin p := pos(';',s); delete(s,p,length(s)); end; result := strtoint(s); except result := -1; end; end;
procedure TForm1.Panel4Click(Sender: TObject); begin if sd.Execute then m.Lines.SaveToFile(sd.FileName+'.shp'); end;
procedure TForm1.Panel5Click(Sender: TObject); begin if od.Execute then m.lines.LoadFromFile(od.FileName); panel2.onclick(od); end;
procedure TForm1.cb1Change(Sender: TObject); begin if cb1.Text = 'Menschen(3,0%)' then ras := 1; if cb1.Text = 'Ti-Roc(2,85%)' then ras := 2; if cb1.Text = 'Myridianer(2,7%)' then ras := 3; if cb1.Text = 'Beraluten(3,3%)' then ras := 4; if cb1.Text = 'Tradoner(3,9%)' then ras := 5; if cb1.Text = 'Se´ze Lux(3.15%)' then ras := 6; akt; end;
procedure TForm1.SpeedButton1Click(Sender: TObject); var oPicture: TJPEGImage; oBitmap: TBitmap;
begin techlist.LoadFromFile(path+'Angriff.txt'); techgrid.picture.LoadFromFile(path+techlist.Strings[0]); list := 1; end;
procedure TForm1.SpeedButton2Click(Sender: TObject); begin techlist.LoadFromFile(path+'Verteidigung.txt'); techgrid.picture.LoadFromFile(path+techlist.Strings[0]); list := 2; end;
procedure TForm1.SpeedButton3Click(Sender: TObject); begin techlist.LoadFromFile(path+'Energie.txt'); techgrid.picture.LoadFromFile(path+techlist.Strings[0]); list := 3; end;
procedure TForm1.SpeedButton4Click(Sender: TObject); begin techlist.LoadFromFile(path+'Antrieb.txt'); techgrid.picture.LoadFromFile(path+techlist.Strings[0]); list := 4; end;
procedure TForm1.SpeedButton5Click(Sender: TObject); begin techlist.LoadFromFile(path+'Sonstiges.txt'); techgrid.picture.LoadFromFile(path+techlist.Strings[0]); list := 5; end;
procedure TForm1.SpinButton1DownClick(Sender: TObject); begin if pe > 1 then begin dec(pe); ep.caption := inttostr(pe); akt; end; end;
procedure TForm1.SpinButton1UpClick(Sender: TObject); begin if pe < 10 then begin inc(pe); ep.Caption := inttostr(pe); akt; end; end;
procedure TForm1.SpinButton2DownClick(Sender: TObject); begin if pm > 1 then begin dec(pm); mp.Caption := inttostr(pm); akt; end; end;
procedure TForm1.SpinButton2UpClick(Sender: TObject); begin if pm < 10 then begin inc(pm); mp.Caption := inttostr(pm); akt; end; end;
procedure TForm1.SpinButton3DownClick(Sender: TObject); begin if pk > 1 then begin dec(pk); kp.Caption := inttostr(pk); akt; end; end;
procedure TForm1.SpinButton3UpClick(Sender: TObject); begin if pk < 10 then begin inc(pk); kp.Caption := inttostr(pk); akt; end; end;
procedure TForm1.SpinButton4DownClick(Sender: TObject); begin if pw > 1 then begin dec(pw); wp.Caption := inttostr(pw); akt; end; end;
procedure TForm1.SpinButton4UpClick(Sender: TObject); begin if pw < 10 then begin inc(pw); wp.Caption := inttostr(pw); akt; end; end;
procedure TForm1.SpinButton5DownClick(Sender: TObject); begin if pa > -70 then begin pa := pa-5; ap.Caption := inttostr(abs(pa)); akt; if pa < 0 then label21.Caption := 'Rabatt in %:'; if pa = 0 then label21.caption := 'Normalpreis:'; if pa > 0 then label21.Caption := 'Aufschlag in %:'; end; end;
procedure TForm1.SpinButton5UpClick(Sender: TObject); begin if pa < 70 then begin pa := pa+5; ap.Caption := inttostr(abs(pa)); akt; if pa < 0 then label21.Caption := 'Rabatt in %:'; if pa = 0 then label21.caption := 'Normalpreis:'; if pa > 0 then label21.Caption := 'Aufschlag in %:'; end; end;
procedure TForm1.Panel6Click(Sender: TObject); begin form2.Visible := true; end;
procedure TForm1.SpinButton6DownClick(Sender: TObject); begin if pf > 1 then begin dec(pf); fp.Caption := inttostr(pf); akt; end; end;
procedure TForm1.SpinButton6UpClick(Sender: TObject); begin if pf < 10 then begin inc(pf); fp.Caption := inttostr(pf); akt; end; end;
procedure TForm1.Image8Click(Sender: TObject); begin Groupbox2.Height:=361; Groupbox4.Visible:=true; Image8.Visible:=false; end;
procedure TForm1.Image7Click(Sender: TObject); begin Groupbox2.Height:=209; Groupbox4.Visible:=false; Image8.Visible:=true; end;
procedure TForm1.winclose(Sender: TObject; var Action: TCloseAction); var i : integer; begin if save = false then begin i := application.MessageBox('Wollen Sie vor dem Beenden ihre Arbeit speichern?','Wichtige Frage!!!',4+32); if i = IDYES then if sd.Execute then begin panel1.OnClick(sd); m.lines.savetofile(sd.FileName+'.shp'); end; end; end;
end. |