コード例 #1
0
        private void OpenData()
        {
            OpenFileDialog openFile = new OpenFileDialog();
            string         tableFileName;
            string         messageDataFileName;

            openFile.Filter = "Table Data (*.tbl)|*.tbl|All files|*";
            openFile.Title  = "Select the MessageTable.tbl file";

            if (openFile.ShowDialog() != true)
            {
                return;
            }

            tableFileName = openFile.FileName;

            openFile.Filter      = "String Data (*.bin)|*.bin|All files|*";
            openFile.Title       = "Select the StringData.bin file";
            openFile.FilterIndex = 0;

            if (openFile.ShowDialog() != true)
            {
                return;
            }

            messageDataFileName = openFile.FileName;

            Importer file = new Importer(tableFileName, messageDataFileName, m_controlCodes);

            MessageList       = file.GetMessageList();
            ViewSource.Source = MessageList;
            SelectedMessage   = MessageList[0];

            WindowTitle = string.Format("{0} - Ocarina of Time Text Editor", tableFileName);
        }
コード例 #2
0
        private void Open()
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Filter = "N64 ROMs (*.n64, *.z64)|*.n64;*.z64|All files|*";

            if (openFile.ShowDialog() == true)
            {
                Importer file = new Importer(openFile.FileName, m_controlCodes);
                MessageList = file.GetMessageList();

                // If message list is null, we failed to open a ROM
                if (MessageList == null)
                {
                    return;
                }

                m_inputFileName = openFile.FileName;
                m_inputFile     = file.GetInputFile();

                ViewSource.Source = MessageList;
                SelectedMessage   = MessageList[0];

                WindowTitle = string.Format("{0} - Ocarina of Time Text Editor", openFile.FileName);
            }
        }
コード例 #3
0
        private void OpenZZRP()
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Filter = "zzromtool Projects (*.zzrp)|*.zzrp";

            if (openFile.ShowDialog() == true)
            {
                string zzrpFolder = Path.GetDirectoryName(openFile.FileName);
                string codeFile   = Path.Combine(zzrpFolder, "system", "code");
                string msgData    = Path.Combine(zzrpFolder, "misc", "nes_message_data_static");

                if (!File.Exists(codeFile) || !File.Exists(msgData))
                {
                    System.Windows.Forms.MessageBox.Show("This doesn't look to be a zzromtool filesystem...");
                    return;
                }

                Importer file = new Importer(openFile.FileName, m_controlCodes, EditMode.ZZRT, Version == ROMVer.Debug);
                MessageList = file.GetMessageList();

                // If message list is null, we failed to parse.
                if (MessageList == null)
                {
                    return;
                }

                m_inputFileName = openFile.FileName;
                m_inputFile     = file.GetInputFile();

                ViewSource.Source = MessageList;
                SelectedMessage   = MessageList[0];

                WindowTitle = Path.GetFileNameWithoutExtension(openFile.FileName) + " - Ocarina of Time Text Editor";

                ZZRPMode  = true;
                OldMode   = false;
                ZZRPLMode = false;
            }
        }
コード例 #4
0
        private void Open()
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Filter = "N64 ROMs (*.n64, *.z64)|*.n64;*.z64|All files|*";

            if (openFile.ShowDialog() == true)
            {
                Version = CheckRomVersion(openFile.FileName);

                if (Version == ROMVer.Unknown)
                {
                    return;
                }

                Importer file = new Importer(openFile.FileName, m_controlCodes, EditMode.ROM, Version == ROMVer.Debug);
                MessageList = file.GetMessageList();

                // If message list is null, we failed to open a ROM
                if (MessageList == null)
                {
                    return;
                }

                m_inputFileName = openFile.FileName;
                m_inputFile     = file.GetInputFile();

                ViewSource.Source = MessageList;
                SelectedMessage   = MessageList[0];

                WindowTitle = string.Format("{0} - Ocarina of Time Text Editor", openFile.FileName);

                OldMode   = true;
                ZZRPMode  = false;
                ZZRPLMode = false;
            }
        }
コード例 #5
0
        private void OpenZZRPL()
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Filter = "zzrtl Projects (*.zzrpl)|*.zzrpl";

            if (openFile.ShowDialog() == true)
            {
                string zzrplFolder = Path.GetDirectoryName(openFile.FileName);


                string msgDataEd = Path.Combine(zzrplFolder, "messages", "StringData.bin");
                string tableEd   = Path.Combine(zzrplFolder, "messages", "MessageTable.tbl");

                if (!File.Exists(msgDataEd) || !File.Exists(tableEd))
                {
                    string msgData    = Path.Combine(zzrplFolder, "messages", "_vanilla-1.0", "StringData.bin");
                    string table      = Path.Combine(zzrplFolder, "messages", "_vanilla-1.0", "MessageTable.tbl");
                    string msgDataDeb = Path.Combine(zzrplFolder, "messages", "_vanilla-debug", "StringData.bin");
                    string tableDeb   = Path.Combine(zzrplFolder, "messages", "_vanilla-debug", "MessageTable.tbl");

                    if ((!File.Exists(msgData) || !File.Exists(table)) && (!File.Exists(msgDataDeb) || !File.Exists(tableDeb)))
                    {
                        System.Windows.Forms.MessageBox.Show("Not a ZZRTL-Audio filesystem.");
                        return;
                    }

                    if (File.Exists(msgData))
                    {
                        File.Copy(msgData, msgDataEd);
                        File.Copy(table, tableEd);
                    }
                    else if (File.Exists(msgDataDeb))
                    {
                        File.Copy(msgDataDeb, msgDataEd);
                        File.Copy(tableDeb, tableEd);
                    }
                }

                Importer file = new Importer(openFile.FileName, m_controlCodes, EditMode.ZZRPL, Version == ROMVer.Debug);
                MessageList = file.GetMessageList();

                // If message list is null, we failed to parse.
                if (MessageList == null)
                {
                    return;
                }

                m_inputFileName = openFile.FileName;
                m_inputFile     = file.GetInputFile();

                ViewSource.Source = MessageList;
                SelectedMessage   = MessageList[0];

                WindowTitle = Path.GetFileNameWithoutExtension(openFile.FileName) + " - Ocarina of Time Text Editor";

                ZZRPMode  = false;
                OldMode   = false;
                ZZRPLMode = true;
            }
        }