Пример #1
0
        private void AddInputOption(InputComboBox combo, string text, string tag)
        {
            InputOption io = new InputOption();

            io.Text = text;
            io.Tag  = tag;
            combo.Items.Add(io);
        }
Пример #2
0
 protected override void OnShown(EventArgs e)
 {
     if (isCombo)
     {
         InputComboBox.Focus();
     }
     else
     {
         InputTextBox.Focus();
     }
     base.OnShown(e);
 }
Пример #3
0
        //adds an InputComboBox to InputPanel with And/Or options
        private void AddAndOrBox()
        {
            InputComboBox cb = new InputComboBox();

            cb.Items.Add(new InputOption("And"));
            cb.Items.Add(new InputOption("Or"));
            cb.SelectedIndex = 0;
            cb.Width         = 50;
            cb.DropDownStyle = InputComboBoxStyle.DropDownList;
            cb.Break         = BreakType.None;
            c1InputPanel1.Items.Insert(c1InputPanel1.Items.Count - 2, cb);
        }
Пример #4
0
        //adds an InputComboBox to InputPanel with operator options
        private void AddOperatorBox()
        {
            InputComboBox cb = new InputComboBox();

            AddInputOption(cb, "Contains", "LIKE");
            AddInputOption(cb, "Equals", "=");
            AddInputOption(cb, "Less Than", "<");
            AddInputOption(cb, "Greater Than", ">");
            cb.SelectedIndex = 0;
            cb.DropDownStyle = InputComboBoxStyle.DropDownList;
            cb.Break         = BreakType.None;
            c1InputPanel1.Items.Insert(c1InputPanel1.Items.Count - 2, cb);
        }
Пример #5
0
        void box_SelectedIndexChanged(object sender, EventArgs e)
        {
            InputComboBox box = sender as InputComboBox;

            if (box != null)
            {
                InputOption io   = box.SelectedOption;
                Association a    = box.Tag as Association;
                FieldInfo   info = io.Tag as FieldInfo;

                if (info != null)
                {
                    a.Value = info.GetRawConstantValue();
                }
            }
        }
Пример #6
0
        //adds an InputComboBox to InputPanel with grid fields
        private void AddPropertyBox()
        {
            InputComboBox cb = new InputComboBox();

            AddInputOption(cb, "ProductName", "tstring");
            AddInputOption(cb, "SupplierID", "tnumber");
            AddInputOption(cb, "CategoryID", "tnumber");
            AddInputOption(cb, "QuantityPerUnit", "tstring");
            AddInputOption(cb, "UnitPrice", "tnumber");
            AddInputOption(cb, "UnitsInStock", "tnumber");
            AddInputOption(cb, "UnitsOnOrder", "tnumber");
            AddInputOption(cb, "ReorderLevel", "tnumber");
            AddInputOption(cb, "Discontinued", "tbool");
            cb.SelectedIndex = 0;
            cb.DropDownStyle = InputComboBoxStyle.DropDownList;
            cb.Break         = BreakType.None;
            c1InputPanel1.Items.Insert(c1InputPanel1.Items.Count - 2, cb);
        }
Пример #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inp"></param>
        /// <returns></returns>
        public static void Invoke_InputPanel_Reset(C1InputPanel inp)
        {
            if (inp.InvokeRequired)
            {
                inp.Invoke(new delInvoke_InputPanel_Reset(Invoke_InputPanel_Reset), new object[] { inp });
                return;
            }

            foreach (InputComponent ctl in inp.Items)
            {
                InputDatePicker dt = ctl as InputDatePicker;
                if (dt != null)
                {
                    dt.ValueIsNull = true;
                    continue;
                }

                InputTimePicker tm = ctl as InputTimePicker;
                if (tm != null)
                {
                    tm.ValueIsNull = true;
                    continue;
                }

                InputTextBox txt = ctl as InputTextBox;
                if (txt != null)
                {
                    txt.Text = string.Empty;
                    continue;
                }

                InputComboBox cmb = ctl as InputComboBox;
                if (cmb != null)
                {
                    cmb.SelectedIndex = -1;
                    continue;
                }
            }
        }
Пример #8
0
 public void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     Left = 0;
     Top  = SystemParameters.WorkArea.Height - ActualHeight;
     InputComboBox.Focus();
 }
Пример #9
0
        /// <summary>
        /// Make a shadow copy of the element at the current state which stays available even the element is gone.
        /// </summary>
        /// <returns>A shadow copy of the current element.</returns>
        public new BasicOpenFileDialogData GetDataCopy()
        {
            var data = new BasicOpenFileDialogData();

            FillData(data);

            data.InputComboBox = GetSafeData(() =>
            {
                if (InputComboBox == null)
                {
                    return(null);
                }
                return(InputComboBox.GetDataCopy());
            });

            data.BreadCrumbBar = GetSafeData(() =>
            {
                if (BreadCrumbBar == null)
                {
                    return(null);
                }
                return(BreadCrumbBar.GetDataCopy());
            });

            data.BreadCrumbTextBox = GetSafeData(() =>
            {
                if (BreadCrumbTextBox == null)
                {
                    return(null);
                }
                return(BreadCrumbTextBox.GetDataCopy());
            });

            data.FilterComboBox = GetSafeData(() =>
            {
                if (FilterComboBox == null)
                {
                    return(null);
                }
                return(FilterComboBox.GetDataCopy());
            });

            data.CancelButton = GetSafeData(() =>
            {
                if (CancelButton == null)
                {
                    return(null);
                }
                return(CancelButton.GetDataCopy());
            });

            data.OpenButton = GetSafeData(() =>
            {
                if (OpenButton == null)
                {
                    return(null);
                }
                return(OpenButton.GetDataCopy());
            });

            data.FilesList = GetSafeData(() =>
            {
                if (FilesList == null)
                {
                    return(null);
                }
                return(FilesList.GetDataCopy());
            });

            data.SearchTextBox = GetSafeData(() =>
            {
                if (SearchTextBox == null)
                {
                    return(null);
                }
                return(SearchTextBox.GetDataCopy());
            });

            data.SearchButton = GetSafeData(() =>
            {
                if (SearchButton == null)
                {
                    return(null);
                }
                return(SearchButton.GetDataCopy());
            });

            data.FolderTree = GetSafeData(() =>
            {
                if (FolderTree == null)
                {
                    return(null);
                }
                return(FolderTree.GetDataCopy());
            });

            data.ToolBar = GetSafeData(() =>
            {
                if (ToolBar == null)
                {
                    return(null);
                }
                return(ToolBar.GetDataCopy());
            });

            data.ChangeViewButton = GetSafeData(() =>
            {
                if (ChangeViewButton == null)
                {
                    return(null);
                }
                return(ChangeViewButton.GetDataCopy());
            });

            data.ShowPreviewButton = GetSafeData(() =>
            {
                if (ShowPreviewButton == null)
                {
                    return(null);
                }
                return(ShowPreviewButton.GetDataCopy());
            });

            data.HelpButton = GetSafeData(() =>
            {
                if (HelpButton == null)
                {
                    return(null);
                }
                return(HelpButton.GetDataCopy());
            });

            return(data);
        }
