コード例 #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
        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);
        }
コード例 #8
0
ファイル: App.xaml.cs プロジェクト: aquadran/ME3Explorer
        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();
            }
        }
コード例 #9
0
        private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeNode t = e.Node;

            if (t == null || t.Parent == null)
            {
                return;
            }
            TreeNode p = t.Parent;
            int      n = p.Index, i = 0;
            string   result;

            ME2BioConversation.EntryListStuct el = Dialog.EntryList[n];
            #region MainProps
            if (p.Parent == null)//MainProps
            {
                string propname = t.Text.Split(':')[0].Trim();
                switch (propname)
                {
                case "SpeakerIndex":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.SpeakerIndex.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.SpeakerIndex = i;
                    }
                    break;

                case "ListenerIndex":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.ListenerIndex.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.ListenerIndex = i;
                    }
                    break;

                case "Skippable":
                    if (el.Skippable)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    el.Skippable = (result == "1");
                    break;

                case "Text":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new string", "ME2Explorer", el.Text, 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    el.Text = result;
                    break;

                case "refText":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.refText.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.refText = i;
                    }
                    break;

                case "ConditionalFunc":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.ConditionalFunc.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.ConditionalFunc = i;
                    }
                    break;

                case "ConditionalParam":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.ConditionalParam.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.ConditionalParam = i;
                    }
                    break;

                case "StateTransition":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.StateTransition.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.StateTransition = i;
                    }
                    break;

                case "StateTransitionParam":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.StateTransitionParam.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.StateTransitionParam = i;
                    }
                    break;

                case "ExportID":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.ExportID.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.ExportID = i;
                    }
                    break;

                case "ScriptIndex":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.ScriptIndex.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.ScriptIndex = i;
                    }
                    break;

                case "CameraIntimacy":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.CameraIntimacy.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.CameraIntimacy = i;
                    }
                    break;

                case "FireConditional":
                    if (el.FireConditional)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    el.FireConditional = (result == "1");
                    break;

                case "Ambient":
                    if (el.Ambient)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    el.Ambient = (result == "1");
                    break;

                case "NonTextline":
                    if (el.NonTextline)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    el.NonTextline = (result == "1");
                    break;

                case "IgnoreBodyGestures":
                    if (el.IgnoreBodyGestures)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    el.IgnoreBodyGestures = (result == "1");
                    break;

                case "GUIStyle":
                    result = InputComboBox.GetValue("Please select new value", ME2UnrealObjectInfo.getEnumValues("EConvGUIStyles"), pcc.getNameEntry(el.GUIStyleValue));
                    if (result == "")
                    {
                        return;
                    }
                    el.GUIStyleValue = pcc.FindNameOrAdd(result);
                    break;
                }
                Dialog.EntryList[n] = el;
                Dialog.Save();
            }
            #endregion
            #region EntryList
            else //ReplyList/SpeakerList
            {
                n  = p.Parent.Index;
                el = Dialog.EntryList[n];
                int m = t.Index;
                if (p.Index == 0) //ReplyList
                {
                    ME2BioConversation.EntryListReplyListStruct rpe = el.ReplyList[m];
                    result         = Microsoft.VisualBasic.Interaction.InputBox("Please enter new string for \"Paraphrase\"", "ME2Explorer", rpe.Paraphrase.ToString(), 0, 0);
                    rpe.Paraphrase = result;
                    result         = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value for \"Index\"", "ME2Explorer", rpe.Index.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rpe.Index = i;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new StringRef value for \"refParaphrase\"", "ME2Explorer", rpe.refParaphrase.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rpe.refParaphrase = i;
                    }
                    result = InputComboBox.GetValue("Please select new value for \"Category\"", ME2UnrealObjectInfo.getEnumValues("EReplyCategory"), pcc.getNameEntry(rpe.CategoryValue));
                    if (result == "")
                    {
                        return;
                    }
                    rpe.CategoryValue = pcc.FindNameOrAdd(result);
                    el.ReplyList[m]   = rpe;
                    Dialog.Save();
                }
                if (p.Index == 1) //Speaker List
                {
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", el.SpeakerList[m].ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        el.SpeakerList[m] = i;
                        Dialog.Save();
                    }
                }
            }
            #endregion
        }
