isaacscript-common 6.8.0 → 6.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/customStage/customStageGridEntities.lua +2 -2
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +5 -4
- package/dist/features/customStage/init.d.ts.map +1 -1
- package/dist/features/customStage/init.lua +12 -3
- package/dist/features/customStage/streakText.d.ts +4 -2
- package/dist/features/customStage/streakText.d.ts.map +1 -1
- package/dist/features/customStage/streakText.lua +216 -15
- package/dist/features/customStage/v.d.ts +4 -2
- package/dist/features/customStage/v.d.ts.map +1 -1
- package/dist/features/customStage/v.lua +9 -1
- package/dist/features/customStage/versusScreen.d.ts +1 -1
- package/dist/features/customStage/versusScreen.d.ts.map +1 -1
- package/dist/features/customStage/versusScreen.lua +2 -5
- package/dist/features/extraConsoleCommands/init.lua +1 -0
- package/dist/features/extraConsoleCommands/listCommands.d.ts +8 -0
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +13 -0
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/saveDataManager/exports.lua +2 -4
- package/dist/features/saveDataManager/load.d.ts +1 -1
- package/dist/features/saveDataManager/load.d.ts.map +1 -1
- package/dist/features/saveDataManager/main.d.ts.map +1 -1
- package/dist/features/saveDataManager/main.lua +0 -1
- package/dist/features/saveDataManager/maps.d.ts +3 -3
- package/dist/features/saveDataManager/maps.d.ts.map +1 -1
- package/dist/features/saveDataManager/maps.lua +1 -4
- package/dist/features/saveDataManager/merge.d.ts +2 -2
- package/dist/features/saveDataManager/merge.d.ts.map +1 -1
- package/dist/features/saveDataManager/merge.lua +3 -3
- package/dist/features/saveDataManager/save.d.ts +1 -1
- package/dist/features/saveDataManager/save.d.ts.map +1 -1
- package/dist/features/saveDataManager/save.lua +1 -2
- package/dist/features/saveDataManager/{serializationBrand.d.ts → serializationBrands.d.ts} +1 -1
- package/dist/features/saveDataManager/serializationBrands.d.ts.map +1 -0
- package/dist/features/saveDataManager/{serializationBrand.lua → serializationBrands.lua} +0 -0
- package/dist/functions/array.d.ts.map +1 -1
- package/dist/functions/color.d.ts +1 -1
- package/dist/functions/color.d.ts.map +1 -1
- package/dist/functions/deepCopy.d.ts +1 -1
- package/dist/functions/deepCopy.lua +55 -36
- package/dist/functions/deepCopyTests.lua +20 -17
- package/dist/functions/entities.d.ts +1 -1
- package/dist/functions/entities.d.ts.map +1 -1
- package/dist/functions/input.d.ts.map +1 -1
- package/dist/functions/input.lua +8 -10
- package/dist/functions/jsonHelpers.d.ts +1 -1
- package/dist/functions/jsonHelpers.d.ts.map +1 -1
- package/dist/functions/kColor.d.ts +1 -1
- package/dist/functions/kColor.d.ts.map +1 -1
- package/dist/functions/log.d.ts +1 -1
- package/dist/functions/log.d.ts.map +1 -1
- package/dist/functions/log.lua +3 -1
- package/dist/functions/mergeTests.d.ts +2 -2
- package/dist/functions/mergeTests.lua +2 -2
- package/dist/functions/playerIndex.d.ts +1 -1
- package/dist/functions/playerIndex.lua +1 -1
- package/dist/functions/rng.d.ts +1 -1
- package/dist/functions/rng.d.ts.map +1 -1
- package/dist/functions/run.d.ts +8 -0
- package/dist/functions/run.d.ts.map +1 -1
- package/dist/functions/run.lua +15 -0
- package/dist/functions/table.d.ts +9 -9
- package/dist/functions/table.d.ts.map +1 -1
- package/dist/functions/table.lua +23 -21
- package/dist/functions/types.d.ts +1 -1
- package/dist/functions/types.d.ts.map +1 -1
- package/dist/functions/vector.d.ts +1 -1
- package/dist/functions/vector.d.ts.map +1 -1
- package/dist/interfaces/SaveData.d.ts +1 -1
- package/dist/interfaces/private/TSTLClassMetatable.d.ts +1 -1
- package/dist/interfaces/private/TSTLClassMetatable.d.ts.map +1 -1
- package/dist/lualib_bundle.lua +38 -7
- package/dist/types/PlayerIndex.d.ts +3 -2
- package/dist/types/PlayerIndex.d.ts.map +1 -1
- package/dist/types/private/IsaacAPIClass.d.ts +1 -1
- package/dist/types/private/IsaacAPIClass.d.ts.map +1 -1
- package/dist/types/private/SerializedIsaacAPIClass.d.ts +1 -1
- package/dist/types/private/SerializedIsaacAPIClass.d.ts.map +1 -1
- package/dist/types/private/TSTLClass.d.ts +1 -1
- package/dist/types/private/TSTLClass.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/customStage/customStageGridEntities.ts +4 -4
- package/src/features/customStage/exports.ts +5 -3
- package/src/features/customStage/init.ts +19 -7
- package/src/features/customStage/streakText.ts +284 -19
- package/src/features/customStage/v.ts +6 -1
- package/src/features/customStage/versusScreen.ts +2 -5
- package/src/features/extraConsoleCommands/init.ts +1 -0
- package/src/features/extraConsoleCommands/listCommands.ts +14 -0
- package/src/features/saveDataManager/exports.ts +3 -8
- package/src/features/saveDataManager/load.ts +2 -3
- package/src/features/saveDataManager/main.ts +4 -5
- package/src/features/saveDataManager/maps.ts +3 -3
- package/src/features/saveDataManager/merge.ts +11 -11
- package/src/features/saveDataManager/save.ts +6 -6
- package/src/features/saveDataManager/{serializationBrand.ts → serializationBrands.ts} +0 -0
- package/src/functions/array.ts +2 -4
- package/src/functions/color.ts +3 -3
- package/src/functions/deepCopy.ts +77 -40
- package/src/functions/deepCopyTests.ts +45 -28
- package/src/functions/entities.ts +7 -7
- package/src/functions/input.ts +7 -8
- package/src/functions/isaacAPIClass.ts +3 -3
- package/src/functions/jsonHelpers.ts +3 -3
- package/src/functions/kColor.ts +3 -3
- package/src/functions/log.ts +7 -4
- package/src/functions/mergeTests.ts +24 -24
- package/src/functions/playerIndex.ts +1 -1
- package/src/functions/rng.ts +3 -3
- package/src/functions/run.ts +14 -0
- package/src/functions/table.ts +25 -23
- package/src/functions/tstlClass.ts +1 -1
- package/src/functions/types.ts +3 -1
- package/src/functions/vector.ts +3 -3
- package/src/interfaces/SaveData.ts +1 -1
- package/src/interfaces/private/TSTLClassMetatable.ts +1 -1
- package/src/types/PlayerIndex.ts +3 -2
- package/src/types/private/IsaacAPIClass.ts +1 -1
- package/src/types/private/SerializedIsaacAPIClass.ts +1 -1
- package/src/types/private/TSTLClass.ts +1 -1
- package/dist/features/saveDataManager/serializationBrand.d.ts.map +0 -1
|
@@ -203,13 +203,13 @@ function ____exports.removeUrnRewards(self, customStage, gridEntity)
|
|
|
203
203
|
if customStage.rocksPNGPath == nil then
|
|
204
204
|
return
|
|
205
205
|
end
|
|
206
|
-
local spiders = getNPCs(nil, EntityType.SPIDER)
|
|
207
|
-
removeEntitiesSpawnedFromGridEntity(nil, spiders, gridEntity)
|
|
208
206
|
local coins = getCoins(nil)
|
|
209
207
|
removeEntitiesSpawnedFromGridEntity(nil, coins, gridEntity)
|
|
210
208
|
local quarters = getCollectibles(nil, CollectibleType.QUARTER)
|
|
211
209
|
removeEntitiesSpawnedFromGridEntity(nil, quarters, gridEntity)
|
|
212
210
|
local swallowedPennies = getTrinkets(nil, TrinketType.SWALLOWED_PENNY)
|
|
213
211
|
removeEntitiesSpawnedFromGridEntity(nil, swallowedPennies, gridEntity)
|
|
212
|
+
local spiders = getNPCs(nil, EntityType.SPIDER)
|
|
213
|
+
removeEntitiesSpawnedFromGridEntity(nil, spiders, gridEntity)
|
|
214
214
|
end
|
|
215
215
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAOX,MAAM,8BAA8B,CAAC;AAsBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,IAAI,CA+GlE;
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAOX,MAAM,8BAA8B,CAAC;AAsBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,IAAI,CA+GlE;AAUD,wBAAgB,mBAAmB,IAAI,IAAI,CAQ1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,IAAI,CAGN"}
|
|
@@ -34,15 +34,16 @@ local ____runNextRoom = require("features.runNextRoom")
|
|
|
34
34
|
local runNextRoom = ____runNextRoom.runNextRoom
|
|
35
35
|
local ____customStageUtils = require("features.customStage.customStageUtils")
|
|
36
36
|
local getRandomCustomStageRoom = ____customStageUtils.getRandomCustomStageRoom
|
|
37
|
+
local ____streakText = require("features.customStage.streakText")
|
|
38
|
+
local topStreakTextStart = ____streakText.topStreakTextStart
|
|
37
39
|
local ____v = require("features.customStage.v")
|
|
38
40
|
local v = ____v.default
|
|
39
41
|
local customBossPNGPaths = ____v.customBossPNGPaths
|
|
40
42
|
local customStageCachedRoomData = ____v.customStageCachedRoomData
|
|
41
43
|
local customStagesMap = ____v.customStagesMap
|
|
42
|
-
local ____versusScreen = require("features.customStage.versusScreen")
|
|
43
|
-
local playVersusScreenAnimation = ____versusScreen.playVersusScreenAnimation
|
|
44
44
|
function postRoomTransition(self)
|
|
45
45
|
movePlayersToCenter(nil)
|
|
46
|
+
topStreakTextStart(nil)
|
|
46
47
|
end
|
|
47
48
|
local DEFAULT_BASE_STAGE = LevelStage.BASEMENT_2
|
|
48
49
|
local DEFAULT_BASE_STAGE_TYPE = StageType.ORIGINAL
|
|
@@ -56,7 +57,7 @@ function ____exports.setCustomStage(self, name, verbose)
|
|
|
56
57
|
end
|
|
57
58
|
local customStage = customStagesMap:get(name)
|
|
58
59
|
if customStage == nil then
|
|
59
|
-
error(("Failed to set the custom stage of \"" .. name) .. "\" because it was not found in the custom stages map. (
|
|
60
|
+
error(("Failed to set the custom stage of \"" .. name) .. "\" because it was not found in the custom stages map. (Try restarting IsaacScript / recompiling the mod, and try again. If that does not work, you probably forgot to define it in your \"tsconfig.json\" file.) See the website for more details on how to set up custom stages.")
|
|
60
61
|
end
|
|
61
62
|
local level = game:GetLevel()
|
|
62
63
|
local startingRoomGridIndex = level:GetStartingRoomIndex()
|
|
@@ -124,7 +125,7 @@ function ____exports.setCustomStageDebug(self)
|
|
|
124
125
|
log("No custom stage is currently loaded.")
|
|
125
126
|
return
|
|
126
127
|
end
|
|
127
|
-
|
|
128
|
+
topStreakTextStart(nil)
|
|
128
129
|
end
|
|
129
130
|
--- By default, unknown bosses will be drawn on the boss "versus" screen as "???". If your custom
|
|
130
131
|
-- stage has custom bosses, you can use this function to register the corresponding graphic file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AA8BxD,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAoBtD"}
|
|
@@ -3,7 +3,7 @@ local Map = ____lualib.Map
|
|
|
3
3
|
local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local ____exports = {}
|
|
6
|
-
local initRoomTypeMaps, getRoomTypeMap, postRender, getShaderParams, postGridEntityBrokenRockAlt, postGridEntityBrokenInit, postNewRoomReordered
|
|
6
|
+
local initRoomTypeMaps, getRoomTypeMap, postRender, postGameStarted, getShaderParams, postGridEntityBrokenRockAlt, postGridEntityBrokenInit, postNewRoomReordered
|
|
7
7
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
8
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
9
9
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
@@ -26,6 +26,7 @@ local ____shadows = require("features.customStage.shadows")
|
|
|
26
26
|
local setShadows = ____shadows.setShadows
|
|
27
27
|
local ____streakText = require("features.customStage.streakText")
|
|
28
28
|
local streakTextGetShaderParams = ____streakText.streakTextGetShaderParams
|
|
29
|
+
local streakTextPostGameStarted = ____streakText.streakTextPostGameStarted
|
|
29
30
|
local streakTextPostRender = ____streakText.streakTextPostRender
|
|
30
31
|
local ____v = require("features.customStage.v")
|
|
31
32
|
local v = ____v.default
|
|
@@ -74,11 +75,18 @@ function postRender(self)
|
|
|
74
75
|
if customStage == nil then
|
|
75
76
|
return
|
|
76
77
|
end
|
|
77
|
-
streakTextPostRender(nil
|
|
78
|
+
streakTextPostRender(nil)
|
|
78
79
|
versusScreenPostRender(nil)
|
|
79
80
|
end
|
|
81
|
+
function postGameStarted(self)
|
|
82
|
+
streakTextPostGameStarted(nil)
|
|
83
|
+
end
|
|
80
84
|
function getShaderParams(self, shaderName)
|
|
81
|
-
|
|
85
|
+
local customStage = v.run.currentCustomStage
|
|
86
|
+
if customStage == nil then
|
|
87
|
+
return
|
|
88
|
+
end
|
|
89
|
+
streakTextGetShaderParams(nil, customStage, shaderName)
|
|
82
90
|
return nil
|
|
83
91
|
end
|
|
84
92
|
function postGridEntityBrokenRockAlt(self, gridEntity)
|
|
@@ -111,6 +119,7 @@ function ____exports.customStageInit(self, mod)
|
|
|
111
119
|
saveDataManager(nil, "customStage", v)
|
|
112
120
|
initRoomTypeMaps(nil)
|
|
113
121
|
mod:AddCallback(ModCallback.POST_RENDER, postRender)
|
|
122
|
+
mod:AddCallback(ModCallback.POST_GAME_STARTED, postGameStarted)
|
|
114
123
|
mod:AddCallback(ModCallback.GET_SHADER_PARAMS, getShaderParams)
|
|
115
124
|
mod:AddCallbackCustom(ModCallbackCustom.POST_GRID_ENTITY_BROKEN, postGridEntityBrokenRockAlt, GridEntityType.ROCK_ALT)
|
|
116
125
|
mod:AddCallbackCustom(ModCallbackCustom.POST_GRID_ENTITY_INIT, postGridEntityBrokenInit)
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { CustomStage } from "../../interfaces/CustomStage";
|
|
2
|
-
export declare function streakTextPostRender(
|
|
3
|
-
export declare function
|
|
2
|
+
export declare function streakTextPostRender(): void;
|
|
3
|
+
export declare function streakTextPostGameStarted(): void;
|
|
4
|
+
export declare function streakTextGetShaderParams(customStage: CustomStage, shaderName: string): void;
|
|
5
|
+
export declare function topStreakTextStart(): void;
|
|
4
6
|
//# sourceMappingURL=streakText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streakText.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/streakText.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streakText.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/streakText.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA+F3D,wBAAgB,oBAAoB,IAAI,IAAI,CAS3C;AAmFD,wBAAgB,yBAAyB,IAAI,IAAI,CAGhD;AAGD,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,GACjB,IAAI,CAYN;AAiFD,wBAAgB,kBAAkB,IAAI,IAAI,CAUzC"}
|
|
@@ -1,38 +1,239 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Spread = ____lualib.__TS__Spread
|
|
1
3
|
local ____exports = {}
|
|
4
|
+
local checkEndTopStreakText, trackMapInputPressed, checkStartBottomStreakText, checkEndBottomStreakText, renderSprite, playTextOut, UIStreakAnimation, TEXT_STAY_FRAME, TEXT_OUT_FRAME, STREAK_TEXT_BOTTOM_Y_OFFSET, NUM_RENDER_FRAMES_MAP_HELD_BEFORE_STREAK_TEXT, TEXT_IN_ADJUSTMENTS, TEXT_OUT_ADJUSTMENTS, TEXT_IN_SCALES, TEXT_OUT_SCALES, topStreakSprite, bottomStreakSprite
|
|
5
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
6
|
+
local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
|
|
7
|
+
local ControllerIndex = ____isaac_2Dtypescript_2Ddefinitions.ControllerIndex
|
|
2
8
|
local ____cachedClasses = require("cachedClasses")
|
|
3
9
|
local fonts = ____cachedClasses.fonts
|
|
4
10
|
local game = ____cachedClasses.game
|
|
5
11
|
local ____constants = require("constants")
|
|
6
12
|
local KColorDefault = ____constants.KColorDefault
|
|
13
|
+
local VectorOne = ____constants.VectorOne
|
|
14
|
+
local ____enums = require("functions.enums")
|
|
15
|
+
local getEnumValues = ____enums.getEnumValues
|
|
7
16
|
local ____ui = require("functions.ui")
|
|
8
17
|
local getScreenBottomCenterPos = ____ui.getScreenBottomCenterPos
|
|
9
|
-
local
|
|
10
|
-
local todo = ____utils.todo
|
|
18
|
+
local getScreenTopCenterPos = ____ui.getScreenTopCenterPos
|
|
11
19
|
local ____v = require("features.customStage.v")
|
|
12
20
|
local v = ____v.default
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
function checkEndTopStreakText(self)
|
|
22
|
+
if v.run.topStreakTextStartedRenderFrame == nil or not topStreakSprite:IsPlaying(UIStreakAnimation.TEXT_STAY) then
|
|
23
|
+
return
|
|
24
|
+
end
|
|
25
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
26
|
+
local elapsedFrames = renderFrameCount - v.run.topStreakTextStartedRenderFrame
|
|
27
|
+
if elapsedFrames >= 115 then
|
|
28
|
+
playTextOut(nil, topStreakSprite)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
function trackMapInputPressed(self)
|
|
32
|
+
for ____, controllerIndex in ipairs(getEnumValues(nil, ControllerIndex)) do
|
|
33
|
+
local gameFrameCount = game:GetFrameCount()
|
|
34
|
+
local oldPushedMapFrame = v.run.controllerIndexPushingMapRenderFrame:get(controllerIndex)
|
|
35
|
+
local isPushingMap = Input.IsActionPressed(ButtonAction.MAP, controllerIndex)
|
|
36
|
+
if isPushingMap then
|
|
37
|
+
if oldPushedMapFrame == nil then
|
|
38
|
+
v.run.controllerIndexPushingMapRenderFrame:set(controllerIndex, gameFrameCount)
|
|
39
|
+
end
|
|
40
|
+
else
|
|
41
|
+
v.run.controllerIndexPushingMapRenderFrame:delete(controllerIndex)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
function checkStartBottomStreakText(self)
|
|
46
|
+
if bottomStreakSprite:IsPlaying() then
|
|
47
|
+
return
|
|
48
|
+
end
|
|
49
|
+
local pushedMapFrames = {__TS__Spread(v.run.controllerIndexPushingMapRenderFrame:values())}
|
|
50
|
+
if #pushedMapFrames == 0 then
|
|
51
|
+
return
|
|
52
|
+
end
|
|
53
|
+
local earliestFrame = math.min(table.unpack(pushedMapFrames))
|
|
54
|
+
local gameFrameCount = game:GetFrameCount()
|
|
55
|
+
local elapsedFrames = gameFrameCount - earliestFrame
|
|
56
|
+
if elapsedFrames >= NUM_RENDER_FRAMES_MAP_HELD_BEFORE_STREAK_TEXT then
|
|
57
|
+
bottomStreakSprite:Play(UIStreakAnimation.TEXT, true)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
function checkEndBottomStreakText(self)
|
|
61
|
+
if not bottomStreakSprite:IsPlaying(UIStreakAnimation.TEXT_STAY) then
|
|
19
62
|
return
|
|
20
63
|
end
|
|
64
|
+
local pushedMapFrames = {__TS__Spread(v.run.controllerIndexPushingMapRenderFrame:values())}
|
|
65
|
+
if #pushedMapFrames == 0 then
|
|
66
|
+
playTextOut(nil, bottomStreakSprite)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
function renderSprite(self, customStage, sprite, position)
|
|
70
|
+
sprite:Update()
|
|
71
|
+
if not sprite:IsPlaying() then
|
|
72
|
+
return
|
|
73
|
+
end
|
|
74
|
+
local animation = sprite:GetAnimation()
|
|
75
|
+
local frame = sprite:GetFrame()
|
|
76
|
+
if animation == UIStreakAnimation.TEXT and frame == TEXT_STAY_FRAME then
|
|
77
|
+
sprite:Play(UIStreakAnimation.TEXT_STAY, true)
|
|
78
|
+
end
|
|
21
79
|
local isPaused = game:IsPaused()
|
|
22
80
|
if isPaused then
|
|
23
81
|
return
|
|
24
82
|
end
|
|
25
83
|
local font = fonts.upheaval
|
|
26
|
-
local
|
|
27
|
-
local
|
|
28
|
-
local
|
|
29
|
-
local
|
|
30
|
-
|
|
84
|
+
local ____customStage_0 = customStage
|
|
85
|
+
local name = ____customStage_0.name
|
|
86
|
+
local length = font:GetStringWidthUTF8(name)
|
|
87
|
+
local centeredX = position.X - length / 2
|
|
88
|
+
local adjustment = 0
|
|
89
|
+
local scale = VectorOne
|
|
90
|
+
repeat
|
|
91
|
+
local ____switch26 = animation
|
|
92
|
+
local ____cond26 = ____switch26 == UIStreakAnimation.TEXT
|
|
93
|
+
if ____cond26 then
|
|
94
|
+
do
|
|
95
|
+
if frame < TEXT_STAY_FRAME then
|
|
96
|
+
adjustment = TEXT_IN_ADJUSTMENTS[frame + 1] or 0
|
|
97
|
+
scale = TEXT_IN_SCALES[frame + 1] or VectorOne
|
|
98
|
+
else
|
|
99
|
+
local adjustedFrame = frame - TEXT_OUT_FRAME
|
|
100
|
+
adjustment = TEXT_OUT_ADJUSTMENTS[adjustedFrame + 1] or 0
|
|
101
|
+
scale = TEXT_OUT_SCALES[adjustedFrame + 1] or VectorOne
|
|
102
|
+
end
|
|
103
|
+
break
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
____cond26 = ____cond26 or ____switch26 == UIStreakAnimation.TEXT_IN
|
|
107
|
+
if ____cond26 then
|
|
108
|
+
do
|
|
109
|
+
adjustment = TEXT_IN_ADJUSTMENTS[frame + 1] or 0
|
|
110
|
+
scale = TEXT_IN_SCALES[frame + 1] or VectorOne
|
|
111
|
+
break
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
____cond26 = ____cond26 or ____switch26 == UIStreakAnimation.TEXT_OUT
|
|
115
|
+
if ____cond26 then
|
|
116
|
+
do
|
|
117
|
+
adjustment = TEXT_OUT_ADJUSTMENTS[frame + 1] or 0
|
|
118
|
+
scale = TEXT_OUT_SCALES[frame + 1] or VectorOne
|
|
119
|
+
break
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
do
|
|
123
|
+
do
|
|
124
|
+
break
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
until true
|
|
128
|
+
local adjustedX = centeredX + adjustment
|
|
129
|
+
local adjustedY = position.Y + STREAK_TEXT_BOTTOM_Y_OFFSET
|
|
130
|
+
sprite:RenderLayer(0, position)
|
|
131
|
+
font:DrawStringScaled(
|
|
132
|
+
name,
|
|
133
|
+
adjustedX,
|
|
134
|
+
adjustedY,
|
|
135
|
+
scale.X,
|
|
136
|
+
scale.Y,
|
|
137
|
+
KColorDefault
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
function playTextOut(self, sprite)
|
|
141
|
+
sprite:Play(UIStreakAnimation.TEXT, true)
|
|
142
|
+
sprite:SetFrame(TEXT_OUT_FRAME - 2)
|
|
31
143
|
end
|
|
32
|
-
|
|
144
|
+
UIStreakAnimation = UIStreakAnimation or ({})
|
|
145
|
+
UIStreakAnimation.TEXT = "Text"
|
|
146
|
+
UIStreakAnimation.TEXT_IN = "TextIn"
|
|
147
|
+
UIStreakAnimation.TEXT_OUT = "TextOut"
|
|
148
|
+
UIStreakAnimation.TEXT_STAY = "TextStay"
|
|
149
|
+
--- This must match the name of the shader in "shaders.xml".
|
|
150
|
+
local EMPTY_SHADER_NAME = "IsaacScript-RenderAboveHUD"
|
|
151
|
+
TEXT_STAY_FRAME = 8
|
|
152
|
+
TEXT_OUT_FRAME = 60
|
|
153
|
+
--- This matches the offset that the vanilla game uses; determined via trial and error.
|
|
154
|
+
local STREAK_SPRITE_TOP_OFFSET = Vector(0, 48.25)
|
|
155
|
+
--- This matches the offset that the vanilla game uses; determined via trial and error.
|
|
156
|
+
local STREAK_SPRITE_BOTTOM_OFFSET = Vector(0, -48.25)
|
|
157
|
+
STREAK_TEXT_BOTTOM_Y_OFFSET = -9
|
|
158
|
+
NUM_RENDER_FRAMES_MAP_HELD_BEFORE_STREAK_TEXT = 11
|
|
159
|
+
--- Corresponds to the vanilla value; determined through trial and error.
|
|
160
|
+
local TEXT_PLAYBACK_SPEED = 0.5
|
|
161
|
+
TEXT_IN_ADJUSTMENTS = {
|
|
162
|
+
-800,
|
|
163
|
+
-639,
|
|
164
|
+
-450,
|
|
165
|
+
-250,
|
|
166
|
+
-70,
|
|
167
|
+
10,
|
|
168
|
+
6,
|
|
169
|
+
3
|
|
170
|
+
}
|
|
171
|
+
TEXT_OUT_ADJUSTMENTS = {
|
|
172
|
+
0,
|
|
173
|
+
-5,
|
|
174
|
+
-10,
|
|
175
|
+
-15,
|
|
176
|
+
-20,
|
|
177
|
+
144,
|
|
178
|
+
308,
|
|
179
|
+
472,
|
|
180
|
+
636,
|
|
181
|
+
800
|
|
182
|
+
}
|
|
183
|
+
TEXT_IN_SCALES = {
|
|
184
|
+
Vector(3, 0.2),
|
|
185
|
+
Vector(2.6, 0.36),
|
|
186
|
+
Vector(2.2, 0.52),
|
|
187
|
+
Vector(1.8, 0.68),
|
|
188
|
+
Vector(1.4, 0.84),
|
|
189
|
+
Vector(0.95, 1.05),
|
|
190
|
+
Vector(0.97, 1.03),
|
|
191
|
+
Vector(0.98, 1.02)
|
|
192
|
+
}
|
|
193
|
+
TEXT_OUT_SCALES = {
|
|
194
|
+
Vector(1, 1),
|
|
195
|
+
Vector(0.99, 1.03),
|
|
196
|
+
Vector(0.98, 1.05),
|
|
197
|
+
Vector(0.96, 1.08),
|
|
198
|
+
Vector(0.95, 1.1),
|
|
199
|
+
Vector(1.36, 0.92),
|
|
200
|
+
Vector(1.77, 0.74),
|
|
201
|
+
Vector(2.18, 0.56),
|
|
202
|
+
Vector(2.59, 0.38),
|
|
203
|
+
Vector(3, 0.2)
|
|
204
|
+
}
|
|
205
|
+
topStreakSprite = Sprite()
|
|
206
|
+
topStreakSprite:Load("resources/gfx/ui/ui_streak.anm2", false)
|
|
207
|
+
topStreakSprite.PlaybackSpeed = TEXT_PLAYBACK_SPEED
|
|
208
|
+
bottomStreakSprite = Sprite()
|
|
209
|
+
bottomStreakSprite:Load("resources/gfx/ui/ui_streak.anm2", false)
|
|
210
|
+
bottomStreakSprite.PlaybackSpeed = TEXT_PLAYBACK_SPEED
|
|
211
|
+
function ____exports.streakTextPostRender(self)
|
|
212
|
+
checkEndTopStreakText(nil)
|
|
213
|
+
trackMapInputPressed(nil)
|
|
214
|
+
checkStartBottomStreakText(nil)
|
|
215
|
+
checkEndBottomStreakText(nil)
|
|
216
|
+
end
|
|
217
|
+
function ____exports.streakTextPostGameStarted(self)
|
|
218
|
+
topStreakSprite:Stop()
|
|
219
|
+
bottomStreakSprite:Stop()
|
|
220
|
+
end
|
|
221
|
+
function ____exports.streakTextGetShaderParams(self, customStage, shaderName)
|
|
33
222
|
if shaderName ~= EMPTY_SHADER_NAME then
|
|
34
223
|
return
|
|
35
224
|
end
|
|
36
|
-
|
|
225
|
+
local topCenterPos = getScreenTopCenterPos(nil)
|
|
226
|
+
local topStreakPosition = topCenterPos + STREAK_SPRITE_TOP_OFFSET
|
|
227
|
+
renderSprite(nil, customStage, topStreakSprite, topStreakPosition)
|
|
228
|
+
local bottomCenterPos = getScreenBottomCenterPos(nil)
|
|
229
|
+
local bottomStreakPosition = bottomCenterPos + STREAK_SPRITE_BOTTOM_OFFSET
|
|
230
|
+
renderSprite(nil, customStage, bottomStreakSprite, bottomStreakPosition)
|
|
231
|
+
end
|
|
232
|
+
function ____exports.topStreakTextStart(self)
|
|
233
|
+
local level = game:GetLevel()
|
|
234
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
235
|
+
level:ShowName(false)
|
|
236
|
+
v.run.topStreakTextStartedRenderFrame = renderFrameCount
|
|
237
|
+
topStreakSprite:Play(UIStreakAnimation.TEXT, true)
|
|
37
238
|
end
|
|
38
239
|
return ____exports
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { ControllerIndex } from "isaac-typescript-definitions";
|
|
2
2
|
import { CustomStage } from "../../interfaces/CustomStage";
|
|
3
3
|
declare const v: {
|
|
4
4
|
run: {
|
|
5
5
|
currentCustomStage: CustomStage | null;
|
|
6
|
-
showingStreakText: boolean;
|
|
7
6
|
showingBossVersusScreen: boolean;
|
|
7
|
+
/** Values are the render frame that the controller first pressed the map button. */
|
|
8
|
+
controllerIndexPushingMapRenderFrame: Map<ControllerIndex, number>;
|
|
9
|
+
topStreakTextStartedRenderFrame: number | null;
|
|
8
10
|
};
|
|
9
11
|
room: {
|
|
10
12
|
showingShadows: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/v.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,QAAA,MAAM,CAAC;;;;QAKH,oFAAoF;;;;;;;CASvF,CAAC;AACF,eAAe,CAAC,CAAC;AAEjB,oCAAoC;AACpC,eAAO,MAAM,eAAe,0BAAiC,CAAC;AAE9D,+BAA+B;AAC/B,eAAO,MAAM,yBAAyB,mCAAuC,CAAC;AAE9E,4BAA4B;AAC5B,eAAO,MAAM,kBAAkB,6DAG5B,CAAC"}
|
|
@@ -2,7 +2,15 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local Map = ____lualib.Map
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local ____exports = {}
|
|
5
|
-
local v = {
|
|
5
|
+
local v = {
|
|
6
|
+
run = {
|
|
7
|
+
currentCustomStage = nil,
|
|
8
|
+
showingBossVersusScreen = false,
|
|
9
|
+
controllerIndexPushingMapRenderFrame = __TS__New(Map),
|
|
10
|
+
topStreakTextStartedRenderFrame = nil
|
|
11
|
+
},
|
|
12
|
+
room = {showingShadows = false}
|
|
13
|
+
}
|
|
6
14
|
____exports.default = v
|
|
7
15
|
--- Indexed by custom stage name.
|
|
8
16
|
____exports.customStagesMap = __TS__New(Map)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CustomStage } from "../../interfaces/CustomStage";
|
|
2
|
-
export declare function playVersusScreenAnimation(customStage: CustomStage
|
|
2
|
+
export declare function playVersusScreenAnimation(customStage: CustomStage): void;
|
|
3
3
|
export declare function versusScreenPostRender(): void;
|
|
4
4
|
//# sourceMappingURL=versusScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versusScreen.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/versusScreen.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAiF3D,wBAAgB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"versusScreen.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/versusScreen.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAiF3D,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAuDxE;AA+ED,wBAAgB,sBAAsB,IAAI,IAAI,CAoC7C"}
|
|
@@ -118,14 +118,11 @@ versusScreenBackgroundSprite:Load("gfx/ui/boss/versusscreen.anm2", true)
|
|
|
118
118
|
-- color it with the `Color` property.
|
|
119
119
|
local versusScreenDirtSpotSprite = Sprite()
|
|
120
120
|
versusScreenDirtSpotSprite:Load("gfx/ui/boss/versusscreen.anm2", true)
|
|
121
|
-
function ____exports.playVersusScreenAnimation(self, customStage
|
|
122
|
-
if force == nil then
|
|
123
|
-
force = false
|
|
124
|
-
end
|
|
121
|
+
function ____exports.playVersusScreenAnimation(self, customStage)
|
|
125
122
|
local room = game:GetRoom()
|
|
126
123
|
local roomType = room:GetType()
|
|
127
124
|
local hud = game:GetHUD()
|
|
128
|
-
if roomType ~= RoomType.BOSS
|
|
125
|
+
if roomType ~= RoomType.BOSS then
|
|
129
126
|
return
|
|
130
127
|
end
|
|
131
128
|
v.run.showingBossVersusScreen = true
|
|
@@ -138,6 +138,7 @@ function initMap(self)
|
|
|
138
138
|
extraConsoleCommandsFunctionMap:set("rocksDisplay", commandsDisplay.rocksDisplay)
|
|
139
139
|
extraConsoleCommandsFunctionMap:set("room", commands.roomCommand)
|
|
140
140
|
extraConsoleCommandsFunctionMap:set("rottenHearts", commands.rottenHearts)
|
|
141
|
+
extraConsoleCommandsFunctionMap:set("runTests", commands.runTests)
|
|
141
142
|
extraConsoleCommandsFunctionMap:set("s", commands.s)
|
|
142
143
|
extraConsoleCommandsFunctionMap:set("sacrifice", commands.sacrifice)
|
|
143
144
|
extraConsoleCommandsFunctionMap:set("secret", commands.secret)
|
|
@@ -274,6 +274,14 @@ export declare function roomCommand(): void;
|
|
|
274
274
|
* numbers to remove hearts.)
|
|
275
275
|
*/
|
|
276
276
|
export declare function rottenHearts(params: string): void;
|
|
277
|
+
/**
|
|
278
|
+
* Run the suite of tests that prove that the "deepCopy" helper function and the "merge" function
|
|
279
|
+
* work properly. For more information, see the `runDeepCopyTests` and the `runMergeTests`
|
|
280
|
+
* functions.
|
|
281
|
+
*
|
|
282
|
+
* In general, running the tests is only useful if you are troubleshooting the save data manager.
|
|
283
|
+
*/
|
|
284
|
+
export declare function runTests(): void;
|
|
277
285
|
/**
|
|
278
286
|
* Alias for the "stage" command.
|
|
279
287
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AAqGA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2C/C;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED,gEAAgE;AAChE,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,sEAAsE;AACtE,wBAAgB,OAAO,IAAI,IAAI,CAkB9B;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,+CAA+C;AAC/C,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAcjD;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,IAAI,IAAI,CAEzB;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAczC;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAc1C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED,iDAAiD;AACjD,wBAAgB,IAAI,IAAI,IAAI,CAE3B;AAED,4CAA4C;AAC5C,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEjD;AAED;;;;;;GAMG;A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,MAAM,GAAG,IAAI,CA0BzC"}
|
|
@@ -42,6 +42,8 @@ local ____charge = require("functions.charge")
|
|
|
42
42
|
local addCharge = ____charge.addCharge
|
|
43
43
|
local ____collectibles = require("functions.collectibles")
|
|
44
44
|
local isValidCollectibleType = ____collectibles.isValidCollectibleType
|
|
45
|
+
local ____deepCopyTests = require("functions.deepCopyTests")
|
|
46
|
+
local runDeepCopyTests = ____deepCopyTests.runDeepCopyTests
|
|
45
47
|
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
46
48
|
local getNPCs = ____entitiesSpecific.getNPCs
|
|
47
49
|
local ____enums = require("functions.enums")
|
|
@@ -57,6 +59,8 @@ local logSeedEffects = ____log.logSeedEffects
|
|
|
57
59
|
local logSounds = ____log.logSounds
|
|
58
60
|
local ____map = require("functions.map")
|
|
59
61
|
local getMapPartialMatch = ____map.getMapPartialMatch
|
|
62
|
+
local ____mergeTests = require("functions.mergeTests")
|
|
63
|
+
local runMergeTests = ____mergeTests.runMergeTests
|
|
60
64
|
local ____pickupsSpecific = require("functions.pickupsSpecific")
|
|
61
65
|
local spawnCard = ____pickupsSpecific.spawnCard
|
|
62
66
|
local spawnPill = ____pickupsSpecific.spawnPill
|
|
@@ -850,6 +854,15 @@ end
|
|
|
850
854
|
function ____exports.rottenHearts(self, params)
|
|
851
855
|
addHeart(nil, params, HealthType.ROTTEN)
|
|
852
856
|
end
|
|
857
|
+
--- Run the suite of tests that prove that the "deepCopy" helper function and the "merge" function
|
|
858
|
+
-- work properly. For more information, see the `runDeepCopyTests` and the `runMergeTests`
|
|
859
|
+
-- functions.
|
|
860
|
+
--
|
|
861
|
+
-- In general, running the tests is only useful if you are troubleshooting the save data manager.
|
|
862
|
+
function ____exports.runTests(self)
|
|
863
|
+
runDeepCopyTests(nil)
|
|
864
|
+
runMergeTests(nil)
|
|
865
|
+
end
|
|
853
866
|
--- Alias for the "stage" command.
|
|
854
867
|
--
|
|
855
868
|
-- For example:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/exports.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAarD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,CAAC,EAAE,QAAQ,EACX,eAAe,CAAC,EAAE,MAAM,OAAO,GAC9B,IAAI,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/exports.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAarD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,CAAC,EAAE,QAAQ,EACX,eAAe,CAAC,EAAE,MAAM,OAAO,GAC9B,IAAI,CAkCN;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAQD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAK/C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,GACrB,IAAI,CAiBN"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local Map = ____lualib.Map
|
|
3
2
|
local __TS__TypeOf = ____lualib.__TS__TypeOf
|
|
4
3
|
local __TS__ObjectKeys = ____lualib.__TS__ObjectKeys
|
|
5
4
|
local ____exports = {}
|
|
@@ -117,11 +116,10 @@ function ____exports.saveDataManager(self, key, v, conditionalFunc)
|
|
|
117
116
|
if #saveDataKeys == 1 and saveDataKeys[1] == "room" then
|
|
118
117
|
conditionalFunc = function() return false end
|
|
119
118
|
end
|
|
120
|
-
local
|
|
121
|
-
local saveDataCopy = deepCopy(nil, saveDataTable, SerializationType.NONE, key)
|
|
119
|
+
local saveDataCopy = deepCopy(nil, v, SerializationType.NONE, key)
|
|
122
120
|
saveDataDefaultsMap[key] = saveDataCopy
|
|
123
121
|
if conditionalFunc ~= nil then
|
|
124
|
-
saveDataConditionalFuncMap
|
|
122
|
+
saveDataConditionalFuncMap[key] = conditionalFunc
|
|
125
123
|
end
|
|
126
124
|
end
|
|
127
125
|
--- The save data manager will automatically load variables from disk at the appropriate times (i.e.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
3
|
import { SaveData } from "../../interfaces/SaveData";
|
|
4
|
-
export declare function loadFromDisk(mod: Mod, oldSaveData:
|
|
4
|
+
export declare function loadFromDisk(mod: Mod, oldSaveData: LuaMap<string, SaveData>): void;
|
|
5
5
|
//# sourceMappingURL=load.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/load.ts"],"names":[],"mappings":";;AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AASrD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/load.ts"],"names":[],"mappings":";;AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AASrD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GACpC,IAAI,CAqDN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/main.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAK9D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAwGrD,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,GACvB,IAAI,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/main.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAK9D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAwGrD,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,GACvB,IAAI,CA4CN"}
|
|
@@ -5,7 +5,7 @@ import { SaveData } from "../../interfaces/SaveData";
|
|
|
5
5
|
* Maps for the master map so that we can access the variables via the in-game console when
|
|
6
6
|
* debugging. (TSTL Maps don't expose the map keys as normal keys.)
|
|
7
7
|
*/
|
|
8
|
-
export declare const saveDataMap:
|
|
9
|
-
export declare const saveDataDefaultsMap:
|
|
10
|
-
export declare const saveDataConditionalFuncMap:
|
|
8
|
+
export declare const saveDataMap: LuaMap<string, SaveData>;
|
|
9
|
+
export declare const saveDataDefaultsMap: LuaMap<string, SaveData>;
|
|
10
|
+
export declare const saveDataConditionalFuncMap: LuaMap<string, () => boolean>;
|
|
11
11
|
//# sourceMappingURL=maps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/maps.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/maps.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,0BAAiC,CAAC;AAE1D,eAAO,MAAM,mBAAmB,0BAAiC,CAAC;AAClE,eAAO,MAAM,0BAA0B,uBAA4B,OAAO,CAAG,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local Map = ____lualib.Map
|
|
3
|
-
local __TS__New = ____lualib.__TS__New
|
|
4
1
|
local ____exports = {}
|
|
5
2
|
--- The save data map is indexed by subscriber name. We use Lua tables instead of TypeScriptToLua
|
|
6
3
|
-- Maps for the master map so that we can access the variables via the in-game console when
|
|
7
4
|
-- debugging. (TSTL Maps don't expose the map keys as normal keys.)
|
|
8
5
|
____exports.saveDataMap = {}
|
|
9
6
|
____exports.saveDataDefaultsMap = {}
|
|
10
|
-
____exports.saveDataConditionalFuncMap =
|
|
7
|
+
____exports.saveDataConditionalFuncMap = {}
|
|
11
8
|
return ____exports
|