Пример #10
0
        private void AddInputComponent(XmlNode node)
        {
            switch (node.Name)
            {
            case "C1InputButton":
                InputButton button = new InputButton();
                ReadCommonProperties(node, button);
                button.Text         = XmlUtil.Read(node, "text", String.Empty);
                button.Image        = XmlUtil.ReadImage(node, "image");
                button.CheckOnClick = XmlUtil.Read(node, "toggle", false);
                button.Pressed      = XmlUtil.Read(node, "pressed", false);
                c1InputPanel1.Items.Add(button);
                break;

            case "C1InputCheckBox":
                InputCheckBox checkBox = new InputCheckBox();
                ReadCommonProperties(node, checkBox);
                checkBox.Checked    = XmlUtil.Read(node, "checked", false);
                checkBox.ThreeState = XmlUtil.Read(node, "threeState", false);
                checkBox.Text       = XmlUtil.Read(node, "text", String.Empty);
                c1InputPanel1.Items.Add(checkBox);
                break;

            case "C1InputComboBox":
                InputComboBox comboBox = new InputComboBox();
                ReadCommonProperties(node, comboBox, true);
                comboBox.DropDownStyle = XmlUtil.Read(node, "dropDownList", false)
                        ? InputComboBoxStyle.DropDownList : InputComboBoxStyle.DropDown;
                comboBox.MaxDropDownItems  = XmlUtil.Read(node, "maxDropDownItems", 8);
                comboBox.GripHandleVisible = XmlUtil.Read(node, "gripHandle", false);
                comboBox.Text      = XmlUtil.Read(node, "text", String.Empty);
                comboBox.Width     = XmlUtil.Read(node, "width", 100);
                comboBox.MaxLength = XmlUtil.Read(node, "maxLength", 250);

                // parse combobox options
                string   options = XmlUtil.Read(node, "options", String.Empty);
                string[] optList = options.Split(',');
                for (int i = 0; i < optList.Length; i++)
                {
                    InputOption option = new InputOption();
                    option.Text = optList[i];
                    comboBox.Items.Add(option);
                }

                c1InputPanel1.Items.Add(comboBox);
                break;

            case "C1InputDatePicker":
                InputDatePicker datePicker = new InputDatePicker();
                ReadCommonProperties(node, datePicker, true);
                datePicker.Format    = XmlUtil.Read(node, "format", String.Empty);
                datePicker.ShowToday = XmlUtil.Read(node, "showToday", true);
                datePicker.Width     = XmlUtil.Read(node, "width", 100);
                c1InputPanel1.Items.Add(datePicker);
                break;

            case "C1InputGroup":
                InputGroupHeader header = new InputGroupHeader();
                header.Text        = XmlUtil.Read(node, "text", String.Empty);
                header.Collapsible = XmlUtil.Read(node, "collapsible", false);
                header.Collapsed   = XmlUtil.Read(node, "collapsed", false);
                header.Height      = XmlUtil.Read(node, "height", 24);
                c1InputPanel1.Items.Add(header);
                break;

            case "C1InputImage":
                InputImage image = new InputImage();
                ReadCommonProperties(node, image);
                image.Image = XmlUtil.ReadImage(node, "image");
                c1InputPanel1.Items.Add(image);
                break;

            case "C1InputLabel":
                InputLabel label = new InputLabel();
                ReadCommonProperties(node, label);
                label.Text     = XmlUtil.Read(node, "text", String.Empty);
                label.WordWrap = XmlUtil.Read(node, "wordwrap", false);
                c1InputPanel1.Items.Add(label);
                break;

            case "C1InputRadioButton":
                InputRadioButton radioButton = new InputRadioButton();
                ReadCommonProperties(node, radioButton);
                radioButton.Checked   = XmlUtil.Read(node, "checked", false);
                radioButton.GroupName = XmlUtil.Read(node, "groupName", String.Empty);
                radioButton.Text      = XmlUtil.Read(node, "text", String.Empty);
                c1InputPanel1.Items.Add(radioButton);
                break;

            case "C1InputSeparator":
                InputSeparator separator = new InputSeparator();
                ReadCommonProperties(node, separator);
                c1InputPanel1.Items.Add(separator);
                break;

            case "C1InputTextBox":
                InputTextBox textBox = new InputTextBox();
                ReadCommonProperties(node, textBox, true);
                textBox.Text      = XmlUtil.Read(node, "text", String.Empty);
                textBox.Width     = XmlUtil.Read(node, "width", 100);
                textBox.MaxLength = XmlUtil.Read(node, "maxLength", 250);
                c1InputPanel1.Items.Add(textBox);
                break;

            case "C1InputNumericBox":
                InputNumericBox numBox = new InputNumericBox();
                ReadCommonProperties(node, numBox, true);
                numBox.Format    = XmlUtil.Read(node, "format", string.Empty);
                numBox.Text      = XmlUtil.Read(node, "value", String.Empty);
                numBox.Increment = Decimal.Parse(XmlUtil.Read(node, "step", "1"));
                numBox.Width     = XmlUtil.Read(node, "width", 100);
                c1InputPanel1.Items.Add(numBox);
                break;

            case "C1InputControlHost":
                string className = XmlUtil.Read(node, "control", String.Empty);
                if (!String.IsNullOrEmpty(className))
                {
                    string qualifiedTypeName = typeof(Control).AssemblyQualifiedName;
                    qualifiedTypeName = qualifiedTypeName.Replace(".Control", "." + className);
                    Type controlType = Type.GetType(qualifiedTypeName, true);
                    if (controlType != null)
                    {
                        ConstructorInfo ci = controlType.GetConstructor(new Type[0]);
                        if (ci != null)
                        {
                            Control control = ci.Invoke(new object[0]) as Control;
                            if (control != null)
                            {
                                InputControlHost controlHost = new InputControlHost(control);
                                ReadCommonProperties(node, controlHost);
                                c1InputPanel1.Items.Add(controlHost);
                            }
                        }
                    }
                }
                break;

            case "C1InputLinkLabel":
                string linkText = XmlUtil.Read(node, "text", String.Empty);
                if (!String.IsNullOrEmpty(linkText))
                {
                    InputHtmlLabel htmlLabel = new InputHtmlLabel();
                    ReadCommonProperties(node, htmlLabel);
                    string linkHRef = XmlUtil.Read(node, "href", String.Empty);
                    htmlLabel.Text         = "<a href='" + linkHRef + "'>" + linkText + "</a>";
                    htmlLabel.LinkClicked += new C1.Win.C1InputPanel.LinkClickedEventHandler(htmlLabel_LinkClicked);
                    c1InputPanel1.Items.Add(htmlLabel);
                }
                break;

            default:
                InputLabel unknown = new InputLabel();
                ReadCommonProperties(node, unknown);
                string text = XmlUtil.Read(node, "text", String.Empty);
                if (text.Length > 0)
                {
                    unknown.Text = "< " + node.Name + ", Text = \"" + text + "\" >";
                }
                else
                {
                    unknown.Text = "< " + node.Name + " >";
                }
                c1InputPanel1.Items.Add(unknown);
                break;
            }
        }
