Example #1
0
        protected override void Deserialize()
        {
            base.Deserialize();

            int classIndex = _Buffer.ReadObjectIndex();

            ClassObject = (UClass)GetIndexObject(classIndex);
        }
Example #2
0
        protected override void Deserialize()
        {
            base.Deserialize();

            int index = _Buffer.ReadObjectIndex();

            InterfaceObject = (UClass)GetIndexObject(index);

            //Index = _Buffer.ReadObjectIndex();
            //_InterfaceType = (UInterfaceProperty)GetIndexObject( Index );
        }
Example #3
0
        private string FormatFlags()
        {
            string output = string.Empty;

            if ((ClassFlags & (uint)Flags.ClassFlags.Abstract) != 0)
            {
                output += "\r\n\tabstract";
            }

            if ((ClassFlags & (uint)Flags.ClassFlags.Transient) != 0)
            {
                output += "\r\n\ttransient";
            }
            else
            {
                // Only do if parent had Transient
                UClass parentClass = (UClass)Super;
                if (parentClass != null && (parentClass.ClassFlags & (uint)Flags.ClassFlags.Transient) != 0)
                {
                    output += "\r\n\tnotransient";
                }
            }

            if (HasObjectFlag(Flags.ObjectFlagsLO.Native))
            {
                output += "\r\n\t" + FormatNative();
                if (NativeClassName.Length != 0)
                {
                    output += "(" + NativeClassName + ")";
                }
            }

            if (HasClassFlag(Flags.ClassFlags.NativeOnly))
            {
                output += "\r\n\tnativeonly";
            }

            if (HasClassFlag(Flags.ClassFlags.NativeReplication))
            {
                output += "\r\n\tnativereplication";
            }

            // BTClient.Menu.uc has Config(ClientBtimes) and this flag is not true???
            if ((ClassFlags & (uint)Flags.ClassFlags.Config) != 0)
            {
                string inner = ConfigName;
                if (string.Compare(inner, "None", StringComparison.OrdinalIgnoreCase) == 0 ||
                    string.Compare(inner, "System", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    output += "\r\n\tconfig";
                }
                else
                {
                    output += "\r\n\tconfig(" + inner + ")";
                }
            }

            if ((ClassFlags & (uint)Flags.ClassFlags.ParseConfig) != 0)
            {
                output += "\r\n\tparseconfig";
            }

            if ((ClassFlags & (uint)Flags.ClassFlags.PerObjectConfig) != 0)
            {
                output += "\r\n\tperobjectconfig";
            }
            else
            {
                // Only do if parent had PerObjectConfig
                UClass parentClass = (UClass)Super;
                if (parentClass != null && (parentClass.ClassFlags & (uint)Flags.ClassFlags.PerObjectConfig) != 0)
                {
                    output += "\r\n\tnoperobjectconfig";
                }
            }

            if ((ClassFlags & (uint)Flags.ClassFlags.EditInlineNew) != 0)
            {
                output += "\r\n\teditinlinenew";
            }
            else
            {
                // Only do if parent had EditInlineNew
                UClass parentClass = (UClass)Super;
                if (parentClass != null && (parentClass.ClassFlags & (uint)Flags.ClassFlags.EditInlineNew) != 0)
                {
                    output += "\r\n\tnoteditinlinenew";
                }
            }

            if ((ClassFlags & (uint)Flags.ClassFlags.CollapseCategories) != 0)
            {
                output += "\r\n\tcollapsecategories";
            }

            // TODO: Might indicate "Interface" in later versions
            if (HasClassFlag(Flags.ClassFlags.ExportStructs) && Package.Version < 300)
            {
                output += "\r\n\texportstructs";
            }

            if ((ClassFlags & (uint)Flags.ClassFlags.NoExport) != 0)
            {
                output += "\r\n\tnoexport";
            }

            if (Extends("Actor"))
            {
                if ((ClassFlags & (uint)Flags.ClassFlags.Placeable) != 0)
                {
                    output += Package.Version >= PlaceableVersion ? "\r\n\tplaceable" : "\r\n\tusercreate";
                }
                else
                {
                    output += Package.Version >= PlaceableVersion ? "\r\n\tnotplaceable" : "\r\n\tnousercreate";
                }
            }

            if ((ClassFlags & (uint)Flags.ClassFlags.SafeReplace) != 0)
            {
                output += "\r\n\tsafereplace";
            }

            // Approx version
            if ((ClassFlags & (uint)Flags.ClassFlags.Instanced) != 0 && Package.Version < 150)
            {
                output += "\r\n\tinstanced";
            }

            if ((ClassFlags & (uint)Flags.ClassFlags.HideDropDown) != 0)
            {
                output += "\r\n\thidedropdown";
            }

            if (Package.Build == UnrealPackage.GameBuild.BuildName.UT2004)
            {
                if (HasClassFlag(Flags.ClassFlags.CacheExempt))
                {
                    output += "\r\n\tcacheexempt";
                }
            }

            if (Package.Version >= 749 && Super != null)
            {
                if (ForceScriptOrder && !((UClass)Super).ForceScriptOrder)
                {
                    output += "\r\n\tforcescriptorder(true)";
                }
                else if (!ForceScriptOrder && ((UClass)Super).ForceScriptOrder)
                {
                    output += "\r\n\tforcescriptorder(false)";
                }
            }

            try
            {
                if (Package.Version >= UnrealPackage.VDLLBIND &&
                    string.Compare(DLLBindName, "None", StringComparison.OrdinalIgnoreCase) != 0)
                {
                    output += "\r\n\tdllbind(" + DLLBindName + ")";
                }
            }
            catch
            {
                output += "\r\n\t// Failed to decompile dllbind";
            }

            if (ClassDependencies != null)
            {
                var dependsOn = new List <int>();
                foreach (var dependency in ClassDependencies)
                {
                    if (dependsOn.Exists(dep => dep == dependency.Class))
                    {
                        continue;
                    }
                    var obj = (UClass)GetIndexObject(dependency.Class);
                    // Only exports and those who are further than this class
                    if (obj != null && (int)obj > (int)this)
                    {
                        output += "\r\n\tdependson(" + obj.Name + ")";
                    }
                    dependsOn.Add(dependency.Class);
                }
            }

            output += FormatNameGroup("dontsortcategories", DontSortCategories);
            output += FormatNameGroup("hidecategories", HideCategories);
            output += FormatNameGroup("classgroup", ClassGroups);
            output += FormatNameGroup("autoexpandcategories", AutoExpandCategories);
            output += FormatNameGroup("autocollapsecategories", AutoCollapseCategories);
            output += FormatObjectGroup("implements", ImplementedInterfaces);

            return(output + ";\r\n");
        }