Skip to content

Commit 2654757

Browse files
committed
Added support for ToggleCollision, Cosmetic_SkellyZagreusStatue
1 parent 959c7cd commit 2654757

5 files changed

Lines changed: 22 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# Changelog
22

3-
## v1.0.2
3+
## v1.0.3
44

55
<!--Releasenotes start-->
6-
- Fixed potential issues with modded and vanilla cosmetics being equipped at the same time if the mod was temporarily disabled and the player returns from a Chaos Trial.
6+
- Added `ToggleCollision` property.
7+
- Added vanilla `SetAnimationValue` for `Cosmetic_SkellyZagreusStatue`.
78
<!--Releasenotes end-->
89

10+
## v1.0.2
11+
12+
- Fixed potential issues with modded and vanilla cosmetics being equipped at the same time if the mod was temporarily disabled and the player returns from a Chaos Trial.
13+
914
## v1.0.1
1015

1116
- The default `RevealReactionVoiceLines` have been updated to include more varied voicelines by Melinoë.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ CosmeticsAPI.RegisterCosmetic({
8585
SetAnimationIds = nil,
8686
ActivateIds = nil,
8787
DeactivateIds = nil,
88+
ToggleCollision = nil,
8889
ActivateFunctionName = nil,
8990
OnRevealFunctionName = nil,
9091
PanDuration = 1,

src/Scripts/CosmeticsAPI.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ public.RegisterCosmetic = function(cosmeticData)
201201
end
202202
-- #endregion
203203

204+
-- #region ToggleCollision
205+
if cosmeticData.ToggleCollision ~= nil and type(cosmeticData.ToggleCollision) == "boolean" then
206+
newGameCosmetic.ToggleCollision = cosmeticData.ToggleCollision
207+
elseif cosmeticData.ToggleCollision ~= nil then
208+
mod.WarnIncorrectType("ToggleCollision", "boolean", type(cosmeticData.ToggleCollision), cosmeticData.Id)
209+
end
210+
-- #endregion
211+
204212
-- #region CosmeticsGroup
205213
-- Validate the cosmetic that the group points to exists
206214
if game.WorldUpgradeData[cosmeticData.CosmeticsGroup] == nil then

src/Scripts/Utils.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- Add the base cosmetic overrides for vanilla cosmetics here
22
-- You can most often get the SetAnimationValue from the Game/Obstacles/Crossroads.sjson file
3-
-- Most obstacles in this file are named "Crossroads<Cosmetic name without "Cosmetic_" prefix>01"
3+
-- Most obstacles in this file are named "Crossroads<Cosmetic name without 'Cosmetic_' prefix>01"
44
-- The SetAnimationValue we need is the "Thing.Graphic" of the obstacle, NOT the obstacle name itself
55
-- Some cosmetics may require additional overrides to work correctly with modded cosmetics, you can add them here as well
66
-- This is e.g. the case if the vanilla cosmetic defines ActivateIds, which would all get set to the new SetAnimationValue if no separate SetAnimationIds table is provided
@@ -23,9 +23,12 @@ mod.KnownExtraDecorBaseAnimations = {
2323
-- #region CosmeticsShop_Taverna
2424
Cosmetic_TavernaStarMosaic = {
2525
SetAnimationValue = "Tilesets\\Crossroads\\Crossroads_Terrain_Taverna_Mosaic_01",
26-
}
26+
},
2727
-- #endregion
2828
-- #region CosmeticsShop_PreRun
29+
Cosmetic_SkellyZagreusStatue = {
30+
SetAnimationValue = "Tilesets\\Crossroads\\Crossroads_Skelly_ZagreusStatue_01",
31+
},
2932
-- #endregion
3033
}
3134

src/def.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ local public = {}
2727
---@field ActivateIds table|nil Which ObjectIds to activate when this cosmetic is equipped. The camera will pan to the first ID in this table if CameraFocusId is not set. Note: There is no validation on this field, so ensure the IDs exist.
2828
---@field DeactivateIds table|nil Which ObjectIds to deactivate when this cosmetic is equipped. Note: There is no validation on this field, so ensure the IDs exist.
2929
-- ---@field ActivateRoomObstacleIds table|nil Which RoomObstacleIds to activate when this cosmetic is equipped. Cannot be set if SetAnimationIds or ActivateIds are set. The camera will pan to the first ID in this table if CameraFocusId is not set. Not used for the API. Note: There is no validation on this field, so ensure the IDs exist.
30-
-- ---@field ToggleCollision boolean|nil If true, toggles collision for the activated/deactivated objects when this cosmetic is equipped. Only used if ActivateRoomObstacleIds is set. Defaults to true. Not used for the API.
30+
---@field ToggleCollision boolean|nil If true, toggles collision for the activated/deactivated objects when this cosmetic is equipped. Should be the same as for the base cosmetic you're adding an alternative to in most cases. Defaults to nil.
3131
-- ---@field ToggleShadows boolean|nil If true, toggles shadows for the activated/deactivated objects when this cosmetic is equipped. Only used if ActivateRoomObstacleIds is set. Defaults to true. Not used for the API.
3232
---@field ActivateFunctionName string|nil The name of a function to call whenever the cosmetic is equipped. You can use <_PLUGIN.guid .. "." .. "YourModFunctionName"> to reference a function in your mod's namespace. If nil, no function is called.
3333
---@field OnRevealFunctionName string|nil The name of a function to call after the cosmetic is revealed, but before the camera pans back to Melinoe. You can use <_PLUGIN.guid .. "." .. "YourModFunctionName"> to reference a function in your mod's namespace. If nil, no function is called.

0 commit comments

Comments
 (0)