public void CollectScriptFiles(DeltinScript deltinScript, ScriptFile scriptFile)
        {
            ScriptFiles.Add(scriptFile);

            FileImporter importer = new FileImporter(scriptFile.Diagnostics, this);

            // Get the imported files.
            foreach (var importFileContext in scriptFile.Context.Imports)
            {
                if (importFileContext.File)
                {
                    string directory = GetImportedFile(deltinScript, scriptFile, importer, importFileContext);
                    if (Directory.Exists(directory))
                    {
                        AddImportCompletion(deltinScript, scriptFile, directory, importFileContext.File.Range);
                    }
                }
            }
        }
        public void CollectScriptFiles(ScriptFile scriptFile)
        {
            ScriptFiles.Add(scriptFile);

            FileImporter importer = new FileImporter(scriptFile.Diagnostics, this);

            // Get the imported files.
            if (scriptFile.Context.import_file() != null)
            {
                foreach (var importFileContext in scriptFile.Context.import_file())
                {
                    string directory = GetImportedFile(scriptFile, importer, importFileContext);
                    if (Directory.Exists(directory))
                    {
                        AddImportCompletion(scriptFile, directory, DocRange.GetRange(importFileContext.STRINGLITERAL()));
                    }
                }
            }
        }
Esempio n. 3
0
        public BitmapViewer()
        {
            _browserImageFormat      = BrowserImageFormat.Auto;
            _browserJpegQuality      = 70;
            _firstBitmapAccess       = true;
            _imageLoadMode           = ImageLoadMode.AdaptiveTile;
            _previewImageResizeRatio = 8;
            _previewImageEnabled     = true;
            _tileSize    = 300;
            _postedState = BitmapViewerState.Empty;

            _fileCache = FileCache.GetInstance();

            if (!DesignMode)
            {
                _bitmapChanged = false;
            }

            ScriptFiles.Add("BitmapViewer");
            ScriptClassName = "Aurigma.GraphicsMill.BitmapViewer";
        }
Esempio n. 4
0
        private void fitOpen_Click(object sender, EventArgs e)
        {
            if (fsDlg.ShowDialog() == DialogResult.OK)
            {
                this.Reset();
                foreach (var p in Directory.EnumerateFiles(fsDlg.SelectedPath))
                {
                    if (p.EndsWith(".bin"))
                    {
                        var acmd = new ACMDFile(p);
                        ScriptFiles.Add(p, acmd);
                        Runtime.WorkingEndian = acmd.Endian;
                    }
                    else if (p.EndsWith(".mtable"))
                    {
                        MotionTable = new MTable(p, Runtime.WorkingEndian);
                    }
                }
                var acmdnode = new TreeNode("ACMD")
                {
                    Name = "nACMD"
                };

                for (int i = 0; i < MotionTable.Count; i++)
                {
                    var node = new ScriptNode(MotionTable[i], $"{i:X} - [{MotionTable[i]:X8}]");
                    foreach (var keypair in ScriptFiles)
                    {
                        if (keypair.Value.Scripts.Keys.Contains(MotionTable[i]))
                        {
                            node.Scripts.Add(Path.GetFileNameWithoutExtension(keypair.Key), keypair.Value.Scripts[MotionTable[i]]);
                        }
                    }
                    acmdnode.Nodes.Add(node);
                }
                FileTree.Nodes.Add(acmdnode);
                IDEMode    = IDE_MODE.Fighter;
                this.Text += fsDlg.SelectedPath;
            }
        }
Esempio n. 5
0
        private unsafe void fOpen_Click(object sender, EventArgs e)
        {
            if (ofDlg.ShowDialog() == DialogResult.OK)
            {
                this.Reset();
                if (ofDlg.FileName.EndsWith(".bin"))
                {
                    DataSource source = new DataSource(FileMap.FromFile(ofDlg.FileName));
                    if (*(buint *)source.Address == 0x41434D44) // ACMD
                    {
                        if (*(byte *)(source.Address + 0x04) == 0x02)
                        {
                            Runtime.WorkingEndian = Endianness.Little;
                        }
                        else if ((*(byte *)(source.Address + 0x04) == 0x00))
                        {
                            Runtime.WorkingEndian = Endianness.Big;
                        }

                        var f = new ACMDFile(source);
                        ScriptFiles.Add(ofDlg.FileName, f);
                        var node = new TreeNode("ACMD")
                        {
                            Name = "nACMD"
                        };
                        foreach (var keypair in f.Scripts)
                        {
                            node.Nodes.Add(new ScriptNode(keypair.Key, $"{keypair.Key:X8}", keypair.Value));
                        }
                        FileTree.Nodes.Add(node);
                    }
                    else if (*(buint *)source.Address == 0xFFFF0000)
                    {
                        source.Close();
                        ParamFile = new ParamFile(ofDlg.FileName);
                        var node = new TreeNode("PARAMS")
                        {
                            Name = "nPARAMS"
                        };
                        FileTree.Nodes.Add(node);
                        PopulateParams();
                    }
                }
                else if (ofDlg.FileName.EndsWith(".mscsb")) // MSC
                {
                    var f = new MSCFile(ofDlg.FileName);
                    ScriptFiles.Add(ofDlg.FileName, f);

                    var node = new TreeNode("MSC")
                    {
                        Name = "nMSC"
                    };
                    for (int i = 0; i < f.Scripts.Count; i++)
                    {
                        var sn = new ScriptNode((uint)i, $"{i:D8}", f.Scripts.Values[i]);
                        if (((MSCScript)f.Scripts.Values[i]).IsEntrypoint)
                        {
                            sn.Text = "Entrypoint";
                        }
                        else if (i == 0)
                        {
                            sn.Text = "Init";
                        }

                        node.Nodes.Add(sn);
                    }
                    FileTree.Nodes.Add(node);
                }
                IDEMode    = IDE_MODE.File;
                this.Text += ofDlg.FileName;
            }
        }
Esempio n. 6
0
 protected UserInputController()
     : base()
 {
     ScriptFiles.Add("Controller");
 }