Пример #11
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
        }
Пример #12
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
        }
Пример #13
0
        public PropertyList(ArrayList properties)
        {
            this.ChildSpacing = new Size(2, 2);
            this.Margin       = new Padding(0);
            this.Padding      = new Padding(0);
            this.SuspendLayout();

            for (int i = 0; i < properties.Count; i++)
            {
                Association a = properties[i] as Association;

                if (a == null)
                {
                    string s = properties[i] as string;
                    if (s.ToLower().Equals("separator"))
                    {
                        InputSeparator sep = new InputSeparator();
                        this.Items.Add(sep);
                    }
                    else if (s.ToLower().Equals("colbreak"))
                    {
                        this.Items[this.Items.Count - 1].Break = BreakType.Column;
                    }
                    else
                    {
                        InputGroupHeader gh = new InputGroupHeader();
                        gh.Text      = s;
                        gh.Height    = unitHeight;
                        gh.BackColor = Color.Transparent;
                        this.Items.Add(gh);
                    }
                }
                else if (a.Descriptor.PropertyType == Type.GetType("System.Boolean"))
                {
                    InputCheckBox chk = new InputCheckBox();
                    chk.Height  = unitHeight;
                    chk.Checked = (bool)a.Value;
                    chk.Tag     = a;
                    if (string.IsNullOrEmpty(a.LongName))
                    {
                        chk.Text = a.Descriptor.Name + " ";
                    }
                    else
                    {
                        chk.Text = a.LongName + " ";
                    }
                    chk.CheckedChanged += new EventHandler(chk_CheckedChanged);
                    this.Items.Add(chk);
                }
                else
                {
                    InputLabel lab = new InputLabel();
                    lab.VerticalAlign = InputContentAlignment.Center;
                    lab.Height        = unitHeight;
                    lab.Width         = labelWidth;
                    if (string.IsNullOrEmpty(a.LongName))
                    {
                        lab.Text = a.Descriptor.Name;
                    }
                    else
                    {
                        lab.Text = a.LongName;
                    }
                    this.Items.Add(lab);
                    if (a.Descriptor.PropertyType.IsEnum)
                    {
                        InputComboBox box = new InputComboBox();
                        box.Height        = unitHeight;
                        box.DropDownStyle = InputComboBoxStyle.DropDownList;
                        BindingFlags flags  = BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly;
                        FieldInfo[]  fields = a.Descriptor.PropertyType.GetFields(flags);
                        box.Tag  = a;
                        box.Text = a.Value.ToString();
                        box.SelectedIndexChanged += new EventHandler(box_SelectedIndexChanged);
                        for (int f = 0; f < fields.Length; f++)
                        {
                            var field = fields[f];
                            if (a.AllowedValues == null || a.AllowedValues.Contains(field.Name))
                            {
                                InputOption ic = new InputOption();
                                ic.Text = field.GetValue(field).ToString();
                                ic.Tag  = field;
                                box.Items.Add(ic);
                            }
                        }
                        this.Items.Add(box);
                    }
                    else if (a.Descriptor.PropertyType == Type.GetType("System.DateTime"))
                    {
                        InputDatePicker dp = new InputDatePicker();
                        dp.Height     = unitHeight;
                        dp.Value      = (DateTime)a.Value;
                        dp.Tag        = a;
                        dp.LostFocus += new EventHandler(date_LostFocus);
                        this.Items.Add(dp);
                    }
                    else if (a.Descriptor.PropertyType == Type.GetType("System.TimeSpan"))
                    {
                        InputTimePicker tp = new InputTimePicker();
                        tp.Height     = unitHeight;
                        tp.Value      = (TimeSpan)a.Value;
                        tp.Tag        = a;
                        tp.LostFocus += new EventHandler(time_LostFocus);
                        this.Items.Add(tp);
                    }
                    else if (a.Descriptor.PropertyType.ToString().Equals("System.Drawing.Color"))
                    {
                        ColorEditorHost ce = new ColorEditorHost();
                        ce.Height        = unitHeight;
                        ce.Width         = 102;
                        ce.SelectedColor = (System.Drawing.Color)a.Value;
                        ce.Tag           = a;
                        ce.LostFocus    += new EventHandler(color_LostFocus);
                        this.Items.Add(ce);
                    }
                    else if (a.Descriptor.PropertyType == Type.GetType("System.Int32"))
                    {
                        InputNumericBox nb = new InputNumericBox();
                        nb.Height        = unitHeight;
                        nb.Width         = 50;
                        nb.Value         = (int)a.Value;
                        nb.Tag           = a;
                        nb.Maximum       = 100000;
                        nb.ValueChanged += new EventHandler(nb_ValueChanged);
                        this.Items.Add(nb);
                    }
                    else if (a.Descriptor.PropertyType == Type.GetType("System.Int16"))
                    {
                        InputNumericBox nb = new InputNumericBox();
                        nb.Height        = unitHeight;
                        nb.Width         = 50;
                        nb.Value         = (short)a.Value;
                        nb.Tag           = a;
                        nb.Maximum       = 100000;
                        nb.ValueChanged += new EventHandler(nb_ValueChanged);
                        this.Items.Add(nb);
                    }
                    else if (a.Descriptor.PropertyType == Type.GetType("System.Int64"))
                    {
                        InputNumericBox nb = new InputNumericBox();
                        nb.Value         = (long)a.Value;
                        nb.Tag           = a;
                        nb.Maximum       = 100000;
                        nb.Height        = unitHeight;
                        nb.Width         = 50;
                        nb.ValueChanged += new EventHandler(nb_ValueChanged);
                        this.Items.Add(nb);
                    }
                    else if (a.Descriptor.PropertyType == Type.GetType("System.Single") || a.Descriptor.PropertyType == Type.GetType("System.Double"))
                    {
                        InputNumericBox nb = new InputNumericBox();
                        nb.Value         = (decimal)Math.Floor((Single)a.Value);
                        nb.Tag           = a;
                        nb.Maximum       = 360;
                        nb.Minimum       = 0;
                        nb.Height        = unitHeight;
                        nb.Width         = 50;
                        nb.ValueChanged += new EventHandler(nb_ValueChanged);
                        this.Items.Add(nb);
                    }
                    else
                    {
                        InputTextBox txt = new InputTextBox();
                        txt.VerticalAlign = InputContentAlignment.Center;
                        txt.Height        = unitHeight;
                        txt.Text          = a.Value.ToString();
                        txt.Tag           = a;
                        txt.LostFocus    += new EventHandler(txt_LostFocus);
                        this.Items.Add(txt);
                    }
                }
            }

            this.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ResumeLayout();
        }
