public frmMain()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            //Create open file dialog
            mOpenFileDialog = new OpenFileDialog();
            mOpenFileDialog.InitialDirectory = (string)Directory.GetCurrentDirectory().Clone();
            mOpenFileDialog.RestoreDirectory = true;

            mSaveFileDialog = new SaveFileDialog();
            mSaveFileDialog.InitialDirectory = (string)Directory.GetCurrentDirectory().Clone();
            mSaveFileDialog.RestoreDirectory = true;

            //Create select directory dialog
            mSelectDirDialog              = new FolderBrowserDialog();
            mSelectDirDialog.Description  = "Select the resource directory to add. The directory MUST be a subdirectory in redist folder!";
            mSelectDirDialog.RootFolder   = Environment.SpecialFolder.MyComputer;
            mSelectDirDialog.SelectedPath = Directory.GetCurrentDirectory();

            mpTransBaseData = new HplTrans(this);
            mpTransDestData = new HplTrans(this);

            mpEnterNameForm = new frmEnterName();
        }
예제 #2
0
        public cTransCategory(HplTrans apTrans)
        {
            mvEntries = new ArrayList();

            mpTrans = apTrans;
        }
예제 #3
0
		public frmMain()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
			
			//Create open file dialog
			mOpenFileDialog = new OpenFileDialog();
			mOpenFileDialog.InitialDirectory = (string)Directory.GetCurrentDirectory().Clone();
			mOpenFileDialog.RestoreDirectory = true;

			mSaveFileDialog = new SaveFileDialog();
			mSaveFileDialog.InitialDirectory = (string)Directory.GetCurrentDirectory().Clone();
			mSaveFileDialog.RestoreDirectory = true;

			//Create select directory dialog
			mSelectDirDialog = new FolderBrowserDialog();
			mSelectDirDialog.Description = "Select the resource directory to add. The directory MUST be a subdirectory in redist folder!";
			mSelectDirDialog.RootFolder=  Environment.SpecialFolder.MyComputer;
			mSelectDirDialog.SelectedPath = Directory.GetCurrentDirectory();
			
			mpMaterial = new HplMaterial();
			
			//init sound data
			mpSoundData = new HplSound();
			mpSoundData.ClearData(this);

			mpTransData = new HplTrans(this);

			mpEnterNameForm = new frmEnterName();
			
			//Load resource directories
			LoadResourceDirs(msResourceDirFile);

			//Load physics material name
			LoadPhysicsMaterialNames(msPhysicsMaterialsFile);
			
			//Add the types of materials available
			AddMaterialTypes();
		}
예제 #4
0
        //------------------------------------------

        public void FillStructureFromTrans(HplTrans apSrcTrans)
        {
        }
예제 #5
0
        //------------------------------------------

        /**
         * Fills up a translation with categories and entries taken from a source one
         * If the invoking translation has stuff, it will add the ones which are not already in
         */
        public void CopyStructureFromTrans(HplTrans apSrcTrans, bool abClear)
        {
            bool bTransHasNonPresentEntries = false;

            if (abClear)
            {
                Clear();
            }

            ArrayList vAddedCategoryNames = new ArrayList();
            ArrayList vAddedCategoryCount = new ArrayList();

            ArrayList vAddedEntries    = new ArrayList();
            ArrayList vAddedEntryTexts = new ArrayList();

            for (int i = 0; i < apSrcTrans.mvDirectories.Count; ++i)
            {
                String sDir = (String)apSrcTrans.mvDirectories[i];

                if (mvDirectories.IndexOf(sDir) == -1)
                {
                    mvDirectories.Add(sDir);
                }
            }

            for (int i = 0; i < apSrcTrans.mvCategories.Count; ++i)
            {
                cTransCategory srcCat = (cTransCategory)apSrcTrans.mvCategories[i];

                cTransCategory cat = GetCategory(srcCat.msName);
                if (cat == null)
                {
                    cat = AddCategory(srcCat.msName);
                }

                for (int j = 0; j < srcCat.mvEntries.Count; ++j)
                {
                    cTransEntry srcEntry = (cTransEntry)srcCat.mvEntries[j];

                    cTransEntry entry = cat.GetEntry(srcEntry.msName);
                    if (entry == null)
                    {
                        bTransHasNonPresentEntries = true;

                        entry = cat.AddEntry(srcEntry.msName);

                        vAddedEntries.Add(entry);
                        vAddedEntryTexts.Add(srcEntry.msText);

                        int lCatIndex = vAddedCategoryNames.IndexOf(cat.msName);
                        if (lCatIndex == -1)
                        {
                            lCatIndex = vAddedCategoryNames.Add(cat.msName);
                            vAddedCategoryCount.Add(0);
                        }
                        vAddedCategoryCount[lCatIndex] = (int)vAddedCategoryCount[lCatIndex] + 1;
                    }
                }
            }

            if (abClear == false && bTransHasNonPresentEntries)
            {
                String sCategoryNames = "";
                for (int i = 0; i < vAddedCategoryNames.Count; ++i)
                {
                    sCategoryNames += (String)vAddedCategoryNames[i] + ": " + vAddedCategoryCount[i] + " entries, ";
                }

                sCategoryNames = sCategoryNames.Substring(0, sCategoryNames.Length - 2);

                DialogResult lRes = MessageBox.Show(mpMainForm, "There are entries in Base Language that are not present in loaded file, in categories:\n  " + sCategoryNames + "\nWant to add base text for them?",
                                                    "Warning!",
                                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (lRes == DialogResult.Yes)
                {
                    mbChanged = true;

                    for (int i = 0; i < vAddedEntries.Count; ++i)
                    {
                        cTransEntry entry = (cTransEntry)vAddedEntries[i];

                        entry.msText = (String)vAddedEntryTexts[i];
                    }
                }
            }
        }
예제 #6
0
		public cTransCategory(HplTrans apTrans)
		{
			mvEntries = new ArrayList();

			mpTrans = apTrans;
		}