Repository navigation
[Lib] PlusHelper
Small shared helpers for Pilot Level Up Skills packs (More+, Legendary+, RebalanceCore+, etc.). Centralizes exclusion groups, WeaponPreview group registration, phase conversion between DamageModifierLib and WeaponPreview, and icon preview helpers.
Any issues or concerns? Join the Redacted Rice Discord and @Das Keifer
A library providing shared helpers for Pilot Level Up Skills mods. Loaded with the Redacted Rice libs pack.
Constants:
| Name | Type | Description |
|---|---|---|
GROUP_ID |
string |
"more_plus_levelup_skills" - primary WeaponPreview group |
QUEUED_GROUP_ID |
string |
"more_plus_levelup_skills_queued" - queued preview group |
GROUP_OFFSET |
Point | Point(-25, 11) |
QUEUED_GROUP_OFFSET |
Point | Point(-18, -4) |
Shared exclusion/relatedness groups for CPLUS+ Ex skill registration:
| Field | Type | Description |
|---|---|---|
ADD_GRID_DEF |
string | "Add Grid Def" |
ADD_REACTOR |
string | "Add Reactor" |
BOOST |
string | "Boost" |
STATUS_BASED |
string | "Status Based" |
REVIVE |
string | "Revive" |
MOVE_TYPE |
string | "Move Type" |
SHIELD |
string | "Shield" |
ADD_DAMAGE |
string | "Add Damage" |
ITEM_DROP |
string | "Item Drop" |
Example:
constraints = {
groups = {PlusHelper.GROUPS.ADD_DAMAGE},
},
| Argument name | Type | Description |
|---|---|---|
phase |
number | A DamageModifierLib.PHASE_* value (or already-aligned WeaponPreview.STATE_* number) |
Maps DamageModifierLib.PHASE_* values to WeaponPreview.STATE_*. Any unmatched number is passed through unchanged (phases are numeric aligned with STATE_*). Non number values log a warning and return STATE_NONE.
Example:
more_plus.libs.weaponPreview.ExecuteWithState(PlusHelper.convertPhase(phase), function()
-- add preview marks
end, attackingPawn:GetId())
| Argument name | Type | Description |
|---|---|---|
phase |
number | Phase / state used to choose the group |
Returns QUEUED_GROUP_ID for queued skill/final phases, otherwise GROUP_ID.
Example:
local groupId = PlusHelper.getWeaponPreviewGroupId(phase)
| Argument name | Type | Description |
|---|---|---|
phase |
number | Phase / state to check |
Returns true when the converted state is STATE_QUEUED_SKILL or STATE_QUEUED_FINAL_EFFECT.
Example:
if PlusHelper.isQueuedWeaponPreview(phase) then
-- queued preview marks
end
| Argument name | Type | Description |
|---|---|---|
phase |
number | DamageModifierLib/WeaponPreview phase |
loc |
Point | Tile for the icon |
animKey |
string | ANIMS key |
description |
string | Tooltip text for H key tips |
alwaysShow |
boolean | (optional) If true, queued marks stay visible without hover. Defaults to false
|
Wraps WeaponPreview:AddAnimation with the appropriate group id from getWeaponPreviewGroupId.
Example:
PlusHelper.addWeaponPreviewIcon(
phase,
spaceDamage.loc,
more_plus.commonIcons.extraDamage.key,
GetText(customSkill.name) .. ": " .. GetText(customSkill.description)
)
| Argument name | Type | Description |
|---|---|---|
phase |
number | DamageModifierLib / WeaponPreview phase |
loc |
Point | Tile for the icon |
animKey |
string | ANIMS key |
description |
string | Tooltip text for H key tips |
alwaysShowQueued |
boolean | (optional) When true and phase is queued, passes alwaysShow = true to addWeaponPreviewIcon
|
Like addWeaponPreviewIcon, but alwaysShow is only applied for queued previews when alwaysShowQueued is true. Use with readAlwaysShowQueuedPreviewIcons for a mod option.
Example:
local alwaysShowQueued = PlusHelper.readAlwaysShowQueuedPreviewIcons("more_plus", false)
PlusHelper.addWeaponPreviewIconForMod(phase, loc, animKey, description, alwaysShowQueued)
| Argument name | Type | Description |
|---|---|---|
modId |
string | Mod id whose options to read from modcontent.lua
|
defaultEnabled |
boolean | (optional) Value when the option is unset. Defaults to false
|
Reads modcontent.lua option alwaysShowQueuedPreviewIcons for modId. Returns defaultEnabled when unset.
Example:
local enabled = PlusHelper.readAlwaysShowQueuedPreviewIcons("more_plus", false)
Registers vanilla CPLUS+ skills into shared groups (Grid -> ADD_GRID_DEF, Reactor -> ADD_REACTOR, Opener/Closer -> BOOST, Thick -> STATUS_BASED, Invulnerable -> REVIVE). Safe to call multiple times. Runs once. Requires cplus_plus_ex.
Example:
PlusHelper.registerVanillaSkillGroups()
| Argument name | Type | Description |
|---|---|---|
iconList |
table | Map of icon entries. Each entry may have key and img
|
The entries in iconList can have the following fields:
| Field | Type | Description |
|---|---|---|
key |
string | ANIMS key to create |
img |
string | Image path for a one-frame looping animation |
For each entry with key and img, creates a one frame looping ANIMS entry if missing.
Example:
PlusHelper.registerIconList({
extraDamage = { key = "my_extra_dmg", img = "img/combat/icons/icon_damage.png" },
})
Registers the primary and queued WeaponPreview groups with their offsets (GROUP_ID/QUEUED_GROUP_ID). Called automatically during lib finalize/load. Requires WeaponPreview.
Example:
PlusHelper:registerGroups()