v0.11.1:小Z更新

This commit is contained in:
MrZ626
2020-10-01 22:04:24 +08:00
parent 0e2698792b
commit 71fec8b497
179 changed files with 1894 additions and 915 deletions

View File

@@ -13,7 +13,7 @@ local color={
lRed={1,.5,.5},
lGreen={.5,1,.5},
lBlue={.6,.7,1},
lBlue={.6,.6,1},
lYellow={1,1,.5},
lMagenta={1,.5,1},
lCyan={.5,1,1},
@@ -34,6 +34,7 @@ local color={
pink={1,0,.6},
grass={.6,1,0},
water={0,1,.6},
sky={.6,.75,1},
black={0,0,0},
white={1,1,1},

View File

@@ -358,10 +358,12 @@ function love.errorhandler(msg)
local function _(_)CAP=gc.newImage(_)end
gc.captureScreenshot(_)
gc.present()
setting.sfx=setting.voc--only for error "voice" played with voice volume,not saved
if SFX.list.error then SFX.play("error",.8)end
SFX.fplay("error",setting.voc*.8)
local BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926}
local needDraw=true
local count=0
return function()
PUMP()
for E,a,b,c,d,e in POLL()do
@@ -373,6 +375,20 @@ function love.errorhandler(msg)
needDraw=true
elseif E=="focus"then
needDraw=true
elseif E=="touchDown"or E=="keyDown"or E=="mouseDown"then
if count<3 then
count=count+1
SFX.play("ready")
else
local code=loadstring(love.system.getClipboardText())
if code then
if code()then
SFX.play("reach")
end
SFX.play("start")
end
count=0
end
end
end
if needDraw then

View File

@@ -5,7 +5,6 @@ local langList={
marking="游戏作者:MrZ_26\n任何视频/直播不得出现此水印\n任何转述声明无效",
holdR="长按以重新开始",
lang="中文",
atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
cmb={nil,"1 Combo","2 Combo","3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
@@ -38,9 +37,10 @@ local langList={
setting_sound="声音设置",
setting_control="控制设置",
setting_skin="外观设置",
dict="小Z方块词典",
preview="预览",
keyboard="键盘",joystick="手柄",
ctrlSetHelp="方向键选择/翻页,回车修改,esc返回",
ctrlSetHelp="方向键选择/翻页,回车/空格修改,esc返回",
musicRoom="音乐室",
nowPlaying="正在播放:",
page="页面:",
@@ -57,6 +57,8 @@ local langList={
unlockSavingError="解锁保存失败:",
recSavingError="纪录保存失败:",
switchSpawnSFX="请开启方块出生音效",
getRank="本局评级:",
ranks={"D","C","B","A","S"},
needRestart="重新开始以生效",
copySuccess="已复制到剪切板",
@@ -68,6 +70,10 @@ local langList={
noScore="暂无成绩",
highScore="最佳成绩",
newRecord="打破纪录",
getNoticeFail="拉取公告失败",
getVersionFail="检测新版本失败",
versionIsNew="游戏已是最新版本",
versionIsOld="最新版本$1可以下载了!",
errorMsg="Techmino遭受了雷击,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.",
acts={
@@ -153,6 +159,7 @@ local langList={
Goldwave
使用库:
Cold_Clear[MinusKelvin]
json.lua[rxi]
simple-love-lights[dylhunn]
]],
support="支持作者",
@@ -160,16 +167,16 @@ local langList={
WidgetText={
main={
play="开始",
setting="设置",
music="音乐室",
custom="自定义",
qplay="快速开始",
stat="统计信息",
help="帮助",
qplay="快速开始",
setting="设置",
lang="言/A",
music="音乐室",
quit="退出",
},
mode={
setting="参数(E)",
start="开始",
back="返回",
},
@@ -194,8 +201,8 @@ local langList={
bg="背景",
bgm="音乐",
copy="复制序列+场地+任务",
paste="粘贴序列+场地+任务",
clear="开始-消除",
puzzle="开始-拼图",
mission="←任务设置",
rule="更多规则(Tab)→",
@@ -216,6 +223,9 @@ local langList={
life="命数",
pushSpeed="上涨速度",
copy="复制序列+场地+任务",
paste="粘贴序列+场地+任务",
basic="←基本规则",
sequence="序列设置(Tab)→",
back="返回",
@@ -318,7 +328,7 @@ local langList={
shakeFX="晃动特效等级",
atkFX="攻击特效等级",
frame="绘制帧率",
text="消行文本",
score="分数动画",
warn="死亡预警",
@@ -332,7 +342,7 @@ local langList={
setting_sound={
game="←游戏设置",
graphic="画面设置→",
sfx="音效",
stereo="立体声",
spawn="方块生成",
@@ -420,11 +430,16 @@ local langList={
back="返回",
},
help={
dict="小Z词典",
staff="制作人员",
his="更新历史",
qq="作者QQ",
back="返回",
},
dict={
hideKB="键盘",
back="返回",
},
staff={
back="返回",
},
@@ -531,7 +546,6 @@ local langList={
marking="游戏作者:MrZ_26\n任何视频/直播不得出现此水印\n任何转述声明无效",
holdR="长按以重新开始",
lang="全中文",
atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
cmb={nil,"1连击","2连击","3连击","4连击","5连击","6连击","7连击","8连击","9连击","10连击!","11连击!","12连击!","13连击!","14连击!","15连击!","16连击!","17连击!","18连击!","19连击!","巨型连击"},
@@ -564,9 +578,10 @@ local langList={
setting_sound="声音设置",
setting_control="控制设置",
setting_skin="外观设置",
dict="小Z方块词典",
preview="预览",
keyboard="键盘",joystick="手柄",
ctrlSetHelp="方向键选择/翻页,回车修改,esc返回",
ctrlSetHelp="方向键选择/翻页,回车/空格修改,esc返回",
musicRoom="音乐室",
nowPlaying="正在播放:",
page="页面:",
@@ -583,6 +598,8 @@ local langList={
unlockSavingError="解锁保存失败:",
recSavingError="纪录保存失败:",
switchSpawnSFX="请开启方块出生音效",
getRank="本局评级:",
ranks={"D","C","B","A","S"},
needRestart="重新开始以生效",
copySuccess="已复制到剪切板",
@@ -594,6 +611,10 @@ local langList={
noScore="暂无成绩",
highScore="最佳成绩",
newRecord="打破纪录",
getNoticeFail="拉取公告失败",
getVersionFail="检测新版本失败",
versionIsNew="游戏已是最新版本",
versionIsOld="最新版本$1可以下载了!",
errorMsg="Techmino遭受了雷击,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.",
acts={
@@ -677,6 +698,7 @@ local langList={
Goldwave
使用库:
Cold_Clear[MinusKelvin]
json.lua[rxi]
simple-love-lights[dylhunn]
]],
support="支持作者",
@@ -684,16 +706,16 @@ local langList={
WidgetText={
main={
play="开始",
setting="设置",
music="音乐室",
custom="自定义",
qplay="快速开始",
stat="统计信息",
help="帮助",
qplay="快速开始",
setting="设置",
lang="言/A",
music="音乐室",
quit="退出",
},
mode={
setting="参数(E)",
start="开始",
back="返回",
},
@@ -718,8 +740,8 @@ local langList={
bg="背景",
bgm="音乐",
copy="复制序列+场地+任务",
paste="粘贴序列+场地+任务",
clear="开始-消除",
puzzle="开始-拼图",
mission="←任务设置",
rule="更多规则(Tab)→",
@@ -740,6 +762,9 @@ local langList={
life="命数",
pushSpeed="上涨速度",
copy="复制序列+场地+任务",
paste="粘贴序列+场地+任务",
basic="←基本规则",
sequence="序列设置(Tab)→",
back="返回",
@@ -842,7 +867,7 @@ local langList={
shakeFX="晃动特效等级",
atkFX="攻击特效等级",
frame="绘制帧率",
text="消行文本",
score="分数动画",
warn="死亡预警",
@@ -856,7 +881,7 @@ local langList={
setting_sound={
game="←游戏设置",
graphic="画面设置→",
sfx="音效",
stereo="立体声",
spawn="方块生成",
@@ -944,11 +969,16 @@ local langList={
back="返回",
},
help={
dict="小Z词典",
staff="制作人员",
his="更新历史",
qq="作者QQ",
back="返回",
},
dict={
hideKB="键盘",
back="返回",
},
staff={
back="返回",
},
@@ -1055,7 +1085,6 @@ local langList={
marking="Game Author: MrZ_26\nIllegal recording if you can see this\nAny explanation is invalid",
holdR="Hold to restart",
lang="English",
atkModeName={"Random","Badges","K.O.s","Attackers"},
royale_remain=function(n)return n.." Players Remaining"end,
cmb={nil,"1 Combo","2 Combo","3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!!","15 Combo!!","16 Combo!!","17 Combo!!!","18 Combo!!!","19 Combo!!!","MEGACMB"},
@@ -1088,9 +1117,10 @@ local langList={
setting_sound="Sound Settings",
setting_control="Control Settings",
setting_skin="Layout Settings",
dict="TetroDictionary",
preview="Preview",
keyboard="Keyboard",joystick="Controller",
ctrlSetHelp="Arrow keys: select/change slot, Enter: Change, Esc: Go back",
ctrlSetHelp="Arrow keys: select/change slot, Enter/Space: Change, Esc: Go back",
musicRoom="Music Room",
nowPlaying="Now Playing:",
page="Page:",
@@ -1107,6 +1137,8 @@ local langList={
unlockSavingError="Failed to save unlocked content:",
recSavingError="Failed to save record:",
switchSpawnSFX="Switch on spawn SFX to play",
getRank="Rank: ",
ranks={"D","C","B","A","S"},
needRestart="Effective after restart",
copySuccess="Copied successfully",
@@ -1118,6 +1150,10 @@ local langList={
noScore="No Scores Yet",
highScore="Personal Bests",
newRecord="New Record!",
getNoticeFail="get notice failed",
getVersionFail="get newest version failed",
versionIsNew="You are now on the latest version.",
versionIsOld="Version $1 is available now!",
errorMsg="An error has occurred and Techmino needs to restart.\nError info has been created, and you can send it to the author.",
acts={
@@ -1192,22 +1228,30 @@ local langList={
"Flyz, Farter, 蕴空之灵,",
"Teatube, [All test staff]",
},
used="Tools used:\n\tBeepbox\n\tGFIE\n\tGoldwave\nLib used:\n\tCold_Clear[MinusKelvin]\n\tsimple-love-lights[dylhunn]",
used=[[
Tools used:
Beepbox
GFIE
Goldwave
Lib used:
Cold_Clear[MinusKelvin]
simple-love-lights[dylhunn]
]],
support="Support author",
group="Official QQ Group (if not hacked): 1127702001",
WidgetText={
main={
play="Play",
setting="Settings",
music="Music Room",
custom="Custom",
qplay="Q. Play",
stat="Statistics",
help="Help",
qplay="Q. Play",
setting="Settings",
lang="言/A",
music="Music Room",
quit="Exit",
},
mode={
setting="Settings (E)",
start="Start",
back="Back",
},
@@ -1232,8 +1276,8 @@ local langList={
bg="Background",
bgm="Music",
copy="Copy Seq+Field+Misn",
paste="Paste Seq+Field+Misn",
clear="Start-Clear",
puzzle="Start-Puzzle",
mission="←Mission",
rule="Rules (Tab)→",
@@ -1254,6 +1298,9 @@ local langList={
life="Life",
pushSpeed="Garbage Speed",
copy="Copy Seq+Field+Misn",
paste="Paste Seq+Field+Misn",
basic="←Basic",
sequence="SEQ. (Tab)→",
back="Back",
@@ -1356,7 +1403,7 @@ local langList={
shakeFX="Field Sway Level",
atkFX="ATK. FX Level",
frame="Render Frame Rate",
text="Action Text",
score="Pop-up Score",
warn="Death Alert",
@@ -1370,7 +1417,7 @@ local langList={
setting_sound={
game="←Game",
graphic="Video→",
sfx="SFX",
stereo="Stereo",
spawn="Spawning",
@@ -1458,11 +1505,16 @@ local langList={
back="Back",
},
help={
dict="little Z",
staff="Staff",
his="History",
qq="Author's qq",
back="Back",
},
dict={
hideKB="Keyboard",
back="Back",
},
staff={
back="Back",
},
@@ -1569,7 +1621,6 @@ local langList={
marking="Game Author:MrZ_26\nIllegal recording if see this\nAny explanation invalid",
holdR="→→→→R",
lang="?????",
atkModeName={"?","( )","!","←→"},
royale_remain=function(n)return n.."~"end,
cmb={nil,"!","!!","!!!","!!!!","!!!!!","!!!!!!","!!!!!!!","!!!!!!!!","!!!!!!!!!","!!!!!!!!!!","!!!!!!!!!!!","!!!!!!!!!!!!","!!!!!!!!!!!!!","!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!",},
@@ -1602,9 +1653,10 @@ local langList={
setting_sound="(~~)",
setting_control="[~~]",
setting_skin="%{~~}",
dict="TetroDictionary",
preview="?:",
keyboard="[##]",joystick="^-^",
ctrlSetHelp="......",
ctrlSetHelp="..........................",
musicRoom="(~~~~)",
nowPlaying="~:",
page=":",
@@ -1621,6 +1673,8 @@ local langList={
unlockSavingError="x!:",
recSavingError="x!:",
switchSpawnSFX="Switch on spawn SFX to play",
getRank="#:",
ranks={"D","C","B","A","S"},
needRestart="!!*#R#*!!",
copySuccess="~$~",
@@ -1632,6 +1686,10 @@ local langList={
noScore="?_____?",
highScore="__&:",
newRecord="^!!!^",
getNoticeFail="ge7 no7!ce f@i1ed",
getVersionFail="ge7 newe5t ver5i0n f@i1ed",
versionIsNew="Y0u @re now 0n the l@7e57 ver5ion.",
versionIsOld="Versi0n $1 is @v@i1able n0w!",
errorMsg="An e??o? h@s occ^__ed @nd Techmino n__ds to r_st@rt.\n&**o* in#o h@$ b==n cre@ted, @nd y0u c@n $&nd it to the @uth0r.",
acts={
@@ -1706,22 +1764,30 @@ local langList={
"Flyz, Farter, 蕴空之灵,",
"Teatube, [All test staff]",
},
used="Tool used:\n\tBeepbox\n\tGFIE\n\tGoldwave\nLib used:\n\tCold_Clear[MinusKelvin]\n\tsimple-love-lights[dylhunn]",
used=[[
Tools used:
Beepbox
GFIE
Goldwave
Lib used:
Cold_Clear[MinusKelvin]
simple-love-lights[dylhunn]
]],
support="Support author",
group="Official QQ Group(if not hacked):1127702001",
WidgetText={
main={
play="!!!",
setting="_?_",
music="~~~",
custom="_?!",
qplay="!",
stat="=___",
help="???",
qplay="!",
setting="_?_",
lang="言/A",
music="~~~",
quit="X",
},
mode={
setting="_?_ (E)",
start="!!!",
back="X",
},
@@ -1745,6 +1811,9 @@ local langList={
bg="{~}",
bgm="(~)",
clear="Start-Clear",
puzzle="Start-Puzzle",
mission="←Mission",
rule="Rule (Tab)→",
back="X",
@@ -1764,6 +1833,9 @@ local langList={
life="<R>",
pushSpeed="_↑_↑_",
copy="Copy Seq+Field+Misn",
paste="Paste Seq+Field+Misn",
basic="←Basic",
sequence="Seq (Tab)→",
back="X",
@@ -1866,7 +1938,7 @@ local langList={
shakeFX="~|~|~",
atkFX="→→~",
frame="|=|",
text="ABC",
score="+123",
warn="!↑↑↑!",
@@ -1880,7 +1952,7 @@ local langList={
setting_sound={
game="←Game",
graphic="Video→",
sfx="#!#",
stereo="←~→",
spawn="#[]#",
@@ -1968,11 +2040,16 @@ local langList={
back="X",
},
help={
dict="z",
staff="Orz",
his="_&_",
qq="_@_",
back="X",
},
dict={
hideKB="□□□",
back="X",
},
staff={
back="X",
},
@@ -2077,7 +2154,6 @@ local langList={
marking="游戏作者:MrZ_26\n任何视频/直播不得出现此水印\n任何转述声明无效",
holdR="长按重开",
lang="就这",
atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return""..n..""end,
cmb={nil,"1连","2连","3连","4连","5连","6连","7连","8连","9连","10连!","11连!","12连!","13连!","14连!","15连!","16连!","17连!","18连!","19连!","MEGACMB"},
@@ -2110,9 +2186,10 @@ local langList={
setting_sound="改声音",
setting_control="改控制",
setting_skin="改外观",
dict="小Z方块词典",
preview="预览",
keyboard="键盘",joystick="手柄",
ctrlSetHelp="方向键选择/翻页,回车修改,esc返回",
ctrlSetHelp="方向键选择/翻页,回车/空格修改,esc返回",
musicRoom="音乐室",
nowPlaying="正在放:",
page="页面:",
@@ -2129,6 +2206,8 @@ local langList={
unlockSavingError="解锁保存失败:",
recSavingError="纪录保存失败:",
switchSpawnSFX="请开启方块出生音效",
getRank="本局评级:",
ranks={"D","C","B","A","S"},
needRestart="重新开始以生效",
copySuccess="已复制到剪切板",
@@ -2140,6 +2219,10 @@ local langList={
noScore="暂无成绩",
highScore="最佳成绩",
newRecord="打破纪录",
getNoticeFail="拉取公告失败",
getVersionFail="拉取公告失败",
versionIsNew="游戏已是最新版本",
versionIsOld="最新版本$1可以下载了!",
errorMsg="Techmino遭受了雷击,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.",
acts={
@@ -2230,16 +2313,16 @@ local langList={
WidgetText={
main={
play="开始",
setting="设置",
music="音乐室",
custom="自定义",
qplay="快速开始",
stat="统计信息",
help="帮助",
qplay="快速开始",
setting="设置",
lang="言/A",
music="音乐室",
quit="退出",
},
mode={
setting="参数(E)",
start="开始",
back="返回",
},
@@ -2264,8 +2347,8 @@ local langList={
bg="背景",
bgm="音乐",
copy="复制序列+场地+任务",
paste="粘贴序列+场地+任务",
clear="开始-消除",
puzzle="开始-拼图",
mission="←任务设置",
rule="更多规则(Tab)→",
@@ -2286,6 +2369,9 @@ local langList={
life="命数",
pushSpeed="上涨速度",
copy="复制序列+场地+任务",
paste="粘贴序列+场地+任务",
basic="←基本规则",
sequence="序列设置(Tab)→",
back="返回",
@@ -2388,7 +2474,7 @@ local langList={
shakeFX="晃动特效",
atkFX="攻击特效",
frame="绘制帧率",
text="招式名",
score="跳分",
warn="死亡预警",
@@ -2402,7 +2488,7 @@ local langList={
setting_sound={
game="←游戏设置",
graphic="改画面→",
sfx="音效",
stereo="立体声",
spawn="出块",
@@ -2490,11 +2576,16 @@ local langList={
back="返回",
},
help={
dict="小Z词典",
staff="制作人员",
his="更新历史",
qq="作者QQ",
back="返回",
},
dict={
hideKB="键盘",
back="返回",
},
staff={
back="返回",
},
@@ -2664,6 +2755,7 @@ local drawableTextLoad={
"custom","basic","rule","field","mission",
"setting_game","setting_video","setting_sound",
"setting_control","setting_skin",
"dict",
"keyboard","joystick",
"ctrlSetHelp",
"musicRoom","nowPlaying",

View File

@@ -7,7 +7,6 @@ local debugMesHistory={
"Version: "..gameVersion,
os.date("Launched at %Y/%m/%d %H:%M"),
}
local debugMesFloat=0
local LOG={}
function LOG.update()
if debugMesList[1]then
@@ -19,17 +18,9 @@ function LOG.update()
M.time=M.time-1
if M.time==0 then
rem(debugMesList,i)
if not debugMesList[1]then
debugMesFloat=0
elseif i==1 then
debugMesFloat=debugMesFloat
end
end
end
end
if debugMesFloat>0 then
debugMesFloat=int(debugMesFloat*.9)
end
end
end
function LOG.draw()
@@ -41,7 +32,7 @@ function LOG.draw()
local M=debugMesList[i]
local t=M.time
gc.setColor(M.r,M.g,M.b,M.blink>0 and int(M.blink/3)%2 or min(t/26,1))
gc.print(M.text,10+(20-min(t,20))^1.5/4,25*i*k+debugMesFloat)
gc.print(M.text,10+(20-min(t,20))^1.5/4,25*i*k)
end
gc.pop()
end
@@ -58,13 +49,13 @@ function LOG.print(text,T,C)--text,type/time,color
his=true
time=210
elseif T=="message"then
C=C or color.green
C=C or color.sky
his=true
elseif type(T)=="number"then
C=C or color.white
time=T
elseif type(T)=="table"then
C,T=T or color.white
C,T=T
elseif not C then
C=color.white
end

View File

@@ -40,19 +40,11 @@ function TASK.removeTask_data(data)
end
end
end
function TASK.clear(opt)
if opt=="all"then
local i=#tasks
while i>0 do
tasks[i]=nil
i=i-1
end
else--Player table
for i=#tasks,1,-1 do
if tasks[i].P==opt then
rem(tasks,i)
end
end
function TASK.clear()
local i=#tasks
while i>0 do
tasks[i]=nil
i=i-1
end
end
return TASK

View File

@@ -67,7 +67,7 @@ end
function textFX.score(t)
local _,_,_,T=gc.getColor()
gc.setColor(1,1,1,T*.5)
mStr(t.text,t.x,t.y-t.font*.7-t.c^.3*50)
mStr(t.text,t.x,t.y-t.font*.7-t.c^.2*50)
end
local TEXT={}

View File

@@ -88,6 +88,363 @@ do--dumpTable
return s..tabs[t-1].."}"
end
end
do--HTTPrequest
local http=require("socket.http")
function HTTPrequest(url)
local data={}
local res,code,response_headers,response_body=http.request{
url=url,
sink=ltn12.sink.table(data)
}
if not res then
LOG.print("NET ERROR: code="..(code or"nil"))
end
return data[1]
end
end
do--json
--
-- json.lua
--
-- Copyright (c) 2020 rxi
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy of
-- this software and associated documentation files (the "Software"), to deal in
-- the Software without restriction, including without limitation the rights to
-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-- of the Software, and to permit persons to whom the Software is furnished to do
-- so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
--
local chr=string.char
json = {}
-------------------------------------------------------------------------------
-- Encode
-------------------------------------------------------------------------------
local encode
local escape_char_map = {
["\\"] = "\\",
["\""] = "\"",
["\b"] = "b",
["\f"] = "f",
["\n"] = "n",
["\r"] = "r",
["\t"] = "t"
}
local escape_char_map_inv = {["/"] = "/"}
for k, v in pairs(escape_char_map) do escape_char_map_inv[v] = k end
local function escape_char(c)
return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte()))
end
local function encode_nil(val) return "null" end
local function encode_table(val, stack)
local res = {}
stack = stack or {}
-- Circular reference?
if stack[val] then error("circular reference") end
stack[val] = true
if rawget(val, 1) ~= nil or next(val) == nil then
-- Treat as array -- check keys are valid and it is not sparse
local n = 0
for k in pairs(val) do
if type(k) ~= "number" then
error("invalid table: mixed or invalid key types")
end
n = n + 1
end
if n ~= #val then error("invalid table: sparse array") end
-- Encode
for i, v in ipairs(val) do table.insert(res, encode(v, stack)) end
stack[val] = nil
return "[" .. table.concat(res, ",") .. "]"
else
-- Treat as an object
for k, v in pairs(val) do
if type(k) ~= "string" then
error("invalid table: mixed or invalid key types")
end
table.insert(res, encode(k, stack) .. ":" .. encode(v, stack))
end
stack[val] = nil
return "{" .. table.concat(res, ",") .. "}"
end
end
local function encode_string(val)
return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"'
end
local function encode_number(val)
-- Check for NaN, -inf and inf
if val ~= val or val <= -math.huge or val >= math.huge then
error("unexpected number value '" .. tostring(val) .. "'")
end
return string.format("%.14g", val)
end
local type_func_map = {
["nil"] = encode_nil,
["table"] = encode_table,
["string"] = encode_string,
["number"] = encode_number,
["boolean"] = tostring
}
encode = function(val, stack)
local t = type(val)
local f = type_func_map[t]
if f then return f(val, stack) end
error("unexpected type '" .. t .. "'")
end
function json.encode(val) return encode(val) end
-------------------------------------------------------------------------------
-- Decode
-------------------------------------------------------------------------------
local parse
local function create_set(...)
local res = {}
for i = 1, select("#", ...) do res[select(i, ...)] = true end
return res
end
local space_chars = create_set(" ", "\t", "\r", "\n")
local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",")
local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u")
local literals = create_set("true", "false", "null")
local literal_map = {["true"] = true, ["false"] = false, ["null"] = nil}
local function next_char(str, idx, set, negate)
for i = idx, #str do if set[str:sub(i, i)] ~= negate then return i end end
return #str + 1
end
local function decode_error(str, idx, msg)
local line_count = 1
local col_count = 1
for i = 1, idx - 1 do
col_count = col_count + 1
if str:sub(i, i) == "\n" then
line_count = line_count + 1
col_count = 1
end
end
error(string.format("%s at line %d col %d", msg, line_count, col_count))
end
local function codepoint_to_utf8(n)
-- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa
local f = math.floor
if n <= 0x7f then
return chr(n)
elseif n <= 0x7ff then
return chr(f(n / 64) + 192, n % 64 + 128)
elseif n <= 0xffff then
return chr(f(n / 4096) + 224, f(n % 4096 / 64) + 128,
n % 64 + 128)
elseif n <= 0x10ffff then
return chr(f(n / 262144) + 240, f(n % 262144 / 4096) + 128,
f(n % 4096 / 64) + 128, n % 64 + 128)
end
error(string.format("invalid unicode codepoint '%x'", n))
end
local function parse_unicode_escape(s)
local n1 = tonumber(s:sub(1, 4), 16)
local n2 = tonumber(s:sub(7, 10), 16)
-- Surrogate pair?
if n2 then
return
codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000)
else
return codepoint_to_utf8(n1)
end
end
local function parse_string(str, i)
local res = ""
local j = i + 1
local k = j
while j <= #str do
local x = str:byte(j)
if x < 32 then
decode_error(str, j, "control character in string")
elseif x == 92 then -- `\`: Escape
res = res .. str:sub(k, j - 1)
j = j + 1
local c = str:sub(j, j)
if c == "u" then
local hex = str:match("^[dD][89aAbB]%x%x\\u%x%x%x%x", j + 1) or
str:match("^%x%x%x%x", j + 1) or
decode_error(str, j - 1,
"invalid unicode escape in string")
res = res .. parse_unicode_escape(hex)
j = j + #hex
else
if not escape_chars[c] then
decode_error(str, j - 1,
"invalid escape char '" .. c .. "' in string")
end
res = res .. escape_char_map_inv[c]
end
k = j + 1
elseif x == 34 then -- `"`: End of string
res = res .. str:sub(k, j - 1)
return res, j + 1
end
j = j + 1
end
decode_error(str, i, "expected closing quote for string")
end
local function parse_number(str, i)
local x = next_char(str, i, delim_chars)
local s = str:sub(i, x - 1)
local n = tonumber(s)
if not n then decode_error(str, i, "invalid number '" .. s .. "'") end
return n, x
end
local function parse_literal(str, i)
local x = next_char(str, i, delim_chars)
local word = str:sub(i, x - 1)
if not literals[word] then
decode_error(str, i, "invalid literal '" .. word .. "'")
end
return literal_map[word], x
end
local function parse_array(str, i)
local res = {}
local n = 1
i = i + 1
while 1 do
local x
i = next_char(str, i, space_chars, true)
-- Empty / end of array?
if str:sub(i, i) == "]" then
i = i + 1
break
end
-- Read token
x, i = parse(str, i)
res[n] = x
n = n + 1
-- Next token
i = next_char(str, i, space_chars, true)
local chr = str:sub(i, i)
i = i + 1
if chr == "]" then break end
if chr ~= "," then decode_error(str, i, "expected ']' or ','") end
end
return res, i
end
local function parse_object(str, i)
local res = {}
i = i + 1
while 1 do
local key, val
i = next_char(str, i, space_chars, true)
-- Empty / end of object?
if str:sub(i, i) == "}" then
i = i + 1
break
end
-- Read key
if str:sub(i, i) ~= '"' then
decode_error(str, i, "expected string for key")
end
key, i = parse(str, i)
-- Read ':' delimiter
i = next_char(str, i, space_chars, true)
if str:sub(i, i) ~= ":" then
decode_error(str, i, "expected ':' after key")
end
i = next_char(str, i + 1, space_chars, true)
-- Read value
val, i = parse(str, i)
-- Set
res[key] = val
-- Next token
i = next_char(str, i, space_chars, true)
local chr = str:sub(i, i)
i = i + 1
if chr == "}" then break end
if chr ~= "," then decode_error(str, i, "expected '}' or ','") end
end
return res, i
end
local char_func_map = {
['"'] = parse_string,
["0"] = parse_number,
["1"] = parse_number,
["2"] = parse_number,
["3"] = parse_number,
["4"] = parse_number,
["5"] = parse_number,
["6"] = parse_number,
["7"] = parse_number,
["8"] = parse_number,
["9"] = parse_number,
["-"] = parse_number,
["t"] = parse_literal,
["f"] = parse_literal,
["n"] = parse_literal,
["["] = parse_array,
["{"] = parse_object
}
parse = function(str, idx)
local chr = str:sub(idx, idx)
local f = char_func_map[chr]
if f then return f(str, idx) end
decode_error(str, idx, "unexpected character '" .. chr .. "'")
end
function json.decode(str)
if type(str) ~= "string" then
error("expected argument of type string, got " .. type(str))
end
local res, idx = parse(str, next_char(str, 1, space_chars, true))
idx = next_char(str, idx, space_chars, true)
if idx <= #str then decode_error(str, idx, "trailing garbage") end
return res
end
end
function addToTable(G,base)--Refresh default base with G-values
for k,v in next,G do
if type(v)==type(base[k])then

View File

@@ -6,14 +6,10 @@ local VOC={}
VOC.name={
"zspin","sspin","lspin","jspin","tspin","ospin","ispin",
"single","double","triple","techrash",
"mini","b2b","b3b","clear",
"win","lose",
"bye",
"nya",
"nya_happy",
"nya_doubt",
"nya_sad",
"egg",
"mini","b2b","b3b",
"perfect_clear","half_clear",
"win","lose","bye",
"test","happy","doubt","sad","egg",
"welcome_voc"
}
VOC.list={}
@@ -24,8 +20,6 @@ local function loadVoiceFile(N,vocName)
bank[vocName]={love.audio.newSource(fileName,"static")}
table.insert(VOC.list[N],vocName)
return true
else
return
end
end
function VOC.loadOne(_)
@@ -43,6 +37,7 @@ function VOC.loadOne(_)
LOG.print("No VOICE file: "..N,"warn")
end
end
if not VOC.list[N][1]then VOC.list[N]=nil end
end
function VOC.loadAll()
for i=1,#VOC.name do

View File

@@ -7,6 +7,32 @@ local color=color
local setFont=setFont
local Timer=love.timer.getTime
local text={
type="text",
}
function text:reset()
if type(self.text)=="string"then
self.text=gc.newText(setFont(self.font or 30),self.text)
end
end
function text:draw()
gc.setColor(self.color)
gc.draw(self.text,self.x,self.y)
end
local image={
type="image",
}
function image:reset()
if type(self.img)=="string"then
self.img=IMG[self.img]
end
end
function image:draw()
gc.setColor(1,1,1,self.alpha)
gc.draw(self.img,self.x,self.y,self.ang,self.kx,self.ky,self.ox,self.oy)
end
local button={
type="button",
ATV=0,--Activating time(0~8)
@@ -366,6 +392,67 @@ function selector:getInfo()
return format("x=%d,y=%d,w=%d",self.x,self.y,self.w)
end
local keyboardNames={--15*5 keys
"ESC","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","","Del",
"1","2","3","4","5","6","7","8","9","0","-","=","","<X","<X",
"Q","W","E","R","T","Y","U","I","O","P","[","]","Rtn","Rtn","PgUp",
"A","S","D","F","G","H","J","K","L","",";","'","/","","PgDn",
"","Z","X","C","V","B","N","M","___","___",",",".","","","",
}
local keyboardKeys={
"escape","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12",nil,"delete",
"1","2","3","4","5","6","7","8","9","0","-","=",nil,"backspace","backspace",
"q","w","e","r","t","y","u","i","o","p","[","]","return","return","pgup",
"a","s","d","f","g","h","j","k","l",nil,";","'","/","up","pgdown",
nil,"z","x","c","v","b","n","m","space","space",",",".","left","down","right",
}
local keyboard={
type="keyboard",
}
function keyboard:reset()end
function keyboard:isAbove(x,y)
return
x>self.x and
x<self.x+self.w and
y>self.y and
y<self.y+self.h
end
function keyboard:getCenter()
return self.x+self.w*.5,self.y+self.h*.5
end
function keyboard:update()end
function keyboard:draw()
local x,y,w,h=self.x,self.y,self.w,self.h
gc.translate(x,y)
gc.setColor(0,0,0,.4)
gc.rectangle("fill",0,0,w,h)
gc.setColor(1,1,1)
gc.setLineWidth(3)
for x=0,w,w/15 do
gc.line(x,0,x,h)
end
for y=0,h,h/5 do
gc.line(0,y,w,y)
end
local mStr=mStr
for i=0,4 do
for j=1,15 do
local s=keyboardNames[15*i+j]
local f=int((55-7*#s)*w/1200)
setFont(f)
mStr(s,(j-.5)*w/15,(i+.5)*h/5-f*.7)
end
end
gc.translate(-x,-y)
end
function keyboard:getInfo()
return format("x=%d,y=%d,w=%d,h=%d",self.x,self.y,self.w,self.h)
end
local WIDGET={}
WIDGET.active={}--Table contains all active widgets
WIDGET.sel=nil--Selected widget
@@ -376,7 +463,7 @@ function WIDGET.set(L)
--Reset all widgets
if L then
for _,W in next,L do
W:reset()
if W.reset then W:reset()end
end
end
end
@@ -391,28 +478,28 @@ function WIDGET.newText(D)
name= D.name,
x= D.x,
y= D.y,
align= D.align,
color= D.color and(color[D.color]or D.color)or color.white,
font= D.font,
hide= D.hide,
}
for k,v in next,button do _[k]=v end
for k,v in next,text do _[k]=v end
setmetatable(_,widgetMetatable)
return _
end
function WIDGET.newImage(D)
local _={
name= D.name,
x= D.x-w*.5,
y= D.y-h*.5,
w= D.w,
h= D.h,
color= D.color and(color[D.color]or D.color)or color.white,
font= D.font,
code= D.code,
img= D.img,
alpha= D.alpha or 1,
x= D.x,
y= D.y,
ang= D.ang,
kx= D.kx,
ky= D.ky,
ox= D.ox,
oy= D.oy,
hide= D.hide,
}
for k,v in next,button do _[k]=v end
for k,v in next,image do _[k]=v end
setmetatable(_,widgetMetatable)
return _
end
@@ -435,7 +522,7 @@ function WIDGET.newButton(D)
},
color= D.color and(color[D.color]or D.color)or color.white,
font= D.font,
font= D.font or 30,
code= D.code,
hide= D.hide,
}
@@ -462,7 +549,7 @@ function WIDGET.newKey(D)
},
color= D.color and(color[D.color]or D.color)or color.white,
font= D.font,
font= D.font or 30,
code= D.code,
hide= D.hide,
}
@@ -481,7 +568,7 @@ function WIDGET.newSwitch(D)
D.x+25,D.y,
},
font= D.font,
font= D.font or 30,
disp= D.disp,
code= D.code,
hide= D.hide,
@@ -508,7 +595,7 @@ function WIDGET.newSlider(D)
unit= D.unit or 1,
--smooth=nil,
font= D.font,
font= D.font or 30,
change= D.change,
disp= D.disp,
code= D.code,
@@ -565,11 +652,25 @@ function WIDGET.newSelector(D)
setmetatable(_,widgetMetatable)
return _
end
function WIDGET.newKeyboard(D)
local _={
x= D.x,
y= D.y,
w= D.w,
h= D.h,
hide= D.hide,
resCtr={},
}
for k,v in next,keyboard do _[k]=v end
setmetatable(_,widgetMetatable)
return _
end
function WIDGET.moveCursor(x,y)
WIDGET.sel=nil
for _,W in next,WIDGET.active do
if not(W.hide and W.hide())and W:isAbove(x,y)then
if not(W.hide and W.hide())and W.resCtr and W:isAbove(x,y)then
WIDGET.sel=W
return
end
@@ -611,6 +712,15 @@ function WIDGET.press(x,y)
SFX.play("prerotate")
end
end
elseif W.type=="keyboard"then
if x then
x,y=int((x-W.x)/W.w*15)+1,int((y-W.y)/W.h*5)
local k=keyboardKeys[15*y+x]
if k then
sysFX.newShade(.4,1,1,1,W.x+(x-1)/15*W.w,W.y+y/5*W.h,W.w/15,W.h/5)
love.keypressed(k)
end
end
end
if W.hide and W.hide()then WIDGET.sel=nil end
end
@@ -691,50 +801,52 @@ function WIDGET.keyPressed(i)
elseif i=="up"or i=="down"or i=="left"or i=="right"then
if WIDGET.sel then
local W=WIDGET.sel
local WX,WY=W:getCenter()
local dir=(i=="right"or i=="down")and 1 or -1
local tar
local minDist=1e99
if i=="left"or i=="right"then
for i=1,#WIDGET.active do
local W1=WIDGET.active[i]
if W~=W1 and W1.resCtr then
local L=W1.resCtr
for j=1,#L,2 do
local x,y=L[j],L[j+1]
local dist=(x-WX)*dir
if dist>10 then
dist=dist+abs(y-WY)*6.26
if dist<minDist then
minDist=dist
tar=W1
if W.getCenter then
local WX,WY=W:getCenter()
local dir=(i=="right"or i=="down")and 1 or -1
local tar
local minDist=1e99
if i=="left"or i=="right"then
for i=1,#WIDGET.active do
local W1=WIDGET.active[i]
if W~=W1 and W1.resCtr then
local L=W1.resCtr
for j=1,#L,2 do
local x,y=L[j],L[j+1]
local dist=(x-WX)*dir
if dist>10 then
dist=dist+abs(y-WY)*6.26
if dist<minDist then
minDist=dist
tar=W1
end
end
end
end
end
else
for i=1,#WIDGET.active do
local W1=WIDGET.active[i]
if W~=W1 and W1.resCtr then
local L=W1.resCtr
for j=1,#L,2 do
local x,y=L[j],L[j+1]
local dist=(y-WY)*dir
if dist>10 then
dist=dist+abs(x-WX)*6.26
if dist<minDist then
minDist=dist
tar=W1
end
end
end
end
end
end
else
for i=1,#WIDGET.active do
local W1=WIDGET.active[i]
if W~=W1 and W1.resCtr then
local L=W1.resCtr
for j=1,#L,2 do
local x,y=L[j],L[j+1]
local dist=(y-WY)*dir
if dist>10 then
dist=dist+abs(x-WX)*6.26
if dist<minDist then
minDist=dist
tar=W1
end
end
end
end
if tar then
WIDGET.sel=tar
end
end
if tar then
WIDGET.sel=tar
end
else
WIDGET.sel=WIDGET.active[1]
end
@@ -776,7 +888,7 @@ end
function WIDGET.update()
for _,W in next,WIDGET.active do
W:update()
if W.update then W:update()end
end
end
function WIDGET.draw()

View File

@@ -115,6 +115,7 @@ local newKey= WIDGET.newKey
local newSwitch= WIDGET.newSwitch
local newSlider= WIDGET.newSlider
local newSelector= WIDGET.newSelector
local newKeyboard= WIDGET.newKeyboard
--All widgets
local Widgets={
@@ -143,16 +144,16 @@ local Widgets={
main={
newButton({name="play", x=150,y=280,w=200,h=160,color="lRed", font=55,code=goScene("mode")}),
newButton({name="setting", x=370,y=280,w=200,h=160,color="lBlue", font=45,code=goScene("setting_game")}),
newButton({name="music", x=590,y=280,w=200,h=160,color="lPurple",font=32,code=goScene("music")}),
newButton({name="custom", x=590,y=280,w=200,h=160,color="lOrange",font=43,code=goScene("custom_basic"),hide=function()return not modeRanks.marathon_normal end}),
newButton({name="help", x=150,y=460,w=200,h=160,color="lYellow",font=50,code=goScene("help")}),
newButton({name="stat", x=370,y=460,w=200,h=160,color="lCyan", font=43,code=goScene("stat")}),
newButton({name="qplay", x=590,y=460,w=200,h=160,color="lOrange",font=43,code=function()SCN.push()loadGame(stat.lastPlay,true)end}),
newButton({name="lang", x=150,y=610,w=160,h=100,color="lGreen", font=45,code=goScene("setting_lang")}),
newButton({name="minigame", x=370,y=610,w=80, color="black", code=goScene("minigame")}),
newButton({name="quit", x=590,y=610,w=160,h=100,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}),
newButton({name="qplay", x=590,y=460,w=200,h=160,color="lGreen", font=45,code=function()SCN.push()loadGame(stat.lastPlay,true)end}),
newButton({name="lang", x=150,y=600,w=200,h=80,color="lGreen", font=45,code=goScene("setting_lang")}),
newButton({name="music", x=370,y=600,w=200,h=80,color="lPurple", font=30,code=goScene("music")}),
newButton({name="quit", x=590,y=600,w=200,h=80,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}),
newButton({name="minigame", x=780,y=600,w=80, color="black", code=goScene("minigame")}),
},
mode={
newButton({name="setting", x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=pressKey("e"),hide=function()return mapCam.sel~="custom_clear" and mapCam.sel~="custom_puzzle"end}),
newButton({name="start", x=1040,y=655,w=180,h=80,color="white", font=40,code=pressKey("return"),hide=function()return not mapCam.sel end}),
newButton({name="back", x=1200,y=655,w=120,h=80,color="white", font=40,code=BACK}),
},
@@ -170,26 +171,26 @@ local Widgets={
newSelector({name="wait", x=250, y=310,w=260,color="green", list=CUSlist.wait, disp=CUSval("wait"), code=CUSsto("wait")}),
newSelector({name="fall", x=250, y=390,w=260,color="yellow", list=CUSlist.fall, disp=CUSval("fall"), code=CUSsto("fall")}),
newSlider({name="next", x=170, y=470,w=200,unit=6, font=30, disp=CUSval("next"), code=CUSsto("next")}),
newSwitch({name="hold", x=300, y=540, font=30, disp=CUSval("hold"), code=CUSrev("hold")}),
newSwitch({name="oncehold", x=300, y=620, font=30, disp=CUSval("oncehold"),code=CUSrev("oncehold"),hide=function()return not customEnv.hold end}),
newSlider({name="next", x=170, y=470,w=200,unit=6, disp=CUSval("next"), code=CUSsto("next")}),
newSwitch({name="hold", x=300, y=540, disp=CUSval("hold"), code=CUSrev("hold")}),
newSwitch({name="oncehold", x=300, y=620, disp=CUSval("oncehold"),code=CUSrev("oncehold"),hide=function()return not customEnv.hold end}),
--Visual
newSwitch({name="block", x=700, y=160, font=25, disp=CUSval("block"), code=CUSrev("block")}),
newSlider({name="ghost", x=570, y=230,w=200,unit=.6, font=25, disp=CUSval("ghost"), code=CUSsto("ghost")}),
newSlider({name="center", x=570, y=290,w=200,unit=1, font=25, disp=CUSval("center"), code=CUSsto("center")}),
newSwitch({name="bagLine", x=1190, y=160, font=30, disp=CUSval("bagLine"), code=CUSrev("bagLine")}),
newSwitch({name="highCam", x=1190, y=230, font=30, disp=CUSval("highCam"), code=CUSrev("highCam")}),
newSwitch({name="nextPos", x=1190, y=300, font=30, disp=CUSval("nextPos"), code=CUSrev("nextPos")}),
newSwitch({name="bone", x=1190, y=370, font=30, disp=CUSval("bone"), code=CUSrev("bone")}),
newSwitch({name="bagLine", x=1190, y=160, disp=CUSval("bagLine"), code=CUSrev("bagLine")}),
newSwitch({name="highCam", x=1190, y=230, disp=CUSval("highCam"), code=CUSrev("highCam")}),
newSwitch({name="nextPos", x=1190, y=300, disp=CUSval("nextPos"), code=CUSrev("nextPos")}),
newSwitch({name="bone", x=1190, y=370, disp=CUSval("bone"), code=CUSrev("bone")}),
--Else
newSelector({name="bg", x=1140, y=460, w=220,color="yellow", list=CUSlist.bg, disp=CUSval("bg"), code=function(i)customEnv.bg=i BG.set(i)end}),
newSelector({name="bgm", x=1140, y=540, w=220,color="yellow", list=CUSlist.bgm, disp=CUSval("bgm"), code=function(i)customEnv.bgm=i BGM.play(i)end}),
--Copy/Paste Quest
newButton({name="copy", x=560, y=640, w=300,h=100, color="lRed", font=25,code=pressKey("cC")}),
newButton({name="paste", x=870, y=640, w=300,h=100, color="lBlue", font=25,code=pressKey("cV")}),
--Start
newButton({name="clear", x=560, y=640, w=300,h=100, color="lYellow", font=40,code=pressKey("return")}),
newButton({name="puzzle", x=870, y=640, w=300,h=100, color="lMagenta", font=40,code=pressKey("return2")}),
newButton({name="mission", x=900, y=60, w=220,h=80, color="lBlue", font=25,code=swapScene("custom_mission","swipeR")}),
newButton({name="rule", x=1140, y=60, w=220,h=80, color="lBlue", font=25,code=swapScene("custom_rule","swipeL")}),
@@ -211,6 +212,10 @@ local Widgets={
newSelector({name="life", x=1100, y=260,w=260,color="red", list=CUSlist.life, disp=CUSval("life"), code=CUSsto("life")}),
newSelector({name="pushSpeed", x=1100, y=360,w=260,color="red", list=CUSlist.pushSpeed, disp=CUSval("pushSpeed"),code=CUSsto("pushSpeed")}),
--Copy/Paste
newButton({name="copy", x=560, y=640, w=300,h=100, color="lRed", font=25,code=pressKey("cC")}),
newButton({name="paste", x=870, y=640, w=300,h=100, color="lBlue", font=25,code=pressKey("cV")}),
newButton({name="basic", x=900, y=60, w=220,h=80, color="lBlue", font=25,code=swapScene("custom_basic","swipeR")}),
newButton({name="sequence", x=1140, y=60, w=220,h=80, color="lBlue", font=25,code=swapScene("custom_seq","swipeL")}),
newButton({name="back", x=1140, y=640, w=170,h=80, color="white", font=40,code=BACK}),
@@ -257,24 +262,24 @@ local Widgets={
newButton({name="back", x=1140, y=640, w=170,h=80, color="white", font=40,code=BACK}),
},
custom_draw={
newButton({name="b1", x=500+65*1, y=200, w=58, color="red", font=30,code=setPen(1)}),--B1
newButton({name="b2", x=500+65*2, y=200, w=58, color="orange", font=30,code=setPen(2)}),--B2
newButton({name="b3", x=500+65*3, y=200, w=58, color="yellow", font=30,code=setPen(3)}),--B3
newButton({name="b4", x=500+65*4, y=200, w=58, color="grass", font=30,code=setPen(4)}),--B4
newButton({name="b5", x=500+65*5, y=200, w=58, color="green", font=30,code=setPen(5)}),--B5
newButton({name="b6", x=500+65*6, y=200, w=58, color="water", font=30,code=setPen(6)}),--B6
newButton({name="b7", x=500+65*7, y=200, w=58, color="cyan", font=30,code=setPen(7)}),--B7
newButton({name="b8", x=500+65*8, y=200, w=58, color="blue", font=30,code=setPen(8)}),--B8
newButton({name="b9", x=500+65*9, y=200, w=58, color="purple", font=30,code=setPen(9)}),--B9
newButton({name="b10", x=500+65*10,y=200, w=58, color="magenta",font=30,code=setPen(10)}),--B10
newButton({name="b11", x=500+65*11,y=200, w=58, color="pink", font=30,code=setPen(11)}),--B11
newButton({name="b1", x=500+65*1, y=200, w=58, color="red", code=setPen(1)}),--B1
newButton({name="b2", x=500+65*2, y=200, w=58, color="orange", code=setPen(2)}),--B2
newButton({name="b3", x=500+65*3, y=200, w=58, color="yellow", code=setPen(3)}),--B3
newButton({name="b4", x=500+65*4, y=200, w=58, color="grass", code=setPen(4)}),--B4
newButton({name="b5", x=500+65*5, y=200, w=58, color="green", code=setPen(5)}),--B5
newButton({name="b6", x=500+65*6, y=200, w=58, color="water", code=setPen(6)}),--B6
newButton({name="b7", x=500+65*7, y=200, w=58, color="cyan", code=setPen(7)}),--B7
newButton({name="b8", x=500+65*8, y=200, w=58, color="blue", code=setPen(8)}),--B8
newButton({name="b9", x=500+65*9, y=200, w=58, color="purple", code=setPen(9)}),--B9
newButton({name="b10", x=500+65*10,y=200, w=58, color="magenta", code=setPen(10)}),--B10
newButton({name="b11", x=500+65*11,y=200, w=58, color="pink", code=setPen(11)}),--B11
newButton({name="b12", x=500+65*1, y=270, w=58, color="dGrey", font=30,code=setPen(12)}),--Bone
newButton({name="b13", x=500+65*2, y=270, w=58, color="grey", font=30,code=setPen(13)}),--GB1
newButton({name="b14", x=500+65*3, y=270, w=58, color="lGrey", font=30,code=setPen(14)}),--GB2
newButton({name="b15", x=500+65*4, y=270, w=58, color="dPurple",font=30,code=setPen(15)}),--GB3
newButton({name="b16", x=500+65*5, y=270, w=58, color="dRed", font=30,code=setPen(16)}),--GB4
newButton({name="b17", x=500+65*6, y=270, w=58, color="dGreen", font=30,code=setPen(17)}),--GB5
newButton({name="b12", x=500+65*1, y=270, w=58, color="dGrey", code=setPen(12)}),--Bone
newButton({name="b13", x=500+65*2, y=270, w=58, color="grey", code=setPen(13)}),--GB1
newButton({name="b14", x=500+65*3, y=270, w=58, color="lGrey", code=setPen(14)}),--GB2
newButton({name="b15", x=500+65*4, y=270, w=58, color="dPurple", code=setPen(15)}),--GB3
newButton({name="b16", x=500+65*5, y=270, w=58, color="dRed", code=setPen(16)}),--GB4
newButton({name="b17", x=500+65*6, y=270, w=58, color="dGreen", code=setPen(17)}),--GB5
newButton({name="any", x=600, y=380, w=120, color="lGrey", font=40,code=setPen(0)}),
newButton({name="space", x=730, y=380, w=120, color="grey", font=65,code=setPen(-1)}),
@@ -294,10 +299,10 @@ local Widgets={
newKey({name="_2", x=900, y=540, w=90, color="white", font=50,code=pressKey(02)}),
newKey({name="_3", x=800, y=640, w=90, color="white", font=50,code=pressKey(03)}),
newKey({name="_4", x=900, y=640, w=90, color="white", font=50,code=pressKey(04)}),
newKey({name="any1", x=100, y=640, w=90, color="white", font=30,code=pressKey(05)}),
newKey({name="any2", x=200, y=640, w=90, color="white", font=30,code=pressKey(06)}),
newKey({name="any3", x=300, y=640, w=90, color="white", font=30,code=pressKey(07)}),
newKey({name="any4", x=400, y=640, w=90, color="white", font=30,code=pressKey(08)}),
newKey({name="any1", x=100, y=640, w=90, color="white", code=pressKey(05)}),
newKey({name="any2", x=200, y=640, w=90, color="white", code=pressKey(06)}),
newKey({name="any3", x=300, y=640, w=90, color="white", code=pressKey(07)}),
newKey({name="any4", x=400, y=640, w=90, color="white", code=pressKey(08)}),
newKey({name="PC", x=500, y=640, w=90, color="white", font=50,code=pressKey(09)}),
newKey({name="Z1", x=100, y=340, w=90, color="white", font=50,code=pressKey(11)}),
@@ -371,13 +376,13 @@ local Widgets={
newButton({name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene("setting_sound","swipeR")}),
newButton({name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene("setting_game","swipeL")}),
newSwitch({name="block", x=360, y=180, font=30,disp=SETval("block"), code=SETrev("block")}),
newSlider({name="ghost", x=260, y=250,w=200,unit=.6,font=30,disp=SETval("ghost"),show="percent",code=SETsto("ghost")}),
newSlider({name="center", x=260, y=300,w=200,unit=1, font=30,disp=SETval("center"), code=SETsto("center")}),
newSwitch({name="block", x=360, y=180, disp=SETval("block"), code=SETrev("block")}),
newSlider({name="ghost", x=260, y=250,w=200,unit=.6, disp=SETval("ghost"),show="percent",code=SETsto("ghost")}),
newSlider({name="center", x=260, y=300,w=200,unit=1, disp=SETval("center"), code=SETsto("center")}),
newSwitch({name="smooth", x=700, y=180, font=30,disp=SETval("smooth"), code=SETrev("smooth")}),
newSwitch({name="grid", x=700, y=240, font=30,disp=SETval("grid"), code=SETrev("grid")}),
newSwitch({name="bagLine", x=700, y=300, font=30,disp=SETval("bagLine"), code=SETrev("bagLine")}),
newSwitch({name="smooth", x=700, y=180, disp=SETval("smooth"), code=SETrev("smooth")}),
newSwitch({name="grid", x=700, y=240, disp=SETval("grid"), code=SETrev("grid")}),
newSwitch({name="bagLine", x=700, y=300, disp=SETval("bagLine"), code=SETrev("bagLine")}),
newSlider({name="lockFX", x=350, y=350,w=373,unit=5, font=32,disp=SETval("lockFX"), code=SETsto("lockFX")}),
newSlider({name="dropFX", x=350, y=400,w=373,unit=5, font=32,disp=SETval("dropFX"), code=SETsto("dropFX")}),
@@ -425,17 +430,17 @@ local Widgets={
newSlider({name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..rnd(7),setting.spawn)end,disp=SETval("spawn"), code=SETsto("spawn")}),
newSlider({name="bgm", x=180, y=400,w=400, font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}),
newSlider({name="vib", x=750, y=200,w=400, unit=5, font=28,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}),
newSlider({name="voc", x=750, y=300,w=400, font=32,change=function()VOC.play("nya")end, disp=SETval("voc"), code=SETsto("voc")}),
newSlider({name="voc", x=750, y=300,w=400, font=32,change=function()VOC.play("test")end, disp=SETval("voc"), code=SETsto("voc")}),
newButton({name="back", x=1140, y=640,w=170,h=80,color="white", font=40,code=BACK}),
},
setting_control={
newSlider({name="das", x=250, y=200,w=910, unit=26, font=30,disp=SETval("das"), show="frame_time",code=SETsto("das")}),
newSlider({name="arr", x=250, y=290,w=525, unit=15, font=30,disp=SETval("arr"), show="frame_time",code=SETsto("arr")}),
newSlider({name="sddas", x=250, y=380,w=350, unit=10, font=30,disp=SETval("sddas"), show="frame_time",code=SETsto("sddas")}),
newSlider({name="sdarr", x=250, y=470,w=140, unit=4, font=30,disp=SETval("sdarr"), show="frame_time",code=SETsto("sdarr")}),
newSwitch({name="ihs", x=1100, y=290,font=30, disp=SETval("ihs"), code=SETrev("ihs")}),
newSwitch({name="irs", x=1100, y=380,font=30, disp=SETval("irs"), code=SETrev("irs")}),
newSwitch({name="ims", x=1100, y=470,font=30, disp=SETval("ims"), code=SETrev("ims")}),
newSlider({name="das", x=250, y=200,w=910, unit=26, disp=SETval("das"), show="frame_time",code=SETsto("das")}),
newSlider({name="arr", x=250, y=290,w=525, unit=15, disp=SETval("arr"), show="frame_time",code=SETsto("arr")}),
newSlider({name="sddas", x=250, y=380,w=350, unit=10, disp=SETval("sddas"), show="frame_time",code=SETsto("sddas")}),
newSlider({name="sdarr", x=250, y=470,w=140, unit=4, disp=SETval("sdarr"), show="frame_time",code=SETsto("sdarr")}),
newSwitch({name="ihs", x=1100, y=290, disp=SETval("ihs"), code=SETrev("ihs")}),
newSwitch({name="irs", x=1100, y=380, disp=SETval("irs"), code=SETrev("irs")}),
newSwitch({name="ims", x=1100, y=470, disp=SETval("ims"), code=SETrev("ims")}),
newButton({name="reset", x=160, y=580,w=200,h=100,color="lRed",font=40,
code=function()
local _=setting
@@ -451,29 +456,29 @@ local Widgets={
setting_skin={
newButton({name="prev", x=700,y=100,w=140,h=100,color="white",font=50,code=function()SKIN.prevSet()end}),
newButton({name="next", x=860,y=100,w=140,h=100,color="white",font=50,code=function()SKIN.nextSet()end}),
newButton({name="prev1", x=130,y=230,w=90,h=65,color="white",font=30,code=prevSkin(1)}),
newButton({name="prev2", x=270,y=230,w=90,h=65,color="white",font=30,code=prevSkin(2)}),
newButton({name="prev3", x=410,y=230,w=90,h=65,color="white",font=30,code=prevSkin(3)}),
newButton({name="prev4", x=550,y=230,w=90,h=65,color="white",font=30,code=prevSkin(4)}),
newButton({name="prev5", x=690,y=230,w=90,h=65,color="white",font=30,code=prevSkin(5)}),
newButton({name="prev6", x=830,y=230,w=90,h=65,color="white",font=30,code=prevSkin(6)}),
newButton({name="prev7", x=970,y=230,w=90,h=65,color="white",font=30,code=prevSkin(7)}),
newButton({name="prev1", x=130,y=230,w=90,h=65,color="white",code=prevSkin(1)}),
newButton({name="prev2", x=270,y=230,w=90,h=65,color="white",code=prevSkin(2)}),
newButton({name="prev3", x=410,y=230,w=90,h=65,color="white",code=prevSkin(3)}),
newButton({name="prev4", x=550,y=230,w=90,h=65,color="white",code=prevSkin(4)}),
newButton({name="prev5", x=690,y=230,w=90,h=65,color="white",code=prevSkin(5)}),
newButton({name="prev6", x=830,y=230,w=90,h=65,color="white",code=prevSkin(6)}),
newButton({name="prev7", x=970,y=230,w=90,h=65,color="white",code=prevSkin(7)}),
newButton({name="next1", x=130,y=450,w=90,h=65,color="white",font=30,code=nextSkin(1)}),
newButton({name="next2", x=270,y=450,w=90,h=65,color="white",font=30,code=nextSkin(2)}),
newButton({name="next3", x=410,y=450,w=90,h=65,color="white",font=30,code=nextSkin(3)}),
newButton({name="next4", x=550,y=450,w=90,h=65,color="white",font=30,code=nextSkin(4)}),
newButton({name="next5", x=690,y=450,w=90,h=65,color="white",font=30,code=nextSkin(5)}),
newButton({name="next6", x=830,y=450,w=90,h=65,color="white",font=30,code=nextSkin(6)}),
newButton({name="next7", x=970,y=450,w=90,h=65,color="white",font=30,code=nextSkin(7)}),
newButton({name="next1", x=130,y=450,w=90,h=65,color="white",code=nextSkin(1)}),
newButton({name="next2", x=270,y=450,w=90,h=65,color="white",code=nextSkin(2)}),
newButton({name="next3", x=410,y=450,w=90,h=65,color="white",code=nextSkin(3)}),
newButton({name="next4", x=550,y=450,w=90,h=65,color="white",code=nextSkin(4)}),
newButton({name="next5", x=690,y=450,w=90,h=65,color="white",code=nextSkin(5)}),
newButton({name="next6", x=830,y=450,w=90,h=65,color="white",code=nextSkin(6)}),
newButton({name="next7", x=970,y=450,w=90,h=65,color="white",code=nextSkin(7)}),
newButton({name="spin1", x=130,y=540,w=90,h=65,color="white",font=30,code=nextDir(1)}),
newButton({name="spin2", x=270,y=540,w=90,h=65,color="white",font=30,code=nextDir(2)}),
newButton({name="spin3", x=410,y=540,w=90,h=65,color="white",font=30,code=nextDir(3)}),
newButton({name="spin4", x=550,y=540,w=90,h=65,color="white",font=30,code=nextDir(4)}),
newButton({name="spin5", x=690,y=540,w=90,h=65,color="white",font=30,code=nextDir(5)}),
--newButton({name="spin6",x=825,y=540,w=90,h=65,color="white",font=30,code=nextDir(6)}),--Cannot rotate O
newButton({name="spin7", x=970,y=540,w=90,h=65,color="white",font=30,code=nextDir(7)}),
newButton({name="spin1", x=130,y=540,w=90,h=65,color="white",code=nextDir(1)}),
newButton({name="spin2", x=270,y=540,w=90,h=65,color="white",code=nextDir(2)}),
newButton({name="spin3", x=410,y=540,w=90,h=65,color="white",code=nextDir(3)}),
newButton({name="spin4", x=550,y=540,w=90,h=65,color="white",code=nextDir(4)}),
newButton({name="spin5", x=690,y=540,w=90,h=65,color="white",code=nextDir(5)}),
--newButton({name="spin6",x=825,y=540,w=90,h=65,color="white",code=nextDir(6)}),--Cannot rotate O
newButton({name="spin7", x=970,y=540,w=90,h=65,color="white",code=nextDir(7)}),
newButton({name="skinR", x=200,y=640,w=220,h=80,color="lPurple",font=35,
code=function()
@@ -606,11 +611,18 @@ local Widgets={
newButton({name="back", x=1140,y=640,w=170,h=80,color="white", font=40,code=BACK}),
},
help={
newButton({name="staff", x=980, y=500,w=150,h=80,color="white",font=32,code=goScene("staff")}),
newButton({name="his", x=1160, y=500,w=150,h=80,color="white",font=32,code=goScene("history")}),
newButton({name="qq", x=1070, y=600,w=200,h=80,color="white",font=32,code=function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,hide=mobileHide}),
newButton({name="dict", x=1140, y=410,w=220,h=70,color="white",font=35,code=goScene("dict")}),
newButton({name="staff", x=1140, y=490,w=220,h=70,color="white",font=35,code=goScene("staff")}),
newButton({name="his", x=1140, y=570,w=220,h=70,color="white",font=35,code=goScene("history")}),
newButton({name="qq", x=1140, y=650,w=220,h=70,color="white",font=35,code=function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,hide=mobileHide}),
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=35,code=BACK}),
},
dict={
newKey({name="hideKB", x=1050, y=90,w=120,h=120,color="white",font=40,code=pressKey("kb"),hide=function()return not sceneTemp.select end}),
newButton({name="back", x=1190, y=90,w=120,h=120,color="white",font=40,code=BACK}),
newKeyboard({name="kb", x=40, y=280,w=1200,h=420,hide=function()return sceneTemp.select end}),
newKeyboard({name="kb", x=400, y=360,w=840,h=340,hide=function()return not sceneTemp.select or sceneTemp.hideKB end}),
},
staff={
newButton({name="back", x=1140, y=640,w=170,h=80,color="white",font=40,code=BACK}),
},
@@ -624,8 +636,7 @@ local Widgets={
newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=35,code=BACK}),
},
debug={
newButton({name="copyLog", x=300,y=120,w=300,h=100,color="green", font=30,code=function()LOG.copy()end}),
newButton({name="scrInfo", x=640,y=120,w=300,h=100,color="green", font=30,code=function()
newButton({name="scrInfo", x=300,y=120,w=300,h=100,color="green", font=30,code=function()
LOG.print("Screen Info:")
LOG.print("x y: "..scr.x.." "..scr.y)
LOG.print("w h: "..scr.w.." "..scr.h)