/// <summary>
        /// 補間
        /// </summary>
        /// <param name="left"></param>
        /// <param name="leftKey"></param>
        /// <param name="right"></param>
        /// <param name="rightKey"></param>
        /// <returns></returns>
        protected override ReadOnlyCollection<ValueBase> Interpolate(
            ValueBase left, int leftKey, ValueBase right, int rightKey)
        {
            Value leftValue = (Value) left;
            Value rightValue = (Value) right;

            int count = rightKey - leftKey - 1;
            List<ValueBase> results = new List<ValueBase>( count );

            // 間のフレームの補間を生み出す
            Interpolater interporator = Interpolater.GetInterpolater( "linear" );
            for ( int i = 0; i < count; ++i ) {
                float[] lt = interporator.Interpolate( leftValue.lt, rightValue.lt, leftKey, rightKey, i + leftKey + 1 );
                float[] rt = interporator.Interpolate( leftValue.rt, rightValue.rt, leftKey, rightKey, i + leftKey + 1 );
                float[] lb = interporator.Interpolate( leftValue.lb, rightValue.lb, leftKey, rightKey, i + leftKey + 1 );
                float[] rb = interporator.Interpolate( leftValue.rb, rightValue.rb, leftKey, rightKey, i + leftKey + 1 );
                results.Add( new Value() {
                    lt = lt,
                    rt = rt,
                    lb = lb,
                    rb = rb
                } );
            }
            return results.AsReadOnly();
        }
        // Ward Slider display
        public static void WardSlider_OnValueChange(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
        {
            int value = 0;

            if (args != null)
            {
                value = args.NewValue;
            }
            else
            {
                value = sender.CurrentValue;
            }

            if (value == 0)
            {
                sender.DisplayName = "Ward Type: Warding Totem";
            }
            else if (value == 1)
            {
                sender.DisplayName = "Ward Type: Sweeping Lens";
            }
            else if (value == 2)
            {
                sender.DisplayName = "Ward Type: Farsight Trinket";
            }
            else if (value == 3)
            {
                sender.DisplayName = "Ward Type: Oracles Lens";
            }
        }
    public object?ParseLiteral(ValueBase input)
    {
        if (input.Kind == NodeKind.NullValue)
        {
            return(null);
        }

        if (input.Kind == NodeKind.FloatValue)
        {
            var doubleValue = (FloatValue)input;

            if (!Utf8Parser.TryParse(doubleValue.ValueSpan, out double d, out _))
            {
                throw new FormatException(
                          $"Could not parse value '{Encoding.UTF8.GetString(doubleValue.ValueSpan)}' as double");
            }

            return(d);
        }

        if (input.Kind == NodeKind.IntValue)
        {
            var intValue = (IntValue)input;
            return((double)intValue.Value);
        }

        throw new FormatException(
                  $"Cannot coerce Float value from '{input.Kind}'");
    }
        /// <summary>
        /// 補間生成
        /// </summary>
        /// <param name="left"></param>
        /// <param name="leftKey"></param>
        /// <param name="right"></param>
        /// <param name="rightKey"></param>
        /// <returns></returns>
        protected override ReadOnlyCollection <ValueBase> Interpolate(
            ValueBase left, int leftKey,
            ValueBase right, int rightKey)
        {
            Value leftValue  = (Value)left;
            Value rightValue = (Value)right;

            int count = rightKey - leftKey - 1;
            List <ValueBase> results = new List <ValueBase>(count);

            // 間のフレームの補間を生み出す
            Interpolater interporator = Interpolater.GetInterpolater(leftValue.ipType);

            for (int i = 0; i < count; ++i)
            {
                float value = interporator.Interpolate(
                    leftValue.value, rightValue.value,
                    leftKey, rightKey, i + leftKey + 1);
                results.Add(new Value()
                {
                    ipType = leftValue.ipType,
                    value  = value,
                });
            }
            return(results.AsReadOnly());
        }
Exemple #5
0
        public void NullValueString_EqualsNullValueString_IsTrue()
        {
            ValueBase value1 = (string)null !;
            ValueBase value2 = (string)null !;

            Assert.AreEqual(value1, value2);
        }
Exemple #6
0
        private bool ParseImmediateValue(ParseTreeNode node, Block block, out ValueBase res)
        {
            res = null;
            //Determine pattern
            if (node.Term.Name == "value-integer")
            {
                res = new Assemble.ValueInteger((int)node.ChildNodes[0].Token.Value);
                res.AssemblePosition = new Assemble.AssemblePosition(this.ParsingFilePath, node);
                return(true);
            }
            else if (node.Term.Name == "value-character")
            {
                res = new Assemble.ValueChar((char)node.ChildNodes[0].Token.Value);
                res.AssemblePosition = new Assemble.AssemblePosition(this.ParsingFilePath, node);
                return(true);
            }
            else if (node.Term.Name == "value-referaddress")
            {
                if (node.ChildNodes.Count == 2)
                {
                    res = new Assemble.ValueReference(node.ChildNodes[1].Token.Text, block);
                    res.AssemblePosition = new Assemble.AssemblePosition(this.ParsingFilePath, node);
                }
                else
                {
                    res = new Assemble.ValueReference(node.ChildNodes[1].Token.Text, (int)node.ChildNodes[3].Token.Value, block);
                    res.AssemblePosition = new Assemble.AssemblePosition(this.ParsingFilePath, node);
                }
                return(true);
            }

            ReportError("ImmediateValue", "Unknown immediate value format.", node);
            return(false);
        }
 public static void OrbwalkLRCLK_ValueChanged(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
 {
     if (args.NewValue)
     {
         LastClickPoint = Game.CursorPos.LSTo2D();
     }
 }
Exemple #8
0
        /// <summary>
        /// 生成
        /// </summary>
        /// <param name="part"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override AttributeBase CreateKeyFrame(SpritePart part, ValueBase value)
        {
            Value v    = (Value)value;
            var   cell = part.Root.CellMap(v.mapId);

            return(CellUpdater.Create(v.mapId, cell.FindCell(v.name)));
        }
Exemple #9
0
        private void OnSpellStartChange(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
        {
            //e.Process = false;

            spellStartPosition = myHero.ServerPosition;
            Draw.RenderObjects.Add(new Draw.RenderCircle(spellStartPosition.LSTo2D(), 1000, Color.Red, 100, 20));
        }
Exemple #10
0
 private static void OnValueChange(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
 {
     if (args.NewValue && SpellSlot.R.IsReady() && KillSteal.RKillableBases.Any())
     {
         TapKeyPressed = true;
     }
 }
        public BehaviorNodeData CopyNode(BehaviorNodeData node)
        {
            BehaviorNodeData copyNode = new BehaviorNodeData();

            copyNode.name      = node.name;
            copyNode.describe  = node.describe;
            copyNode.Pos       = node.Pos;
            copyNode.args_dict = new BehaviorTreeArgsDict();
            foreach (var item in node.args_dict)
            {
                ValueBase valueBase = ValueBase.Clone(item.Value);
                copyNode.args_dict.Add(item.Key, valueBase);
            }
            List <BehaviorNodeData> list = new List <BehaviorNodeData>();

            foreach (var item in node.children)
            {
                list.Add(item);
            }
            foreach (var child in list)
            {
                copyNode.AddChild(CopyNode(child));
            }
            copyNode.ResetId();
            return(copyNode);
        }
Exemple #12
0
        /// <summary>
        ///		Ejecuta una instrucción while
        /// </summary>
        private void Execute(InstructionWhile instruction)
        {
            bool end       = false;
            int  loopIndex = 0;

            // Ejecuta las instrucciones en un bucle
            do
            {
                ValueBase result = ExpressionComputer.Evaluate(instruction.ConditionRPN);

                if (result.HasError)
                {
                    Compiler.LocalErrors.Add(instruction.Token, result.Error);
                    end = true;
                }
                else if (!(result is ValueBool))
                {
                    Compiler.LocalErrors.Add(instruction.Token, "El resultado de calcular la expresión no es un valor lógico");
                    end = true;
                }
                else if (!(result as ValueBool).Value)
                {
                    end = true;
                }
                else
                {
                    Execute(instruction.Instructions);
                }
            }while (!end && ++loopIndex < Compiler.MaximumRepetitionsLoop);
        }
Exemple #13
0
 static void noTextures_OnValueChange(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
 {
     //Creates a file so that AutoBuddy can check on load if the user doesn't want textures.. :) Thanks @Finndev!
     try
     {
         if (!Directory.Exists(loadTextureDir))
         {
             Directory.CreateDirectory(loadTextureDir);
         }
         if (MainMenu.GetMenu("AB").Get <CheckBox>("noTextures").CurrentValue)
         {
             if (!File.Exists(loadTextureDir + "loadTexture"))
             {
                 File.Create(loadTextureDir + "loadTexture");
             }
         }
         else
         {
             if (File.Exists(loadTextureDir + "loadTexture"))
             {
                 File.Delete(loadTextureDir + "loadTexture");
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine($"Load Texture Error: '{e}'");
     }
 }
Exemple #14
0
 private static void OnUltButton(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
 {
     if (args.NewValue && TargetSelector.GetTarget(_r.Range, DamageType.Physical) != null)
     {
         _r.Cast(_r.GetPrediction(TargetSelector.GetTarget(_r.Range, DamageType.Physical)).CastPosition);
     }
 }
Exemple #15
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((GetType().GetHashCode() * 397) ^ (ValueBase?.GetHashCode() ?? 0));
     }
 }
Exemple #16
0
        private static void OnResetPress(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
        {
            if (args.NewValue)
            {
                // Reset skins of all champs
                foreach (var hero in EntityManager.Heroes.AllHeroes.Where(hero => HeroMenus.ContainsKey(hero.NetworkId) && hero.SkinId != DefaultSkins[hero.NetworkId]))
                {
                    // Get the menu for the hero
                    var menu = HeroMenus[hero.NetworkId];

                    try
                    {
                        // Set the menu value for the hero
                        var skins = menu.Get <ComboBox>("skins");
                        skins.CurrentValue = DefaultSkins[hero.NetworkId];
                    }
                    catch (Exception)
                    {
                        // ignored
                    }
                }

                // Reset CheckBox
                sender.CurrentValue = !args.NewValue;
            }
        }
Exemple #17
0
 private void enabled_OnValueChange(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
 {
     if (args.NewValue)
     {
         OnLvLUp(ObjectManager.Player.Level, true);
     }
 }
Exemple #18
0
        public MenuItem(string translationName, int defValue, int minValue = 0, int maxValue = 100) : base(translationName)
        {
            var item = new Slider("PLACEHOLDER", defValue, minValue, maxValue);

            this.Instance = item;

            this.intVal = item.CurrentValue;

            this.MenuItemType = Type.Int;

            item.OnValueChange += (sender, args) =>
            {
                if (args.NewValue == args.OldValue)
                {
                    return;
                }

                this.intVal = args.NewValue;

                if (this.InvokeAndDetermine(nameof(this.Int)))
                {
                    item.CurrentValue = args.OldValue;
                }
            };
        }
Exemple #19
0
        public void MyOutw(ValueBase port, ValueBase s)
        {
            switch (port.UInt32AsInt)
            {
            //    case 0x00 ... 0x07:
            //        dma_controllers[0].write_controller_reg(port, s);
            //        break;
            //
            //    case 0xc0:
            //    case 0xc2:
            //    case 0xc4:
            //    case 0xc6:
            //    case 0xc8:
            //    case 0xca:
            //    case 0xcc:
            //    case 0xce:
            //        dma_controllers[1].write_controller_reg((port - 0xc0) / 2, s);
            //        break;

            case 0x3c4:
                vga_seq_index = s.UInt32AsInt;
                break;

            case 0x3d4:
                vga_crtc_index = s.UInt32AsInt;
                break;

            default:
                throw new NotImplementedException($"Port: {port}, value: {s}");
            }
        }
Exemple #20
0
 private static void DrawHP_ValueChanged(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
 {
     if (sender != null)
     {
         CustomDamageIndicator.Enabled = args.NewValue;
     }
 }
Exemple #21
0
        public static void RoleSlider(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
        {
            try
            {
                switch (args.NewValue)
                {
                case 1:
                    sender.DisplayName += "Laner";
                    break;

                case 2:
                    sender.DisplayName += "Jungler";
                    break;

                case 3:
                    sender.DisplayName += "Support";
                    break;
                }
            }
            catch (Exception e)
            {
                Chat.Print("JSON parse ERROR: Code AUTOLVLUP.ROLESLIDER");
                Console.Write(e);
            }
        }
        private static void Program_OnValueChange(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
        {
            string[] cards  = new string[] { "Gold Card", "Blue Card", "Red Card" };
            Slider   slider = menu.Get <Slider>("Card Slider");

            slider.DisplayName = "Active Card: " + cards[slider.CurrentValue];
        }
Exemple #23
0
 private static void _EvadeLegit_OnValueChange(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
 {
     if (args.NewValue == true)
     {
         _EvadeLegit.CurrentValue = false;
     }
 }
 private static void Program_PlaceWard_OnValueChange(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
 {
     if (!Properties.GetData<bool>("Enable")) return;
     if (!args.OldValue && args.NewValue)
     {
         WardSpot spot;
         if (Wards.TryFindNearestSafeWardSpot(Game.CursorPos, out spot))
         {
             if (spot.ClickPosition.IsInRange(Player.Instance, 1100))
             {
                 var item = Wards.GetWardSlot();
                 if (item != null)
                 {
                     if(Player.CastSpell(item.SpellSlot, spot.ClickPosition))
                         Chat.Print(_placePinkWard ? "Placed pink ward!" : "Placed normal ward!");
                     return;
                 }
             }
             Player.IssueOrder(GameObjectOrder.MoveTo, spot.MovePosition, false);
             _placingWardSpot = spot;
         }else if (Wards.TryFindNearestWardSpot(Game.CursorPos, out spot))
         {
             var item = Wards.GetWardSlot();
             if (item != null)
                 Player.CastSpell(item.SpellSlot, spot.MagneticPosition);
         }
     }
 }
Exemple #25
0
 public static void SkinManager_OnSkinSliderChange(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
 {
     var model = GetModelByIndex(UtilityMenu.Skinmanager["skinmanager.models"].Cast<Slider>().CurrentValue);
     var skin = model.Skins[UtilityMenu.Skinmanager["skinmanager.skins"].Cast<Slider>().CurrentValue];
     UtilityMenu.Skinmanager["skinmanager.skins"].Cast<Slider>().DisplayName = "Skin - " + skin.Name;
     Player.SetSkinId(skin.Index);
 }
Exemple #26
0
        public MenuItem(string translationName, List <string> values, int defaultIndex = 0) : base(translationName)
        {
            var item = new ComboBox("PLACEHOLDER", values, defaultIndex);

            this.Instance = item;

            this.stringTextValues = values;

            this.stringIndex = item.SelectedIndex;

            this.stringVal = values[this.stringIndex];

            this.MenuItemType = Type.StringList;

            item.OnValueChange += (sender, args) =>
            {
                if (args.NewValue == args.OldValue)
                {
                    return;
                }

                var n = args.NewValue;

                this.stringIndex = n;

                this.stringVal = this.stringTextValues[n];

                if (this.InvokeAndDetermine(nameof(this.StringIndex)))
                {
                    item.CurrentValue = args.OldValue;
                }
            };
        }
        /// <summary>
        /// Асинхронно записывает данные объекта на сервере.
        /// </summary>
        /// <param name="режимЗаписиДокумента">Режим записи документа (только для документов).</param>
        /// <param name="режимПроведенияДокумента">Режим проведения документа (только для документов).</param>
        /// <returns></returns>
        protected async Task ЗаписатьДанныеАсинх(ежимЗаписиДокумента режимЗаписиДокумента = ежимЗаписиДокумента.Запись, ежимПроведенияДокумента режимПроведенияДокумента = ежимПроведенияДокумента.Неоперативный)
        {
            ValueObjectRef tempObject = new ValueObjectRef(this.reference);

            tempObject.Property = new ValueBase[this.modifiedFields.Count];
            int i = 0;

            foreach (string key in this.modifiedFields)
            {
                object value = null;
                this.data.TryGetValue(key, out value);
                ValueBase property = ValueBase.From(value);
                property.Name          = key;
                tempObject.Property[i] = property;
                i++;
            }

            PostObject_Settings settings = new PostObject_Settings(
                this.ДополнительныеСвойства,
                режимЗаписиДокумента,
                режимПроведенияДокумента,
                this.isExchangeLoadMode
                );

            Task <PostObjectResponse> task = this.Клиент().SoapКлиент.PostObjectAsync(tempObject, settings);

            ValueObjectRef returnObject = (await task).@return;
            ОбъектСсылка   ссылка       = returnObject.GetValue(this.Клиент()) as ОбъектСсылка;

            this.УстановитьСсылку(ссылка);

            this.УстановитьЗначенияИзСвойствSOAP(returnObject.Property);

            this.modifiedFields.Clear();
        }
Exemple #28
0
 public static void OnSkinSliderChange(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
 {
     if (Config.IsChecked(Config.Misc, "useSkin"))
     {
         Player.SetSkinId(args.NewValue);
     }
 }
Exemple #29
0
 internal static void ValorZoom(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
 {
     if (Utility["AtvZoom"].Cast <KeyBind>().CurrentValue)
     {
         Camera.SetZoomDistance(Utility["ValZoom"].Cast <Slider>().CurrentValue);
     }
 }
Exemple #30
0
 private static void OnSkinIdChange(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
 {
     if (SkinHackEnabled)
     {
         Player.Instance.SetSkinId(args.NewValue);
     }
 }
Exemple #31
0
        private ValueBase ReadPoint(object pointDataSource, Point point)
        {
            ValueBase value = new ValueBase();

            value.State    = ValueState.Success;
            value.LastTime = DataUtil.ToDateString(DateTime.Now);

            switch (point.type)
            {
            case PointType.String:
                value.Value = pointDataSource;
                break;

            case PointType.Ushort:
                value.Value = DataUtil.ToDouble(pointDataSource);
                break;

            case PointType.Real:
                value.Value = DataUtil.ToDouble(pointDataSource) * point.scale;
                break;

            default:
                value.MakeFail("点ID:" + point.pointID + "未知的数据类型");
                break;
            }
            return(value);
        }
Exemple #32
0
 public static void OrbwalkLRCLK_ValueChanged(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
 {
     if (args.NewValue)
     {
         LastClickPoint = Game.CursorPos.LSTo2D();
     }
 }
Exemple #33
0
        private static void OnRandomSkinsPress(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
        {
            if (args.NewValue)
            {
                // Apply random skin for each champ
                foreach (var menu in EntityManager.Heroes.AllHeroes.Where(hero => HeroMenus.ContainsKey(hero.NetworkId)).Select(hero => HeroMenus[hero.NetworkId]))
                {
                    try
                    {
                        // Set the menu value for the hero
                        var skins = menu.Get <ComboBox>("skins");

                        // Get a new unique random skin
                        int skin;
                        do
                        {
                            skin = Random.Next(skins.Overlay.Children.Count);
                        } while (skin == skins.CurrentValue);

                        // Apply random skin
                        skins.CurrentValue = skin;
                    }
                    catch (Exception)
                    {
                        // ignored
                    }
                }

                // Reset CheckBox
                sender.CurrentValue = !args.NewValue;
            }
        }
Exemple #34
0
        private void BaseSlider_OnValueChange(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
        {
            var c = GetColor(BaseSlider.CurrentValue);

            BaseSlider.DisplayName = Slot == SpellSlot.Unknown ? Name + " Color: " + c : Slot + " Color: " + c;
            CurrentColor           = GetColor(c);
        }
Exemple #35
0
 public void SkinManager_OnModelSliderChange(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
 {
     var model = GetModelByIndex(Menu["skinmanager.models"].Cast<Slider>().CurrentValue);
     Menu["skinmanager.models"].Cast<Slider>().DisplayName = "Model - " + model.Name;
     Player.SetModel(model.Name);
     Menu["skinmanager.skins"].Cast<Slider>().CurrentValue = 0;
     Menu["skinmanager.skins"].Cast<Slider>().MaxValue = model.Skins.Length - 1;
 }
 private void SpellTester_SelectedSpellIndex_OnValueChange(ValueBase<int> sender,
     ValueBase<int>.ValueChangeArgs args)
 {
     if (SelectedPoints.Count > 0)
     {
         SelectedPoint = SelectedPoints[Config.Properties.GetData<int>("SpellTester_SelectedSpellIndex") - 1];
     }
 }
Exemple #37
0
        public static void SkinManager_OnResetModel(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
        {
            UtilityMenu.Skinmanager["skinmanager.models"].Cast<Slider>().CurrentValue = Array.IndexOf(ModelNames,
                Player.Instance.ChampionName);

            if (UtilityMenu.Skinmanager["skinmanager.resetModel"].Cast<CheckBox>().CurrentValue)
                UtilityMenu.Skinmanager["skinmanager.resetModel"].Cast<CheckBox>().CurrentValue = false;
        }
 private static void OnFlash(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
 {
     if (UtilityManager.Activator.Flash.IsReady() && args.NewValue)
     {
         var position = Player.Instance.ServerPosition.Extend(Game.CursorPos,
             UtilityManager.Activator.Flash.Range);
         UtilityManager.Activator.Flash.Cast(position.To3DWorld());
     }
 }
Exemple #39
0
 private static void OnFlash(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
 {
     if (Flash.IsReady() && args.NewValue)
     {
         Notifications.Show(new SimpleNotification("Flash Assistant", "NOOOOOOOOOOOOB!"));
         var position = Player.Instance.ServerPosition.Extend(Game.CursorPos, Flash.Range);
         Flash.Cast(position.To3DWorld());
     }
 }
Exemple #40
0
 public static void SkinHax_OnValueChanged(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
 {
     if (Config.Modes.Draw.UseHax)
     {
         Config.Modes.Draw._skinhax.DisplayName =
             Config.Modes.Draw.skinName[Config.Modes.Draw._skinhax.CurrentValue];
         Player.Instance.SetSkin(Player.Instance.ChampionName, args.NewValue);
     }
 }
Exemple #41
0
        private static void ExtendedZoomValue_OnValueChange(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
        {
            if (!_config["ExtendedZoom"].Cast<KeyBind>().CurrentValue)
            {
                return;
            }

            Camera.SetZoomDistance(args.NewValue);
        }
        private void SpellTester_SelectedSpellAngle_OnValueChange(ValueBase<int> sender,
            ValueBase<int>.ValueChangeArgs args)
        {
            if (SelectedPoint != null)
            {
                SelectedPoint.Angle = sender.CurrentValue;
            }

        }
Exemple #43
0
        private void RecallTracker_OnReset(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
        {
            HackMenu["recallx"].Cast<Slider>().CurrentValue = 645;
            HackMenu["recally"].Cast<Slider>().CurrentValue = 860;
            HackMenu["recallwidth"].Cast<Slider>().CurrentValue = 465;

            if (HackMenu["resetPos"].Cast<CheckBox>().CurrentValue)
                HackMenu["resetPos"].Cast<CheckBox>().CurrentValue = false;
        }
Exemple #44
0
        private static void Slider_OnValueChange(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
        {
            List<string> colorList = new List<string>();

            foreach (PropertyInfo info in typeof(Color).GetProperties())
                if(!badNames.Contains(info.Name))
                    colorList.Add(info.Name);

            ((Slider)sender).DisplayName = "Shroom Color: " + colorList[((Slider)sender).CurrentValue];
        }
Exemple #45
0
 private static void OffsetOnOnValueChange(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
 {
     if (sender.SerializationId == Program.BaseUltMenu["x"].Cast<Slider>().SerializationId)
     {
         UpdateOffset(args.NewValue);
     }
     else
     {
         UpdateOffset(0, args.NewValue);
     }
 }
Exemple #46
0
        public static void SelfW_OnValueChanged(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
        {
            if (args.NewValue && SpellManager.W.IsReady() && SpellManager.E.IsReady())
            {
                var tempPos = Game.CursorPos;

                ObjectManager.Player.Spellbook.CastSpell(SpellSlot.W, tempPos);
                ObjectManager.Player.Spellbook.CastSpell(SpellSlot.E, tempPos);
                Config.Modes.Misc._SelfW.CurrentValue = false;
            }
        }
Exemple #47
0
 private void kb_OnValueChange(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
 {
     if (args.NewValue)
     {
         selectedObject = null;
     }
     else if (nearbyObjects.Any())
     {
         selectedObject = nearbyObjects.First();
         RefreshText();
     }
 }
Exemple #48
0
 static void en_OnValueChange(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
 {
     if (args.NewValue == false)
     {
         foreach (Champ ch in champions)
             ch.Kill();
         Drawing.OnEndScene -= Drawing_OnEndScene;
         Game.OnUpdate -= Game_OnUpdate;
     }
     else
         Init();
 }
Exemple #49
0
 private void s_OnValueChange(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
 {
     if (args.NewValue != 5 && args.NewValue != 0 && !cus.canLvl((SkillToLvl) args.NewValue, level))
     {
         s.CurrentValue = 0;
     }
     else
     {
         cus.SetSkill(level, (SkillToLvl) args.NewValue);
         sender.DisplayName = skills[args.NewValue];
     }
 }
Exemple #50
0
        private static void ToggleKey_OnValueChange(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
        {
            KeyBind keybind = sender as KeyBind;
            if(keybind.CurrentValue == true)
            {
                Slider slider = menu.Get<Slider>("Card Slider");

                if (slider.CurrentValue == 2)
                    slider.CurrentValue = 0;
                else
                    slider.CurrentValue = slider.CurrentValue + 1;
            }
        }
 private void Slider_OnValueChange(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
 {
     Debug.DrawTopLeft(_type + ": " + _spellProperty + ": " + _configKey + ": " + "Value Changed To " + sender.CurrentValue);
     switch (_type)
     {
         case ConfigDataType.Data:
             Properties.SetValue(_configKey, sender.CurrentValue, false);
             break;
         case ConfigDataType.Spells:
             if (_isBasedOnSpell)
             {
                 var spell = Properties.GetSpell(_spellKey);
                 switch (_spellProperty)
                 {
                     case SpellConfigProperty.Radius:
                         spell.Radius = sender.CurrentValue;
                         break;
                     case SpellConfigProperty.DangerLevel:
                         spell.DangerLevel = (SpellDangerLevel) sender.CurrentValue;
                         break;
                     case SpellConfigProperty.SpellMode:
                         spell.EvadeSpellMode = (SpellModes) sender.CurrentValue;
                         break;
                     default:
                         return;
                 }
                 Properties.SetSpell(_spellKey, spell);
             }
             break;
         case ConfigDataType.EvadeSpell:
             if (_isBasedOnSpell)
             {
                 var spell = Properties.GetEvadeSpell(_spellKey);
                 switch (_spellProperty)
                 {
                     case SpellConfigProperty.DangerLevel:
                         spell.DangerLevel = (SpellDangerLevel) sender.CurrentValue;
                         break;
                     case SpellConfigProperty.SpellMode:
                         spell.SpellMode = (SpellModes) sender.CurrentValue;
                         break;
                     default:
                         return;
                 }
                 Properties.SetEvadeSpell(_spellKey, spell);
             }
             break;
     }
 }
Exemple #52
0
 public static void ModeSwitch(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
 {
     if (args.NewValue)
     {
         switch (Mode)
         {
             case 1:
                 Mode = 2;
                 break;
             case 2:
                 Mode = 1;
                 break;
         }
     }
 }
Exemple #53
0
 private static void LoadOption(ValueBase valueBase, JsonSetting type)
 {
     if (type.Type == Setting.Checkbox)
     {
         valueBase.Cast<CheckBox>().CurrentValue = Convert.ToBoolean(type.Value);
     }
     if (type.Type == Setting.Slider)
     {
         valueBase.Cast<Slider>().CurrentValue = Convert.ToInt32(type.Value);
     }
     if (type.Type == Setting.Combobox)
     {
         valueBase.Cast<ComboBox>().CurrentValue = Convert.ToInt32(type.Value);
     }
 }
Exemple #54
0
 private static void SaveOption(ValueBase valueBase, JsonSetting option)
 {
     if (option.Type == Setting.Checkbox)
     {
         Profile.Options[Profile.Options.FindIndex(o => o.UiD == option.UiD)].Value = valueBase.Cast<CheckBox>().CurrentValue.ToString();
     }
     if (option.Type == Setting.Slider)
     {
         Profile.Options[Profile.Options.FindIndex(o => o.UiD == option.UiD)].Value = valueBase.Cast<Slider>().CurrentValue.ToString();
     }
     if (option.Type == Setting.Combobox)
     {
         Profile.Options[Profile.Options.FindIndex(o => o.UiD == option.UiD)].Value = valueBase.Cast<ComboBox>().CurrentValue.ToString();
     }
 }
Exemple #55
0
        public static void SelfW_OnValueChanged(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
        {
            if (args.NewValue && SpellManager.W.IsReady() && SpellManager.E.IsReady())
            {
                var tempPos = Game.CursorPos;

                SpellManager.W.Cast(tempPos);
                if (tempPos.IsInRange(Player.Instance.ServerPosition, SpellManager.E.Range))
                {
                    Core.DelayAction(() => SpellManager.E.Cast(tempPos), 120);
                }
                else
                {
                    Core.DelayAction(() => SpellManager.E.Cast(Player.Instance.ServerPosition.Extend(tempPos, 450).To3DWorld()), 500);
                }
                Config.Modes.Misc._SelfW.CurrentValue = false;
            }
        }
 private void CheckBox_OnValueChange(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
 {
     Debug.DrawTopLeft(_type + ": " +  _spellProperty + ": " + _configKey + ": " + "Value Changed To " + sender.CurrentValue);
     switch (_type)
     {
         case ConfigDataType.Data:
             Properties.SetValue(_configKey, sender.CurrentValue, false);
             break;
         case ConfigDataType.Spells:
             if (_isBasedOnSpell)
             {
                 var spell = Properties.GetSpell(_spellKey);
                 switch (_spellProperty)
                 {
                     case SpellConfigProperty.Dodge:
                         spell.Dodge = sender.CurrentValue;
                         break;
                     case SpellConfigProperty.Draw:
                         spell.Draw = sender.CurrentValue;
                         break;
                 }
                 Properties.SetSpell(_spellKey, spell);
             }
             break;
         case ConfigDataType.EvadeSpell:
             if (_isBasedOnSpell)
             {
                 var spell = Properties.GetEvadeSpell(_spellKey);
                 switch (_spellProperty)
                 {
                     case SpellConfigProperty.UseEvadeSpell:
                         spell.Use = sender.CurrentValue;
                         break;
                     default:
                         return;
                 }
                 Properties.SetEvadeSpell(_spellKey, spell);
             }
             break;
     }
 }
Exemple #57
0
 private static void Toggle_OnValueChange(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
 {
     if (menu.Get<CheckBox>("Toggle").CurrentValue)
     {
         menu.Get<KeyBind>("Gold Card").IsVisible = false;
         menu.Get<KeyBind>("Blue Card").IsVisible = false;
         menu.Get<KeyBind>("Red Card").IsVisible = false;
         menu.Get<KeyBind>("Toggle Key").IsVisible = true;
         menu.Get<Slider>("Card Slider").IsVisible = true;
         menu.Get<CheckBox>("Draw Card Type").IsVisible = true;
     }
     else
     {
         menu.Get<KeyBind>("Gold Card").IsVisible = true;
         menu.Get<KeyBind>("Blue Card").IsVisible = true;
         menu.Get<KeyBind>("Red Card").IsVisible = true;
         menu.Get<KeyBind>("Toggle Key").IsVisible = false;
         menu.Get<Slider>("Card Slider").IsVisible = false;
         menu.Get<CheckBox>("Draw Card Type").IsVisible = false;
     }
 }
        /// <summary>
        /// 補間生成
        /// </summary>
        /// <param name="left"></param>
        /// <param name="leftKey"></param>
        /// <param name="right"></param>
        /// <param name="rightKey"></param>
        /// <returns></returns>
        protected override ReadOnlyCollection<ValueBase> Interpolate(
            ValueBase left, int leftKey,
            ValueBase right, int rightKey)
        {
            Value leftValue = (Value) left;
            Value rightValue = (Value) right;

            int count = rightKey - leftKey - 1;
            List<ValueBase> results = new List<ValueBase>( count );

            // 間のフレームの補間を生み出す
            Interpolater interporator = Interpolater.GetInterpolater( leftValue.ipType );
            for ( int i = 0; i < count; ++i ) {
                float value = interporator.Interpolate(
                        leftValue.value, rightValue.value,
                        leftKey, rightKey, i + leftKey + 1 );
                results.Add( new Value() {
                    ipType = leftValue.ipType,
                    value = value,
                } );
            }
            return results.AsReadOnly();
        }
Exemple #59
0
        private void OnLoadSpellTesterChange(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs changeArgs)
        {
            sender.CurrentValue = changeArgs.OldValue;

            if (spellTester == null)
            {
                spellTester = new SpellTester();
            }
        }
Exemple #60
0
        private void OnEvadeModeChange(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs changeArgs)
        {
            var mode = sender.DisplayName;

            if (mode == "Very Smooth")
            {
                menu["FastEvadeActivationTime"].Cast<Slider>().CurrentValue = 0;
                menu["RejectMinDistance"].Cast<Slider>().CurrentValue = 0;
                menu["ExtraCPADistance"].Cast<Slider>().CurrentValue = 0;
                menu["ExtraPingBuffer"].Cast<Slider>().CurrentValue = 40;
            }
            else if (mode == "Smooth")
            {
                menu["FastEvadeActivationTime"].Cast<Slider>().CurrentValue = 65;
                menu["RejectMinDistance"].Cast<Slider>().CurrentValue = 10;
                menu["ExtraCPADistance"].Cast<Slider>().CurrentValue = 10;
                menu["ExtraPingBuffer"].Cast<Slider>().CurrentValue = 65;
            }
        }