Skip to content

Releases: Emik03/KeepCoding

[Hotfix] Fixed NullRef caused by ModInfo

22 Aug 00:19
Compare
Choose a tag to compare

[Hotfix] Fixed PathManager finding ModInfo

21 Aug 23:05
ecb214c
Compare
Choose a tag to compare
9.0.2

Security: Marked 9 and 9.0.1 as vulnerable

[Hotfix] Fixed updater + now overwrites itself

21 Aug 17:51
Compare
Choose a tag to compare
9.0.1

ModuleScriptEditor: Override itself when updating

Restructured PathManager

21 Aug 13:34
Compare
Choose a tag to compare

MAJOR

PathManager restructure

  • Fixed bug which caused modules to throw exceptions when played locally with demand-based mod loading enabled.
  • IOExceptions are now suppressed, default values are now returned instead. Refer to the XML or MD documentation to see the default values for each method.
  • Removed methods where generics and types are passed in; this is now done implicitly just by calling the method and looking at the stack-trace to find the caller.
  • Rewrote the entire structure of PathManager to cache the results of every mod only once and by looking in the dictionary provided by the game as oppose to looking for each file. Performance significantly increased.

Additions

  • Added compatibility for vanilla modules to hook OnModuleSolved and OnModuleStrike.
  • Added ConsecutiveGroup, CustomComparer and UtilityExtensions, from RT.Util.Core
  • Added Profiler, allowing an easy of measuring code performance.
  • Added StringifyFormat class for customizing Helper.Stringify

Changes

  • Changed BigInteger to a new BigInt implementation by Timwi. Performance is better with more operators overloaded.
  • Changed Game.Vanilla to only return vanilla modules instead of all vanilla components that would be added to each module, modded-or-not.
  • Changed Helper.Modulo to return right-hand side negative values correctly by inverting the result.
  • Changed Number to be a struct rather than a class.
  • Changed OnSolvableSolved to OnModuleSolved.
  • Changed ToArray in TupleBase to Items, and subsequently all tuple types that inherit from TupleBase. Changed return type of KeyHelper.Catch to a Func<T>/Action to call it to be stackable.

Removals

  • Removed ability to implicitly convert an Array, string, or any object to BigInteger and passing them in a constructor. A BigInt.Parse exists for strings, the other ones aren't needed.
  • Removed deprecated OnActivate in ModuleContainer. Use Assign(onInteract: Action) instead.
  • Removed implicit casting from and to ValueType to Number.
  • Removed OnNeedySolved since not all modules necessarily solve when deactivated, causing inconsistent behavior.
  • OnModuleSolved and OnModuleStrike pass a ModuleContainer instead of a string. You can still access the module id with module.Id.
  • Removed Unwrap, and in-place added Combine which is a simpler Unwrap, and Stringify which is a much more complex version with customizable formatting.

MINOR

Additions

  • Added Add and Set overloads for Vector2Int and Vector3Int in TypeHelper.
  • Added Alphabet constant in Helper.
  • Added Game.References which indicates which library it references for Game. This value may only be modified by trusted sources.
  • Added IsAny<T>() and IsAll<T>() in Helper.
  • Added OnInteractSequence() overload in TPScript that allows you to press a sequence of buttons, just as you would yield returning a KMSelectable[].
  • Added overloads for IsBetween() in Helper.
  • Added ToReadOnly<T>() in Helper, which converts IEnumerable<T> to ReadOnlyCollection<T>.
  • Added ToString() in ModuleContainer.
  • Added Yield<T>() in KeyHelper.
  • Added Zip extension methods in Helper. Back-port of Enumerable.Zip

Changes

  • Changed Stringifier to unwrap dictionaries correctly and allowing for custom specified formatting with StringifyFormat.

PATCH

Additions

  • Added private ModuleId property for compatibility with LFA.

Changes

  • Changed OnInteractSequence() in TPScript to yield break instead of throwing a NullReferenceException when selectables is null.
  • Changed Helper.Combine to allow the parameter self to be null rather than throwing a NullReferenceException.
  • Changed ModuleScript to automatically now run Assign by default during Awake. This is so that the needy events get hooked with IsNeedyActive.
  • Changed Sound's explicit conversion to SoundEffect to throw a specific exception when Game is null.

