private static void EdgeRadials(Toy toy) { VibrateRadial(toy, toy.name + " 2"); CustomSubMenu.AddRadialPuppet(toy.name + " 1", f => { int roundedPercent = (int)Math.Round(f * 100); toy.setEdgeSpeed(roundedPercent / (100 / toy.maxSpeed2)); //0-10 }, ((float)toy.lastEdgeSpeed) / toy.maxSpeed2, toy.GetTexture()); }
private static void EdgeRadials(Toy toy) { VibrateRadial(toy, $"{toy.name} 2"); AMAPI.AddRadialPedalToSubMenu($"{toy.name} 1", f => { int roundedPercent = (int)Math.Round(f * 100); toy.setEdgeSpeed(roundedPercent / 5); //0-20 }, ((float)toy.lastEdgeSpeed) / 20, toy_icons[toy.name]); }
private static void handleSetSpeeds(VibratorControllerMessage msg) { foreach (var toymessage in msg.messages.Select(x => x.Value)) { if (!Toy.myToys.ContainsKey(toymessage.ToyID)) { continue; } Toy toy = Toy.myToys[toymessage.ToyID]; switch (toymessage.Command) { //Local toy commands case Commands.SetSpeed: if (toy?.hand == Hand.shared) { toy?.setSpeed(toymessage.Strength); } break; case Commands.SetSpeedEdge: if (toy?.hand == Hand.shared) { toy?.setEdgeSpeed(toymessage.Strength); } break; case Commands.SetAir: if (toy?.hand == Hand.shared) { toy?.setContraction(toymessage.Strength); } break; case Commands.SetRotate: if (toy?.hand == Hand.shared) { toy?.rotate(); } break; } } }