Skip to content

Commit d28f23f

Browse files
committed
更新mod逻辑获取为render中,更新至0.3.1
1 parent b731a8a commit d28f23f

File tree

7 files changed

+13
-22
lines changed

7 files changed

+13
-22
lines changed

dependencies/isaac_box/main.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
WEBSOCKET_PORT = 58869
2-
VERSION = "0.3.0"
2+
VERSION = "0.3.1"
33
Mod = RegisterMod("IsaacBox", 1)
44
local callbacks = require("modules.callbacks")
55

66
Mod:AddCallback(ModCallbacks.MC_POST_RENDER, callbacks.onPostRender)
77
Mod:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT,callbacks.onPreGameExit)
88
Mod:AddCallback(ModCallbacks.MC_POST_GAME_STARTED,callbacks.onPostGameStarted)
9-
Mod:AddCallback(ModCallbacks.MC_POST_GAME_END,callbacks.onPostGameEnd)
10-
Mod:AddCallback(ModCallbacks.MC_POST_UPDATE,callbacks.onPostUpdate)
9+
Mod:AddCallback(ModCallbacks.MC_POST_GAME_END,callbacks.onPostGameEnd)

dependencies/isaac_box/metadata.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<name>IsaacBox(auto installed)</name>
33
<directory>isaac_box</directory>
44
<description />
5-
<version>0.3.0</version>
5+
<version>0.3.1</version>
66
<visibility />
77
</metadata>

dependencies/isaac_box/modules/callbacks.lua

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ local function onPostRender()
1818
font:DrawStringScaledUTF8("[IsaacBox] Version:" .. (VERSION), 216, 0, 0.5,
1919
0.5,
2020
white, 0, false)
21+
if bridge.UpdateAllCollectibles() then
22+
websocket.emit("OFFER_ITEMS", require("json").encode(Items))
23+
end
2124
end
2225
end
2326

@@ -27,7 +30,7 @@ end
2730
-- Returning any value will have no effect on later callback executions.
2831
local function onPreGameExit(_, bool)
2932
if IsaacSocket == nil and not IsaacSocket.IsConnected() then return end
30-
websocket.emit("OFFER_ITEMS","[]")
33+
websocket.emit("OFFER_ITEMS", "[]")
3134
end
3235

3336
-- This function gets called when you start a game.
@@ -49,25 +52,14 @@ end
4952

5053
local function onPostGameEnd(_, bool)
5154
if IsaacSocket == nil and not IsaacSocket.IsConnected() then return end
52-
websocket.emit("OFFER_ITEMS","[]")
55+
websocket.emit("OFFER_ITEMS", "[]")
5356
end
5457

5558

56-
-- Called after every game update.
57-
-- Returning any value will have no effect on later callback executions.
58-
-- This callback is called 30 times per second.
59-
-- It will not be called, when its paused (for example on screentransitions or on the pause menu).
60-
local function onPostUpdate()
61-
if IsaacSocket == nil and not IsaacSocket.IsConnected() then return end
62-
if bridge.UpdateAllCollectibles() then
63-
websocket.emit("OFFER_ITEMS",require("json").encode(Items))
64-
end
65-
end
6659

6760
local Module = {}
6861
Module.onPostRender = onPostRender
6962
Module.onPreGameExit = onPreGameExit
7063
Module.onPostGameStarted = onPostGameStarted
7164
Module.onPostGameEnd = onPostGameEnd
72-
Module.onPostUpdate = onPostUpdate
7365
return Module

env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const parseString = promisify(require('xml2js').parseString);
66

77
const ISAAC_BOX_MOD_DIRNAME = "isaac_box"
88
const ISAAC_BOX_MOD_NAME = "IsaacBox(auto installed)"
9-
const TARGET_ISAAC_BOX_MOD_VERSION = "0.3.0"
9+
const TARGET_ISAAC_BOX_MOD_VERSION = "0.3.1"
1010

1111
const ISAAC_SOCKET_MOD_DIRNAME = "isaac_socket"
1212
const ISAAC_SOCKET_OFFICIAL_MOD_NAME = "IsaacSocket"

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "isaac-box",
33
"private": true,
4-
"version": "0.3.0",
4+
"version": "0.3.1",
55
"main": "main.js",
66
"author": "NOTF-API",
77
"description": "Isaac's Console Client based on IsaacSocket",

src/utils/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const I18N_TYPE = Object.freeze({
1616
FRENCH: 7
1717
})
1818

19-
const $VERSION_TEXT = "V0.3.0"
19+
const $VERSION_TEXT = "V0.3.1"
2020

2121
const messages = {
2222
[I18N_TYPE.ENGLISH]: {

0 commit comments

Comments
 (0)