Пример #1
0
        private CompletableXMLTag RegisterMetaTag(string name, string description)
        {
            var tag = new CompletableXMLTag(name, description);
            tag.RegisterAttribute(new CompletableXMLAttribute("name", "The field's name (required)"));
            tag.RegisterAttribute(new CompletableXMLAttribute("offset", "The field's offset (required)"));

            var visible = new CompletableXMLAttribute("visible", "Whether or not the field is always visible (required)");
            visible.RegisterValue(new CompletableXMLValue("true", "Field is always visible"));
            visible.RegisterValue(new CompletableXMLValue("false", "Field is only visible when invisibles are shown"));

            tag.RegisterAttribute(visible);
            _completer.RegisterTag(tag);
            return tag;
        }
Пример #2
0
        private void LoadCodeCompletion()
        {
            RegisterMetaTag("uint8", "Unsigned 8-bit integer");
            RegisterMetaTag("int8", "Signed 8-bit integer");
            RegisterMetaTag("uint16", "Unsigned 16-bit integer");
            RegisterMetaTag("int16", "Signed 16-bit integer");
            RegisterMetaTag("uint32", "Unsigned 32-bit integer");
            RegisterMetaTag("int32", "Signed 32-bit integer");
            RegisterMetaTag("float32", "32-bit floating-point value");
            RegisterMetaTag("stringId", "32-bit string ID");
            RegisterMetaTag("bitfield8", "8-bit bitfield");
            RegisterMetaTag("bitfield16", "16-bit bitfield");
            RegisterMetaTag("bitfield32", "32-bit bitfield");
            RegisterMetaTag("enum8", "8-bit enumeration value");
            RegisterMetaTag("enum16", "8-bit enumeration value");
            RegisterMetaTag("enum32", "8-bit enumeration value");
            RegisterMetaTag("vector3", "3D vector of 32-bit floating point values");
            RegisterMetaTag("degree", "Radian value that should be converted to/from degrees");

            CompletableXMLTag color = RegisterMetaTag("color", "Integer color value");
            CompletableXMLTag colorf = RegisterMetaTag("colorf", "Floating-point color value");
            var colorFormat = new CompletableXMLAttribute("format",
                "A string containing the characters 'a', 'r', 'g', and 'b' which describes the format of the color (required)");
            color.RegisterAttribute(colorFormat);
            colorf.RegisterAttribute(colorFormat);

            RegisterMetaTag("color24", "32-bit RGB color");
            RegisterMetaTag("color32", "32-bit ARGB color");

            CompletableXMLTag tagRef = RegisterMetaTag("tagRef", "Tag reference");
            var withClass = new CompletableXMLAttribute("withClass",
                "Whether or not the reference includes a class ID (optional, default=true)");
            withClass.RegisterValue(new CompletableXMLValue("true", "The reference includes a 12-byte class ID (default)"));
            withClass.RegisterValue(new CompletableXMLValue("false", "The reference only includes a 4-byte datum index"));
            tagRef.RegisterAttribute(withClass);

            CompletableXMLTag dataRef = RegisterMetaTag("dataRef", "Data reference");
            var format = new CompletableXMLAttribute("format", "The format of the data in the dataref (optional, default=bytes)");
            format.RegisterValue(new CompletableXMLValue("bytes", "Raw byte data (default)"));
            format.RegisterValue(new CompletableXMLValue("asciiz", "Null-terminated ASCII string"));
            format.RegisterValue(new CompletableXMLValue("unicode", "Null-terminated unicode string"));
            dataRef.RegisterAttribute(format);

            CompletableXMLTag reflexive = RegisterMetaTag("reflexive", "Reflexive pointer");
            reflexive.RegisterAttribute(new CompletableXMLAttribute("entrySize",
                "The size of each entry in the reflexive (required)"));

            CompletableXMLTag ascii = RegisterMetaTag("ascii", "ASCII string");
            CompletableXMLTag utf16 = RegisterMetaTag("utf16", "UTF-16 string");
            var strLength = new CompletableXMLAttribute("length",
                "The size of the string, including the null terminator (required)");
            ascii.RegisterAttribute(strLength);
            utf16.RegisterAttribute(strLength);

            CompletableXMLTag raw = RegisterMetaTag("raw", "Raw data viewer");
            raw.RegisterAttribute(new CompletableXMLAttribute("size", "The size of the raw data (required)"));

            var comment = new CompletableXMLTag("comment", "Displays a message");
            comment.RegisterAttribute(new CompletableXMLAttribute("title", "The title of the comment (optional)"));
            _completer.RegisterTag(comment);

            CompletableXMLTag shader = RegisterMetaTag("shader", "Shader reference");
            var shaderType = new CompletableXMLAttribute("type", "The type of the shader (required)");
            shaderType.RegisterValue(new CompletableXMLValue("pixel", "Pixel shader"));
            shaderType.RegisterValue(new CompletableXMLValue("vertex", "Vertex shader"));
            shader.RegisterAttribute(shaderType);

            RegisterMetaTag("undefined", "Value of an unknown type");

            _completer.TagCompletionAvailable += TagCompletionAvailable;
            _completer.AttributeCompletionAvailable += AttributeCompletionAvailable;
            _completer.ValueCompletionAvailable += ValueCompletionAvailable;
        }
