Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sewer56/sewer56.ui.controller
UI Control Library Used by Reloaded-II. Fully custom.
https://github.com/sewer56/sewer56.ui.controller
Last synced: 19 days ago
JSON representation
UI Control Library Used by Reloaded-II. Fully custom.
- Host: GitHub
- URL: https://github.com/sewer56/sewer56.ui.controller
- Owner: Sewer56
- License: lgpl-3.0
- Created: 2022-07-01T21:42:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-01T18:46:08.000Z (about 2 years ago)
- Last Synced: 2024-10-04T01:18:50.721Z (about 1 month ago)
- Language: C#
- Size: 178 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Sewer56.UI.Controller
A basic library for UI Controller Navigation.
Made for Reloaded II, opened to all.
# Sewer56.UI.Controller
Sewer56.UI.Controller is a simple personal use library for navigating user interfaces via controllers (and/or other supported input devices). It is a modular library, allowing you to add your own custom backends for input and/or UI Platform.
## Usage
Basic usage of the library is as follows:
**Instantiation**
```csharp
// Create an IController, IPlatform and finally the Navigator
IController controller = new ReloadedInputController("Controller.json");
IPlatform platform = new WpfPlatform();
var navigator = new Navigator(Platform, Controller);// Callback for handling custom controls/input (if necessary)
platform.ProcessCustomInputs += ProcessCustomInputs;
```That's all you need to do, just keep the Navigator around so it doesn't get garbage collected.
**Modules**
Sewer56.UI.Controller consists of 3 modules:
- Core: The core library, contained in `Sewer56.UI.Controller.Core`.
- IPlatform: Abstracts a UI platform like WPF or WinForms. (e.g. `Sewer56.UI.Controller.WPF`).
- IController: Provides input support to the library. (e.g. `Sewer56.UI.Controller.ReloadedInput`)## Available Packages
- [Sewer56.UI.Controller.WPF](https://www.nuget.org/packages/Sewer56.UI.Controller.WPF): Adds basic WPF support to the library.
- [Sewer56.UI.Controller.ReloadedInput](https://www.nuget.org/packages/Sewer56.UI.Controller.ReloadedInput): Adds `Reloaded.Input` support to the library.
- [Sewer56.UI.Controller.ReloadedInput.Configurator](https://www.nuget.org/packages/Sewer56.UI.Controller.ReloadedInput.Configurator): Adds the `Reloaded.Input` Configurator to this library.### .ReloadedInput Usage Guide
Consider first becoming familiar with the [basic Reloaded.Input usage here](https://github.com/Sewer56/Reloaded.Input#usage).
The `ReloadedInputController` class exports the methods:
- `MapButton`: Maps a button to a button.
- `MapTriggerToButton`: Maps a controller trigger to a button. [Activates if >50% pressed]
- `MapCustomStickBehaviour`: Maps a stick to a button. [Activates if >75% moved]And cooresponding `UnMap` functions.
### .ReloadedInput.Configurator Usage Guide
Use `ReloadedInputControllerWithConfigurator` as your `IController`.
Call the `Configure` method to show the WPF powered configuration screen.Note: Configurator built with Reloaded II's Default Theme in mind.
Mileage may vary with custom themes.## Structure of Sewer56.UI.Controller
If you are interested in contributing to the library, the following diagram represents the internal structure of the library (at the time of writing):
![Library Structure](./docs/images/architecture-diagram.png)
Hopefully this can be useful 🤞.