Optimizations

  • Improved performance by making PathManager cache results for every other mod that is currently loaded, such that other modules using the same version of this library can grab information from the cached result.
  • Improved performance by only hooking modules if OnModuleSolved and/or OnModuleStrike is overriden.
  • Improved performance by only running colorblind when OnColorblindChanged is overriden.

Fixed conflict with Log Viewer Hotkey

26 Jul 15:57
Compare
Choose a tag to compare
  • Add button to download latest version if a newer version exists.
  • Add KeepCoding.Internal namespace to hide some of the classes that aren't useful but serve to help the library.
  • Add OnAwake() to ModuleScript such that calling the base Awake can be avoided by using this method instead.
  • Add parameter to Game.AddStrikes and Game.SetStrikes to test whether or not the bomb needs to explode.
  • Fix Find<T>() in CacheableBehaviour.
  • Remove autosolve on exception due to conflicts with Log Viewer Hotkey.
  • Remove IsEmpty from TupleBase, you can just do a type comparison or type generic count instead.
  • Remove ITuple interface as TupleBase offers a non-generic tuple type already, and isn't meant to be expanded.

Colorblind fixes

16 Jul 21:18
Compare
Choose a tag to compare
  • Added ModuleScriptEditor class which gives a button during editor play mode to enable/disable colorblindness if the method is overriden.
  • Changed ColorblindInfo to no longer look in directories while in the Editor.
  • Fixed ColorblindInfo unable to be serialized due to a missing attribute.

Added colorblind support and improved TP support

16 Jul 03:04
Compare
Choose a tag to compare
  • Added a wad of method overloads in KeyHelper.
  • Added colorblind support in ModuleScript.
  • Added ColorblindInfo class, allowing you to access and store information about the colorblind mod.
  • Added Dump() overload from Logger and IDump.
  • Added Flatten() in Helper which flattens an IEnumerator.
  • Added JsonSerializerSettings parameter from Deserializer() in ModInfo.
  • Added Randomize<T>() in Helper which shuffles IEnumerators.
  • Added ReflectionScript to help get any data during Editor runtime.
  • Changed AudioScript to exist in the global namespace. This is to address a bug where in-game this component type could not be grabbed.
  • Changed bool cast to be explicit in Number.
  • Changed TPScript to support proper nested IEnumerator handling.
  • Fixed Assign lacking an onStateChange default parameter value in EventHelper.
  • Fixed editor-only request for version number being sent to GitHub for every instantiation of a module.
  • Fixed inaccessible Reverse() methods in ArrayHelper.
  • Removed WrongDatatypeException because UnrecognizedTypeException works similarly.

[Hotfix] Added null checks to KeyHelper and fixed For<T>()

11 Jul 01:33
Compare
Choose a tag to compare
6.0.1

KeyHelper: Add null checks on arguments

3 new classes: CacheableBehaviour, KeyHelper, Number

10 Jul 19:51
Compare
Choose a tag to compare
  • Added CacheableBehaviour, a MonoBehaviour with Cache<T> methods from ModuleScript. Every other MonoBehaviour script in this library inherits from this script for maximum flexibility.
  • Added constructor parameter to specify compliancy with the Logfile Analyzer in Logger.
  • Added GetChild<T>(), GetChildren<T>(), GetParent<T>(), and GetParents<T>() in CacheableBehaviour.
  • Added KeyHelper, which allows inline methods for keyword-functionality, including accessing keywords not normally present in C# 4.
  • Added Number class, allowing for abstraction of primitive numeric values.
  • Added Reverse() string overload in Helper.
  • Added SplitEvery<T>() method in Helper.
  • Added static getters for in-game sound effects in Sound.
  • Changed primitive numeric casting to Number in BigInteger.
  • Renamed GetAll<T>() to Gets<T>() to be consistent with other methods in CacheableBehaviour.
  • Fixed a crash when doing PlaySound() with more than 2 KMAudio components. An exception is raised instead.

Fixed crash on invalid sound

05 Jul 02:03
Compare
Choose a tag to compare
  • Added AudioClips property in AudioScript.
  • Added MasterAudio subclass in Game.
  • Fixed ModuleScript to log if a custom sound is unable to be found within the prefab instead of crashing the game.