Compare commits

...

16 Commits

Author SHA1 Message Date
MrZ626
707bcca368 Merge commit 'f8f115de10b4ef7818cf58bc03c9d75700e425b0' into test-new-mode-system 2021-12-27 14:26:32 +08:00
MrZ626
0498beecdf 特化新的模式选择场景名 2021-12-16 03:04:35 +08:00
MrZ626
b642f2b5c4 Merge branch 'main' into test-new-mode-system 2021-12-16 02:32:51 +08:00
MrZ626
462720881a 支持鼠标滚动模式列表 2021-12-16 02:07:49 +08:00
MrZ626
c9f8240234 添加模式搜索的帮助文本 2021-12-10 13:22:42 +08:00
MrZ626
f41f58e13f 模式文件夹可以显示作者 2021-12-10 01:49:05 +08:00
MrZ626
e81f25c216 修正段位更新条件
模式列表显示获得的段位
2021-12-10 01:37:14 +08:00
MrZ626
36fc681fbf 项目名太长会压缩显示 2021-12-09 20:10:46 +08:00
MrZ626
87e5e29129 彩蛋模式补充进模式树 2021-12-09 20:10:17 +08:00
MrZ626
6e78a3fedd 选择模式后右侧显示排行榜等信息 2021-12-09 19:41:42 +08:00
MrZ626
24760801af 增加模式图标显示,等待添加素材 2021-12-09 17:26:37 +08:00
MrZ626
f5e8e0f7a5 Merge commit 'df089a2f04fc44774e8dc722cc5d9948f94e5de5' into HEAD 2021-12-09 17:26:31 +08:00
MrZ626
5470387685 优化滚动
增加触摸控制
2021-12-09 15:55:09 +08:00
MrZ626
2f4a416353 整理代码
调整模式排列顺序
2021-12-09 15:13:09 +08:00
MrZ626
3dbafb042c 进一步优化 2021-12-09 15:04:17 +08:00
MrZ626
28103ad952 新模式选择菜单原型
删除模式图标
动态加载所有模式
2021-12-09 03:20:57 +08:00
70 changed files with 660 additions and 648 deletions

View File

@@ -24,7 +24,7 @@ VERSION=require"version"
TIME=love.timer.getTime
YIELD=coroutine.yield
SYSTEM=love.system.getOS()if SYSTEM=='OS X'then SYSTEM='macOS'end
FNNS=true or SYSTEM:find'\79\83'--What does FNSF stand for? IDK so don't ask me lol
FNNS=SYSTEM:find'\79\83'--What does FNSF stand for? IDK so don't ask me lol
MOBILE=SYSTEM=='Android'or SYSTEM=='iOS'
SAVEDIR=fs.getSaveDirectory()
@@ -128,7 +128,7 @@ BOT= require'parts.bot'
RSlist= require'parts.RSlist'DSCP=RSlist.TRS.centerPos
PLY= require'parts.player'
NETPLY= require'parts.netPlayer'
MODES= require'parts.modes'
MODETREE= require'parts.modeTree'
setmetatable(TEXTURE,{__index=function(self,k)
MES.new('warn',"No texture called: "..k)
@@ -271,6 +271,7 @@ IMG.init{
speedLimit='media/image/mess/speedLimit.png',--Not used, for future C2-mode
pay1='media/image/mess/pay1.png',
pay2='media/image/mess/pay2.png',
drought='media/image/mess/drought.png',
miyaCH1='media/image/characters/miya1.png',
miyaCH2='media/image/characters/miya2.png',
@@ -409,24 +410,6 @@ for _,v in next,fs.getDirectoryItems('parts/scenes')do
LANG.addScene(sceneName)
end
end
--Load mode files
for i=1,#MODES do
local m=MODES[i]--Mode template
if isSafeFile('parts/modes/'..m.name)then
TABLE.complete(require('parts.modes.'..m.name),MODES[i])
MODES[m.name],MODES[i]=MODES[i]
end
end
for _,v in next,fs.getDirectoryItems('parts/modes')do
if isSafeFile('parts/modes/'..v)and not MODES[v:sub(1,-5)]then
local M={name=v:sub(1,-5)}
local modeData=require('parts.modes.'..M.name)
if modeData.env then
TABLE.complete(modeData,M)
MODES[M.name]=M
end
end
end
table.insert(_LOADTIMELIST_,("Load Files: %.3fs"):format(TIME()-_LOADTIME_))
@@ -554,26 +537,8 @@ do
if type(name)=='number'or type(rank)~='number'then
RANKS[name]=nil
needSave=true
else
local M=MODES[name]
if M and M.unlock and rank>0 then
for _,unlockName in next,M.unlock do
if not RANKS[unlockName]then
RANKS[unlockName]=0
needSave=true
end
end
end
if not(M and M.x)then
RANKS[name]=nil
needSave=true
end
end
end
if not MODES[STAT.lastPlay]then
STAT.lastPlay='sprint_10l'
needSave=true
end
if needSave then
saveStats()

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -28,7 +28,7 @@ return{
end
setFont(50)
mStr(P.modeData.drought,63,130)
mDraw(MODES.drought_l.icon,63,200,nil,.5)
mDraw(IMG.drought,63,200,nil,.5)
end
end,
task=function(P)

View File

@@ -28,7 +28,7 @@ return{
end
setFont(50)
mStr(P.modeData.drought,63,130)
mDraw(MODES.drought_l.icon,63,200,nil,.5)
mDraw(IMG.drought,63,200,nil,.5)
end
end,
task=function(P)

View File

@@ -28,7 +28,7 @@ return{
end
setFont(50)
mStr(P.modeData.drought,63,130)
mDraw(MODES.drought_l.icon,63,200,nil,.5)
mDraw(IMG.drought,63,200,nil,.5)
end
end,
task=function(P)

View File

@@ -95,7 +95,8 @@ do--function loadFile(name,args), function saveFile(data,name,args)
end
end
function isSafeFile(file,mes)
if love.filesystem.getRealDirectory(file)~=SAVEDIR then
local path=love.filesystem.getRealDirectory(file)
if path and path~=SAVEDIR then
return true
elseif mes then
MES.new('warn',mes)
@@ -497,12 +498,9 @@ end
function loadGame(mode,ifQuickPlay,ifNet)--Load a mode and go to game scene
freshDate()
if legalGameTime()then
if not MODES[mode]and love.filesystem.getRealDirectory('parts/modes/'..mode)~=SAVEDIR then
MODES[mode]=require('parts.modes.'..mode)
MODES[mode].name=mode
end
if MODES[mode].score then
STAT.lastPlay=mode
if not MODES[mode].available then
MES.new('error',"Unavailable mode: "..mode)
return
end
GAME.playing=true
GAME.init=true
@@ -543,29 +541,9 @@ function gameOver()--Save record
GAME.rank=R
end
if not GAME.replaying and M.score and scoreValid()then
if RANKS[M.name]then--Old rank exist
local needSave
if R>RANKS[M.name]then
RANKS[M.name]=R
needSave=true
end
if R>0 then
if M.unlock then
for i=1,#M.unlock do
local m=M.unlock[i]
local n=MODES[m].name
if not RANKS[n]then
if MODES[m].x then
RANKS[n]=0
end
needSave=true
end
end
end
end
if needSave then
saveProgress()
end
if not RANKS[M.name]or R>RANKS[M.name]then--Old rank exist
RANKS[M.name]=R
saveProgress()
end
local D=M.score(P)
local L=M.records

View File

@@ -13,6 +13,13 @@ BLOCK_COLORS={
COLOR.dH,COLOR.D,COLOR.lY,COLOR.H,COLOR.lH,COLOR.dV,COLOR.dR,COLOR.dG,
}
RANK_CHARS={'B','A','S','U','X'}for i=1,#RANK_CHARS do RANK_CHARS[i]=CHAR.icon['rank'..RANK_CHARS[i]]end
RANK_BASE_COLORS={
{.1,.2,.3},
{.3,.42,.32},
{.45,.44,.15},
{.42,.25,.2},
{.42,.15,.4},
}
RANK_COLORS={
{.8,.86,.9},
{.6,.9,.7},
@@ -724,3 +731,44 @@ do--Userdata tables
todayTime=0,
}
end
do--Mode data tables
MODES=setmetatable({},{__index=function(self,name)
local M
if love.filesystem.getInfo('parts/modes/'..name..'.lua')and love.filesystem.getRealDirectory('parts/modes/'..name..'.lua')~=SAVEDIR then
M=require('parts.modes.'..name)
M.available=true
M.name=name
do--Check if need slowmark
for k in next,M.env do
if
k=='mindas'or k=='minarr'or
k=='das'or k=='arr'or
k=='minsdarr'
then
M.slowMark=true
break
end
end
end
if M.score then
M.records=loadFile("record/"..name..".rec",'-luaon -canSkip')or{}
end
else
M={
available=false,
}
MES.new('error',"Failed to load mode file: "..name)
end
self[name]=M
return M
end})
MODEICON=setmetatable({},{__index=function(self,k)
if isSafeFile('media/image/modeicon/'..k..'.png')then
local img=love.graphics.newImage('media/image/modeicon/'..k..'.png')
self[k]=img
return img
else
return PAPER
end
end})
end

View File

@@ -5,7 +5,6 @@ return{
loadSample="Loading instrument samples",
loadVoice="Loading voice packs",
loadFont="Loading fonts",
loadModeIcon="Loading mode icons",
loadMode="Loading modes",
loadOther="Loading other assets",
finish="Press any key to start!",
@@ -138,7 +137,8 @@ return{
chatStart="------Beginning of log------",
chatHistory="------New messages below------",
keySettingInstruction="Press to bind key\nescape: cancel\nbackspace: delete",
searchModeHelp="Type to search",
keySettingHelp="Press to bind key\nescape: cancel\nbackspace: delete",
customBGhelp="Drop image file here to apply custom background",
customBGloadFailed="Unsupport image format for custom background",
@@ -252,9 +252,8 @@ return{
sprint="Sprint",
marathon="Marathon",
},
mode={
modeExplorer={
mod="Mods (F1)",
start="Start",
},
mod={
title="Mods",

View File

@@ -127,7 +127,8 @@ return{
chatStart="------Comienzo del historial------",
chatHistory="------Nuevos mensajes------",
keySettingInstruction="Pulsa la tecla a mapear\nEsc.: Cancelar\nBackspace: Borrar",
-- searchModeHelp="Type to search",
keySettingHelp="Pulsa la tecla a mapear\nEsc.: Cancelar\nBackspace: Borrar",
customBGhelp="Suelta una imagen aquí para aplicarla de fondo",
customBGloadFailed="Formato de imagen no soportado",
@@ -218,9 +219,8 @@ return{
sprint="Sprint",
marathon="Maratón",
},
mode={
modeExplorer={
mod="Mods (F1)",
start="Empezar",
},
mod={
title="Mods",

View File

@@ -128,7 +128,8 @@ return{
chatStart="--------Début des logs--------",
chatHistory="-Nouveaux messages en dessous-",
-- keySettingInstruction="Press to bind key\nescape: cancel\nbackspace: delete",
-- searchModeHelp="Type to search",
-- keySettingHelp="Press to bind key\nescape: cancel\nbackspace: delete",
-- customBGhelp="Drop image file here to apply custom background",
-- customBGloadFailed="Unsupport image format for custom background",
@@ -214,9 +215,8 @@ return{
dict="Zictionary",
-- replays="Replays",
},
mode={
modeExplorer={
mod="Mods (F1)",
start="Démarrer",
},
mod={
title="Mods",

View File

@@ -6,7 +6,6 @@ return{
loadSample="Memuat sampel-sampel instrumen",
loadVoice="Memuat kumpulan suara",
loadFont="Memuat fon",
loadModeIcon="Memuat ikon-ikon mode",
loadMode="Memuat mode-mode",
loadOther="Memuat aset-aset yang lain",
finish="Tekan tombol apapun untuk memulai!",
@@ -139,7 +138,8 @@ return{
chatStart="------Awal percakapan------",
chatHistory="------Pesan-pesan baru di bawah ini------",
keySettingInstruction="Tekan untuk menghubung tombol ke aksi tertentu\nescape: batal\nbackspace: hapus",
-- searchModeHelp="Type to search",
keySettingHelp="Tekan untuk menghubung tombol ke aksi tertentu\nescape: batal\nbackspace: hapus",
customBGhelp="Seret file gambar di sini untuk memasangkan background",
customBGloadFailed="Format file gambar tidak didukung untuk background",
@@ -253,9 +253,8 @@ return{
sprint="Balapan",
marathon="Maraton",
},
mode={
modeExplorer={
mod="Mod (F1)",
start="Mulai",
},
mod={
title="Mod",

View File

@@ -126,7 +126,8 @@ return{
chatStart="------Começo do log------",
chatHistory="------Novas mensagens abaixo------",
-- keySettingInstruction="Press to bind key\nescape: cancel\nbackspace: delete",
-- searchModeHelp="Type to search",
-- keySettingHelp="Press to bind key\nescape: cancel\nbackspace: delete",
-- customBGhelp="Drop image file here to apply custom background",
-- customBGloadFailed="Unsupport image format for custom background",
@@ -240,9 +241,8 @@ return{
sprint="Sprint",
marathon="Maratona",
},
mode={
modeExplorer={
mod="Mods (F1)",
start="Começar",
},
mod={
title="Mods",

View File

@@ -6,7 +6,6 @@ return{
loadSample="#~#",
loadVoice="#<()==)#",
loadFont="#Aa#",
loadModeIcon="#[ ]#",
loadMode="#[…]#",
loadOther="#…#",
finish="&",
@@ -143,9 +142,8 @@ return{
dict="z",
replays="=~~~",
},
mode={
modeExplorer={
mod="?!?!?!(F1)",
start="!!!",
},
mod={
title="?!?!?!",

View File

@@ -4,7 +4,6 @@ return{fallback='zh',
loadSample="乐器",
loadVoice="语音",
loadFont="字体",
loadModeIcon="模式图标",
loadMode="模式",
loadOther="其他",
finish="走你",

View File

@@ -5,7 +5,6 @@ return{
loadSample="加载乐器采样",
loadVoice="加载语音资源",
loadFont="缓存字体资源",
loadModeIcon="加载模式图标",
loadMode="加载模式",
loadOther="加载杂项",
finish="按任意键继续",
@@ -138,7 +137,8 @@ return{
chatStart="------消息的开头------",
chatHistory="------以上是历史消息------",
keySettingInstruction="点击添加键位绑定\nesc取消选中\n退格键清空选中",
searchModeHelp="直接输入关键词搜索",
keySettingHelp="点击添加键位绑定\nesc取消选中\n退格键清空选中",
customBGhelp="把图片文件拖到这个窗口里使用自定义背景",
customBGloadFailed="自定义背景的图片文件格式不支持",
@@ -252,9 +252,8 @@ return{
sprint="40行",
marathon="马拉松",
},
mode={
modeExplorer={
mod="Mods (F1)",
start="开始",
},
mod={
title="Mods",

View File

@@ -50,7 +50,7 @@ return{
radar={"","","","","",""},
radarData={"防/分","守/分","攻/分","送/分","行/分","挖/分"},
WidgetText={
mode={
modeExplorer={
mod="模组(F1)",
},
mod={

View File

@@ -5,7 +5,6 @@ return{
loadSample="装载仪器样品",
loadVoice="加载语音包",
loadFont="加载字体",
loadModeIcon="加载模式图标",
loadMode="加载方式",
loadOther="加载其他资产",
finish="按任意按钮开始!",
@@ -136,7 +135,8 @@ return{
chatStart="------日志开始------",
chatHistory="------下面是新消息------",
keySettingInstruction="按绑定键\n退出:取消\n退格:删除",
searchModeHelp="键入要搜索的内容",
keySettingHelp="按绑定键\n退出:取消\n退格:删除",
customBGhelp="将图像文件拖放到此处以应用自定义背景",
customBGloadFailed="不支持自定义背景的图像格式",
@@ -250,9 +250,9 @@ return{
sprint="冲刺",
marathon="马拉松赛跑",
},
mode={
modeExplorer={
mod="多重器官衰竭(F1)",
start="开始",
sel="选择",
},
mod={
title="多重器官衰竭",

View File

@@ -5,7 +5,6 @@ return{
loadSample="加載樂器取樣",
loadVoice="加載語音資源",
loadFont="加載字體資源",
loadModeIcon="加載模式圖標",
loadMode="加載模式",
loadOther="加載雜項",
finish="按任意鍵繼續!",
@@ -138,7 +137,8 @@ return{
chatStart="------訊息開始------",
chatHistory="------以上為歷史訊息------",
keySettingInstruction="點擊來設置鍵位\n按esc來取消選中\n按退格鍵來清除選中",
searchModeHelp="直接輸入關鍵字搜索",
keySettingHelp="點擊來設置鍵位\n按esc來取消選中\n按退格鍵來清除選中",
customBGhelp="把圖片檔案拖到這個視窗裏使用自定義背景",
customBGloadFailed="自定義背景的圖片檔案格式不支持",
@@ -252,9 +252,8 @@ return{
sprint="40行",
marathon="馬拉松",
},
mode={
modeExplorer={
mod="Mods (F1)",
start="開始",
},
mod={
title="Mods",

163
parts/modeTree.lua Normal file
View File

@@ -0,0 +1,163 @@
return{
{folder=true,name='sprint',
{name='sprint_10l'},
{name='sprint_20l'},
{name='sprint_40l'},
{name='sprint_100l'},
{name='sprint_400l'},
{name='sprint_1000l'},
},
{folder=true,name='marathon',
{name='marathon_n'},
{name='marathon_h'},
{name='master_n'},
{name='master_h'},
{name='master_m'},
{name='master_final'},
{name='master_ph'},
{name='master_ex'},
},
{folder=true,name='dig_sprint',
{name='dig_10l'},
{name='dig_40l'},
{name='dig_100l'},
{name='dig_400l'},
},
{folder=true,name='survival',author='MrZ',
{folder=true,name='survivor',
{name='survivor_e'},
{name='survivor_n'},
{name='survivor_h'},
{name='survivor_l'},
{name='survivor_u'},
},
{folder=true,name='attacker',
{name='attacker_h'},
{name='attacker_u'},
},
{folder=true,name='defender',
{name='defender_n'},
{name='defender_l'},
},
{folder=true,name='dig',
{name='dig_h'},
{name='dig_u'},
},
},
{folder=true,name='battle',
{folder=true,name='solo',
{name='solo_e'},
{name='solo_n'},
{name='solo_h'},
{name='solo_l'},
{name='solo_u'},
},
{folder=true,name='round',
{name='round_e'},
{name='round_n'},
{name='round_h'},
{name='round_l'},
{name='round_u'},
},
{folder=true,name='techmino',author='MrZ',
{name='techmino49_e'},
{name='techmino49_h'},
{name='techmino49_u'},
{name='techmino99_e'},
{name='techmino99_h'},
{name='techmino99_u'},
},
},
{folder=true,name='drought',author='MrZ',
{name='drought_n'},
{name='drought_l'},
},
{folder=true,name='blind',author='MrZ',
{name='blind_e'},
{name='blind_n'},
{name='blind_h'},
{name='blind_l'},
{name='blind_u'},
{name='blind_wtf'},
},
{folder=true,name='classic',
{name='classic_e'},
{name='classic_h'},
{name='classic_u'},
},
{folder=true,name='train',author='MrZ',
{name='clearRush'},
{name='c4wtrain_n'},
{name='c4wtrain_l'},
{name='pctrain_n'},
{name='pctrain_l'},
},
{folder=true,name='pc',author='MrZ',
{name='pc_n'},
{name='pc_h'},
{name='pc_l'},
{name='pc_inf'},
},
{folder=true,name='tech',author='MrZ',
{name='sprintAtk'},
{name='sprintEff'},
{name='tech_n'},
{name='tech_n_plus'},
{name='tech_h'},
{name='tech_h_plus'},
{name='tech_l'},
{name='tech_l_plus'},
{name='tech_finesse'},
{name='tech_finesse_f'},
},
{folder=true,name='tsd',author='MrZ',
{name='tsd_e'},
{name='tsd_h'},
{name='tsd_u'},
},
{folder=true,name='backfire',author='MrZ',
{name='backfire_n'},
{name='backfire_h'},
{name='backfire_l'},
{name='backfire_u'},
},
{folder=true,name='infinite',
{name='zen'},
{name='ultra'},
{name='infinite'},
{name='infinite_dig'},
{name='marathon_inf'},
},
{folder=true,name='special',author='MrZ',
{folder=true,name='sprint',
{name='sprintPenta'},
{name='sprintMPH'},
{name='sprintSmooth'},
{name='sprintMD'},
{name='sprintSym'},
{name='sprintLock'},
{name='sprintFix'},
},
{folder=true,name='sprint',
{name='stack_e'},
{name='stack_u'},
},
{folder=true,name='sprint',
{name='techrash_n'},
{name='techrash_u'},
},
{name='marathon_bfmax'},
},
{folder=true,name='big_pack',author='NOT_A_ROBOT',
{name='big_n'},
{name='big_h'},
},
{folder=true,name='strategy_pack',author='Milla',
{name='strategy_e'},
{name='strategy_h'},
{name='strategy_u'},
{name='strategy_e_plus'},
{name='strategy_h_plus'},
{name='strategy_u_plus'},
},
}

View File

@@ -1,119 +0,0 @@
return{
{name='sprint_10l', x=0, y=0, size=40,shape=1,icon="sprint1", unlock={'sprint_20l','sprint_40l'}},
{name='sprint_20l', x=-200, y=200, size=50,shape=1,icon="sprint1"},
{name='sprint_40l', x=0, y=-300, size=40,shape=1,icon="sprint2", unlock={'dig_10l','sprint_100l','marathon_n','sprintPenta','sprintMPH'}},
{name='sprint_100l', x=-200, y=0, size=50,shape=1,icon="sprint2", unlock={'sprint_400l','drought_n'}},
{name='sprint_400l', x=-400, y=0, size=40,shape=1,icon="sprint3", unlock={'sprint_1000l'}},
{name='sprint_1000l', x=-600, y=0, size=40,shape=1,icon="sprint3"},
{name='sprintPenta', x=180, y=-160, size=40,shape=3,icon="sprint2"},
{name='sprintMPH', x=220, y=-340, size=40,shape=3,icon="sprint2"},
{name='drought_n', x=-400, y=200, size=40,shape=1,icon="drought", unlock={'drought_l'}},
{name='drought_l', x=-600, y=200, size=40,shape=1,icon="drought"},
{name='dig_10l', x=-200, y=-200, size=40,shape=1,icon="dig_sprint", unlock={'dig_40l'}},
{name='dig_40l', x=-400, y=-200, size=40,shape=1,icon="dig_sprint", unlock={'dig_100l'}},
{name='dig_100l', x=-600, y=-200, size=40,shape=1,icon="dig_sprint", unlock={'dig_400l'}},
{name='dig_400l', x=-800, y=-200, size=40,shape=1,icon="dig_sprint"},
{name='marathon_n', x=0, y=-600, size=60,shape=1,icon="marathon", unlock={'marathon_h','solo_e','round_e','blind_e','classic_e','survivor_e','clearRush','zen'}},
{name='marathon_h', x=0, y=-800, size=50,shape=1,icon="marathon", unlock={'master_n','strategy_e'}},
{name='solo_e', x=-600, y=-1000, size=40,shape=1,icon="solo", unlock={'solo_n'}},
{name='solo_n', x=-800, y=-1000, size=40,shape=1,icon="solo", unlock={'solo_h'}},
{name='solo_h', x=-1000, y=-1000, size=40,shape=1,icon="solo", unlock={'solo_l','techmino49_e'}},
{name='solo_l', x=-1200, y=-1000, size=40,shape=1,icon="solo", unlock={'solo_u'}},
{name='solo_u', x=-1400, y=-1000, size=40,shape=1,icon="solo"},
{name='techmino49_e', x=-1100, y=-1200, size=40,shape=1,icon="t49", unlock={'techmino49_h','techmino99_e'}},
{name='techmino49_h', x=-1100, y=-1400, size=40,shape=1,icon="t49", unlock={'techmino49_u'}},
{name='techmino49_u', x=-1100, y=-1600, size=40,shape=1,icon="t49"},
{name='techmino99_e', x=-1300, y=-1400, size=40,shape=1,icon="t99", unlock={'techmino99_h'}},
{name='techmino99_h', x=-1300, y=-1600, size=40,shape=1,icon="t99", unlock={'techmino99_u'}},
{name='techmino99_u', x=-1300, y=-1800, size=40,shape=1,icon="t99"},
{name='round_e', x=-600, y=-800, size=40,shape=1,icon="round", unlock={'round_n'}},
{name='round_n', x=-800, y=-800, size=40,shape=1,icon="round", unlock={'round_h'}},
{name='round_h', x=-1000, y=-800, size=40,shape=1,icon="round", unlock={'round_l'}},
{name='round_l', x=-1200, y=-800, size=40,shape=1,icon="round", unlock={'round_u'}},
{name='round_u', x=-1400, y=-800, size=40,shape=1,icon="round"},
{name='master_n', x=0, y=-1000, size=40,shape=1,icon="master", unlock={'master_h','strategy_h'}},
{name='master_h', x=0, y=-1200, size=40,shape=3,icon="master", unlock={'master_final','master_ex','master_ph','master_m','strategy_u'}},
{name='master_m', x=150, y=-1320, size=30,shape=3,icon="master"},
{name='master_final', x=0, y=-1600, size=40,shape=2,icon="master"},
{name='master_ph', x=-150, y=-1500, size=40,shape=2,icon="master"},
{name='master_ex', x=150, y=-1500, size=40,shape=2,icon="master_ex"},
{name='strategy_e', x=-150, y=-1030, size=40,shape=3,icon="master"},
{name='strategy_h', x=-200, y=-1160, size=35,shape=3,icon="master"},
{name='strategy_u', x=-250, y=-1290, size=30,shape=2,icon="master"},
{name='blind_e', x=150, y=-700, size=40,shape=1,icon="hidden", unlock={'blind_n'}},
{name='blind_n', x=150, y=-800, size=40,shape=1,icon="hidden", unlock={'blind_h'}},
{name='blind_h', x=150, y=-900, size=35,shape=1,icon="hidden", unlock={'blind_l'}},
{name='blind_l', x=150, y=-1000, size=35,shape=3,icon="hidden2", unlock={'blind_u'}},
{name='blind_u', x=150, y=-1100, size=30,shape=3,icon="hidden2", unlock={'blind_wtf'}},
{name='blind_wtf', x=150, y=-1200, size=25,shape=2,icon="hidden2"},
{name='classic_e', x=-200, y=-850, size=40,shape=1,icon="classic", unlock={'classic_h'}},
{name='classic_h', x=-300, y=-950, size=35,shape=2,icon="classic", unlock={'classic_u'}},
{name='classic_u', x=-400, y=-1050, size=30,shape=2,icon="classic"},
{name='survivor_e', x=300, y=-600, size=40,shape=1,icon="survivor", unlock={'survivor_n'}},
{name='survivor_n', x=500, y=-600, size=40,shape=1,icon="survivor", unlock={'survivor_h','attacker_h','defender_n','dig_h'}},
{name='survivor_h', x=700, y=-600, size=40,shape=1,icon="survivor", unlock={'survivor_l'}},
{name='survivor_l', x=900, y=-600, size=40,shape=3,icon="survivor", unlock={'survivor_u'}},
{name='survivor_u', x=1100, y=-600, size=40,shape=2,icon="survivor"},
{name='attacker_h', x=300, y=-800, size=40,shape=1,icon="attack", unlock={'attacker_u'}},
{name='attacker_u', x=300, y=-1000, size=40,shape=1,icon="attack"},
{name='defender_n', x=500, y=-800, size=40,shape=1,icon="defend", unlock={'defender_l'}},
{name='defender_l', x=500, y=-1000, size=40,shape=1,icon="defend"},
{name='dig_h', x=700, y=-800, size=40,shape=1,icon="dig", unlock={'dig_u'}},
{name='dig_u', x=700, y=-1000, size=40,shape=1,icon="dig"},
{name='clearRush', x=400, y=-400, size=50,shape=1,icon="bigbang", unlock={'c4wtrain_n','pctrain_n','sprintAtk'}},
{name='c4wtrain_n', x=700, y=-400, size=40,shape=1,icon="pc", unlock={'c4wtrain_l'}},
{name='c4wtrain_l', x=900, y=-400, size=40,shape=1,icon="pc"},
{name='pctrain_n', x=700, y=-250, size=40,shape=1,icon="pc", unlock={'pctrain_l','pc_n'}},
{name='pctrain_l', x=900, y=-250, size=40,shape=1,icon="pc"},
{name='pc_n', x=800, y=-110, size=40,shape=1,icon="pc", unlock={'pc_h'}},
{name='pc_h', x=950, y=-110, size=40,shape=3,icon="pc", unlock={'pc_l','pc_inf'}},
{name='pc_l', x=1100, y=-110, size=40,shape=3,icon="pc"},
{name='pc_inf', x=1100, y=-250, size=40,shape=2,icon="pc"},
{name='sprintAtk', x=530, y=-150, size=40,shape=1,icon="sprint2", unlock={'sprintEff','tech_n','tech_finesse','tsd_e','backfire_n'}},
{name='sprintEff', x=360, y=-150, size=40,shape=1,icon="sprint2"},
{name='tech_n', x=400, y=50, size=40,shape=1,icon="tech", unlock={'tech_n_plus','tech_h'}},
{name='tech_n_plus', x=200, y=20, size=40,shape=3,icon="tech"},
{name='tech_h', x=400, y=200, size=40,shape=1,icon="tech", unlock={'tech_h_plus','tech_l'}},
{name='tech_h_plus', x=200, y=170, size=35,shape=3,icon="tech"},
{name='tech_l', x=400, y=350, size=40,shape=1,icon="tech", unlock={'tech_l_plus'}},
{name='tech_l_plus', x=200, y=320, size=35,shape=3,icon="tech"},
{name='tech_finesse', x=800, y=50, size=40,shape=1,icon="tech", unlock={'tech_finesse_f'}},
{name='tech_finesse_f',x=1000, y=50, size=40,shape=1,icon="tech"},
{name='tsd_e', x=720, y=200, size=40,shape=1,icon="tsd", unlock={'tsd_h'}},
{name='tsd_h', x=960, y=200, size=40,shape=1,icon="tsd", unlock={'tsd_u'}},
{name='tsd_u', x=1200, y=200, size=40,shape=1,icon="tsd"},
{name='backfire_n', x=650, y=350, size=40,shape=1,icon="backfire", unlock={'backfire_h'}},
{name='backfire_h', x=850, y=350, size=40,shape=1,icon="backfire", unlock={'backfire_l'}},
{name='backfire_l', x=1050, y=350, size=40,shape=3,icon="backfire", unlock={'backfire_u'}},
{name='backfire_u', x=1250, y=350, size=35,shape=2,icon="backfire"},
{name='zen', x=-1000, y=-600, size=40,shape=1,icon="zen", unlock={'ultra','infinite','infinite_dig','marathon_inf'}},
{name='ultra', x=-1200, y=-600, size=40,shape=1,icon="ultra"},
{name='infinite', x=-1200, y=-400, size=40,shape=1,icon='infinite'},
{name='infinite_dig', x=-1000, y=-400, size=40,shape=1,icon="dig"},
{name='marathon_inf', x=-800, y=-400, size=40,shape=1,icon="marathon"}
}

View File

@@ -6,7 +6,6 @@ return{
eventSet='classic_e',
bg='rgb',bgm='1980s',
},
slowMark=true,
score=function(P)return{P.stat.score,P.stat.row}end,
scoreDisp=function(D)return D[1].." "..D[2].." Lines"end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -6,7 +6,6 @@ return{
eventSet='classic_h',
bg='rgb',bgm='1980s',
},
slowMark=true,
score=function(P)return{P.stat.score,P.stat.row}end,
scoreDisp=function(D)return D[1].." "..D[2].." Lines"end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -6,7 +6,6 @@ return{
eventSet='classic_u',
bg='rgb',bgm='1980s',
},
slowMark=true,
score=function(P)return{P.stat.score,P.stat.row}end,
scoreDisp=function(D)return D[1].." "..D[2].." Lines"end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -5,7 +5,6 @@ return{
eventSet='marathon_bfmax',
bg='bg2',bgm='blank',
},
slowMark=true,
getRank=function(P)
local L=P.stat.row
if L>=200 then

View File

@@ -6,7 +6,6 @@ return{
eventSet='marathon_h',
bg='cubes',bgm='push',
},
slowMark=true,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -6,7 +6,6 @@ return{
eventSet='marathon_inf',
bg='bg2',bgm='push',
},
slowMark=true,
score=function(P)return{P.stat.score,P.stat.row,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..D[2].."L "..STRING.time(D[3])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -6,7 +6,6 @@ return{
eventSet='marathon_n',
bg='bg2',bgm='push',
},
slowMark=true,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -5,7 +5,6 @@ return{
eventSet='master_ex',
bg='blockspace',bgm='hope',
},
slowMark=true,
score=function(P)return{P.modeData.rankPoint,P.stat.score}end,
scoreDisp=function(D)return sectionName[math.floor(D[1]/10)+1].." "..D[2]end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]>b[2]end,

View File

@@ -4,7 +4,6 @@ return{
eventSet='master_final',
bg='lightning',bgm='rectification',
},
slowMark=true,
score=function(P)return{P.modeData.pt,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -5,7 +5,6 @@ return{
eventSet='master_h',
bg='bg2',bgm='secret7th',
},
slowMark=true,
score=function(P)return{P.modeData.pt,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..STRING.time(D[2])end,
comp=function(a,b)

View File

@@ -4,7 +4,6 @@ return{
eventSet='master_m',
bg='bg2',bgm='super7th',
},
slowMark=true,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -5,7 +5,6 @@ return{
eventSet='master_n',
bg='bg1',bgm='secret8th',
},
slowMark=true,
score=function(P)return{P.modeData.pt,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..STRING.time(D[2])end,
comp=function(a,b)

View File

@@ -3,7 +3,6 @@ return{
eventSet='master_ph',
bg='blockspace',bgm='race remix',
},
slowMark=true,
score=function(P)return{P.result=='win'and 260 or P.modeData.pt,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -4,7 +4,6 @@ return{
eventSet='strategy_e',
bg='bg2',bgm='push',
},
slowMark=true,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -4,7 +4,6 @@ return{
eventSet='strategy_e_plus',
bg='bg2',bgm='push',
},
slowMark=true,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -4,7 +4,6 @@ return{
eventSet='strategy_h',
bg='bg2',bgm='secret8th',
},
slowMark=true,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -4,7 +4,6 @@ return{
eventSet='strategy_h_plus',
bg='bg2',bgm='secret8th',
},
slowMark=true,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -4,7 +4,6 @@ return{
eventSet='strategy_u',
bg='bg2',bgm='secret7th',
},
slowMark=true,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -4,7 +4,6 @@ return{
eventSet='strategy_u_plus',
bg='bg2',bgm='secret7th',
},
slowMark=true,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -7,7 +7,6 @@ return{
eventSet='checkAttack_100',
bg='flink',bgm='infinite',
},
slowMark=true,
score=function(P)return{P.stat.atk<=100 and math.floor(P.stat.atk)or 100,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -20,7 +20,6 @@ return{
hook_drop=tech_check_hard,
bg='flink',bgm='infinite',
},
slowMark=true,
score=function(P)return{P.stat.atk<=100 and math.floor(P.stat.atk)or 100,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..STRING.time(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,

View File

@@ -7,7 +7,6 @@ return{
eventSet='ultra',
bg='fan',bgm='sakura',
},
slowMark=true,
score=function(P)return{P.stat.score}end,
scoreDisp=function(D)return tostring(D[1])end,
comp=function(a,b)return a[1]>b[1]end,

View File

@@ -37,69 +37,6 @@ local loadingThread=coroutine.wrap(function()
YIELD('loadVoice')VOC.load('media/vocal/'..SETTING.vocPack..'/')
YIELD('loadFont')for i=1,17 do getFont(15+5*i)getFont(15+5*i,'mono')end
YIELD('loadModeIcon')
local modeIcons={}
modeIcons.marathon=GC.DO{64,64,
{'move',3,1},
{'fRect',20,6,-4,42},
{'fPoly',20,6,48,20,20,34},
{'fRect',8,48,20,6},
}
modeIcons.infinite=GC.DO{64,64,
{'setLW',4},
{'dCirc',32,32,28},
{'line',32,32,32,14},
{'line',32,32,41,41},
{'move',.5,.5},
{'fRect',30,7,4,4},
{'fRect',7,30,4,4},
{'fRect',52,30,4,4},
{'fRect',30,52,4,4},
}
modeIcons.classic=GC.DO{64,64,
{'setLW',6},
{'dRect',10,24,12,12},
{'dRect',26,24,12,12},
{'dRect',42,24,12,12},
{'dRect',26,40,12,12},
}
modeIcons.tsd=GC.DO{64,64,
{'fRect',7,7,16,16},
{'fRect',7,41,16,16},
{'fRect',41,41,16,16},
{'move',.5,.5},
{'setLW',1},
{'dPoly',7,24,56,24,56,39,39,39,39,56,24,56,24,39,7,39},
}
modeIcons.t49=GC.DO{64,64,
{'setLW',2},
{'dRect',05,05,10,20},{'dRect',49,05,10,20},
{'dRect',05,39,10,20},{'dRect',49,39,10,20},
{'dRect',20,10,23,43},
{'setCL',1,1,1,.7},
{'fRect',20,10,23,43},
}
modeIcons.t99=GC.DO{64,64,
{'setLW',2},
{'dRect',02,02,6,12},{'dRect',11,02,6,12},
{'dRect',02,18,6,12},{'dRect',11,18,6,12},
{'dRect',02,34,6,12},{'dRect',11,34,6,12},
{'dRect',02,50,6,12},{'dRect',11,50,6,12},
{'dRect',47,02,6,12},{'dRect',56,02,6,12},
{'dRect',47,18,6,12},{'dRect',56,18,6,12},
{'dRect',47,34,6,12},{'dRect',56,34,6,12},
{'dRect',47,50,6,12},{'dRect',56,50,6,12},
{'dRect',20,10,23,43},
{'setCL',1,1,1,.7},
{'fRect',20,10,23,43},
}
YIELD('loadMode')
for _,M in next,MODES do
M.records=loadFile("record/"..M.name..".rec",'-luaon -canSkip')or M.score and{}
M.icon=M.icon and(modeIcons[M.icon]or gc.newImage("media/image/modeicon/"..M.icon..".png"))
end
YIELD('loadOther')
STAT.run=STAT.run+1

View File

@@ -59,7 +59,7 @@ function scene.keyDown(key,isRep)
if isRep then return true end
if key=='1'then
if _testButton(1)then
SCN.go('mode')
SCN.go('modeExplorer')
end
elseif key=='q'then
if _testButton(2)then

View File

@@ -1,337 +0,0 @@
local gc=love.graphics
local gc_push,gc_pop=gc.push,gc.pop
local gc_translate,gc_scale,gc_rotate,gc_applyTransform=gc.translate,gc.scale,gc.rotate,gc.applyTransform
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
local gc_draw,gc_line=gc.draw,gc.line
local gc_rectangle,gc_circle=gc.rectangle,gc.circle
local gc_print,gc_printf=gc.print,gc.printf
local ms,kb,tc=love.mouse,love.keyboard,love.touch
local mt=love.math
local max,min=math.max,math.min
local int,abs=math.floor,math.abs
local setFont=FONT.set
local mapCam={
sel=false,--Selected mode ID
xOy=mt.newTransform(0,0,0,1),--Transformation for map display
keyCtrl=false,--If controlling with key
--For auto zooming when enter/leave scene
zoomMethod=false,
zoomK=false,
}
local visibleModes
local touchDist
local scene={}
function scene.sceneInit()
BG.set()
mapCam.zoomK=SCN.prev=='main'and 5 or 1
visibleModes={}--1=unlocked, 2=locked but visible
for name,M in next,MODES do
if RANKS[name]and M.x then
visibleModes[name]=1
if M.unlock then
for i=1,#M.unlock do
visibleModes[M.unlock[i]]=visibleModes[M.unlock[i]]or 2
end
end
end
end
end
local function _getK()
return abs(mapCam.xOy:transformPoint(1,0)-mapCam.xOy:transformPoint(0,0))
end
local function _getPos()
return mapCam.xOy:inverseTransformPoint(0,0)
end
local function _onModeRaw(x,y)
for name,M in next,MODES do
if visibleModes[name]and M.x then
local s=M.size
if M.shape==1 then
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then return name end
elseif M.shape==2 then
if abs(x-M.x)+abs(y-M.y)<s+12 then return name end
elseif M.shape==3 then
if(x-M.x)^2+(y-M.y)^2<(s+6)^2 then return name end
end
end
end
end
local function _moveMap(dx,dy)
local k=_getK()
local x,y=_getPos()
if x>1300 and dx<0 or x<-1500 and dx>0 then dx=0 end
if y>420 and dy<0 or y<-1900 and dy>0 then dy=0 end
mapCam.xOy:translate(dx/k,dy/k)
end
function scene.wheelMoved(_,dy)
mapCam.keyCtrl=false
local k=_getK()
k=min(max(k+dy*.1,.3),1.6)/k
mapCam.xOy:scale(k)
local x,y=_getPos()
mapCam.xOy:translate(x*(1-k),y*(1-k))
end
function scene.mouseMove(_,_,dx,dy)
if ms.isDown(1)then
_moveMap(dx,dy)
end
mapCam.keyCtrl=false
end
function scene.mouseClick(x,y)
local _=mapCam.sel
if not _ or x<920 then
x,y=x-640,y-360
x,y=mapCam.xOy:inverseTransformPoint(x,y)
local SEL=_onModeRaw(x,y)
if _~=SEL then
if SEL then
mapCam.moving=true
_=MODES[SEL]
mapCam.sel=SEL
SFX.play('click')
else
mapCam.sel=false
end
elseif _ then
scene.keyDown('return')
end
end
mapCam.keyCtrl=false
end
function scene.touchDown()
touchDist=false
end
function scene.touchMove(x,y,dx,dy)
local L=tc.getTouches()
if not L[2]then
_moveMap(dx,dy)
elseif not L[3]then
x,y=SCR.xOy:inverseTransformPoint(tc.getPosition(L[1]))
dx,dy=SCR.xOy:inverseTransformPoint(tc.getPosition(L[2]))--Not delta!!!
local d=(x-dx)^2+(y-dy)^2
if d>100 then
d=d^.5
if touchDist then
scene.wheelMoved(nil,(d-touchDist)*.02)
end
touchDist=d
end
end
mapCam.keyCtrl=false
end
function scene.touchClick(x,y)
scene.mouseClick(x,y)
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='return'then
if mapCam.sel then
if visibleModes[mapCam.sel]==2 then
MES.new('info',text.unlockHint)
else
mapCam.keyCtrl=false
loadGame(mapCam.sel)
end
end
elseif key=='f1'then
SCN.go('mod')
elseif key=='escape'then
if mapCam.sel then
mapCam.sel=false
else
SCN.back()
end
end
end
function scene.update()
local dx,dy=0,0
local F
if not SCN.swapping then
if kb.isDown('up', 'w')then dy=dy+10 F=true end
if kb.isDown('down', 's')then dy=dy-10 F=true end
if kb.isDown('left', 'a')then dx=dx+10 F=true end
if kb.isDown('right','d')then dx=dx-10 F=true end
local js=Z.getJsState()[1]
if js then
local sx,sy=js._jsObj:getGamepadAxis('leftx'),js._jsObj:getGamepadAxis('lefty')
if math.abs(sx)>.1 or math.abs(sy)>.1 then
if sy<-.1 then dy=dy-12.6*sy end
if sy>.1 then dy=dy-12.6*sy end
if sx<-.1 then dx=dx-12.6*sx end
if sx>.1 then dx=dx-12.6*sx end
F=true
end
end
end
if F then
mapCam.keyCtrl=true
if kb.isDown('lctrl','rctrl','lalt','ralt')then
scene.wheelMoved(nil,(dy-dx)*.026)
else
_moveMap(dx,dy)
local x,y=_getPos()
local SEL=_onModeRaw(x,y)
if SEL and mapCam.sel~=SEL then
mapCam.sel=SEL
SFX.play('click')
end
end
end
local _=SCN.stat.tar
mapCam.zoomMethod=_=="game"and 1 or _=="mode"and 2
if mapCam.zoomMethod==1 then
_=mapCam.zoomK
if _<.8 then _=_*1.05 end
if _<1.1 then _=_*1.05 end
mapCam.zoomK=_*1.05
elseif mapCam.zoomMethod==2 then
mapCam.zoomK=mapCam.zoomK^.9
end
end
--noRank/B/A/S/U/X
local baseRankColor={
[0]={0,0,0,.3},
{.2,.4,.6,.3},
{.6,.85,.65,.3},
{.85,.8,.3,.3},
{.85,.5,.4,.3},
{.85,.3,.8,.3},
}
local function _drawModeShape(M,S,drawType)
if M.shape==1 then--Rectangle
gc_rectangle(drawType,M.x-S,M.y-S,2*S,2*S)
elseif M.shape==2 then--Diamond
gc_circle(drawType,M.x,M.y,S+12,4)
elseif M.shape==3 then--Octagon
gc_circle(drawType,M.x,M.y,S+6,8)
end
end
function scene.draw()
local _
gc_push('transform')
gc_translate(640,360)
gc_rotate((mapCam.zoomK^.6-1))
gc_scale(mapCam.zoomK^.7)
gc_applyTransform(mapCam.xOy);
local R=RANKS
local sel=mapCam.sel
--Lines connecting modes
gc_setLineWidth(8)
gc_setColor(1,1,1,.2)
for name,M in next,MODES do
if R[name]and M.unlock and M.x then
for _=1,#M.unlock do
local m=MODES[M.unlock[_]]
gc_line(M.x,M.y,m.x,m.y)
end
end
end
--Modes
setFont(80)
gc_setLineWidth(4)
for name,M in next,MODES do
local unlocked=visibleModes[name]
if unlocked then
local rank=R[name]
local S=M.size
--Draw shapes on map
if unlocked==1 then
gc_setColor(baseRankColor[rank])
_drawModeShape(M,S,'fill')
end
gc_setColor(1,1,sel==name and 0 or 1,unlocked==1 and .8 or .3)
_drawModeShape(M,S,'line')
--Icon
local icon=M.icon
if icon then
gc_setColor(unlocked==1 and COLOR.lH or COLOR.dH)
local length=icon:getWidth()*.5
gc_draw(icon,M.x,M.y,nil,S/length,nil,length,length)
end
--Rank
if unlocked==1 then
name=RANK_CHARS[rank]
if name then
gc_setColor(COLOR.dX)
mStr(name,M.x+M.size*.7,M.y-50-M.size*.7)
gc_setColor(RANK_COLORS[rank])
mStr(name,M.x+M.size*.7+4,M.y-50-M.size*.7-4)
end
end
end
end
gc_pop()
--Score board
if sel then
local M=MODES[sel]
gc_setColor(COLOR.lX)
gc_rectangle('fill',920,0,360,720,5)--Info board
gc_setColor(COLOR.Z)
setFont(40)mStr(text.modes[sel][1],1100,5)
setFont(30)mStr(text.modes[sel][2],1100,50)
setFont(25)gc_printf(text.modes[sel][3],920,110,360,'center')
if M.slowMark then
gc_draw(IMG.ctrlSpeedLimit,1230,50,nil,.4)
end
if M.score then
mText(TEXTOBJ.highScore,1100,240)
gc_setColor(COLOR.X)
gc_rectangle('fill',940,290,320,280,5)--Highscore board
local L=M.records
gc_setColor(1,1,1)
if visibleModes[sel]==2 then
mText(TEXTOBJ.modeLocked,1100,370)
elseif L[1]then
for i=1,#L do
local t=M.scoreDisp(L[i])
local f=int((30-#t*.5)/5)*5
setFont(f)
gc_print(t,955,275+25*i+17-f*.7)
_=L[i].date
if _ then
setFont(10)
gc_print(_,1155,285+25*i)
end
end
else
mText(TEXTOBJ.noScore,1100,370)
end
end
end
if mapCam.keyCtrl then
gc_setColor(1,1,1)
gc_setLineWidth(4)
gc_translate(640,360)
gc_line(-20,0,20,0)
gc_line(0,-20,0,20)
gc_translate(-640,-360)
end
end
scene.widgetList={
WIDGET.newKey{name='mod', x=140,y=655,w=220,h=80,font=35,code=goScene'mod'},
WIDGET.newButton{name='start',x=1040,y=655,w=180,h=80,font=40,code=pressKey'return',hideF=function()return not mapCam.sel end},
WIDGET.newButton{name='back', x=1200,y=655,w=120,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}
return scene

View File

@@ -0,0 +1,405 @@
local gc=love.graphics
local gc_push,gc_pop=gc.push,gc.pop
local gc_translate=gc.translate
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
local gc_line,gc_rectangle,gc_circle=gc.line,gc.rectangle,gc.circle
local gc_draw,gc_print,gc_printf=gc.draw,gc.print,gc.printf
local gc_stencil,gc_setStencilTest=gc.stencil,gc.setStencilTest
local max,min=math.max,math.min
local int=math.floor
local ins=table.insert
local setFont=setFont
local searchText=""
local searchTimer
local results={}
local selectedItem
local path={}
local pathStr="modes/"
function _setPos(self,x,y,dx,dy)
self.x0,self.y0=x,y
self.x,self.y=x+dx,y+dy
end
local function _newItem(item)
local text=gc.newText(getFont(20),item.name)
local icon=MODEICON[item.icon or item.name]
return{
type=item.folder and'folder'or'mode',
name=item.name,
author=item.author or'',
text=text,
text_scaleX=min(1,150/text:getWidth()),
icon=icon,
icon_scale=min(max(160/icon:getWidth(),130/icon:getHeight()),1),
x0=0,y0=0,
x=0,y=0,
w=160,h=160,
alpha=0,
selTime=0,
setPos=_setPos,
}
end
local _backItem={folder=true,name='_back'}
local function _freshPacks()
--Change directory
local t=MODETREE
for i=1,#path do
for j=1,#t do
if t[j].name==path[i]then
t=t[j]
break
end
end
end
--Get items with searchText
local r={}
if path[1]then
ins(r,_newItem(_backItem))
end
for i=1,#t do
local item=t[i]
if #searchText==0 or item.name:find(searchText)then
ins(r,_newItem(item))
end
end
--Add items in correct order
TABLE.cut(results)
for i=1,#r do
if r[i].type=='folder'then
ins(results,r[i])
end
end
for i=1,#r do
if r[i].type~='folder'then
ins(results,r[i])
end
end
--Set items' positions
for i=0,#results-1 do
results[i+1]:setPos(180*(i%4),200*int(i/4),26+16*i,i)
end
selectedItem=false
end
local function _scrollModes(y)
if not results[1]then return end
local r=results[#results]
if r.y0+r.h+y<540 then y=540-r.y0-r.h end
if results[1].y0>-y then y=-results[1].y0 end
for i=1,#results do
local item=results[i]
item.y0=item.y0+y
end
end
local scene={}
function scene.sceneInit()
BG.set()
_freshPacks()
searchTimer=0
end
function scene.mouseMove(x,y,_,dy)
x,y=x-40,y-150
if x<-40 or x>765 or y<-40 or y>570 then return end
if love.mouse.isDown(1)then
_scrollModes(1.26*dy)
end
end
function scene.mouseClick(x,y,k)
if k==1 then
local sel=false
x,y=x-40,y-150
if x<-40 or x>765 or y<-40 or y>570 then return end
for i=1,#results do
local item=results[i]
if x>item.x and x<item.x+item.w and y>item.y and y<item.y+item.h then
sel=item
break
end
end
if sel then
if sel==selectedItem then
scene.keyDown('return')
elseif sel then
SFX.play('click')
selectedItem=sel
end
end
elseif k==2 then
if path[1]then
table.remove(path)
pathStr="modes/"
if path[1]then pathStr=pathStr..table.concat(path,'/').."/"end
_freshPacks()
SFX.play('uncheck')
end
end
end
function scene.wheelMoved(_,y)
if results[1]then
_scrollModes(y*126)
end
end
function scene.touchClick(x,y)
scene.mouseClick(x,y,1)
end
function scene.touchMove(x,y,_,dy)
x,y=x-40,y-150
if x<-40 or x>765 or y<-40 or y>570 then return end
_scrollModes(dy*1.26)
end
function scene.keyDown(key,isRep)
if key=='up'or key=='down'or key=='left'or key=='right'then
if not selectedItem then
selectedItem=results[1]
else
local i=TABLE.find(results,selectedItem)
if key=='up'then
i=i-4
elseif key=='down'then
i=i+4
elseif key=='left'then
i=i-1
elseif key=='right'then
i=i+1
end
if i<1 then
i=1
elseif i>#results then
i=#results
end
selectedItem=results[i]
if selectedItem.y0<0 then
_scrollModes(-selectedItem.y)
elseif selectedItem.y0+selectedItem.h>540 then
_scrollModes(540-selectedItem.y0-selectedItem.h)
end
end
elseif key=='f1'then
SCN.go('mod')
elseif key=='space'or key=='return'then
if isRep then return end
if selectedItem then
if selectedItem.type=='mode'then
loadGame(selectedItem.name)
elseif selectedItem.type=='folder'then
if selectedItem.name=='_back'then
table.remove(path)
SFX.play('uncheck')
else
ins(path,selectedItem.name)
SFX.play('check')
end
pathStr="modes/"
if path[1]then pathStr=pathStr..table.concat(path,'/').."/"end
_freshPacks()
end
else
selectedItem=results[1]
end
elseif key=='escape'then
if isRep then return end
if #searchText>0 then
searchText=""
_freshPacks()
else
SCN.back()
end
elseif key=='backspace'then
if #searchText>0 then
searchText=searchText:sub(1,-2)
searchTimer=.26
end
elseif #key==1 and #searchText<12 then
searchText=searchText..key
searchTimer=.26
end
end
function scene.update(dt)
if searchTimer>0 then
searchTimer=searchTimer-dt
if searchTimer<=0 then
_freshPacks()
end
end
for i=1,#results do
local item=results[i]
item.x=item.x*.9+item.x0*.1
item.y=item.y*.9+item.y0*.1
if item.alpha<1 then
item.alpha=min(item.alpha+dt*2.6,1)
end
if item==selectedItem then
item.selTime=min(item.selTime+dt,.126)
elseif item.selTime>0 then
item.selTime=item.selTime-dt
end
end
end
local function _modePannelStencil()
gc_rectangle('fill',0,0,810,610)
end
local _unknownModeText={'???','?','?????'}
local _rankName={
CHAR.icon.rankB,
CHAR.icon.rankA,
CHAR.icon.rankS,
CHAR.icon.rankU,
CHAR.icon.rankX,
}
function scene.draw()
--Gray background
gc_setColor(COLOR.dX)
gc_rectangle('fill',0,0,1280,110)
gc_rectangle('fill',0,110,810,610)
gc_setColor(COLOR.X)
gc_rectangle('fill',810,110,475,610)
--Seperating line
gc_setLineWidth(2)
gc_setColor(COLOR.Z)
gc_line(0,110,1280,110)
gc_line(810,110,810,720)
--Path
setFont(35)
gc_print(pathStr,60,40)
--SearchText
gc_print(CHAR.key.right,800,40)
if searchText==""then
gc_setColor(COLOR.dH)
gc_print(text.searchModeHelp,840,40)
else
gc_setColor(COLOR.Z)
gc_print(searchText,840,40)
end
--Items
gc_push('transform')
gc_translate(0,110)
gc_stencil(_modePannelStencil,'replace',1)
gc_setStencilTest('equal',1)
gc_translate(40,40)
setFont(50)
for i=1,#results do
local item=results[i]
local rank=RANKS[item.name]
if rank==0 then rank=nil end
if item.type=='folder'then
--Folder's yellow back
local r,g,b
if item.name=='_back'then
r,g,b=0,0,0
else
r,g,b=1,.8,.5
end
gc_setColor(r,g,b,item.alpha*.4)
gc_rectangle('fill',item.x,item.y,item.w,item.h)
gc_setColor(1,1,1,item.alpha)
gc_circle('line',item.x+15,item.y+15,8)
else
--Rank background
if rank then
local r,g,b=RANK_BASE_COLORS[rank][1],RANK_BASE_COLORS[rank][2],RANK_BASE_COLORS[rank][3]
gc_setColor(r,g,b,item.alpha*.3)
gc_rectangle('fill',item.x,item.y,item.w,item.h)
end
end
--Icon
gc_setColor(1,1,1,item.alpha)
mDraw(item.icon,item.x+item.w/2,item.y+(item.h-30)/2,0,item.icon_scale)
--Frame
gc_rectangle('line',item.x,item.y,item.w,item.h,6)
gc_draw(item.text,item.x+6,item.y+item.h-28,0,item.text_scaleX,1)
--Rank
if rank then
local rankStr=_rankName[RANKS[item.name]]
gc_setColor(0,0,0,item.alpha)
gc_print(rankStr,item.x+item.w-30+2,item.y-26+2)
local r,g,b=RANK_COLORS[rank][1],RANK_COLORS[rank][2],RANK_COLORS[rank][3]
gc_setColor(r,g,b,item.alpha)
gc_print(rankStr,item.x+item.w-30,item.y-26)
end
--Selecting glow
if item.selTime>0 then
gc_setColor(1,1,1,item.selTime*2)
gc_rectangle('fill',item.x+8,item.y+8,item.w-16,item.h-36,5)
end
end
gc_setStencilTest()
gc_pop()
--Selected item info
if selectedItem then
if selectedItem.type=='folder'then
gc_setColor(1,1,1,selectedItem.alpha)
setFont(50)mStr(selectedItem.name,1043,110)
setFont(30)mStr(selectedItem.author,1043,180)
elseif selectedItem.type=='mode'then
local M=MODES[selectedItem.name]
--Slowmark
if M.slowMark then
gc_setColor(.6,.9,1,(1-3*TIME()%1*.8)*selectedItem.alpha)
setFont(20)
gc_print("CTRL",815,110)
end
--Mode title & info
gc_setColor(1,1,1,selectedItem.alpha)
local t=text.modes[M.name]or _unknownModeText
setFont(40)mStr(t[1],1043,110)
setFont(30)mStr(t[2],1043,153)
setFont(25)mStr(t[3],1043,200)
--High scores
if M.score then
mText(TEXTOBJ.highScore,1043,293)
gc_setColor(COLOR.dX)
gc_rectangle('fill',825,335,440,260,3)
local L=M.records
gc_setColor(1,1,1)
setFont(20)
if L[1]then
for i=1,#L do
local res=M.scoreDisp(L[i])
gc_print(res,830,310+25*i,0,min(35/#res,1),1)
gc_printf(L[i].date or"-/-/-",1100,310+25*i,200,'right',0,.8,1)
end
else
mText(TEXTOBJ.noScore,1043,433)
end
end
end
end
end
scene.widgetList={
WIDGET.newButton{name='mod',x=920,y=655,w=150,h=80,code=goScene'mod'},
WIDGET.newButton{name='back',x=1140,y=655,w=220,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}
return scene

View File

@@ -168,7 +168,7 @@ end
function scene.draw()
setFont(20)
gc.setColor(COLOR.Z)
gc.printf(text.keySettingInstruction,526,620,500,'right')
gc.printf(text.keySettingHelp,526,620,500,'right')
for i=0,20 do
for j=1,#keyList[i]do

View File

@@ -42,6 +42,7 @@ return[=[
自定义场地界面按超过第三个的鼠标键会报错
经典模式h和u难度没有干旱计数器 #546
自定义场地16号色的方块名位置显示错误
自动保存会丢掉最后一个键(如果它触发了结束)
联网对战结算的l'pm公式错写成lpm的
录像界面导入导出按钮隐藏状态错误
登录界面读取本地账号密码数据错误