# Controlify 1.1

A noteable update to Controlify, with a lot of new features.

## New Features

- Controller vibration support for all platforms.
- Gyro support for compatible controllers.
- Reach-around block interaction that imitates Bedrock Edition's exact behaviour.
- Reduce aim sensitivity option. When aiming, the sensitivity is reduced and more fine control is given.
- UI sounds option.
  - A toggleable setting enables playing the legacy console edition UI sound when changing the selected component
    in GUIs. In the future, this will be expanded to have more sounds.
- Modded keybinds are now automatically registered as controller binds.
- Bindings are now grouped into categories.
- Under-the-hood drivers.
- Compound joysticks, allowing for an infinite amount of inputs. This currently has no UI, and you have to create a joystick mapping resource-pack yourself. This will come in a future update.
- Two abstract gui controller binds are available for mod developers to use in any screen context.
- Button guide in screens, with a new API for mod developers to add their own button guides.
- New registry for screenop API, as an alternative to mixing into UIs, you now register `ScreenProcessor`s and `ComponentProcessor`s on the Controlify entrypoint.
- New builder API for controller bindings, deprecating the old constructor-based approach.

### Controller Vibration

This is a feature that is available on all platforms, Windows, Linux, and Mac.

The current vibrations are:

- Using items (including eating)
- Taking damage
- Ender dragon death
- Anvil use (clang! clang! clang!)
- Explosions
  - Their intensity is scaled based on the explosion's distance from the player and power.
  - This is a cool custom effect where you feel an initial boom, and then another fading vibration.
- Survival block mining
  - The intensity is scaled based on the block's hardness.
- Items breaking
- Fishing rod bite

Vibrations play nicely together, where playing a vibration over a longer vibration does
not cause the longer vibration to stop, but is suppressed until the interrupting vibration is completed.

### Gyro support

Controlify now has built-in support for controller gyroscopes, allowing you to make fine movements in-game.
This can be combined with [flick stick](https://www.reddit.com/r/gamedev/comments/bw5xct/flick_stick_is_a_new_way_to_control_3d_games_with/) to be able to use a controller without
the compromise of using the thumbsticks.

This requires use of a compatible controller, such as a Dualsense controller.

Currently, the Steam Deck is not supported, as it does not expose the gyro data to the OS, however, explicit
support for this device is planned in the future.

### Under-the-hood drivers

Controlify now uses a new driver system, which allows me to combine multiple libraries to create a more
powerful controller interface, with a modular system to mix and match drivers.

This means in the future, I can add more advanced features per-controller, such as Steam Deck touchpad and
back buttons explicitly supported in-game.

### Built-in resource pack for extra mappings

Controlify now has a built-in resource pack, which contains mappings and language files for the
aforementioned joystick.

The split was done to not modify the default language file, which would become huge in size and potentially cause merge
conflicts.

## Changes

There are multiple breaking API changes in this update, but as of writing, I am not aware of any
mods that utilise any of Controlify's APIs. This will not happen in minor updates when this mod is more popular.

- Ingame guide registry now takes a function that provides `IngameGuideContext`, rather than many parameters, this
  future-proofs the API if more parameters are added.
- Some ingame guide classes have moved inside the `api` package.
- Partial Chinese translation by [@GodGun968](https://github.com/GodGun968).

### Screen navigation improvements

Moving between components in GUIs feel more like most other games, where when holding the stick in a direction,
it moves once, waits a bit, and then moves through components quickly. Think holding down a key while you type.

### More controller identifications

More controllers are now identified out-of-box, particularly the PS3 and Dualsense controllers.

Along with that, DualSense, PS3 and Steam Deck now have textures.

### Improved crash handling

Where possible, Controlify now generates Minecraft crash reports with details of the controller which
caused the crash.

### Improved joystick mapping

Allows the mapping of joysticks to be more flexible, allowing for more complex mappings. This has been
battle-tested with a Thrustmaster TM.16000M FCS HOTAS joystick.

## Bug Fixes

- Fixed a bug where some in-game binds worked in containers. ([#35](https://github.com/isXander/Controlify/issues/35))
- Fix controllers not being detected half the time on startup.
- Fix unidentified controllers not being able to save configs.
- Fixed a bug where closing the pause menu or similar menu would cause you to trigger in-game inputs if
  bound to the same button
- Fixed YetAnotherConfigLib not being declared as a fabric dependency, causing crashes if not present.
