Skip to content

Commit

Permalink
添加方便的更新bank途径
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Nov 5, 2024
1 parent 9079e57 commit e25c0d4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions assets/gamefunc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ function task_unloadGame()
collectgarbage()
end

function _getLatestBank(dt)
TASK.new(function()
MSG.new('info',"Opening URL to bank files...")
TASK.yieldT(dt or 0.626)
love.system.openURL("https://kyzj-my.sharepoint.com/:f:/g/personal/noreply_studio26f_org/ElmKJZYcNpFDhGks9nekrUYBoyr1ZJZgpx1lCyFu6tHXQg?e=vJnaQX")
end)
end

getTouches=love.touch.getTouches
isMouseDown=love.mouse.isDown
isKeyDown=love.keyboard.isDown
Expand Down
2 changes: 2 additions & 0 deletions assets/scene/setting_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ function scene.keyDown(key,isRep)
elseif act=='help' then
callDict('setting_out')
PROGRESS.setSecret('dict_shortcut')
elseif key=='d' then
_getLatestBank()
end
return true
end
Expand Down
6 changes: 6 additions & 0 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,14 @@ function FMODLoadFunc() -- Will be called again when applying advanced options
coreFlag=FMOD.FMOD_INIT_NORMAL,
}

local noFile
if not loadBank('soundbank/Master.strings.bank') then
MSG.new('warn',"Strings bank file load failed")
noFile=true
end
if not loadBank('soundbank/Master.bank') then
MSG.new('warn',"Master bank file load failed")
noFile=true
end
FMOD.registerMusic((function()
if not love.filesystem.getInfo('soundbank/Master.bank') then
Expand All @@ -391,6 +394,7 @@ function FMODLoadFunc() -- Will be called again when applying advanced options
MSG.new('warn',bankName.." bank file not found")
else
local bankMusic=loadBank('soundbank/'..bankName..'.bank')
noFile=true
if not bankMusic then
MSG.new('warn',"bank "..bankName.." load failed")
else
Expand All @@ -407,6 +411,8 @@ function FMODLoadFunc() -- Will be called again when applying advanced options
end
end
end
if noFile then _getLatestBank(2.6) end

-- print("--------------------------")
-- print("Musics")
-- for k,v in next,L do print(k,v)end
Expand Down

0 comments on commit e25c0d4

Please sign in to comment.