示例#1
0
        private void HandleMutableItemSelected(MutableBoxMutableItemBehaviour item)
        {
            IndicateMutableValue(item);

            ShowItemDropDown = false;

            //Debug.Log("Assigning Absolute Key: " + item.AbsoluteKey);
        }
示例#2
0
        private void HandleMutableItemSelected(MutableBoxMutableItemBehaviour item)
        {
            UndoLord.Instance.Push(new MutableTargetChange(this, (MutableTarget.SchemaSource == SchemaSource.Mutable ? "Local Payload." : "Global Payload.") + MutableTarget.AbsoluteKey, item.UserFacingAbsoluteKey + "." + MutableTarget.LastKey));

            IndicateMutableValue(item);


            // ArraySuffix never leaves this class!
            var arrayFreeText = item.AbsoluteKey.Replace(ArraySuffix, "");

            if (MutableTarget.ValidateKey(SchemaProvider.Schema))
            {
                MutableTarget.IntermediateKeyString = arrayFreeText;
            }

            IndicateError = !MutableTarget.KeyValid;

            ShowItemDropDown = false;
        }
示例#3
0
        //private void HandleGlobalParameterSelected( MutableBoxMutableItemBehaviour item )
        //{
        //    IndicateGlobalValue(item);
        //
        //    ShowItemDropDown = false;
        //}

        private void IndicateMutableValue(MutableBoxMutableItemBehaviour item)
        {
            SetSelectedMutableText(item.UserFacingAbsoluteKey);

            var segmentCount = item.UserFacingAbsoluteKey.Count(c => c.Equals('.')) + 1;

            GetComponent <LayoutElement>().preferredHeight = segmentCount * 16;

            UndoLord.Instance.Push(new MutableFieldChange(this, MutableField, item.UserFacingAbsoluteKey));

            // ArraySuffix never leaves this class!
            var arrayFreeText = item.AbsoluteKey.Replace(ArraySuffix, "");

            SchemaProvider.CacheSchema();
            MutableField.AbsoluteKey = arrayFreeText;

            MutableField.SchemaSource = item.SchemaSource;

            //////
            //MutableField.UseMutableValue = !item.useCachedData?
            //////

            //MutableField.UseMutableData = true;

            bool fieldValid;

            try
            {
                fieldValid = MutableField.ValidateKey(SchemaProvider.Schema);
            }
            catch (NullReferenceException)
            {
                fieldValid = false;
            }
            SchemaProvider.UnCacheSchema();

            IndicateError = !fieldValid;

            SwitchDisplayToMutableValue();

            //ShowItemDropDown = false;
        }
示例#4
0
        private void IndicateMutableValue(MutableBoxMutableItemBehaviour item)
        {
            SetSelectedMutableText(item.UserFacingAbsoluteKey);

            var segmentCount = item.UserFacingAbsoluteKey.Count(c => c.Equals('.')) + 1;

            GetComponent <LayoutElement>().preferredHeight = segmentCount * 16 + PreferredHeight - 16 + 4;    // -16 for keypanel, +4 for layout group padding.

            // ArraySuffix never leaves this class!
            var arrayFreeText = item.AbsoluteKey.Replace(ArraySuffix, "");

            SchemaProvider.CacheSchema();
            MutableTarget.IntermediateKeyString = arrayFreeText;
            SchemaProvider.UnCacheSchema();

            SchemaProvider.CacheSchema();
            MutableTarget.ValidateKey(SchemaProvider.Schema);
            SchemaProvider.UnCacheSchema();

            IndicateError = !MutableTarget.KeyValid;

            //ShowItemDropDown = false;
        }
示例#5
0
        private void IndicateMutableValue(MutableBoxMutableItemBehaviour item)
        {
            SetSelectedMutableText(item.UserFacingAbsoluteKey);

            var segmentCount = item.UserFacingAbsoluteKey.Count(c => c.Equals('.')) + 1;

            GetComponent <LayoutElement>().preferredHeight = segmentCount * 16;

            // ArraySuffix never leaves this class!
            var arrayFreeText = item.AbsoluteKey.Replace(ArraySuffix, "");

            SchemaProvider.CacheSchema();
            Scope.AbsoluteKey = arrayFreeText;
            SchemaProvider.UnCacheSchema();

            SchemaProvider.CacheSchema();
            IndicateError = !Scope.ValidateKey(SchemaProvider.Schema);
            SchemaProvider.UnCacheSchema();

            SwitchDisplayToMutableValue();

            //ShowItemDropDown = false;
        }