예제 #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //Winforms interop
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
            System.Windows.Forms.Integration.WindowsFormsHost.EnableWindowsFormsInterop();

            //set up AppData Folder
            if (!Directory.Exists(AppDataFolder))
            {
                Directory.CreateDirectory(AppDataFolder);
            }

            //load in data files
            ME3TalkFiles.LoadSavedTlkList();
            ME2Explorer.ME2TalkFiles.LoadSavedTlkList();
            ME1UnrealObjectInfo.loadfromJSON();
            ME2UnrealObjectInfo.loadfromJSON();
            ME3UnrealObjectInfo.loadfromJSON();

            //static class setup
            Tools.Initialize();
            MEPackageHandler.Initialize();

            int exitCode = 0;

            if (HandleCommandLineArgs(Environment.GetCommandLineArgs(), out exitCode))
            {
                Shutdown(exitCode);
            }
            else
            {
                (new MainWindow()).Show();
            }
        }
예제 #2
0
        private List <string> GetEnumValues(string enumName, int propName)
        {
            switch (pcc.Game)
            {
            case MEGame.ME1:
                return(ME1UnrealObjectInfo.getEnumfromProp(className, pcc.getNameEntry(propName)));

            case MEGame.ME2:
                return(ME2UnrealObjectInfo.getEnumfromProp(className, pcc.getNameEntry(propName)));

            case MEGame.ME3:
                return(ME3UnrealObjectInfo.getEnumValues(enumName, true));
            }
            return(null);
        }
예제 #3
0
        private ArrayType GetArrayType(PropertyInfo propInfo)
        {
            switch (pcc.Game)
            {
            case MEGame.ME1:
                return(ME1UnrealObjectInfo.getArrayType(propInfo));

            case MEGame.ME2:
                return(ME2UnrealObjectInfo.getArrayType(propInfo));

            case MEGame.ME3:
                return(ME3UnrealObjectInfo.getArrayType(propInfo));
            }
            return(ArrayType.Int);
        }
예제 #4
0
        private PropertyInfo GetPropertyInfo(string propname, string typeName, bool inStruct = false)
        {
            switch (pcc.Game)
            {
            case MEGame.ME1:
                return(ME1UnrealObjectInfo.getPropertyInfo(typeName, propname, inStruct));

            case MEGame.ME2:
                return(ME2UnrealObjectInfo.getPropertyInfo(typeName, propname, inStruct));

            case MEGame.ME3:
                return(ME3UnrealObjectInfo.getPropertyInfo(typeName, propname, inStruct));
            }
            return(null);
        }
예제 #5
0
        private PropertyInfo GetPropertyInfo(int propName)
        {
            switch (pcc.Game)
            {
            case MEGame.ME1:
                return(ME1UnrealObjectInfo.getPropertyInfo(className, pcc.getNameEntry(propName)));

            case MEGame.ME2:
                return(ME2UnrealObjectInfo.getPropertyInfo(className, pcc.getNameEntry(propName)));

            case MEGame.ME3:
                return(ME3UnrealObjectInfo.getPropertyInfo(className, pcc.getNameEntry(propName)));
            }
            return(null);
        }
예제 #6
0
 public static void Startup()
 {
     if (!Booted)
     {
         ME1UnrealObjectInfo.loadfromJSON();
         ME2UnrealObjectInfo.loadfromJSON();
         ME3UnrealObjectInfo.loadfromJSON();
         UDKUnrealObjectInfo.loadfromJSON();
         ME1Directory.LoadGamePath();
         ME2Directory.LoadGamePath();
         ME3Directory.LoadGamePath();
         MEPackageHandler.Initialize();
         Booted = true;
     }
 }
예제 #7
0
 public static void loadfromJSON()
 {
     if (!loaded)
     {
         try
         {
             var blob = JsonConvert.DeserializeAnonymousType(ME3UnrealObjectInfo.LoadEmbeddedJSONText(MEGame.ME1), new { Classes, Structs, Enums });
             Classes = blob.Classes;
             Structs = blob.Structs;
             Enums   = blob.Enums;
             loaded  = true;
         }
         catch (Exception e)
         {
         }
     }
 }
