Extends the SE component with various Papyrus additions. #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Synopsis
bool AddItemsBulk(Form[] items, int[] count, bool remove = false)
Adds to -or removes from- the container, count instances of the passed forms in a single operation. Mass addition/removal of items can also be achieved by the native AddItems if given a formlist as argument, but this will quickly send OnItemAdded notifications to all listeners, which can overwhelm the VM resulting in stack dumps and massive slowdowns. This function avoids that undesired side effect, and offers the added benefits of not requiring formlists and allowing fine tuning of the added/removed amounts.
int container.GetItemCountCached(Form item, bool refresh = false)
Upon the first call, the contents of the container are cached and subsequent calls simply retrieve the cached value without looking up the container. Much faster than the native GetItemCount. Intended for use when successive calls are required and the container's contents are known not to change.
int[] GetItemsCount(Form[] items]
Due to the frametime sync call overhead, GetItemCountCached is unsuitable for processing large arrays of items. This wrapper uses GetItemCountCached internally to processes an entire array in a single call and -usually- frame.
float RestoreItemCharge(Weapon wepn, bool all = false)
While there are other charge functions, this one works directly on forms inside containers. It restores and returns the missing charge of the first pertinent entry in the extradata list. Or all of them if all is true.
float GetDisplayValue(form item) native
There's already a function that returns a form's base value, however the final value can vary widely from this amount depending on enchantments, temper status and other factors. This function returns the real display value, as shown on the UI.
int GetSkillRequirement(string actorvalue)
Returns the skill level needed to acquire this perk.