Пример #3
0
        private void LoadCodeCompletion()
        {
            RegisterMetaTag("uint8", "Unsigned 8-bit integer");
            RegisterMetaTag("int8", "Signed 8-bit integer");
            RegisterMetaTag("uint16", "Unsigned 16-bit integer");
            RegisterMetaTag("int16", "Signed 16-bit integer");
            RegisterMetaTag("uint32", "Unsigned 32-bit integer");
            RegisterMetaTag("int32", "Signed 32-bit integer");
            RegisterMetaTag("float32", "32-bit floating-point value");

            CompletableXMLTag tagRef = RegisterMetaTag("tagRef", "Tag reference");
            CompletableXMLAttribute withClass = new CompletableXMLAttribute("withClass", "Whether or not the reference includes a class ID (optional, default=true)");
            withClass.RegisterValue(new CompletableXMLValue("true", "The reference includes a 12-byte class ID (default)"));
            withClass.RegisterValue(new CompletableXMLValue("false", "The reference only includes a 4-byte datum index"));
            tagRef.RegisterAttribute(withClass);

            RegisterMetaTag("dataRef", "Data reference");

            CompletableXMLTag reflexive = RegisterMetaTag("reflexive", "Reflexive pointer");
            reflexive.RegisterAttribute(new CompletableXMLAttribute("entrySize", "The size of each entry in the reflexive (required)"));

            CompletableXMLTag ascii = RegisterMetaTag("ascii", "ASCII string");
            ascii.RegisterAttribute(new CompletableXMLAttribute("length", "The size of the string, including the null terminator (required)"));

            RegisterMetaTag("stringId", "32-bit string ID");
            RegisterMetaTag("bitfield8", "8-bit bitfield");
            RegisterMetaTag("bitfield16", "16-bit bitfield");
            RegisterMetaTag("bitfield32", "32-bit bitfield");
            RegisterMetaTag("enum8", "8-bit enumeration value");
            RegisterMetaTag("enum16", "8-bit enumeration value");
            RegisterMetaTag("enum32", "8-bit enumeration value");
            RegisterMetaTag("vector3", "3D vector of 32-bit floating point values");

            CompletableXMLTag raw = RegisterMetaTag("raw", "Raw data viewer");
            raw.RegisterAttribute(new CompletableXMLAttribute("size", "The size of the raw data (required)"));

            CompletableXMLTag comment = new CompletableXMLTag("comment", "Displays a message");
            comment.RegisterAttribute(new CompletableXMLAttribute("title", "The title of the comment (optional)"));
            _completer.RegisterTag(comment);

            RegisterMetaTag("undefined", "Value of an unknown type");

            _completer.TagCompletionAvailable += TagCompletionAvailable;
            _completer.AttributeCompletionAvailable += AttributeCompletionAvailable;
            _completer.ValueCompletionAvailable += ValueCompletionAvailable;
        }