예제 #8
0
        private ArrayType GetArrayType(int propName, string typeName = null)
        {
            if (typeName == null)
            {
                typeName = className;
            }
            switch (pcc.Game)
            {
            case MEGame.ME1:
                return(ME1UnrealObjectInfo.getArrayType(typeName, pcc.getNameEntry(propName)));

            case MEGame.ME2:
                return(ME2UnrealObjectInfo.getArrayType(typeName, pcc.getNameEntry(propName)));

            case MEGame.ME3:
                return(ME3UnrealObjectInfo.getArrayType(typeName, pcc.getNameEntry(propName)));
            }
            return(ArrayType.Int);
        }
예제 #9
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //Winforms interop
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
            System.Windows.Forms.Integration.WindowsFormsHost.EnableWindowsFormsInterop();

            //set up AppData Folder
            if (!Directory.Exists(AppDataFolder))
            {
                Directory.CreateDirectory(AppDataFolder);
            }

            //load in data files
            ME3TalkFiles.LoadSavedTlkList();
            ME2Explorer.ME2TalkFiles.LoadSavedTlkList();
            ME1UnrealObjectInfo.loadfromJSON();
            ME2UnrealObjectInfo.loadfromJSON();
            ME3UnrealObjectInfo.loadfromJSON();

            //static class setup
            Tools.Initialize();
            MEPackageHandler.Initialize();

            //load kismet font
            SequenceObjects.SText.LoadFont();

            splashScreen.Close(TimeSpan.FromMilliseconds(1));
            if (HandleCommandLineJumplistCall(Environment.GetCommandLineArgs(), out int exitCode) != 1)
            {
                Shutdown(exitCode);
            }
            else
            {
                this.Dispatcher.UnhandledException += OnDispatcherUnhandledException; //only start handling them after bootup
                (new MainWindow()).Show();
            }
        }
예제 #10
0
        public static ArrayType getArrayType(string className, string propName, bool inStruct = false, IExportEntry export = null)
        {
            PropertyInfo p = getPropertyInfo(className, propName, inStruct);

            if (p == null)
            {
                p = getPropertyInfo(className, propName, !inStruct);
            }
            if (p == null && export != null && export.ClassName != "Class")
            {
                export = export.FileRef.Exports[export.idxClass - 1]; //make sure you get actual class
                ClassInfo currentInfo;
                switch (export.FileRef.Game)
                {
                case MEGame.ME1:
                    currentInfo = ME1Explorer.Unreal.ME1UnrealObjectInfo.generateClassInfo(export);
                    break;

                case MEGame.ME2:
                    currentInfo = ME2Explorer.Unreal.ME2UnrealObjectInfo.generateClassInfo(export);
                    break;

                case MEGame.ME3:
                default:
                    currentInfo = ME3UnrealObjectInfo.generateClassInfo(export);
                    break;
                }
                currentInfo.baseClass = export.ClassParent;
                p = getPropertyInfo(className, propName, inStruct, currentInfo);
                if (p == null)
                {
                    p = getPropertyInfo(className, propName, !inStruct, currentInfo);
                }
            }
            return(getArrayType(p));
        }
