Releases: Emik03/KeepCoding
Releases · Emik03/KeepCoding
[Hotfix] Fixed NullRef caused by ModInfo
9.0.3 Re-version bump
[Hotfix] Fixed PathManager finding ModInfo
9.0.2 Security: Marked 9 and 9.0.1 as vulnerable
[Hotfix] Fixed updater + now overwrites itself
9.0.1 ModuleScriptEditor: Override itself when updating
Restructured PathManager
MAJOR
PathManager restructure
- Fixed bug which caused modules to throw exceptions when played locally with demand-based mod loading enabled.
IOException
s 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
andOnModuleStrike
. - Added ConsecutiveGroup, CustomComparer and UtilityExtensions, from
RT.Util.Core
- Added
Profiler
, allowing an easy of measuring code performance. - Added
StringifyFormat
class for customizingHelper.Stringify
Changes
- Changed
BigInteger
to a newBigInt
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 astruct
rather than aclass
. - Changed
OnSolvableSolved
toOnModuleSolved
. - Changed
ToArray
inTupleBase
toItems
, and subsequently all tuple types that inherit fromTupleBase
. Changed return type ofKeyHelper.Catch
to aFunc<T>
/Action
to call it to be stackable.
Removals
- Removed ability to implicitly convert an
Array
,string
, or anyobject
toBigInteger
and passing them in a constructor. ABigInt.Parse
exists for strings, the other ones aren't needed. - Removed deprecated
OnActivate
inModuleContainer
. UseAssign(onInteract: Action)
instead. - Removed implicit casting from and to
ValueType
toNumber
. - Removed
OnNeedySolved
since not all modules necessarily solve when deactivated, causing inconsistent behavior. OnModuleSolved
andOnModuleStrike
pass aModuleContainer
instead of astring
. You can still access the module id withmodule.Id
.- Removed
Unwrap
, and in-place addedCombine
which is a simplerUnwrap
, andStringify
which is a much more complex version with customizable formatting.
MINOR
Additions
- Added
Add
andSet
overloads forVector2Int
andVector3Int
inTypeHelper
. - Added
Alphabet
constant inHelper
. - Added
Game.References
which indicates which library it references forGame
. This value may only be modified by trusted sources. - Added
IsAny<T>()
andIsAll<T>()
inHelper
. - Added
OnInteractSequence()
overload inTPScript
that allows you to press a sequence of buttons, just as you wouldyield return
ing aKMSelectable[]
. - Added overloads for
IsBetween()
inHelper
. - Added
ToReadOnly<T>()
inHelper
, which convertsIEnumerable<T>
toReadOnlyCollection<T>
. - Added
ToString()
inModuleContainer
. - Added
Yield<T>()
inKeyHelper
. - Added
Zip
extension methods inHelper
. Back-port ofEnumerable.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()
inTPScript
toyield break
instead of throwing aNullReferenceException
whenselectables
isnull
. - Changed
Helper.Combine
to allow the parameterself
to be null rather than throwing aNullReferenceException
. - Changed
ModuleScript
to automatically now runAssign
by default duringAwake
. This is so that the needy events get hooked withIsNeedyActive
. - Changed
Sound
's explicit conversion toSoundEffect
to throw a specific exception whenGame
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/orOnModuleStrike
is overriden. - Improved performance by only running colorblind when
OnColorblindChanged
is overriden.
Fixed conflict with Log Viewer Hotkey
- 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()
toModuleScript
such that calling the baseAwake
can be avoided by using this method instead. - Add parameter to
Game.AddStrikes
andGame.SetStrikes
to test whether or not the bomb needs to explode. - Fix
Find<T>()
inCacheableBehaviour
. - Remove autosolve on exception due to conflicts with Log Viewer Hotkey.
- Remove
IsEmpty
fromTupleBase
, you can just do a type comparison or type generic count instead. - Remove
ITuple
interface asTupleBase
offers a non-generic tuple type already, and isn't meant to be expanded.
Colorblind fixes
- 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
- 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 fromLogger
andIDump
. - Added
Flatten()
inHelper
which flattens anIEnumerator
. - Added
JsonSerializerSettings
parameter fromDeserializer()
inModInfo
. - Added
Randomize<T>()
inHelper
which shufflesIEnumerator
s. - 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 nestedIEnumerator
handling. - Fixed
Assign
lacking anonStateChange
default parameter value inEventHelper
. - Fixed editor-only request for version number being sent to GitHub for every instantiation of a module.
- Fixed inaccessible
Reverse()
methods inArrayHelper
. - Removed WrongDatatypeException because UnrecognizedTypeException works similarly.
[Hotfix] Added null checks to KeyHelper and fixed For<T>()
6.0.1 KeyHelper: Add null checks on arguments
3 new classes: CacheableBehaviour, KeyHelper, Number
- Added
CacheableBehaviour
, aMonoBehaviour
withCache<T>
methods fromModuleScript
. Every otherMonoBehaviour
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>()
, andGetParents<T>()
inCacheableBehaviour
. - 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 inHelper
. - Added
SplitEvery<T>()
method inHelper
. - Added static getters for in-game sound effects in
Sound
. - Changed primitive numeric casting to
Number
inBigInteger
. - Renamed
GetAll<T>()
toGets<T>()
to be consistent with other methods inCacheableBehaviour
. - Fixed a crash when doing
PlaySound()
with more than 2KMAudio
components. An exception is raised instead.
Fixed crash on invalid sound
- Added
AudioClips
property inAudioScript
. - Added
MasterAudio
subclass inGame
. - Fixed
ModuleScript
to log if a custom sound is unable to be found within the prefab instead of crashing the game.