Unit3.cpp
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:30k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "Unit1.h"
  5. #include "Unit2.h"
  6. #include "Unit3.h"
  7. #include "Unit4.h"
  8. #include "Unit5.h"
  9. #include <stdio.h>
  10. #include <Filectrl.hpp>
  11. //---------------------------------------------------------------------------
  12. #pragma package(smart_init)
  13. #pragma resource "*.dfm"
  14. TForm3 *Form3;
  15. //---------------------------------------------------------------------------
  16. __fastcall TForm3::TForm3(TComponent* Owner)
  17.         : TForm(Owner)
  18. {
  19. }
  20. //---------------------------------------------------------------------------
  21. void __fastcall TForm3::Button8Click(TObject *Sender)
  22. {
  23.      char szStr[250];
  24.      AnsiString szPath;
  25.      if(Edit14->Text!="")
  26.      {
  27.          switch (RadioGroup1->ItemIndex)
  28.          {
  29.          case 0:
  30.              szPath = Form5->Edit53->Text+"\normal\";
  31.              CheckAdd(2,Edit14->Text +".txt");
  32.              ListBox2->Items->SaveToFile(szPath + "_normal.txt");
  33.              break;
  34.          case 1:
  35.              szPath = Form5->Edit53->Text+"\food\";
  36.              CheckAdd(2,Edit14->Text +".txt");
  37.              ListBox2->Items->SaveToFile(szPath + "_food.txt");
  38.              break;
  39.          case 2:
  40.              szPath = Form5->Edit53->Text+"\jiudai\";
  41.              CheckAdd(2,Edit14->Text +".txt");
  42.              ListBox2->Items->SaveToFile(szPath + "_jiudai.txt");
  43.              break;
  44.          case 3:
  45.              szPath = Form5->Edit53->Text+"\drug\";
  46.              CheckAdd(2,Edit14->Text +".txt");
  47.              ListBox2->Items->SaveToFile(szPath + "_drug.txt");
  48.              break;
  49.          case 4:
  50.              szPath = Form5->Edit53->Text+"\equip\";
  51.              CheckAdd(2,Edit14->Text +".txt");
  52.              ListBox2->Items->SaveToFile(szPath + "_equip.txt");
  53.              CheckAdd(6,Edit14->Text);
  54.              Form2->ComboBox6->Items->SaveToFile("equip.lst");
  55.              break;
  56.          case 5:
  57.              szPath = Form5->Edit53->Text+"\weapon\";
  58.              CheckAdd(2,Edit14->Text +".txt");
  59.              ListBox2->Items->SaveToFile(szPath + "_weapon.txt");
  60.              CheckAdd(5,Edit14->Text);
  61.              Form2->ComboBox5->Items->SaveToFile("weapon.lst");
  62.              break;
  63.          case 6:
  64.              szPath = Form5->Edit53->Text+"\book\";
  65.              CheckAdd(2,Edit14->Text +".txt");
  66.              CheckAdd(28,Edit14->Text);
  67.              ListBox2->Items->SaveToFile(szPath + "_book.txt");
  68.              break;
  69.          case 7:
  70.              szPath = Form5->Edit53->Text+"\other\";
  71.              CheckAdd(2,Edit14->Text +".txt");
  72.              ListBox2->Items->SaveToFile(szPath + "_other.txt");
  73.              break;
  74.          case 8:
  75.              szPath = Form5->Edit53->Text+"\flag\";
  76.              CheckAdd(2,Edit14->Text +".txt");
  77.              ListBox2->Items->SaveToFile(szPath + "_flag.txt");
  78.              break;
  79.          }
  80.          if(!DirectoryExists(szPath)) CreateDirectory(szPath.c_str(),NULL);
  81.          StrPCopy(szStr,szPath+Edit14->Text+".txt");
  82.      }
  83.      else
  84.      {
  85.          Form1->StatusBar1->SimpleText = "璣ゅ