NuK3Modpack

版本 v1.0.0·更新於 2024-06-11

Modpack for me and my friends

模組介紹 作者原文

LethalCompany InputUtils

Utilities for creating InputActions and having them be accessible in-game.

InputActions created through this mod are accessible in-game via the keybinds menu added in update v45.

For feature requests or issues head over to my repo

General Users

This mod is just a dependency for other mods, it doesn't add content, but it allows mods to add keybinds.

Where are my bind overrides stored?

Depends on the version of InputUtils:

  • >= 0.4.1 BepInEx/config/controls
  • /g", Name = "Explode")]

public InputAction ExplodeKey { get; set; }

[InputAction("/h", Name = "Another")]

public InputAction AnotherKey { get; set; }

}

Using Attributes

  • Create instance properties for all desired InputActions
  • Annotate the instance properties with the [InputAction(...)] annotation

[!IMPORTANT]

For actions to be registered to the API, Properties MUST be annotated with [InputAction(...)]**

[InputAction("YourkbmPath", Name = "", GamepadPath = "", KbmInteractions = "", GamepadInteractions = "", ActionID = "", ActionType = InputActionType...)]

Required Parameters

  • kbmPath: The default bind for Keyboard and Mouse devices

Optional Parameters

  • Name: The Displayed text in the game keybinds menu
  • GamepadPath: The default bind for Gamepad devices
  • KbmInteractions: Sets the interactions of the kbm binding. See Interactions Docs
  • GamepadInteractions: Sets the interactions of the gamepad binding. See Interactions Docs
  • ActionID: Overrides the generated actionId (Generally you don't want to change this)
  • ActionType: Determines the behavior with which the action triggers. See ActionType Docs

So your Attribute could be written like this:

[InputAction("/minus", Name = "Explode")]

public InputAction ExplodeKey { get; set; }

Or with any combination of optional parameters:

[InputAction("/minus", Name = "Explode", GamepadPath = "/Button North", KbmInteractions = "hold(duration = 5)")]

public InputAction ExplodeKey { get; set; }

[!NOTE]

In this case above the Hold Interaction is being used. This keybind triggers after being held for 5 seconds. See Interactions Docs

At Runtime

  • Override Method void CreateInputActions(in InputActionMapBuilder builder)
  • Use the builder to create InputActions
  • Reference InputAction by calling Asset["actionId"] in your class

[!IMPORTANT]

Make sure you call Finish() after you're done creating each InputAction.

Here's an example usage of the runtime api

public class MyExampleInputClass: LcInputActions

{

public static readonly MyExampleInputClass Instance = new();

public InputAction ExplodeKey => Asset["explodekey"];

public override void CreateInputActions(in InputActionMapBuilder builder)

{

builder.NewActionBinding().WithActionId("explodekey").WithActionType(InputActionType.Button).WithKbmPath("/j").WithBindingName("Explode").Finish();

}

}

Referencing Your Binds

To use your InputActions class, you need to instantiate it.

[!IMPORTANT]

Do not create more than one instance of your InputActions class.

If your class is instantiated more than once, your InputActions are unlikely to work as intended.

The easiest (opinionated) way to do so would be to have a static instance in your plugin class.

[BepInPlugin(...)]

[BepInDependency("com.rune580.LethalCompanyInputUtils", BepInDependency.DependencyFlags.HardDependency)]

public class MyExamplePlugin: BaseUnityPlugin

{

internal static MyExampleInputClass InputActionsInstance = new MyExampleInputClass();

}

You could also opt for instantiating the instance in the InputActions class (Singleton-style).

public class MyExampleInputClass: LcInputActions

{

public static MyExampleInputClass Instance = new();

[InputAction("explodekey", "/j", "/Button North", Name = "Explode")]

public InputAction ExplodeKey { get; set; }

}

[!IMPORTANT]

But How Do I Get My Binds String?

You may have noticed that /yourKey can be a little confusing for the special buttons. So try this:

  • First, arbitrarily set the value to some regular value or just an empty stri

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

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

Hypick-BetterShotgunBepInEx-BepInExPackFlipMods-ReservedItemSlotCoreRugbugRedfern-SkinwalkersEvaisa-LethalLibanormaltwig-LateCompanyFlipMods-ReservedFlashlightSlotx753-Mimics

檔案與校驗

檔案名稱
NuK3Modpack-1.0.0.zip
檔案大小
18.3 KiB