Skip to content

Commit 872459d

Browse files
committed
EA support
1 parent d128f18 commit 872459d

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

assets/textures/menu/mods.png

1.13 KB
Loading

lovely/mod-loader.toml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,26 @@ position = "before"
1818
payload = "loadMods()"
1919
match_indent = true
2020

21-
# handle error and allow custom path in basestate.new()
21+
# handle error and allow custom path
2222
[[patches]]
2323
[patches.pattern]
2424
target = "lib/basestate.lua"
2525
pattern = '''
26-
function basestate.new(name)
27-
basestate.states[name] = love.filesystem.load("states/" .. name .. ".lua") -- this is a bad idea
26+
function basestate.new(filename,name)
27+
name = name or filename
28+
basestate.states[name] = love.filesystem.load("states/" .. filename .. ".lua") -- this is a bad idea
2829
print("made state ".. name)
2930
end
3031
'''
3132
position = "at"
3233
payload = '''
33-
function basestate.new(name, dir)
34-
local source = dir or ("states/" .. name .. ".lua")
34+
function basestate.new(filename, name)
35+
name = name or filename
36+
basestate.fromPath(name, "states/" .. filename .. ".lua")
37+
end
38+
39+
function basestate.fromPath(name, path)
40+
local source = path or ("states/" .. name .. ".lua")
3541
basestate.states[name], error = love.filesystem.load(source)
3642
if error then
3743
print("[BB+] couldn't load state " .. name .. ". Error: " .. error)
@@ -54,7 +60,7 @@ self.mainMenu:addOption('Mods', function()
5460
self.menuMusicManager:clearOnBeatHooks()
5561
cs.menuMusicManager = self.menuMusicManager
5662
cs:init()
57-
end, 17 * 3)
63+
end, 17 * 3, nil, sprites.menu.mods)
5864
5965
for i = 1, 4 do
6066
self.mainMenu.options.main[i].y = self.mainMenu.options.main[i].y - 17

mod-loader.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function loadMods() -- loads mod data, assets, mod icons etc.
163163
-- load states
164164
loopFiles({}, modPath .. "/states", function(_, path, fileName)
165165
print("[BB+] injecting state " .. path .. "...")
166-
bs.new(fileName, path)
166+
bs.fromPath(fileName, path)
167167
end)
168168

169169
-- load entities

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"author":"BeatblockTools","description":"Mod loader for Beatblock","enabled":true,"config":[],"version":"1.4-beta3","id":"beatblock-plus","name":"Beatblock Plus"}
1+
{"author":"BeatblockTools","description":"Mod loader for Beatblock","enabled":true,"config":[],"version":"1.4","id":"beatblock-plus","name":"Beatblock Plus"}

0 commit comments

Comments
 (0)