Subversion Repositories spacemission

Rev

Rev 52 | Rev 61 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 52 Rev 53
Line 376... Line 376...
376
    for curline := 1 to sl.Count-1 do
376
    for curline := 1 to sl.Count-1 do
377
    begin
377
    begin
378
      sLine := sl.Strings[curline].Trim;
378
      sLine := sl.Strings[curline].Trim;
379
      if (sLine = '') or (Copy(sLine, 1, 1) = ';') then continue;
379
      if (sLine = '') or (Copy(sLine, 1, 1) = ';') then continue;
380
      ary := SplitString(CollapseSpaces(sLine), ' ');
380
      ary := SplitString(CollapseSpaces(sLine), ' ');
381
      if ary[0] = 'Width' then // do not localize
381
      if SameText(ary[0], 'Width') then // do not localize
382
      begin
382
      begin
383
        LevelEditorLength := StrToInt(ary[1]);
383
        LevelEditorLength := StrToInt(ary[1]);
384
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
384
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
385
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
385
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
386
      end
386
      end
387
      else if ary[0] = 'Name' then // do not localize
387
      else if SameText(ary[0], 'Name') then // do not localize
388
      begin
388
      begin
389
        LevelName := Copy(sLine, Length(ary[0])+2, Length(sLine));
389
        LevelName := Trim(Copy(sLine, Length(ary[0])+2, Length(sLine)));
390
      end
390
      end
391
      else if ary[0] = 'Author' then // do not localize
391
      else if SameText(ary[0], 'Author') then // do not localize
392
      begin
392
      begin
393
        LevelAuthor := Copy(sLine, Length(ary[0])+2, Length(sLine));
393
        LevelAuthor := Trim(Copy(sLine, Length(ary[0])+2, Length(sLine)));
394
      end
394
      end
395
      else if ary[0] = 'Enemy' then // do not localize
395
      else if SameText(ary[0], 'Enemy') then // do not localize
396
      begin
396
      begin
397
        tmpEnemy := TEnemyType(strtoint(ary[1]));
397
        tmpEnemy := TEnemyType(strtoint(ary[1]));
398
        tmpX     := strtoint(ary[2]);
398
        tmpX     := strtoint(ary[2]);
399
        tmpY     := strtoint(ary[3]);
399
        tmpY     := strtoint(ary[3]);
400
        tmpLifes := strtoint(ary[4]);
400
        tmpLifes := strtoint(ary[4]);
Line 635... Line 635...
635
    for curline := 1 to sl.Count-1 do
635
    for curline := 1 to sl.Count-1 do
636
    begin
636
    begin
637
      sLine := sl.Strings[curline].Trim;
637
      sLine := sl.Strings[curline].Trim;
638
      if (sLine = '') or (Copy(sLine, 1, 1) = ';') then continue;
638
      if (sLine = '') or (Copy(sLine, 1, 1) = ';') then continue;
639
      ary := SplitString(CollapseSpaces(sLine), ' ');
639
      ary := SplitString(CollapseSpaces(sLine), ' ');
640
      if ary[0] = 'Score' then // do not localize
640
      if SameText(ary[0], 'Score') then // do not localize
641
      begin
641
      begin
642
        Score := StrToInt(ary[1]);
642
        Score := StrToInt(ary[1]);
643
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
643
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
644
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
644
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
645
      end
645
      end
646
      else if ary[0] = 'Lives' then // do not localize
646
      else if SameText(ary[0], 'Lives') then // do not localize
647
      begin
647
      begin
648
        Life := StrToInt(ary[1]);
648
        Life := StrToInt(ary[1]);
649
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
649
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
650
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
650
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
651
      end
651
      end
652
      else if ary[0] = 'Level' then // do not localize
652
      else if SameText(ary[0], 'Level') then // do not localize
653
      begin
653
      begin
654
        Level := StrToInt(ary[1]);
654
        Level := StrToInt(ary[1]);
655
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
655
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
656
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
656
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
657
      end
657
      end
658
      else if ary[0] = 'Mode' then // do not localize
658
      else if SameText(ary[0], 'Mode') then // do not localize
659
      begin
659
      begin
660
        GameMode := TGameMode(StrToInt(ary[1]));
660
        GameMode := TGameMode(StrToInt(ary[1]));
661
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
661
        if (Length(ary) > 2) and (Copy(ary[2], 1, 1) <> ';') then
662
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
662
          raise Exception.CreateFmt('Zeile %d ist ungültig (Zusatzinfo am Ende)', [curline+1]);
663
      end;
663
      end;