public void UseWheelMenuItemHandler(Client sender, params object[] arguments) { //args[0] to nazwa opcji WheelMenu wheel = (WheelMenu)sender.GetData("WheelMenu"); wheel.WheelMenuItems.First(x => x.Name == (string)arguments[0]).Use(); wheel.Dispose(); }
public void RequestWheelMenuHandler(Client sender, params object[] arguments) { int entityId = Convert.ToInt32(arguments[0]); if (Enum.TryParse(typeof(EntityType), arguments[1].ToString(), true, out var entityType)) { if ((EntityType)entityType == EntityType.Player) { var character = EntityHelper.GetAccountByCharacterId(entityId); } else if ((EntityType)entityType == EntityType.Vehicle) { var vehicle = EntityHelper.GetVehicle(entityId); WheelMenu wheel = new WheelMenu(PrepareDataSource(sender, vehicle), sender); sender.SetData("WheelMenu", wheel); } } }