HolloFox_TS-RadialUIPlugin icon

RadialUIPlugin

This is a developer tool based package used to help devs easily configure UI Radial Menus.

Last updated 3 weeks ago
Total downloads 1199
Total rating 0 
Categories Client-side Tools
Dependency string HolloFox_TS-RadialUIPlugin-1.4.1
Dependants 14 other mods depend on this mod

This mod requires the following mods to function

bbepisTaleSpire-BepInExPack-5.4.10 icon
bbepisTaleSpire-BepInExPack

Unified BepInEx all-in-one modding pack - plugin framework, detour library

Preferred version: 5.4.10
brcoding-SetInjectionFlagPlugin-2.3.0 icon
brcoding-SetInjectionFlagPlugin

Allows players to flag mods are installed

Preferred version: 2.3.0

README

Radial UI Plugin

This is a plugin for TaleSpire using BepInEx.

Install

Currently you need to either follow the build guide down below or use the R2ModMan.

Usage

This plugin is specifically for developers to easily implement extra Radial buttons based on a entity properties.
Developers should reference the DLL for their own projects. This does not provide anything out of the box.

Example Usage

    void Awake()
        {

        // Adds Callbacks to append new mapmenu item
            AddOnCharacter(Guid, new MapMenu.ItemArgs
            {
                Action = Action,
                Title = "On Character",
                CloseMenuOnActivate = true
            }); // Callback comparator is optional

            AddOnCanAttack(Guid, new MapMenu.ItemArgs
            {
                Action = Action,
                Title = "On Can Attack",
                CloseMenuOnActivate = true
            }, Check);

            AddOnCantAttack(Guid, new MapMenu.ItemArgs
            {
                Action = Action,
                Title = "On Cant Attack",
                CloseMenuOnActivate = true
            }, Check);

            AddOnHideVolume(Guid, new MapMenu.ItemArgs
            {
                Action = Action,
                Title = "On HideVolume",
                CloseMenuOnActivate = true
            }, Check2);
        }

        private Boolean Check(NGuid selectedCreature, NGuid creatureTargetedFromRadial)
        {
            Debug.Log($"{selectedCreature},{creatureTargetedFromRadial}");
            return true;
        }

        private Boolean Check2(HideVolumeItem args2)
        {
            Debug.Log($"{args2}");
            return true;
        }

        private void Action(MapMenuItem args, object args2) => Debug.Log($"{args},{args2}");

Loading a Sprite

Dimensions for sprites should be 32 by 32, Below is an example script supplied by LordAshes loading in
an image to be used as an icon for the new Radial Component.

string dir = "path to directory";
Texture2D tex = new Texture2D(32, 32);
tex.LoadImage(System.IO.File.ReadAllBytes(dir + "Images/Icons/KO.Png"));
Sprite icon = Sprite.Create(tex, new Rect(0, 0, 32, 32), new Vector2(0.5f, 0.5f));

How to Compile / Modify

Open RadialUIPlugin.sln in Visual Studio.

You will need to add references to:

* BepInEx.dll  (Download from the BepInEx project.)
* Bouncyrock.TaleSpire.Runtime (found in Steam\steamapps\common\TaleSpire\TaleSpire_Data\Managed)
* UnityEngine.dll
* UnityEngine.CoreModule.dll
* UnityEngine.InputLegacyModule.dll 
* UnityEngine.UI
* Unity.TextMeshPro

Build the project.

Browse to the newly created bin/Debug or bin/Release folders and copy the RadialUIPlugin.dll to Steam\steamapps\common\TaleSpire\BepInEx\plugins

Changelog

  • 1.4.1: Fixed problem of dissapearing root
  • 1.4.0: Add ability to remove existing buttons to replace them.
  • 1.3.1: fixed backwards compatability due to paramater signature.
  • 1.3.0: Expand Submenu to allow a checker
  • 1.2.5: Privatized method and new method to return last creature selected from menu.
  • 1.2.4: Image not found does not block radial from loading
  • 1.2.3: bugfix
  • 1.2.2: Add size submenu hook
  • 1.2.1: Delay callback to fix forms
  • 1.2.0: Add hooks to character submenus, Added code to manage submenus.
  • 1.1.1: Add Docs on how to implement submenus
  • 1.1.0: Removed Modding Utils and display on main menu
  • 1.0.2: Fixed Issue on radial breaking upon leaving board
  • 1.0.0: Initial release

Shoutouts

Shoutout to my Patreons on https://www.patreon.com/HolloFox recognising your
mighty contribution to my caffeine addiciton:
- John Fuller
- Tales Tavern - MadWizard

Lord Ashes providing dependent code unify snippet controlling submenus.

Available versions

Please note that the install buttons only work if you have compatible client software installed, such as the Thunderstore Mod Manager. Otherwise use the zip download links instead.

Upload date Version number Downloads Download link  
2021-7-7 1.4.1 618 Version 1.4.1 Install
2021-7-3 1.4.0 148 Version 1.4.0 Install
2021-7-1 1.3.1 63 Version 1.3.1 Install
2021-7-1 1.3.0 8 Version 1.3.0 Install
2021-6-28 1.2.5 71 Version 1.2.5 Install
2021-6-26 1.2.4 38 Version 1.2.4 Install
2021-6-20 1.2.3 105 Version 1.2.3 Install
2021-6-20 1.2.2 11 Version 1.2.2 Install
2021-6-20 1.2.1 10 Version 1.2.1 Install
2021-6-19 1.2.0 17 Version 1.2.0 Install
2021-6-18 1.1.1 29 Version 1.1.1 Install
2021-6-16 1.1.0 36 Version 1.1.0 Install
2021-6-14 1.0.2 26 Version 1.0.2 Install
2021-6-14 1.0.1 8 Version 1.0.1 Install
2021-6-14 1.0.0 11 Version 1.0.0 Install