コード例 #10
0
        private void treeView2_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeNode t = e.Node;

            if (t == null || t.Parent == null)
            {
                return;
            }
            TreeNode p = t.Parent;
            int      n = p.Index, i = 0;
            string   result;

            ME2BioConversation.ReplyListStruct rp = Dialog.ReplyList[n];
            #region MainProps
            if (p.Parent == null)//MainProps
            {
                string propname = t.Text.Split(':')[0].Trim();
                switch (propname)
                {
                case "Listener Index":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].ListenerIndex.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rp.ListenerIndex = i;
                    }
                    break;

                case "Unskippable":
                    if (Dialog.ReplyList[n].Unskippable)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    rp.Unskippable = (result == "1");
                    break;

                case "ReplyType":
                    result = InputComboBox.GetValue("Please select new value", ME2UnrealObjectInfo.getEnumValues("EReplyTypes"), pcc.getNameEntry(Dialog.ReplyList[n].ReplyTypeValue));
                    if (result == "")
                    {
                        return;
                    }
                    rp.ReplyTypeValue = pcc.FindNameOrAdd(result);
                    break;

                case "Text":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new string", "ME2Explorer", Dialog.ReplyList[n].Text, 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    rp.Text = result;
                    break;

                case "refText":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].refText.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rp.refText = i;
                    }
                    break;

                case "ConditionalFunc":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].ConditionalFunc.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rp.ConditionalFunc = i;
                    }
                    break;

                case "ConditionalParam":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].ConditionalParam.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rp.ConditionalParam = i;
                    }
                    break;

                case "StateTransition":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].StateTransition.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rp.StateTransition = i;
                    }
                    break;

                case "StateTransitionParam":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].StateTransitionParam.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rp.StateTransitionParam = i;
                    }
                    break;

                case "ExportID":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].ExportID.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rp.ExportID = i;
                    }
                    break;

                case "ScriptIndex":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].ScriptIndex.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rp.ScriptIndex = i;
                    }
                    break;

                case "CameraIntimacy":
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].CameraIntimacy.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    if (int.TryParse(result, out i))
                    {
                        rp.CameraIntimacy = i;
                    }
                    break;

                case "FireConditional":
                    if (Dialog.ReplyList[n].FireConditional)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    rp.FireConditional = (result == "1");
                    break;

                case "Ambient":
                    if (Dialog.ReplyList[n].Ambient)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    rp.Ambient = (result == "1");
                    break;

                case "NonTextline":
                    if (Dialog.ReplyList[n].NonTextLine)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    rp.NonTextLine = (result == "1");
                    break;

                case "IgnoreBodyGestures":
                    if (Dialog.ReplyList[n].IgnoreBodyGestures)
                    {
                        i = 1;
                    }
                    else
                    {
                        i = 0;
                    }
                    result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", i.ToString(), 0, 0);
                    if (result == "")
                    {
                        return;
                    }
                    rp.IgnoreBodyGestures = (result == "1");
                    break;

                case "GUIStyle":
                    result = InputComboBox.GetValue("Please select new value", ME2UnrealObjectInfo.getEnumValues("EConvGUIStyles"), pcc.getNameEntry(Dialog.ReplyList[n].GUIStyleValue));
                    if (result == "")
                    {
                        return;
                    }
                    rp.GUIStyleValue = pcc.FindNameOrAdd(result);
                    break;
                }
                Dialog.Save();
            }
            #endregion
            #region EntryList
            else //EntryList
            {
                n  = p.Parent.Index;
                rp = Dialog.ReplyList[n];
                int m = t.Index;
                result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME2Explorer", Dialog.ReplyList[n].EntryList[m].ToString(), 0, 0);
                if (result == "")
                {
                    return;
                }
                if (int.TryParse(result, out i))
                {
                    rp.EntryList[m] = i;
                    Dialog.Save();
                }
            }
            #endregion
        }