예제 #11
0
        public static string GetProperty(IExportEntry export, List <string> _extantProps, MEGame game)
        {
            string        origname = export.ClassName;
            string        temp     = export.ClassName;
            List <string> classes  = new List <string>();
            Dictionary <string, ClassInfo> classList;

            switch (game)
            {
            case MEGame.ME1:
                classList = ME1Explorer.Unreal.ME1UnrealObjectInfo.Classes;
                break;

            case MEGame.ME2:
                classList = ME2Explorer.Unreal.ME2UnrealObjectInfo.Classes;
                break;

            case MEGame.ME3:
            default:
                classList = ME3UnrealObjectInfo.Classes;
                break;
            }
            //For debugging ME1 Objectinfo when we get around to it
            //foreach (KeyValuePair<string, ClassInfo> entry in classList)
            //{
            //    // do something with entry.Value or entry.Key
            //    if (entry.Key.StartsWith("LightMap"))
            //    {
            //        Debug.WriteLine(entry.Key);
            //    }
            //}
            if (!classList.ContainsKey(temp) && export.idxClass < 0)
            {
                //lookup import parent info
                temp = export.ClassParent;
            }
            else if (!classList.ContainsKey(temp) && export.idxClass > 0)
            {
                export = export.FileRef.Exports[export.idxClass - 1];
                //current object is not in classes db, temporarily add it to the list
                ClassInfo currentInfo;
                switch (game)
                {
                case MEGame.ME1:
                    currentInfo = ME1Explorer.Unreal.ME1UnrealObjectInfo.generateClassInfo(export);
                    break;

                case MEGame.ME2:
                    currentInfo = ME2Explorer.Unreal.ME2UnrealObjectInfo.generateClassInfo(export);
                    break;

                case MEGame.ME3:
                default:
                    currentInfo = ME3UnrealObjectInfo.generateClassInfo(export);
                    break;
                }
                currentInfo.baseClass = export.ClassParent;
                classList             = classList.ToDictionary(entry => entry.Key, entry => entry.Value);
                classList[temp]       = currentInfo;
            }
            while (classList.ContainsKey(temp) && temp != "Object")
            {
                classes.Add(temp);
                temp = classList[temp].baseClass;
            }
            classes.Reverse();
            AddPropertyDialogWPF prompt = new AddPropertyDialogWPF();

            prompt.classList   = classList;
            prompt.extantProps = _extantProps;
            prompt.ClassesListView.ItemsSource  = classes;
            prompt.ClassesListView.SelectedItem = origname;
            prompt.ShowDialog();
            if (prompt.DialogResult.HasValue && prompt.DialogResult.Value && prompt.PropertiesListView.SelectedIndex != -1)
            {
                return(prompt.PropertiesListView.SelectedItem as string);
            }
            else
            {
                return(null);
            }
        }
예제 #12
0
        public static string GetProperty(IExportEntry export, List <string> _extantProps, MEGame game)
        {
            string        origname = export.ClassName;
            string        temp     = export.ClassName;
            List <string> classes  = new List <string>();
            Dictionary <string, ClassInfo> classList;

            switch (game)
            {
            case MEGame.ME1:
                classList = ME1Explorer.Unreal.ME1UnrealObjectInfo.Classes;
                break;

            case MEGame.ME2:
                classList = ME2Explorer.Unreal.ME2UnrealObjectInfo.Classes;
                break;

            case MEGame.ME3:
            default:
                classList = ME3UnrealObjectInfo.Classes;
                break;
            }
            if (!classList.ContainsKey(temp))
            {
                export = export.FileRef.Exports[export.idxClass - 1];
                //current object is not in classes db, temporarily add it to the list
                ClassInfo currentInfo;
                switch (game)
                {
                case MEGame.ME1:
                    currentInfo = ME1Explorer.Unreal.ME1UnrealObjectInfo.generateClassInfo(export);
                    break;

                case MEGame.ME2:
                    currentInfo = ME2Explorer.Unreal.ME2UnrealObjectInfo.generateClassInfo(export);
                    break;

                case MEGame.ME3:
                default:
                    currentInfo = ME3UnrealObjectInfo.generateClassInfo(export);
                    break;
                }
                currentInfo.baseClass = export.ClassParent;
                classList             = classList.ToDictionary(entry => entry.Key, entry => entry.Value);
                classList[temp]       = currentInfo;
            }
            while (classList.ContainsKey(temp) && temp != "Object")
            {
                classes.Add(temp);
                temp = classList[temp].baseClass;
            }
            classes.Reverse();
            AddPropertyDialog prompt = new AddPropertyDialog();

            prompt.classList                 = classList;
            prompt.extantProps               = _extantProps;
            prompt.classListBox.DataSource   = classes;
            prompt.classListBox.SelectedItem = origname;
            if (prompt.ShowDialog() == DialogResult.OK && prompt.propListBox.SelectedIndex != -1)
            {
                return(prompt.propListBox.SelectedItem as string);
            }
            else
            {
                return(null);
            }
        }