Пример #14
0
        public static void Initialize()
        {
            HashSet <Tool> set = new HashSet <Tool>();

            #region Install Mods
            set.Add(new Tool
            {
                name = "AutoTOC",
                type = typeof(AutoTOCWPF),
                icon = Application.Current.FindResource("iconAutoTOC") as ImageSource,
                open = () =>
                {
                    (new AutoTOCWPF()).Show();
                },
                tags = new List <string> {
                    "user", "toc", "tocing", "crash", "infinite", "loop", "loading"
                },
                description = "AutoTOC WPF is a tool for ME3 that updates and/or creates the PCConsoleTOC.bin files associated with the base game and each DLC.\n\nRunning this tool upon mod installation is imperative to ensuring proper functionality of the game."
            });
            set.Add(new Tool
            {
                name = "Mod Maker",
                type = typeof(ModMaker),
                icon = Application.Current.FindResource("iconModMaker") as ImageSource,
                open = () =>
                {
                    (new ModMaker()).Show();
                },
                tags = new List <string> {
                    "utility", ".mod", "mod", "mesh"
                },
                subCategory = "Mod Packagers",
                description = "MOD MAKER IS UNSUPPORTED IN ME3EXPLORER ME3TWEAKS FORK\n\nMod Maker is used to create and install files with the \".mod\" extension. MOD files are compatible with ME3 and may be packaged with meshes and other game resources."
            });
#if DEBUG
            set.Add(new Tool
            {
                name = "Memory Analyzer",
                type = typeof(ME3ExpMemoryAnalyzer.MemoryAnalyzer),
                icon = Application.Current.FindResource("iconMemoryAnalyzer") as ImageSource,
                open = () =>
                {
                    (new ME3ExpMemoryAnalyzer.MemoryAnalyzer()).Show();
                },
                tags = new List <string> {
                    "utility", "toolsetdev"
                },
                subCategory = "For Toolset Devs Only",
                description = "Memory Analyzer allows you to track references to objects to help trace memory leaks."
            });

            set.Add(new Tool
            {
                name = "File Hex Analyzer",
                type = typeof(ME3ExpMemoryAnalyzer.MemoryAnalyzer),
                icon = Application.Current.FindResource("iconFileHexAnalyzer") as ImageSource,
                open = () =>
                {
                    (new FileHexViewer.FileHexViewerWPF()).Show();
                },
                tags = new List <string> {
                    "utility", "toolsetdev", "hex"
                },
                subCategory = "For Toolset Devs Only",
                description = "File Hex Analyzer is a package hex viewer that shows references in the package hex. It also works with non-package files, but won't show any references, obviously."
            });
#endif
            set.Add(new Tool
            {
                name = "TPF Tools",
                type = typeof(KFreonTPFTools3),
                icon = Application.Current.FindResource("iconTPFTools") as ImageSource,
                open = () =>
                {
                    (new KFreonTPFTools3()).Show();
                },
                tags = new List <string> {
                    "utility", "texture", "tpf", "dds", "bmp", "jpg", "png"
                },
                subCategory = "Mod Packagers",
                description = "TPF TOOLS IS UNSUPPORTED IN ME3EXPLORER ME3TWEAKS FORK\n\nTPF Tools allows for permanent insertion of textures into game files. TPF tools can also be used by modders to package textures into TPFs for distribution.\n\nThis tool has been mostly superceded by Mass Effect Modder (MEM)."
            });
            #endregion

            #region Utilities
            set.Add(new Tool
            {
                name = "Animation Explorer",
                type = typeof(AnimationExplorer.AnimationExplorer),
                icon = Application.Current.FindResource("iconAnimationExplorer") as ImageSource,
                open = () =>
                {
                    (new AnimationExplorer.AnimationExplorer()).Show();
                },
                tags = new List <string> {
                    "utility", "animation", "gesture", "bone"
                },
                subCategory = "Explorers",
                description = "Animation Explorer can build a database of all the files containing animtrees and complete animsets in Mass Effect 3. You can import and export Animsets to PSA files."
            });
            set.Add(new Tool
            {
                name = "Bik Movie Extractor",
                type = typeof(BIKExtract),
                icon = Application.Current.FindResource("iconBikExtractor") as ImageSource,
                open = () =>
                {
                    (new BIKExtract()).Show();
                },
                tags = new List <string> {
                    "utility", "bik", "movie"
                },
                subCategory = "Extractors + Repackers",
                description = "BIK Movie Extractor is a utility for extracting BIK videos from the ME3 Movies.tfc. This file contains small resolution videos played during missions, such as footage of Miranda in Sanctuary.",
            });
            set.Add(new Tool
            {
                name = "Coalesced Editor",
                type = typeof(MassEffect3.CoalesceTool.CoalescedEditor),
                icon = Application.Current.FindResource("iconCoalescedEditor") as ImageSource,
                open = () =>
                {
                    (new MassEffect3.CoalesceTool.CoalescedEditor()).Show();
                },
                tags = new List <string> {
                    "utility", "coal", "ini", "bin"
                },
                subCategory = "Extractors + Repackers",
                description = "Coalesced Editor converts between XML and BIN formats for ME3's coalesced files. These are key game files that help control a large amount of content.",
            });
            set.Add(new Tool
            {
                name = "DLC Unpacker",
                type = typeof(DLCUnpacker.DLCUnpacker),
                icon = Application.Current.FindResource("iconDLCUnpacker") as ImageSource,
                open = () =>
                {
                    if (ME3Directory.gamePath != null)
                    {
                        new DLCUnpacker.DLCUnpacker().Show();
                    }
                    else
                    {
                        MessageBox.Show("DLC Unpacker only works with Mass Effect 3.");
                    }
                },
                tags = new List <string> {
                    "utility", "dlc", "sfar", "unpack", "extract"
                },
                subCategory = "Extractors + Repackers",
                description = "DLC Unpacker allows you to extract Mass Effect 3 DLC SFAR files, allowing you to access their contents for modding.\n\nThis unpacker is based on MEM code, which is very fast and is compatible with the ALOT texture mod.",
            });
            set.Add(new Tool
            {
                name = "Hex Converter",
                //type = typeof(HexConverter.Hexconverter),
                icon = Application.Current.FindResource("iconHexConverter") as ImageSource,
                open = () =>
                {
                    if (File.Exists(App.HexConverterPath))
                    {
                        Process.Start(App.HexConverterPath);
                    }
                },
                tags = new List <string> {
                    "utility", "code", "endian", "convert", "integer", "float"
                },
                subCategory = "Converters",
                description = "Hex Converter is a utility that converts among floats, signed/unsigned integers, and hex code in big/little endian.",
            });
            set.Add(new Tool
            {
                name = "Image Engine",
                type = typeof(CSharpImageLibrary.MainWindow),
                icon = Application.Current.FindResource("iconImageEngine") as ImageSource,
                open = () =>
                {
                    (new CSharpImageLibrary.MainWindow()).Show();
                },
                tags = new List <string> {
                    "utility", "texture", "convert", "dds", "bmp", "jpg", "png"
                },
                subCategory = "Converters",
                description = "Image Engine is a texture conversion utility. It supports BMP, JPG, PNG, TGA files, as well as a variety of DDS formats and compressions. Modification to mipmaps are also supported.",
            });
            set.Add(new Tool
            {
                name = "Interp Viewer",
                type = typeof(Matinee.InterpEditor),
                icon = Application.Current.FindResource("iconInterpViewer") as ImageSource,
                open = () =>
                {
                    (new Matinee.InterpEditor()).Show();
                },
                tags = new List <string> {
                    "utility", "dialogue", "matinee", "cutscene", "animcutscene", "interpdata"
                },
                subCategory = "Explorers",
                description = "Interp Viewer is a simplified version of UDK’s Matinee Editor. It loads interpdata objects and displays their children as tracks on a timeline, allowing the user to visualize the game content associated with a specific scene.\n\nAttention: This tool is a utility; editing is not yet supported."
            });
            set.Add(new Tool
            {
                name = "Meshplorer",
                type = typeof(Meshplorer.Meshplorer),
                icon = Application.Current.FindResource("iconMeshplorer") as ImageSource,
                open = () =>
                {
                    (new Meshplorer.Meshplorer()).Show();
                },
                tags = new List <string> {
                    "developer", "mesh"
                },
                subCategory = "Meshes + Textures",
                description = "Meshplorer loads and displays all meshes within a file. The tool skins most meshes with its associated texture.\n\nThis tool only works with Mass Effect 3.",
            });
            set.Add(new Tool
            {
                name = "ME3 + ME2 TLK Editor",
                type = typeof(TLKEditor),
                icon = Application.Current.FindResource("iconTLKEditorME23") as ImageSource,
                open = () =>
                {
                    (new TLKEditor()).Show();
                },
                tags = new List <string> {
                    "utility", "dialogue", "subtitle", "text"
                },
                subCategory = "Extractors + Repackers",
                description = "TLK Editor converts between XML and TLK formats, allowing users to edit the display of all game text in ME2 and ME3. Edits to XML files must be done in an external editor, such as Notepad++.",
            });
            set.Add(new Tool
            {
                name = "Package Dumper",
                type = typeof(PackageDumper.PackageDumper),
                icon = Application.Current.FindResource("iconPackageDumper") as ImageSource,
                open = () =>
                {
                    (new PackageDumper.PackageDumper()).Show();
                },
                tags = new List <string> {
                    "utility", "package", "pcc", "text", "dump"
                },
                subCategory = "Utilities",
                description = "Package Dumper is a utility for dumping package information to files that can be searched with tools like GrepWin. Names, Imports, Exports, Properties and more are dumped."
            });
            set.Add(new Tool
            {
                name = "Plot Database",
                type = typeof(PlotVarDB.PlotVarDB),
                icon = Application.Current.FindResource("iconPlotDatabase") as ImageSource,
                open = () =>
                {
                    (new PlotVarDB.PlotVarDB()).Show();
                },
                tags = new List <string> {
                    "utility", "bool", "boolean", "flag", "int", "integer", "id"
                },
                subCategory = "Databases",
                description = "Plot Database is a cross-game utility used to store plot IDs for reference. The tool comes pre-loaded with a default .db file that can be customized by the user. Never look up a plot bool or integer again!",
            });
            set.Add(new Tool
            {
                name = "Property Database",
                type = typeof(Propertydb.PropertyDB),
                icon = Application.Current.FindResource("iconPropertyDatabase") as ImageSource,
                open = () =>
                {
                    (new Propertydb.PropertyDB()).Show();
                },
                tags = new List <string> {
                    "utility"
                },
                subCategory = "Databases",
                description = "Scans ME3 and creates a database of all the classes and properties for those classes that Bioware uses.\n\nThis is different than Package Dumper, as it looks across all instances of the class and what is actually used."
            });
            set.Add(new Tool
            {
                name = "PSA Viewer",
                type = typeof(PSAViewer),
                icon = Application.Current.FindResource("iconPSAViewer") as ImageSource,
                open = () =>
                {
                    (new PSAViewer()).Show();
                },
                tags = new List <string> {
                    "utility", "mesh", "animation"
                },
                subCategory = "Explorers",
                description = "View the data contained in a PSA animation file extracted using Gildor's umodel toolkit."
            });
            set.Add(new Tool
            {
                name = "PSK Viewer",
                type = typeof(PSKViewer.PSKViewer),
                icon = Application.Current.FindResource("iconPSKViewer") as ImageSource,
                open = () =>
                {
                    (new PSKViewer.PSKViewer()).Show();
                },
                tags = new List <string> {
                    "utility", "mesh"
                },
                subCategory = "Explorers",
                description = "View the data contained in a PSK skeletal mesh file extracted using Gildor's umodel toolkit."
            });
            set.Add(new Tool
            {
                name = "Script Database",
                type = typeof(ScriptDB.ScriptDB),
                icon = Application.Current.FindResource("iconScriptDatabase") as ImageSource,
                open = () =>
                {
                    (new ScriptDB.ScriptDB()).Show();
                },
                tags = new List <string> {
                    "utility", "unreal"
                },
                subCategory = "Databases",
                description = "Script Database is used to locate UnrealScript exports across multiple files for ME3. This tool is deprecated and is no longer supported.",
            });
            set.Add(new Tool
            {
                name = "Subtitle Scanner",
                type = typeof(SubtitleScanner.SubtitleScanner),
                icon = Application.Current.FindResource("iconSubtitleScanner") as ImageSource,
                open = () =>
                {
                    (new SubtitleScanner.SubtitleScanner()).Show();
                },
                tags = new List <string> {
                    "utility", "dialogue", "text", "line"
                },
                subCategory = "Explorers",
                description = "Subtitle Scanner is a utility for ME3 that scans game files for all subtitles and displays the results in a searchable dialog.",
            });
            #endregion

            #region Create Mods
            //set.Add(new Tool
            //{
            //    name = "Audio Editor",
            //    type = typeof(Audio_Editor.AudioEditor),
            //    icon = Application.Current.FindResource("iconAudioEditor") as ImageSource,
            //    open = () =>
            //    {
            //        (new Audio_Editor.AudioEditor()).Show();
            //    },
            //    tags = new List<string> { "developer", "afc", "sound", "wwise" },
            //    subCategory = "Core",
            //});
            set.Add(new Tool
            {
                name        = "Binary Interpreter",
                type        = typeof(BinaryInterpreterHost),
                icon        = Application.Current.FindResource("iconInterpreter") as ImageSource,
                tags        = new List <string>(),
                subCategory = other,
            });
            set.Add(new Tool
            {
                name = "Conditionals Editor",
                type = typeof(Conditionals),
                icon = Application.Current.FindResource("iconConditionalsEditor") as ImageSource,
                open = () =>
                {
                    (new Conditionals()).Show();
                },
                tags = new List <string> {
                    "developer", "conditional", "plot", "boolean", "flag", "int", "integer", "cnd"
                },
                subCategory = "Core",
                description = "Conditionals Editor is used to create and edit ME3 files with the .cnd extension. CND files control game story by checking for specific combinations of plot events.",
            });
            set.Add(new Tool
            {
                name        = "Curve Editor",
                type        = typeof(CurveEd.CurveEditor),
                icon        = Application.Current.FindResource("iconPlaceholder") as ImageSource,
                tags        = new List <string>(),
                subCategory = other,
            });
            set.Add(new Tool
            {
                name = "Dialogue Editor",
                type = typeof(DialogEditor.DialogEditor),
                icon = Application.Current.FindResource("iconDialogueEditor") as ImageSource,
                open = () =>
                {
                    string result = InputComboBox.GetValue("Which game's files do you want to edit?", new[] { "ME3", "ME2", "ME1" }, "ME3", true);
                    switch (result)
                    {
                    case "ME3":
                        (new DialogEditor.DialogEditor()).Show();
                        break;

                    case "ME2":
                        (new ME2Explorer.DialogEditor()).Show();
                        break;

                    case "ME1":
                        (new ME1Explorer.DialogEditor()).Show();
                        break;
                    }
                },
                tags = new List <string> {
                    "developer", "me1", "me2", "me3", "cutscene"
                },
                subCategory = "Scene Shop",
                description = "Dialogue Editor is a cross-game tool used to edit Bioconversation objects, which control the flow of dialogue during a conversation.",
            });
            set.Add(new Tool
            {
                name = "ME2 Dialogue Editor",
                type = typeof(ME2Explorer.DialogEditor),
                icon = Application.Current.FindResource("iconDialogueEditor") as ImageSource,
                tags = new List <string>(),
            });
            set.Add(new Tool
            {
                name = "ME3 Dialogue Editor",
                type = typeof(ME1Explorer.DialogEditor),
                icon = Application.Current.FindResource("iconDialogueEditor") as ImageSource,
                tags = new List <string>(),
            });
            set.Add(new Tool
            {
                name = "FaceFX Editor",
                type = typeof(FaceFX.FaceFXEditor),
                icon = Application.Current.FindResource("iconFaceFXEditor") as ImageSource,
                open = () =>
                {
                    (new FaceFX.FaceFXEditor()).Show();
                },
                tags = new List <string> {
                    "developer", "fxa", "facefx", "lipsync", "fxe", "bones", "animation", "me3", "me3"
                },
                subCategory = "Scene Shop",
                description = "FaceFX Editor is the toolset’s highly-simplified version of FaceFX Studio. With this tool modders can edit ME3 and ME2 FaceFX AnimSets (FXEs).",
            });
            set.Add(new Tool
            {
                name = "FaceFXAnimSet Editor",
                type = typeof(FaceFX.FaceFXAnimSetEditor),
                icon = Application.Current.FindResource("iconFaceFXAnimSetEditor") as ImageSource,
                open = () =>
                {
                    (new FaceFX.FaceFXAnimSetEditor()).Show();
                    //string result = InputComboBox.GetValue("Which game's files do you want to edit?", new string[] { "ME3", "ME2" }, "ME3", true);
                    //switch (result)
                    //{
                    //    case "ME3":
                    //        (new FaceFX.FaceFXAnimSetEditor()).Show();
                    //        break;
                    //    case "ME2":
                    //        (new ME2Explorer.FaceFXAnimSetEditor()).Show();
                    //        break;
                    //}
                },
                tags = new List <string> {
                    "developer", "fxa", "facefx", "lipsync", "fxe", "bones", "animation"
                },
                subCategory = "Scene Shop",
                description = "FaceFXAnimSetEditor is the original tool for manipulating FaceFXAnimsets. It will soon be completely replaced by the more complete FaceFX Editor.",
            });
            set.Add(new Tool
            {
                name        = "Interpreter",
                type        = typeof(InterpreterHost),
                icon        = Application.Current.FindResource("iconInterpreter") as ImageSource,
                tags        = new List <string>(),
                subCategory = other,
            });
            //Benji's tool. Uncomment when we have more progress.

            /*set.Add(new Tool
             * {
             *  name = "Level Explorer",
             *  type = typeof(LevelExplorer.LevelExplorer),
             *  icon = Application.Current.FindResource("iconLevelEditor") as ImageSource,
             *  open = () =>
             *  {
             *      (new LevelExplorer.LevelExplorer()).Show();
             *  },
             *  tags = new List<string> { "developer" },
             *  subCategory = other,
             *  description = "Level Explorer allows you to view the meshes of a level.",
             *
             * });*/
            set.Add(new Tool
            {
                name = "Mesh Database",
                type = typeof(Meshplorer2.MeshDatabase),
                icon = Application.Current.FindResource("iconMeshDatabase") as ImageSource,
                open = () =>
                {
                    (new Meshplorer2.MeshDatabase()).Show();
                },
                tags = new List <string> {
                    "utility", "mesh"
                },
                subCategory = "Databases",
                description = "Scans ME3 (no DLC) for meshes and makes a database. This tool is deprecated and no longer supported."
            });
            set.Add(new Tool
            {
                name = "Mount Editor",
                type = typeof(MountEditor.MountEditorWPF),
                icon = Application.Current.FindResource("iconMountEditor") as ImageSource,
                open = () =>
                {
                    new MountEditor.MountEditorWPF().Show();
                },
                tags = new List <string> {
                    "developer", "mount", "dlc", "me2", "me3"
                },
                subCategory = "Core",
                description = "Mount Editor allows you to create or modify mount.dlc files, which are used in DLC for Mass Effect 2 and Mass Effect 3."
            });
            set.Add(new Tool
            {
                name = "TLK Manager WPF",
                type = typeof(TlkManagerNS.TLKManagerWPF),
                icon = Application.Current.FindResource("iconTLKManager") as ImageSource,
                open = () =>
                {
                    new TlkManagerNS.TLKManagerWPF().Show();
                },
                tags = new List <string> {
                    "developer", "dialogue", "subtitle", "text", "string", "localize", "language"
                },
                subCategory = "Core",
                description = "TLK Manager WPF manages loaded TLK files that are used to display string data in editor tools. You can also use it to extract and recompile TLK files."
            });
            set.Add(new Tool
            {
                name = "Package Editor (Old)",
                type = typeof(PackageEditor),
                icon = Application.Current.FindResource("iconPackageEditorClassic") as ImageSource,
                open = () =>
                {
                    PackageEditor pck = new PackageEditor();
                    pck.Show();
                },
                tags = new List <string> {
                    "developer", "pcc", "cloning", "import", "export", "sfm", "upk", ".u", "me2", "me1", "me3", "name"
                },
                subCategory = "Core",
                description = "Package Editor Classic is a tool for editing trilogy package files in various formats (PCC, SFM, UPK). Properties, arrays, names, curve data, and more can all be easily added and edited.\n\nPackage Editor Classic has been deprecated and is scheduled for removal in the next release."
            });
            set.Add(new Tool
            {
                name = "Package Editor",
                type = typeof(PackageEditorWPF),
                icon = Application.Current.FindResource("iconPackageEditor") as ImageSource,
                open = () =>
                {
                    new PackageEditorWPF().Show();
                },
                tags = new List <string> {
                    "user", "developer", "pcc", "cloning", "import", "export", "sfm", "upk", ".u", "me2", "me1", "me3", "name"
                },
                subCategory = "Core",
                description = "Package Editor WPF is a complete rewrite of Package Editor using the WPF design language. Edit trilogy game files in a single window with access to external tools such as Curve Editor and Soundplorer, right in the same window."
            });
            set.Add(new Tool
            {
                name = "Pathfinding Editor",
                type = typeof(PathfindingEditorWPF),
                icon = Application.Current.FindResource("iconPathfindingEditor") as ImageSource,
                open = () =>
                {
                    (new PathfindingEditorWPF()).Show();
                },
                tags = new List <string> {
                    "user", "developer", "path", "ai", "combat", "spline", "spawn", "map", "path", "node", "cover", "level"
                },
                subCategory = "Core",
                description = "Pathfinding Editor WPF allows you to modify pathing nodes so squadmates and enemies can move around a map. You can also edit placement of several different types of level objects such as StaticMeshes, Splines, CoverSlots, and more.",
            });
            set.Add(new Tool
            {
                name = "Plot Editor",
                type = typeof(MassEffect.NativesEditor.Views.PlotEditor),
                icon = Application.Current.FindResource("iconPlotEditor") as ImageSource,
                open = () =>
                {
                    var plotEd = new MassEffect.NativesEditor.Views.PlotEditor();
                    plotEd.Show();
                },
                tags = new List <string> {
                    "developer", "codex", "state transition", "quest", "natives"
                },
                subCategory = "Core",
                description = "Plot Editor is used to examine, edit, and search ME3's plot maps for quests, state events, and codices."
            });
            set.Add(new Tool
            {
                name = "Sequence Editor",
                type = typeof(SequenceEditorWPF),
                icon = Application.Current.FindResource("iconSequenceEditor") as ImageSource,
                open = () =>
                {
                    (new SequenceEditorWPF()).Show();
                },
                tags = new List <string> {
                    "user", "developer", "kismet", "me1", "me2", "me3"
                },
                subCategory = "Core",
                description = "Sequence Editor WPF is the toolset’s version of UDK’s UnrealKismet. With this cross-game tool, users can edit and create new sequences that control gameflow within and across levels.",
            });
            set.Add(new Tool
            {
                name = "SFAR Editor",
                type = typeof(SFAREditor2),
                icon = Application.Current.FindResource("iconSFAREditor") as ImageSource,
                open = () =>
                {
                    (new SFAREditor2()).Show();
                },
                tags = new List <string> {
                    "developer", "dlc"
                },
                subCategory = other,
                description = "SFAR Editor allows you to explore SFAR files in Mass Effect 3. This tool has been deprecated as DLC unpacking and AutoTOC has replaced the need to inspect SFAR files.",
            });
            set.Add(new Tool
            {
                name = "Soundplorer",
                type = typeof(Soundplorer.SoundplorerWPF),
                icon = Application.Current.FindResource("iconSoundplorer") as ImageSource,
                open = () =>
                {
                    (new Soundplorer.SoundplorerWPF()).Show();
                },
                tags = new List <string> {
                    "user", "developer", "audio", "dialogue", "music", "wav", "ogg", "sound"
                },
                subCategory = "Scene Shop",
                description = "Soundplorer WPF is a complete rewrite of the original  Soundplorer. Extract and play audio from all 3 games, and replace audio directly in Mass Effect 3.",
            });
            set.Add(new Tool
            {
                name = "Texplorer",
                type = typeof(Texplorer2),
                icon = Application.Current.FindResource("iconTexplorer") as ImageSource,
                open = () =>
                {
                    (new Texplorer2()).Show();
                },
                tags = new List <string> {
                    "developer", "texture", "tfc", "scan", "tree"
                },
                subCategory = "Meshes + Textures",
                description = "TEXPLORER IS UNSUPPORTED IN ME3EXPLORER ME3TWEAKS FORK\n\nTexplorer is a texturing utility that allows users to browse and install textures for all 3 Mass Effect trilogy games. It has been superceded by Mass Effect Modder (MEM) in most regards."
            });

            set.Add(new Tool
            {
                name = "WwiseBank Editor",
                type = typeof(WwiseBankEditor.WwiseEditor),
                icon = Application.Current.FindResource("iconWwiseBankEditor") as ImageSource,
                open = () =>
                {
                    (new WwiseBankEditor.WwiseEditor()).Show();
                },
                tags = new List <string> {
                    "developer", "dialogue", "text", "line"
                },
                subCategory = "Scene Shop",
                description = "Wwisebank Editor edits ME3 Wwisebank objects, which contain data references to specific sets of Wwiseevents and Wwisestreams in the PCC. \n\nEditing “the bank” is often necessary when changing game music or when adding new dialogue.",
            });
            set.Add(new Tool
            {
                name = "UDK Explorer",
                type = typeof(UDKExplorer.MainWindow),
                icon = Application.Current.FindResource("iconUDKExplorer") as ImageSource,
                open = () =>
                {
                    string loc = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
                    if (File.Exists(loc + "\\UDKExplorer.exe"))
                    {
                        Process.Start(loc + "\\UDKExplorer.exe");
                    }
                },
                tags = new List <string> {
                    "developer"
                },
                subCategory = other,
                description = "Edits .udk and .upk files created by the UDK. This tool is deprecated and no longer supported."
            });
            #endregion

            items = set;

            loadFavorites();
        }
