public bool DrawValueSlider <T>(string label, EditValueBase <T> edit, Func <bool> drawSlider) where T : IComparable, IFormattable
        {
            var changed     = false;
            var fontChanged = false;

            GUILayout.BeginHorizontal(optItemHeight);
            try {
                DrawLabel(ref label);

                if (!edit.isSync)
                {
                    SetTextColor(uiParams.textStyleSC, ref textColorRed);
                    fontChanged = true;
                }

                var editedVal = GUILayout.TextField(edit.editVal, uiParams.textStyleSC, optInputWidth);
                if (edit.editVal != editedVal)   // 直接書き換えられたケース
                {
                    edit.Set(editedVal);
                    changed |= edit.isSync; // テキスト値書き換え、かつ値が同期⇒変更とみなす
                }

                changed |= drawSlider();
                GUILayout.Space(buttonMargin);
            } finally {
                GUILayout.EndHorizontal();
                if (fontChanged)
                {
                    SetTextColor(uiParams.textStyleSC, ref textColor);
                }
            }
            return(changed);
        }
Esempio n. 2
0
        // Token: 0x0600032A RID: 810 RVA: 0x00019C90 File Offset: 0x00017E90
        public bool DrawValueSlider <T>(string label, EditValueBase <T> edit, Func <bool> drawSlider) where T : IComparable, IFormattable
        {
            bool flag  = false;
            bool flag2 = false;

            GUILayout.BeginHorizontal(new GUILayoutOption[]
            {
                this.optItemHeight
            });
            try
            {
                this.DrawLabel(ref label);
                if (!edit.isSync)
                {
                    this.SetTextColor(this.uiParams.textStyleSC, ref this.textColorRed);
                    flag2 = true;
                }
                string text = GUILayout.TextField(edit.editVal, this.uiParams.textStyleSC, new GUILayoutOption[]
                {
                    this.optInputWidth
                });
                if (edit.editVal != text)
                {
                    edit.Set(text);
                    flag |= edit.isSync;
                }
                flag |= drawSlider();
                GUILayout.Space(this.buttonMargin);
            }
            finally
            {
                GUILayout.EndHorizontal();
                if (flag2)
                {
                    this.SetTextColor(this.uiParams.textStyleSC, ref this.textColor);
                }
            }
            return(flag);
        }