Beispiel #1
0
        private string GetUMeta(string displayName, bool bHidden)
        {
            string temp = GTCS_GTL.EMPTYSTRING;

            if (GTCS_GTL.ConfirmFalse(GTCS_GTL.ConfirmEmptyStringSP(displayName)))
            {
                temp += "DisplayName=" + GTCS_GTL.DecorateString(displayName, "\"");
                temp += ",";
            }
            if (GTCS_GTL.ConfirmTrue(bHidden))
            {
                temp += "Hidden";
            }

            // 各それぞれに最後コンマを含めているので最後だけは要らないのであれば取り除いておく
            if (temp.EndsWith(","))
            {
                temp = temp.Remove(temp.Length - 1);
            }

            // FinalGatheringString..
            if (GTCS_GTL.ConfirmFalse(GTCS_GTL.ConfirmEmptyStringSP(temp)))
            {
                return(GTCS_GTL.DecorateString(temp, "UMETA(", ")"));
            }

            // Return Empty..
            return(temp);
        }
Beispiel #2
0
        private void MakeAndCopyUMacro(bool bFuncOrProp)
        {
            string macroU = (bFuncOrProp) ? "UFUNCTION" : "UPROPERTY";

            macroU += "(";
            var indexAvailables = (bFuncOrProp) ? gtFunctionCheckedListBoxControl.CheckedIndices : gtPropertyCheckedListBoxControl.CheckedIndices;

            //GTCS_GTL.ForLoopGT(indexAvailables, delegate (int i, IList<int> val){ }, delegate (){ } );
            for (int i = 0; i < indexAvailables.Count; i++)
            {
                int index = indexAvailables[i];
                macroU += (bFuncOrProp) ? GetFunctionDomain(index) : GetPropertyDomain(index);
                if (index < (indexAvailables.Count - 1))
                {
                    macroU += ", ";
                }
            }

            // カテゴリー名を連結させる
            {
                string [] category  = GTCS_GTL.DivideString(CategoryTextBox.Text, ",");
                int       nCategory = category.Length;
                if (nCategory > 0)
                {
                    macroU += ", ";
                    macroU += "Category = ";

                    string tempCate = string.Empty;
                    for (int i = 0; i < nCategory; i++)
                    {
                        if (GTCS_GTL.ConfirmEmptyStringSP(category[i]) == false)
                        {
                            tempCate += category[i];
                            if (i < (nCategory - 1))
                            {
                                tempCate += "|";
                            }
                        }
                    }
                    macroU += GTCS_GTL.DecorateString(tempCate, "\"");
                }
            }
            // metaを連結させる
            {
            }

            macroU += ")";
            Clipboard.SetText(macroU);
        }
Beispiel #3
0
        private string GetFunctionDomain(int index)
        {
            string domain = string.Empty;
            var    items  = gtFunctionCheckedListBoxControl.Items;

            string[] templateUFUNCTIONMacros = new string[]
            {
                "BlueprintCallable",
                "BlueprintPure",
                "BlueprintImplementableEvent",
                "BlueprintNativeEvent",
            };
            if (GTCS_GTL.ConfirmOutOfRangeVoid(templateUFUNCTIONMacros, index) == false)
            {
                domain = templateUFUNCTIONMacros[index];
            }
            return(domain);
        }
Beispiel #4
0
        private void AddEnumeratorButton_Click(object sender, EventArgs e)
        {
            string text = gtEnumeratorTextBoxControl.Text;

            // テキストが空だと列挙に追加できないのでreturn
            if (GTCS_GTL.ConfirmEmptyStringSP(text))
            {
                return;
            }
            // 既に存在している列挙名の場合return
            foreach (string item in EnumeratorListBox.Items)
            {
                if (text == item)
                {
                    return;
                }
            }

            // 未だ追加されていない列挙名なので列挙体リストに追加する
            GTCS_GTL.AddItemListBox(EnumeratorListBox, text);
        }
Beispiel #5
0
        private string GetPropertyDomain(int index)
        {
            string domain = string.Empty;
            var    items  = gtPropertyCheckedListBoxControl.Items;

            string[] templateUPROPERTYMacros = new string[]
            {
                // 編集権限(ReadWrite)
                "EditAnywhere",
                "EditInstanceOnly",
                "EditDefaultsOnly",
                // 閲覧権限(ReadOnly)
                "VisibleAnywhere",
                "VisibleInstanceOnly",
                "VisibleDefaultsOnly",
            };
            if (GTCS_GTL.ConfirmOutOfRangeVoid(templateUPROPERTYMacros, index) == false)
            {
                domain = templateUPROPERTYMacros[index];
            }
            return(domain);
        }
Beispiel #6
0
        private void MakeEnumerationUE()
        {
            string enumerationText = GTCS_GTL.EMPTYSTRING;

            // UENUM()
            {
                enumerationText += "UENUM(BlueprintType)" + GTCS_GTL.GetNewLineString();
            }
            // enum class That : uint8
            {
                enumerationText += "enum class E" + EnumeratorTextBlockUserControl.TextBox + " : uint8" + GTCS_GTL.GetNewLineString();
            }
            // Enumeration Body
            {
                // {
                enumerationText += "{" + GTCS_GTL.GetNewLineString();
                {
                    List <string> enumNameList = new List <string>(EnumeratorListBox.Items.Count);
                    foreach (var item in EnumeratorListBox.Items)
                    {
                        enumNameList.Add(item.ToString());
                    }
                    bool bAddMaxEnum = false;
                    foreach (int idxChecked in gtEnumeratorOptionCheckedListBoxControl.CheckedIndices)
                    {
                        if (idxChecked == 0)
                        {
                            enumNameList.AddRange(new string[] { "MAX", "MAXIDX" });
                            bAddMaxEnum = true;
                        }
                    }
                    // Enumeration
                    int theLastIndex = enumNameList.Count - 1;
                    for (int i = 0; i < enumNameList.Count; i++)
                    {
                        enumerationText += GTCS_GTL.TABSTRING;
                        enumerationText += enumNameList[i];
                        if (GTCS_GTL.ConfirmTrue(bAddMaxEnum))
                        {
                            if (i == (theLastIndex - 1))
                            {
                                enumerationText += GTCS_GTL.TABSTRING + GetUMeta(GTCS_GTL.EMPTYSTRING, true);
                            }
                            else
                            if (i == (theLastIndex))
                            {
                                enumerationText += " = " + enumNameList[i - 1] + " - 1";
                                enumerationText += GTCS_GTL.TABSTRING + GetUMeta(GTCS_GTL.EMPTYSTRING, true);
                            }
                        }


                        if (i < theLastIndex)
                        {
                            enumerationText += ",";
                        }
                        enumerationText += GTCS_GTL.GetNewLineString();
                    }
                }
                // }
                enumerationText += "};\n" + GTCS_GTL.GetNewLineString();
            }

            Clipboard.SetText(enumerationText);
        }