public override void ApplySettings(WatchVariableControlSettings settings)
 {
     base.ApplySettings(settings);
     if (settings.ChangeRoundingLimit && _roundingLimit != 0)
     {
         if (settings.ChangeRoundingLimitToDefault)
         {
             _setRoundingLimit(_defaultRoundingLimit);
         }
         else
         {
             _setRoundingLimit(settings.NewRoundingLimit);
         }
     }
     if (settings.ChangeDisplayAsHex)
     {
         if (settings.ChangeDisplayAsHexToDefault)
         {
             _setDisplayAsHex(_defaultDisplayAsHex);
         }
         else
         {
             _setDisplayAsHex(settings.NewDisplayAsHex);
         }
     }
 }
示例#2
0
 public virtual void ApplySettings(WatchVariableControlSettings settings)
 {
     if (settings.ChangeLocked)
     {
         ToggleLocked(settings.NewLocked, _watchVarControl.FixedAddressListGetter());
     }
 }
示例#3
0
        public void MakeYawVariablesBeTruncated()
        {
            WatchVariableControlSettings settings =
                new WatchVariableControlSettings(doTruncateIfYaw: true);

            foreach (WatchVariableControl control in GetCurrentVariableControls())
            {
                control.ApplySettings(settings);
            }
        }
示例#4
0
        public void ApplySettings(WatchVariableControlSettings settings)
        {
            if (settings.ChangeHighlighted)
            {
                Highlighted = settings.NewHighlighted;
            }

            if (settings.ChangeHighlightColor)
            {
                _tableLayoutPanel.BorderColor = settings.NewHighlightColor.Value;
                _tableLayoutPanel.ShowBorder  = true;
            }

            if (settings.ChangeBackgroundColor)
            {
                if (settings.ChangeBackgroundColorToDefault)
                {
                    BaseColor = _initialBaseColor;
                }
                else
                {
                    BaseColor = settings.NewBackgroundColor.Value;
                }
            }

            if (settings.ChangeFixedAddress)
            {
                if (settings.ChangeFixedAddressToDefault)
                {
                    FixedAddressListGetter = _defaultFixedAddressListGetter;
                }
                else
                {
                    SetFixedAddress(settings.NewFixedAddress);
                }
            }

            if (settings.DoFixAddressSpecial)
            {
                List <uint> addresses = FixedAddressListGetter() ?? WatchVarWrapper.GetCurrentAddressesToFix();
                if (addresses.Count > 0)
                {
                    uint objAddress = addresses[0];
                    uint parent     = Config.Stream.GetUInt32(objAddress + ObjectConfig.ParentOffset);
                    int  subtype    = Config.Stream.GetInt32(objAddress + ObjectConfig.BehaviorSubtypeOffset);
                    FixedAddressListGetter = () =>
                                             Config.ObjectSlotsManager.GetLoadedObjectsWithPredicate(
                        obj => obj.Parent == parent && obj.SubType == subtype && obj.Address != obj.Parent)
                                             .ConvertAll(obj => obj.Address);
                }
            }

            WatchVarWrapper.ApplySettings(settings);
        }
示例#5
0
 public override void ApplySettings(WatchVariableControlSettings settings)
 {
     base.ApplySettings(settings);
     if (settings.ChangeAngleSigned)
     {
         if (settings.ChangeAngleSignedToDefault)
         {
             _setSigned(_defaultSigned);
         }
         else
         {
             _setSigned(settings.NewAngleSigned);
         }
     }
     if (settings.ChangeYawSigned && _isYaw)
     {
         if (settings.ChangeYawSignedToDefault)
         {
             _setSigned(_defaultSigned);
         }
         else
         {
             _setSigned(settings.NewYawSigned);
         }
     }
     if (settings.ChangeAngleUnits)
     {
         if (settings.ChangeAngleUnitsToDefault)
         {
             _setAngleUnitType(_defaultAngleUnitType);
         }
         else
         {
             _setAngleUnitType(settings.NewAngleUnits);
         }
     }
     if (settings.ChangeAngleTruncateToMultipleOf16)
     {
         if (settings.ChangeAngleTruncateToMultipleOf16ToDefault)
         {
             _setTruncateToMultipleOf16(_defaultTruncateToMultipleOf16);
         }
         else
         {
             _setTruncateToMultipleOf16(settings.NewAngleTruncateToMultipleOf16);
         }
     }
     if (settings.ChangeAngleConstrainToOneRevolution)
     {
         if (settings.ChangeAngleConstrainToOneRevolutionToDefault)
         {
             _setConstrainToOneRevolution(_defaultConstrainToOneRevolution);
         }
         else
         {
             _setConstrainToOneRevolution(settings.NewAngleConstrainToOneRevolution);
         }
     }
     if (settings.ChangeAngleReverse)
     {
         if (settings.ChangeAngleReverseToDefault)
         {
             _setReverse(_defaultReverse);
         }
         else
         {
             _setReverse(settings.NewAngleReverse);
         }
     }
     if (settings.ChangeAngleDisplayAsHex)
     {
         if (settings.ChangeAngleDisplayAsHexToDefault)
         {
             _setDisplayAsHex(_defaultDisplayAsHex);
         }
         else
         {
             _setDisplayAsHex(settings.NewAngleDisplayAsHex);
         }
     }
     if (settings.DoTruncateIfYaw && _isYaw)
     {
         _setTruncateToMultipleOf16(true);
     }
 }