Пример #15
0
        //submit Query loops through all items in InputPanel and [roughly] builds a query string
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            StringBuilder sql  = new StringBuilder("SELECT * FROM Products WHERE ");
            string        type = "tstring";

            for (int i = c1InputPanel1.Items.IndexOf(hdrQueryBuilder); i < c1InputPanel1.Items.IndexOf(hdrSqlText); i++)
            {
                InputComponent ic = c1InputPanel1.Items[i];
                if (ic.GetType() == typeof(InputComboBox))
                {
                    //handle combo box
                    InputComboBox cb = (InputComboBox)ic;
                    //append ComboBox text if Property, Append ComboBox Tag if Operator
                    sql.Append(cb.SelectedOption.Tag != null && !cb.SelectedOption.Tag.ToString().StartsWith("t") ? cb.SelectedOption.Tag.ToString() + " " : ic.Text + " ");
                    //save type of Property ComboBox for later
                    if (cb.SelectedOption.Tag != null)
                    {
                        if (cb.SelectedOption.Tag.ToString().StartsWith("t"))
                        {
                            type = cb.SelectedOption.Tag.ToString();
                        }
                        if (cb.SelectedOption.Tag.ToString().Equals("LIKE"))
                        {
                            type = type + "_like";
                        }
                    }
                }
                else if (ic.GetType() == typeof(InputTextBox))
                {
                    //handle value text box
                    if (type.Equals("tstring"))
                    {
                        sql.Append("'" + ic.Text + "' ");
                    }
                    else if (type.Equals("tstring_like"))
                    {
                        sql.Append("'%" + ic.Text + "%' ");
                    }
                    else if (type.Equals("tnumber"))
                    {
                        sql.Append(ic.Text + " ");
                    }
                    else if (type.Equals("tbool"))
                    {
                        if (ic.Text.ToLower().Equals("true"))
                        {
                            sql.Append("true ");
                        }
                        else if (ic.Text.ToLower().Equals("false"))
                        {
                            sql.Append("false ");
                        }
                    }
                }
            }
            txtSqlText.Text = sql.ToString();
            try
            {
                c1FlexGrid1.DataSource = DemoDataSource(sql.ToString(), true);
                txtSqlText.ErrorText   = string.Empty;
            }
            catch (Exception ex)
            {
                //show error on SqlTextBox
                txtSqlText.ErrorText = ex.Message;
            }
        }