You are viewing a potentially older version of this package. View all versions.
darmuh-OpenLib-0.1.7 icon

OpenLib

Open-source development library for LethalCompany, initially created for use with darmuh's Mods

Date uploaded a month ago
Version 0.1.7
Download link darmuh-OpenLib-0.1.7.zip
Downloads 4223
Dependency string darmuh-OpenLib-0.1.7

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

OpenLib

Open-source development library for LethalCompany

  • Initially ported from darmuhsTerminalStuff, this is a library of commonly used methods from darmuh's mods. Allowing for flexible additions to the terminal.
  • This will remain open to the public for collaborative efforts. All I (darmuh) ask is that you maintain compatibility with any mod that uses this library.

Current Features:

  • ManagedConfig class will let you watch and assign values to certain config items.
    • Currently supporting ManagedBools and ManagedStrings
    • when a change is detected to the assigned value, your managedconfig item will also update.
    • use this to manage your keyword creation/removal between lobby loads.
    • also provides support for a networking configuration option via ConfigSetup.NetworkingCheck
  • Terminal Keyword/Node creation with flexibility in mind.
    • Create simple commands that can use multiple keywords.
    • Create shop nodes that will be added to the furniture rotation list
    • Create complex commands that require confirmation
    • All added keywords are tracked by this library and will be deleted upon Terminal Disable (closing the lobby)
  • Terminal Menu System
    • Create your own command menu listing with categories and a list of commands under each category.
    • Ported from darmuhsTerminalStuff for general use
    • Optionally add a reference to this menu in the other commands listing
  • Modify already existing terminal node displayText
    • Will gracefully remove new line spaces to add your content and then add newlines below your content.
  • Assign new keywords to already existing nodes.
  • Event system lets you subscribe to all manners of Terminal patches. See EventUsage for examples on how to subscribe to these events.
  • Patches into the Awake method for the Teleporter class and provides referenceable Teleporter instances for both the normal teleporter and inverse teleporter

The plan is to have this library support all of my mods (darmuhsTerminalStuff, ghostCodes, and suitsTerminal). So this library will likely have more features in the future

Currently Supports:

  • darmuhsTerminalStuff version 3.3.0+
  • suitsTerminal 1.4.0+

Icon Attribution: Online library icons created by Ajmal Naha - Flaticon

CHANGELOG

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog.

[0.1.8]

  • Added AddToHelpCommand method.
  • Adjusted some other small things

[0.1.7]

  • Added GetKeywordsPerConfigItem overload that allows for specifying separator char.
  • Added some WIP methods in AddingThings, use at your own-risk.
  • adjusted keyword check to be case in-sensitive
  • made it so "specialString" in managedconfig items does not have to match the keyword
  • Added RemoveCompatibleNoun method in RemoveThings.cs
  • Added new patch/event StartOfRoundChangeLevel
  • Added AssembleMainMenuText overload for when you're not using ManagedConfig stuff
  • Added Plugin.WARNING shortcut for LogWarning messages

[0.1.6]

  • Added soft compatibility method in Common.StartGame
    • Call this method with the GameNetworkManagerStart Event to set your soft compatibility bools.
  • Adjusted some methods that dont have any public use to be internal
  • Removed duplicate method in CoreMethods.CommonThings
  • Added some more public methods to Common.Misc for getting/setting color via hexcode config
  • Updated terminal menus to display category names in upper case to be more in-line with vanilla terminal menus.

[0.1.5]

  • Adjusted some logging messages.
  • Fixed error being thrown by invalid input during TerminalParseSent event.

[0.1.4]

  • Updated ManagedConfig items to indicate what type they are (bool or string)
    • can expand to floats/ints/etc. later if needed
  • Updated Managedbool and ManagedString methods to include the configtype at creation/modification
  • Updated TryGetItemByName to indicate ConfigType as a parameter
    • this is to ensure you are getting the config item you are looking for specifically
  • Updated NetworkingCheck method to properly iterate through a config file

[0.1.3]

  • Removed property "count" from MainListing class.
    • This was causing an odd interaction where menus would not update their displaytext properly due to this property being equal to 0.
    • updated any usage of the count property to the Listing property's "Count"

[0.1.2]

  • Fixed manifest link to the correct github page

[0.1.1]

  • Added bool check ShouldAddCategoryNameToMainMenu for MenuBuild in darmuhsTerminalStuff

[0.1.0]

  • Initial release with usage by darmuhsTerminalStuff
  • Replaced ManagedBool class with ManagedConfig, as I am also managing string config items.
  • Added some more overloads for use in terminalstuff. ReadConfigAndAssignValues should only need to be called on full config reload.
    • Singular config item change event can be subscribed to in bepinex.
    • see CheckChangedConfigSetting in ConfigMisc
      • This will update any corresponding ManagedConfig item whether it's a bool or a string.
    • ShouldReloadConfigNow is unused at this point, since the ManagedConfig class could be modified directly in the config item change event bepinex provides
  • Ported menu handling system from terminalstuff to this library. See terminalstuff for an example on usage.
  • Decided against defining EVERYTHING when creating the config option.
    • Instead you can bind the config option, then directly after it you can define your managedconfig item with either managedbool or managedstring.
  • Cleaning as much as possible back to a blank state at TerminalDisable event (with exception to managedconfig items)
  • Added overload for getting new displaytext from multiple listings.
    • Only use-case I see for it right now is terminalstuff's node syncing feature but who knows it may be useful in the future.
    • There is an event you can subscribe to when getnewdisplaytext is called, however, I'd recommend against it as it can be called multiple times.
  • Added support for adding your terminal command to the Other command listing when category is set to "Other"
    • With this support there is also accessible methods for adding text to an existing node
    • Also added support for adding your terminal menu command to the other listing, an example of this is in terminalStuff with the "more" command
  • If for whatever reason you need a config to reload on terminal disable, you can add it to the list configsToReload in EventUsage.cs
    • Not using this at all at the moment.

[0.0.1]

  • Began port of commonly used functions between my (darmuh) own personal mods. This mod was created by creating a clone of darmuhsTerminalStuff.