Skip to content

Sewer56/Sewer56.UI.Controller

Repository files navigation

Sewer56.UI.Controller



A basic library for UI Controller Navigation.
Made for Reloaded II, opened to all.

NuGet

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

// 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

.ReloadedInput Usage Guide

Consider first becoming familiar with the basic Reloaded.Input usage here.

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

Hopefully this can be useful 🤞.

About

UI Control Library Used by Reloaded-II. Fully custom.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages