Skip to content

Commit

Permalink
音乐室添加富循环开关
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Nov 26, 2024
1 parent 95bc0b1 commit 6eab5b0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
1 change: 1 addition & 0 deletions assets/language/lang_en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ local L={
main_out_multi="Multiple",

musicroom_title="Musicroom",
musicroom_richloop="Rich Loop",
musicroom_fullband="Full Band",
musicroom_section='Chorus',
musicroom_autoplay="Auto Change",
Expand Down
1 change: 1 addition & 0 deletions assets/language/lang_eo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ local L={
main_out_multi="Multoblaj",

musicroom_title="Muzika ĉambro",
-- musicroom_richloop="Rich Loop",
musicroom_fullband="Plena Bando",
musicroom_section='Koruso',
musicroom_autoplay="Aŭtomata kantoŝanĝo",
Expand Down
1 change: 1 addition & 0 deletions assets/language/lang_it.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ local L={
main_out_multi="Multigiocatore",

musicroom_title="Stanza musicale",
-- musicroom_richloop="Rich Loop",
musicroom_fullband="Banda Piena",
musicroom_section='Coro',
musicroom_autoplay="Cambio automatico",
Expand Down
1 change: 1 addition & 0 deletions assets/language/lang_zh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ local L={
main_out_multi="联机",

musicroom_title="音乐室",
musicroom_richloop="富循环",
musicroom_fullband='全频带',
musicroom_section='副歌',
musicroom_autoplay="自动切换",
Expand Down
34 changes: 26 additions & 8 deletions assets/scene/musicroom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local sin=math.sin

local totalBgmCount

local selected,fullband,section
local selected,richloop,fullband,section
local collectCount=0
local noProgress=false
local autoplay=false ---@type number | false
Expand Down Expand Up @@ -53,11 +53,13 @@ local musicListBox do
selected=musicListBox:getItem()
local fullbandMode=SONGBOOK[selected].intensity and (noProgress or PROGRESS.getBgmUnlocked(selected)==2)
local sectionMode=SONGBOOK[selected].section and (noProgress or PROGRESS.getBgmUnlocked(selected)==2)
local loopMode=SONGBOOK[selected].hasloop
scene.widgetList.fullband:setVisible(fullbandMode)
scene.widgetList.section:setVisible(sectionMode)
scene.widgetList.progressBar.fillColor=SONGBOOK[selected].looppoint and COLOR.LD or COLOR.L
scene.widgetList.progressBar.fillColor=SONGBOOK[selected].hasloop and COLOR.LD or COLOR.L
if fullbandMode then fullband=fullband==true else fullband=nil end
if sectionMode then section=section==true else section=nil end
if loopMode then richloop=true else richloop=nil end
playBgm(selected,fullband,noProgress)
end
end
Expand Down Expand Up @@ -366,7 +368,8 @@ scene.widgetList={
{type='button_invis',pos={.5,.5},x=0,y=360,w=160,cornerR=80,text=CHAR.icon.stop,fontSize=90,code=WIDGET.c_pressKey'space',visibleTick=function() return FMOD.music.getPlaying() end},

-- Auto Switching Switch
{type='switch',pos={.5,.5},x=-650,y=150,h=50,widthLimit=260,labelPos='right',disp=function() return autoplay end,
{type='switch',pos={.5,.5},x=-650,y=90,h=50,widthLimit=260,labelPos='right',
disp=function() return autoplay end,
name='autoplay',text=LANG'musicroom_autoplay',
sound_on=false,sound_off=false,
code=function()
Expand All @@ -379,8 +382,24 @@ scene.widgetList={
end,
},

-- Richloop Switch
{type='switch',pos={.5,.5},x=-650,y=150,h=50,widthLimit=260,labelPos='right',
disp=function() return richloop end,
name='autoplay',text=LANG'musicroom_richloop',
sound_on=false,sound_off=false,
code=function()
richloop=not richloop
if FMOD.music.getPlaying() then
FMOD.music.setParam('loop',richloop and 1 or 0)
end
scene.widgetList.progressBar.fillColor=(SONGBOOK[selected].hasloop and richloop) and COLOR.LD or COLOR.L
end,
visibleTick=function() return richloop~=nil end,
},

-- Fullband Switch
{type='switch',pos={.5,.5},x=-650,y=360,h=50,widthLimit=260,labelPos='right',disp=function() return fullband end,
{type='switch',pos={.5,.5},x=-650,y=360,h=50,widthLimit=260,labelPos='right',
disp=function() return fullband end,
name='fullband',text=LANG'musicroom_fullband',
sound_on=false,sound_off=false,
code=function()
Expand All @@ -392,13 +411,12 @@ scene.widgetList={
scene.load()
end
end,
visibleTick=function()
return fullband~=nil
end,
visibleTick=function() return fullband~=nil end,
},

-- Section Switch
{type='switch',pos={.5,.5},x=-650,y=430,h=50,widthLimit=260,labelPos='right',disp=function() return section end,
{type='switch',pos={.5,.5},x=-650,y=430,h=50,widthLimit=260,labelPos='right',
disp=function() return section end,
name='section',text=LANG'musicroom_section',
sound_on=false,sound_off=false,
code=function()
Expand Down

0 comments on commit 6eab5b0

Please sign in to comment.