This guide will teach you a variety of things including:
How to add a Brutton to the MapBar
How to Interact with objects to seamlessly Push and Pop Screens using Objects
How to create Custom Screens and ViewModels
————————————————————————————————————
Outline
Rationale
Required Knowledge
SetUp
Part I : Add Button to MapBar
Part II: Configure Navigation Elements
Part III: Setting up your Screen and View Model
Part IV: Configure SubModule and Launch!
————————————————————————————————————
Rationale
There are much simpler approaches to pushing Screens. However, working with the game objects the way the creators intend will ensure that your mod can scale without hiccups. Furthermore, once you get the hang of this, you will be able to fully take command over GauntletUI objects!
————————————————————————————————————
Required Knowledge
Before we begin, it is important that you know how to do a few things:
Setup a .NET (C#) environment in Rider or Visual Studio
Create basic Prefab Objects (Templates will be Provided)
How to install NuGet Packages in your respective Integrated Development Environment (IDE)
Setting up SubModules
If you need help in any of these areas, please consult these links:
The MapBar is the UI element you see all the time. It’s the bar that has your Inventory, Clan, Kingdom, and other buttons. So it’s a great place to seamlessly add in your own custom button.
Before we get started, it’s a good idea to use my ExampleButton template. Create a file called
ExampleButton.xml in this location. You may need to create this directory.
YourModule/GUI/PrefabExtensions/
Template Code:
now copy this template code and put it into the XML file.
Now that we have added the button using the patcher, we need to implement a custom action that will be taken when you click on it. To do this we will also use UIExtenderLib
Create a class file called CustomMapVM and inherit the BaseViewModelMixin<MapNavigationVM> class.
Now, copy this code to proceed
[ViewModelMixin]
public class CustomMapVM : BaseViewModelMixin<MapNavigationVM>
{
public CustomMapVM(MapNavigationVM vm) : base(vm)
{ }
// Add Your MapBar Button Methods Here
[DataSourceMethod]
public void ExecuteOpenScene()
Want to print your doc? This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (