GUIMenuPlugin

版本 v1.2.0·更新於 2024-04-01

Add text/icon menus that appear in centre of screen or slide out the right side. Support for multi-layer hierarchy.

模組介紹 作者原文

GUI Menu Plugin

This unofficial TaleSpire plugin allows the user to text and icon menus similar to the radial menu but in the centre

of the screen or as a side out from the right side of the screen. The GUI Menu plugin allows any number of menu with

links between any menus so you can construct anything from simple hierarchies to complex hierarchies.

Change Log

1.2.0: Added support for different sized icons and offsets

1.0.0: Initial release

Install

Use R2ModMan or similar installer to install this plugin.

Usage (User)

This plugin does not offer any direct functionality. Typically this will be installed as a dependency for some other plugin.

As such there is no user usage beyond that of what the parent plugin may provide.

Usage (Developer)

The GUI Menu Plugin uses a three tier hierarchy to create the menus: GuiMenu, MenuNode, two implementations of IMenuItem

which are MenuLink and MenuSelection.

A GuiMenu holds the entire hierarchy for the menu. For example, if the main menu had two selections for two sub-menus then

the GuiMenu object would hold all 3 Nodes (menus) - the main one and the two sub-menus.

A MenuNode holds all of the options for one particular menu. In the case of the example with two sub menus, there would be

three MenuNodes - one for the main menu and one for each of the two sub-menus. MenuNodes hold IMenuItems are which there

are two types: MenuLink and MenuSelection. They also hold additional internal information about the Node like the state.

IMenuItem is an interface for creating items that a menu (MenuNode) can contain. Currently there are two implementations of

the IMenuIntem interface: MenuLink and MenuSelection. Most of the properties for these items are the same such as title,

text color, texture, and gmOnly. However, each gave an addition property and perform a different task.

MenuLink has a link property. This property contains the name of a MenuNode and causes the current menu to be closed and

the specified menu to be opened. Normally used to navigate from one menu to another such as from a parent menu to a child

menu or from a child to a parent menu. However, the link feature is geenric so links can be made to any other MenuNode

meaning that complex menus can jump from any menu to any other menu.

MenuSelection has a selection property. This property is contains the value that is sent to the callback when the item is

selected.

While the GUI Menu Plugin does support a number of different ways to create the hierarchy of the GUI Menu, one of the

simplest methods is show below:

GUIMenuPlugin.GuiMenu menu = new GUIMenuPlugin.GuiMenu(new GUIMenuPlugin.MenuNode

{

new GUIMenuPlugin.MenuNode("Root", new GUIMenuPlugin.IMenuItem

{

new GUIMenuPlugin.MenuLink("Menu1","Menu1",UnityEngine.Color.red,FileAccessPlugin.Image.LoadTexture("Menu1.png"),false),

new GUIMenuPlugin.MenuLink("Menu2","Menu2",UnityEngine.Color.red,FileAccessPlugin.Image.LoadTexture("Menu2.png"),false)

}, GUIMenuPlugin.MenuStyle.centre),

new GUIMenuPlugin.MenuNode("Menu1", new GUIMenuPlugin.IMenuItem

{

new GUIMenuPlugin.MenuLink("Root","Back",UnityEngine.Color.red,FileAccessPlugin.Image.LoadTexture("Back.png"),false),

new GUIMenuPlugin.MenuSelection("Item1","Item1",UnityEngine.Color.red,FileAccessPlugin.Image.LoadTexture("Item1.png"),false),

new GUIMenuPlugin.MenuSelection("Item2","Item2",UnityEngine.Color.red,FileAccessPlugin.Image.LoadTexture("Item2.png"),false)

}, GUIMenuPlugin.MenuStyle.centre),

new GUIMenuPlugin.MenuNode("Menu2", new GUIMenuPlugin.IMenuItem

{

new GUIMenuPlugin.MenuLink("Root","Back",UnityEngine.Color.red,FileAccessPlugin.Image.LoadTexture("Back.png"),false),

new GUIMenuPlugin.MenuSelection("Item3","Item3",UnityEngine.Color.red,FileAccessPlugin.Image.LoadTexture("Item3.png"),false),

new GUIMenuPlugin.MenuSelection("Item4","Item4",UnityEngine.Color.red,FileAccessPlugin.Image.LoadTexture("Item4.png"),false)

}, GUIMenuPlugin.MenuStyle.centre)

});

You can change the icon size and offset with

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

bbepisTaleSpire-BepInExPackbrcoding-SetInjectionFlagPlugin

檔案與校驗

檔案名稱
GUIMenuPlugin-1.2.0.zip
檔案大小
28.6 KiB