Esempio n. 1
0
    public FormProgress(FormTOCTREViewer form) {
      InitializeComponent();

      this.m_Form = form;
    }
Esempio n. 2
0
        private void FormNotifyIcon_Load(object sender, EventArgs e)
        {
            this.m_FormTOCTREViewer = new FormTOCTREViewer(this);
            this.m_FormTOCTREViewer.VisibleChanged += new EventHandler(m_FormTOCTREViewer_VisibleChanged);
            this.m_FormIFFILFWSEditor = new FormIFFILFWSEditor(this);
            this.m_FormIFFILFWSEditor.VisibleChanged += new EventHandler(m_FormIFFILFWSEditor_VisibleChanged);
            this.m_FormPALEditor = new FormPALEditor(this);
            this.m_FormPALEditor.VisibleChanged += new EventHandler(m_FormPALEditor_VisibleChanged);
            this.m_FormSTFEditor = new FormSTFEditor(this);
            this.m_FormSTFEditor.VisibleChanged += new EventHandler(m_FormSTFEditor_VisibleChanged);

            this.RegisterClipboardViewer();

            if (TRE_Explorer.Properties.Settings.Default.UpgradeSettings)
            {
                TRE_Explorer.Properties.Settings.Default.Upgrade();
                TRE_Explorer.Properties.Settings.Default.UpgradeSettings = false;
                TRE_Explorer.Properties.Settings.Default.Save();
            }

            if (TRE_Explorer.Properties.Settings.Default.OpenFolder == "null")
            {
                TRE_Explorer.Properties.Settings.Default.OpenFolder = Utilities.GetGameFolder(false);
                TRE_Explorer.Properties.Settings.Default.Save();
            }

            if (TRE_Explorer.Properties.Settings.Default.SaveFolder == "null")
            {
                TRE_Explorer.Properties.Settings.Default.SaveFolder = Utilities.GetGameFolder(false);
                TRE_Explorer.Properties.Settings.Default.Save();
            }

            this.saveFileDialog.InitialDirectory  = TRE_Explorer.Properties.Settings.Default.SaveFolder;
            this.openFileDialog.InitialDirectory  = TRE_Explorer.Properties.Settings.Default.OpenFolder;
            this.folderBrowserDialog.SelectedPath = TRE_Explorer.Properties.Settings.Default.SaveFolder;

            String[] arguments = Environment.GetCommandLineArgs();
            if ((arguments.Length > 1) && (File.Exists(arguments[1])))
            {
                if ((arguments[1].ToLower().EndsWith(".tre")) || (arguments[1].ToLower().EndsWith(".toc")))
                {
                    this.TOCTRELoadFile(arguments[1]);
                }
                else if ((arguments[1].ToLower().EndsWith(".ans")) || (arguments[1].ToLower().EndsWith(".apt")) || (arguments[1].ToLower().EndsWith(".ash")) || (arguments[1].ToLower().EndsWith(".cdf")) || (arguments[1].ToLower().EndsWith(".cef")) || (arguments[1].ToLower().EndsWith(".cmp")) || (arguments[1].ToLower().EndsWith(".eft")) || (arguments[1].ToLower().EndsWith(".flr")) || (arguments[1].ToLower().EndsWith(".iff")) || (arguments[1].ToLower().EndsWith(".ilf")) || (arguments[1].ToLower().EndsWith(".lat")) || (arguments[1].ToLower().EndsWith(".lay")) || (arguments[1].ToLower().EndsWith(".lmg")) || (arguments[1].ToLower().EndsWith(".lod")) || (arguments[1].ToLower().EndsWith(".lsb")) || (arguments[1].ToLower().EndsWith(".ltn")) || (arguments[1].ToLower().EndsWith(".mgn")) || (arguments[1].ToLower().EndsWith(".mkr")) || (arguments[1].ToLower().EndsWith(".msh")) || (arguments[1].ToLower().EndsWith(".pln")) || (arguments[1].ToLower().EndsWith(".pob")) || (arguments[1].ToLower().EndsWith(".prt")) || (arguments[1].ToLower().EndsWith(".psh")) || (arguments[1].ToLower().EndsWith(".pst")) || (arguments[1].ToLower().EndsWith(".sat")) || (arguments[1].ToLower().EndsWith(".sfp")) || (arguments[1].ToLower().EndsWith(".sht")) || (arguments[1].ToLower().EndsWith(".skt")) || (arguments[1].ToLower().EndsWith(".snd")) || (arguments[1].ToLower().EndsWith(".spr")) || (arguments[1].ToLower().EndsWith(".swh")) || (arguments[1].ToLower().EndsWith(".trn")) || (arguments[1].ToLower().EndsWith(".trt")) || (arguments[1].ToLower().EndsWith(".ws")))
                {
                    this.IFFILFWSLoadFile(arguments[1]);
                }
                else if (arguments[1].ToLower().EndsWith(".pal"))
                {
                    this.PALLoadFile(arguments[1]);
                }
                else if (arguments[1].ToLower().EndsWith(".stf"))
                {
                    this.STFLoadFile(arguments[1]);
                }
                else
                {
                    this.IFFILFWSLoadFile(arguments[1]);
                }
            }

            if ((!this.m_FormIFFILFWSEditor.Visible) && (!this.m_FormPALEditor.Visible) && (!this.m_FormSTFEditor.Visible))
            {
                this.m_FormTOCTREViewer.Show();
            }
        }