Compare commits
182 Commits
pre0.17.0-
...
pre0.17.1-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ad7443745 | ||
|
|
d3441628a9 | ||
|
|
0f83ae0f1b | ||
|
|
cdb19179f3 | ||
|
|
d1581b1efe | ||
|
|
511426356c | ||
|
|
282dc9bef2 | ||
|
|
b364d16b3d | ||
|
|
0a4a09479a | ||
|
|
29002f8465 | ||
|
|
1c5b7f1f9c | ||
|
|
05921c2c53 | ||
|
|
5615037fd5 | ||
|
|
786490c654 | ||
|
|
e6dc60afed | ||
|
|
939b32129d | ||
|
|
0ce3c7f9bc | ||
|
|
388a9fe418 | ||
|
|
75e44da055 | ||
|
|
6aedeff515 | ||
|
|
1bf6b887df | ||
|
|
fde80893ef | ||
|
|
b1fb9cc9f9 | ||
|
|
ceafcccc3b | ||
|
|
ac41690e76 | ||
|
|
b941399aa8 | ||
|
|
97eb434d5f | ||
|
|
ea76b618a7 | ||
|
|
89595aa0d8 | ||
|
|
df28ca4cc1 | ||
|
|
7ca83597c4 | ||
|
|
459d1e4c64 | ||
|
|
683d73b04c | ||
|
|
0e838f08a6 | ||
|
|
f8f115de10 | ||
|
|
b07c4dc53a | ||
|
|
6eeddba773 | ||
|
|
0cfe4df468 | ||
|
|
eb5c3c3be5 | ||
|
|
a5b9206694 | ||
|
|
375e67bdc4 | ||
|
|
724a576aa3 | ||
|
|
ed47dcb90c | ||
|
|
64b08a5a4d | ||
|
|
baed0153a2 | ||
|
|
46d95b33e4 | ||
|
|
200d270fee | ||
|
|
a8628275a0 | ||
|
|
20a1d2bcc1 | ||
|
|
b887a1f096 | ||
|
|
9bf0e9f28d | ||
|
|
dfc724767b | ||
|
|
f0e66e9dc5 | ||
|
|
0932335f0b | ||
|
|
a9b39e396a | ||
|
|
2e0ceaae72 | ||
|
|
04f38d2eb6 | ||
|
|
fc1ed4dff6 | ||
|
|
f8935d3dd7 | ||
|
|
a86228677f | ||
|
|
79df9f7876 | ||
|
|
12ea2d76be | ||
|
|
485bd72241 | ||
|
|
7240275075 | ||
|
|
29ef9b8d15 | ||
|
|
97f4795d4e | ||
|
|
226e45b24d | ||
|
|
d6ab7e72b2 | ||
|
|
168f44b8b3 | ||
|
|
b73f646a4c | ||
|
|
36cefcc000 | ||
|
|
f901c25c87 | ||
|
|
6d8478b029 | ||
|
|
9bcb040019 | ||
|
|
d977087fc0 | ||
|
|
1a330771d7 | ||
|
|
9c8c9f2106 | ||
|
|
8e075adf8f | ||
|
|
60f2a0e647 | ||
|
|
2b80f72c6b | ||
|
|
3dda0254a8 | ||
|
|
054a52a445 | ||
|
|
85242d808b | ||
|
|
57241677a9 | ||
|
|
6ccdee2a53 | ||
|
|
a3d2b7b7f3 | ||
|
|
b7b28b4ae3 | ||
|
|
30748200dd | ||
|
|
5c7082e886 | ||
|
|
9a3c889a9d | ||
|
|
b432fdf90a | ||
|
|
df089a2f04 | ||
|
|
6600713f4b | ||
|
|
96dad762b2 | ||
|
|
fa64c868b9 | ||
|
|
97e7b019dd | ||
|
|
1826ca6f2f | ||
|
|
db490a6c6c | ||
|
|
421fdef4f9 | ||
|
|
d717ce842d | ||
|
|
f13c9792af | ||
|
|
41e7b8e0f4 | ||
|
|
4bd723a7ee | ||
|
|
66d5bd5490 | ||
|
|
351d0258b2 | ||
|
|
26fb9a7052 | ||
|
|
307fd637fa | ||
|
|
93fb716f89 | ||
|
|
7b41551e2d | ||
|
|
4806af5f7d | ||
|
|
85cb55cdd0 | ||
|
|
27a9697e47 | ||
|
|
7d230cc3b0 | ||
|
|
0db2fffad1 | ||
|
|
2a3296a0e8 | ||
|
|
941b875afa | ||
|
|
99155bb9cf | ||
|
|
0701dd2ad3 | ||
|
|
5570c19e1f | ||
|
|
a728c91476 | ||
|
|
6a43481067 | ||
|
|
29a049fe4e | ||
|
|
b5a9c8e1bb | ||
|
|
bb9a35c161 | ||
|
|
b25a345b42 | ||
|
|
b22b0e0194 | ||
|
|
55cf95f218 | ||
|
|
225ddbcfac | ||
|
|
9377090c7c | ||
|
|
ed002ec2e1 | ||
|
|
e33036d9ec | ||
|
|
ef03e7c009 | ||
|
|
aef4220ac0 | ||
|
|
46223e38cd | ||
|
|
4bafa4bffe | ||
|
|
2b3dd877dd | ||
|
|
0553e5c45e | ||
|
|
4d93374cf6 | ||
|
|
4e421bf9ba | ||
|
|
8b2a9d7c01 | ||
|
|
5a3244d345 | ||
|
|
f1b9d0c5e4 | ||
|
|
6493e0e623 | ||
|
|
e71ba17f9f | ||
|
|
e656363e20 | ||
|
|
0826a748ae | ||
|
|
a595fe99ef | ||
|
|
9dbc7942e3 | ||
|
|
845d8ae32e | ||
|
|
5c524e138c | ||
|
|
86d9265ff9 | ||
|
|
6994a5d6d3 | ||
|
|
e6213b00c1 | ||
|
|
43e2caa30e | ||
|
|
97ca245dfc | ||
|
|
36de1c0751 | ||
|
|
704341fd15 | ||
|
|
22b61bc9c3 | ||
|
|
f4cbbc0a2a | ||
|
|
dc99187b9d | ||
|
|
915598dec4 | ||
|
|
e7b4518d73 | ||
|
|
9603a78e87 | ||
|
|
bd90e051d4 | ||
|
|
26e66b313f | ||
|
|
c534bbd12a | ||
|
|
83b5e217e5 | ||
|
|
c0adf5bf0b | ||
|
|
4ff737a4ac | ||
|
|
5af0706c09 | ||
|
|
4ccee0f1de | ||
|
|
9b752d540e | ||
|
|
e860c7b7ec | ||
|
|
8a1fd9531f | ||
|
|
5fd6e0ee99 | ||
|
|
53b2b81fe0 | ||
|
|
6ccc811b46 | ||
|
|
962a61567a | ||
|
|
58f05e1cec | ||
|
|
6b426790c7 | ||
|
|
d4fc578673 | ||
|
|
51b567b8db |
4
.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_1.md
vendored
@@ -1,8 +1,8 @@
|
||||
---
|
||||
name: Bug report (bluescreen crash) Bug报告 (蓝屏报错)
|
||||
about: Create a report of problems which made the crash with a bluescreen
|
||||
about: Create a bug report which causes a bluescreen crash
|
||||
---
|
||||
Screenshot with crash information (*Image(s) Here*):
|
||||
|
||||
|
||||
If you can reproduce it, write the steps here. If you can't, try to describe the exactly time the game crash, like pressing which key or which button (*Details Here*)
|
||||
If you can reproduce it, write the steps here. If you can't, try to describe what causes the game to crash, like pressing a key/button (*Details Here*)
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_2.md
vendored
@@ -1,8 +1,8 @@
|
||||
---
|
||||
name: Bug report (unintended behaviors) Bug报告 (奇怪的现象)
|
||||
about: Create a report of unintended behaviors
|
||||
about: Create bug report that causes unintended behaviors
|
||||
---
|
||||
Screenshot with unintended behaviors (*Image(s) Here*):
|
||||
|
||||
|
||||
If you can reproduce it, write the steps here. If you can't, try to describe the exactly time the game crash, like pressing which key or which button (*Details Here*):
|
||||
If you can reproduce it, write the steps here. If you can't, try to describe what causes the unintended behavior, like pressing a key/button (*Details Here*):
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_3.md
vendored
@@ -2,3 +2,7 @@
|
||||
name: Feature Request 添加新功能
|
||||
about: Suggest an idea that may improve Techmino 提一些有意思的新想法,让Techmino越来越好!
|
||||
---
|
||||
### What feature do you want to suggest to the game?
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
.github/build/Linux/icon.png
vendored
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 50 KiB |
BIN
.github/build/Windows/icon.png
vendored
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 50 KiB |
BIN
.github/build/macOS/backgroundImage.tiff
vendored
BIN
.github/build/macOS/icon.icns
vendored
@@ -1,44 +1,17 @@
|
||||
local lastLoaded={}
|
||||
local maxLoadedCount=3
|
||||
local nameList={}
|
||||
local SourceObjList={}
|
||||
local volume=1
|
||||
|
||||
local BGM={
|
||||
default=false,
|
||||
getList=function()error("Cannot getList before initialize!")end,
|
||||
getCount=function()return 0 end,
|
||||
play=NULL,
|
||||
stop=NULL,
|
||||
onChange=NULL,
|
||||
--nowPlay=[str:playing ID]
|
||||
--playing=[src:playing SRC]
|
||||
--lastPlayed=[str:lastPlayed ID]
|
||||
}
|
||||
local function task_fadeOut(src)
|
||||
while true do
|
||||
coroutine.yield()
|
||||
local v=src:getVolume()-.025*volume
|
||||
src:setVolume(v>0 and v or 0)
|
||||
if v<=0 then
|
||||
src:pause()
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
local function task_fadeIn(src)
|
||||
while true do
|
||||
coroutine.yield()
|
||||
local v=volume
|
||||
v=math.min(v,src:getVolume()+.025*v)
|
||||
src:setVolume(v)
|
||||
if v>=volume then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
local function check_curFadeOut(task,code,src)
|
||||
return task.code==code and task.args[1]==src
|
||||
end
|
||||
|
||||
local function _tryReleaseSources()
|
||||
local n=#lastLoaded
|
||||
while #lastLoaded>maxLoadedCount do
|
||||
@@ -53,6 +26,27 @@ local function _tryReleaseSources()
|
||||
end
|
||||
end
|
||||
end
|
||||
local function _addFile(name,path)
|
||||
if not SourceObjList[name]then
|
||||
table.insert(nameList,name)
|
||||
SourceObjList[name]={path=path,source=false}
|
||||
end
|
||||
end
|
||||
|
||||
function BGM.getList()return nameList end
|
||||
function BGM.getCount()return #nameList end
|
||||
function BGM.load(name,path)
|
||||
if type(name)=='table'then
|
||||
for k,v in next,name do
|
||||
_addFile(k,v)
|
||||
end
|
||||
else
|
||||
_addFile(name,path)
|
||||
end
|
||||
table.sort(nameList)
|
||||
LOG(BGM.getCount().." BGM files added")
|
||||
end
|
||||
|
||||
function BGM.setDefault(bgm)
|
||||
BGM.default=bgm
|
||||
end
|
||||
@@ -75,85 +69,114 @@ function BGM.setVol(v)
|
||||
end
|
||||
end
|
||||
end
|
||||
function BGM.init(list)
|
||||
BGM.init=nil
|
||||
|
||||
local simpList={}
|
||||
for _,v in next,list do
|
||||
table.insert(simpList,v.name)
|
||||
SourceObjList[v.name]={path=v.path,source=false}
|
||||
end
|
||||
table.sort(simpList)
|
||||
function BGM.getList()return simpList end
|
||||
local count=#simpList
|
||||
LOG(count.." BGM files added")
|
||||
function BGM.getCount()return count end
|
||||
|
||||
local function _tryLoad(name)
|
||||
if SourceObjList[name]then
|
||||
if SourceObjList[name].source then
|
||||
return true
|
||||
elseif love.filesystem.getInfo(SourceObjList[name].path)then
|
||||
SourceObjList[name].source=love.audio.newSource(SourceObjList[name].path,'stream')
|
||||
SourceObjList[name].source:setLooping(true)
|
||||
SourceObjList[name].source:setVolume(0)
|
||||
table.insert(lastLoaded,1,name)
|
||||
_tryReleaseSources()
|
||||
return true
|
||||
else
|
||||
LOG("No BGM: "..SourceObjList[name],5)
|
||||
end
|
||||
elseif name then
|
||||
LOG("No BGM: "..name,5)
|
||||
local function task_fadeOut(src)
|
||||
while true do
|
||||
coroutine.yield()
|
||||
local v=src:getVolume()-volume/40
|
||||
src:setVolume(v>0 and v or 0)
|
||||
if v<=0 then
|
||||
src:stop()
|
||||
return true
|
||||
end
|
||||
end
|
||||
function BGM.play(name)
|
||||
name=name or BGM.default
|
||||
if not _tryLoad(name)then return end
|
||||
if volume==0 then
|
||||
end
|
||||
local function task_fadeIn(src)
|
||||
while true do
|
||||
coroutine.yield()
|
||||
local v=volume
|
||||
v=math.min(v,src:getVolume()+v/40)
|
||||
src:setVolume(v)
|
||||
if v>=volume then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
local function check_curFadeOut(task,code,src)
|
||||
return task.code==code and task.args[1]==src
|
||||
end
|
||||
local function _tryLoad(name)
|
||||
if SourceObjList[name]then
|
||||
if SourceObjList[name].source then
|
||||
return true
|
||||
elseif love.filesystem.getInfo(SourceObjList[name].path)then
|
||||
SourceObjList[name].source=love.audio.newSource(SourceObjList[name].path,'stream')
|
||||
SourceObjList[name].source:setVolume(0)
|
||||
table.insert(lastLoaded,1,name)
|
||||
_tryReleaseSources()
|
||||
return true
|
||||
else
|
||||
LOG("No BGM: "..SourceObjList[name],5)
|
||||
end
|
||||
elseif name then
|
||||
LOG("No BGM: "..name,5)
|
||||
end
|
||||
end
|
||||
function BGM.play(name,args)
|
||||
name=name or BGM.default
|
||||
args=args or""
|
||||
if not _tryLoad(name)or args:sArg('-preLoad')then return end
|
||||
if volume==0 then
|
||||
BGM.nowPlay=name
|
||||
BGM.playing=SourceObjList[name].source
|
||||
return true
|
||||
end
|
||||
if name and SourceObjList[name].source then
|
||||
if BGM.nowPlay~=name then
|
||||
if BGM.nowPlay then
|
||||
if not args:sArg('-sdout')then
|
||||
TASK.new(task_fadeOut,BGM.playing)
|
||||
else
|
||||
BGM.playing:pause()
|
||||
end
|
||||
end
|
||||
TASK.removeTask_iterate(check_curFadeOut,task_fadeOut,SourceObjList[name].source)
|
||||
TASK.removeTask_code(task_fadeIn)
|
||||
|
||||
BGM.nowPlay=name
|
||||
BGM.playing=SourceObjList[name].source
|
||||
return true
|
||||
end
|
||||
if name and SourceObjList[name].source then
|
||||
if BGM.nowPlay~=name then
|
||||
if BGM.nowPlay then
|
||||
TASK.new(task_fadeOut,BGM.playing)
|
||||
end
|
||||
TASK.removeTask_iterate(check_curFadeOut,task_fadeOut,SourceObjList[name].source)
|
||||
TASK.removeTask_code(task_fadeIn)
|
||||
|
||||
TASK.new(task_fadeIn,SourceObjList[name].source)
|
||||
BGM.nowPlay=name
|
||||
BGM.playing=SourceObjList[name].source
|
||||
BGM.lastPlayed=BGM.nowPlay
|
||||
BGM.playing:seek(0)
|
||||
if not args:sArg('-sdin')then
|
||||
BGM.playing:setVolume(0)
|
||||
TASK.new(task_fadeIn,BGM.playing)
|
||||
else
|
||||
BGM.playing:setVolume(volume)
|
||||
BGM.playing:play()
|
||||
BGM.onChange(name)
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
function BGM.seek(t)
|
||||
if BGM.playing then
|
||||
BGM.playing:seek(t)
|
||||
end
|
||||
end
|
||||
function BGM.continue()
|
||||
if BGM.lastPlayed then
|
||||
BGM.nowPlay,BGM.playing=BGM.lastPlayed,SourceObjList[BGM.lastPlayed].source
|
||||
TASK.removeTask_iterate(check_curFadeOut,task_fadeOut,SourceObjList[BGM.nowPlay].source)
|
||||
TASK.removeTask_code(task_fadeIn)
|
||||
TASK.new(task_fadeIn,BGM.playing)
|
||||
SourceObjList[name].source:setLooping(not args:sArg('-noloop'))
|
||||
BGM.lastPlayed=BGM.nowPlay
|
||||
BGM.playing:play()
|
||||
BGM.onChange(name)
|
||||
end
|
||||
return true
|
||||
end
|
||||
function BGM.stop()
|
||||
end
|
||||
function BGM.seek(t)
|
||||
if BGM.playing then
|
||||
BGM.playing:seek(t)
|
||||
end
|
||||
end
|
||||
function BGM.isPlaying()
|
||||
return BGM.playing and BGM.playing:isPlaying()
|
||||
end
|
||||
function BGM.continue()
|
||||
if BGM.lastPlayed then
|
||||
BGM.nowPlay,BGM.playing=BGM.lastPlayed,SourceObjList[BGM.lastPlayed].source
|
||||
TASK.removeTask_iterate(check_curFadeOut,task_fadeOut,SourceObjList[BGM.nowPlay].source)
|
||||
TASK.removeTask_code(task_fadeIn)
|
||||
TASK.new(task_fadeIn,BGM.playing)
|
||||
BGM.playing:play()
|
||||
end
|
||||
end
|
||||
function BGM.stop(args)
|
||||
args=args or""
|
||||
TASK.removeTask_code(task_fadeIn)
|
||||
if not args:sArg('-s')then
|
||||
if BGM.nowPlay then
|
||||
TASK.new(task_fadeOut,BGM.playing)
|
||||
end
|
||||
BGM.nowPlay,BGM.playing=nil
|
||||
elseif BGM.playing then
|
||||
BGM.playing:pause()
|
||||
end
|
||||
BGM.nowPlay,BGM.playing=nil
|
||||
end
|
||||
return BGM
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local abs=math.abs
|
||||
local function hsv(h,s,v,a)
|
||||
local function hsv(h,s,v,a)--Color type, Color amount, Light
|
||||
if s<=0 then return v,v,v,a end
|
||||
h=h*6
|
||||
local c=v*s
|
||||
@@ -19,16 +19,16 @@ local COLOR={
|
||||
red= {hsv(0.00, 0.89, 0.91)},
|
||||
fire= {hsv(0.04, 0.93, 0.94)},
|
||||
orange= {hsv(0.09, 0.99, 0.96)},
|
||||
yellow= {hsv(0.16, 0.82, 0.90)},
|
||||
lime= {hsv(0.18, 0.89, 0.88)},
|
||||
jade= {hsv(0.23, 1.00, 0.82)},
|
||||
yellow= {hsv(0.15, 0.82, 0.90)},
|
||||
lime= {hsv(0.20, 0.89, 0.88)},
|
||||
jade= {hsv(0.25, 1.00, 0.82)},
|
||||
green= {hsv(0.33, 1.00, 0.81)},
|
||||
aqua= {hsv(0.48, 1.00, 0.74)},
|
||||
aqua= {hsv(0.47, 1.00, 0.76)},
|
||||
cyan= {hsv(0.53, 1.00, 0.88)},
|
||||
navy= {hsv(0.56, 1.00, 1.00)},
|
||||
sea= {hsv(0.61, 1.00, 1.00)},
|
||||
blue= {hsv(0.64, 1.00, 0.95)},
|
||||
violet= {hsv(0.73, 1.00, 0.91)},
|
||||
violet= {hsv(0.74, 1.00, 0.91)},
|
||||
purple= {hsv(0.80, 1.00, 0.81)},
|
||||
magenta= {hsv(0.86, 1.00, 0.78)},
|
||||
wine= {hsv(0.92, 0.98, 0.91)},
|
||||
@@ -36,16 +36,16 @@ local COLOR={
|
||||
lRed= {hsv(0.00, 0.38, 0.93)},
|
||||
lFire= {hsv(0.04, 0.45, 0.91)},
|
||||
lOrange= {hsv(0.10, 0.53, 0.92)},
|
||||
lYellow= {hsv(0.15, 0.61, 0.95)},
|
||||
lLime= {hsv(0.19, 0.66, 0.92)},
|
||||
lJade= {hsv(0.24, 0.56, 0.90)},
|
||||
lYellow= {hsv(0.14, 0.61, 0.95)},
|
||||
lLime= {hsv(0.20, 0.66, 0.92)},
|
||||
lJade= {hsv(0.26, 0.56, 0.90)},
|
||||
lGreen= {hsv(0.34, 0.49, 0.89)},
|
||||
lAqua= {hsv(0.49, 0.59, 0.85)},
|
||||
lAqua= {hsv(0.47, 0.59, 0.86)},
|
||||
lCyan= {hsv(0.51, 0.77, 0.88)},
|
||||
lNavy= {hsv(0.54, 0.80, 0.95)},
|
||||
lSea= {hsv(0.56, 0.72, 0.97)},
|
||||
lSea= {hsv(0.57, 0.72, 0.97)},
|
||||
lBlue= {hsv(0.64, 0.44, 0.96)},
|
||||
lViolet= {hsv(0.73, 0.47, 0.95)},
|
||||
lViolet= {hsv(0.72, 0.47, 0.95)},
|
||||
lPurple= {hsv(0.80, 0.62, 0.89)},
|
||||
lMagenta= {hsv(0.86, 0.61, 0.89)},
|
||||
lWine= {hsv(0.93, 0.57, 0.92)},
|
||||
@@ -53,13 +53,13 @@ local COLOR={
|
||||
dRed= {hsv(0.00, 0.80, 0.48)},
|
||||
dFire= {hsv(0.04, 0.80, 0.34)},
|
||||
dOrange= {hsv(0.07, 0.80, 0.39)},
|
||||
dYellow= {hsv(0.11, 0.80, 0.37)},
|
||||
dLime= {hsv(0.17, 0.80, 0.26)},
|
||||
dJade= {hsv(0.31, 0.80, 0.27)},
|
||||
dYellow= {hsv(0.12, 0.80, 0.37)},
|
||||
dLime= {hsv(0.20, 0.80, 0.26)},
|
||||
dJade= {hsv(0.29, 0.80, 0.27)},
|
||||
dGreen= {hsv(0.33, 0.80, 0.26)},
|
||||
dAqua= {hsv(0.47, 0.80, 0.23)},
|
||||
dAqua= {hsv(0.46, 0.80, 0.24)},
|
||||
dCyan= {hsv(0.50, 0.80, 0.30)},
|
||||
dNavy= {hsv(0.59, 0.80, 0.42)},
|
||||
dNavy= {hsv(0.58, 0.80, 0.42)},
|
||||
dSea= {hsv(0.64, 0.80, 0.40)},
|
||||
dBlue= {hsv(0.67, 0.80, 0.34)},
|
||||
dViolet= {hsv(0.71, 0.80, 0.35)},
|
||||
@@ -72,12 +72,17 @@ local COLOR={
|
||||
gray= {hsv(0.02, 0.05, 0.65)},
|
||||
lGray= {hsv(0.02, 0.06, 0.86)},
|
||||
white= {hsv(0.01, 0.02, 0.99)},
|
||||
|
||||
xGray= {hsv(0.00, 0.00, 0.35,.8)},
|
||||
lxGray= {hsv(0.00, 0.00, 0.62,.8)},
|
||||
dxGray= {hsv(0.00, 0.00, 0.16,.8)},
|
||||
}
|
||||
for k,v in next,{
|
||||
R='red', F='fire', O='orange', Y='yellow', L='lime', J='jade', G='green', A='aqua', C='cyan', N='navy', S='sea', B='blue', V='violet', P='purple', M='magenta', W='wine',
|
||||
lR='lRed',lF='lFire',lO='lOrange',lY='lYellow',lL='lLime',lJ='lJade',lG='lGreen',lA='lAqua',lC='lCyan',lN='lNavy',lS='lSea',lB='lBlue',lV='lViolet',lP='lPurple',lM='lMagenta',lW='lWine',
|
||||
dR='dRed',dF='dFire',dO='dOrange',dY='dYellow',dL='dLime',dJ='dJade',dG='dGreen',dA='dAqua',dC='dCyan',dN='dNavy',dS='dSea',dB='dBlue',dV='dViolet',dP='dPurple',dM='dMagenta',dW='dWine',
|
||||
D='black',dH='dGray',H='gray',lH='lGray',Z='white',
|
||||
X='xGray',lX='lxGray',dX='dxGray',
|
||||
--Remain letter: EIKQTUX
|
||||
}do
|
||||
COLOR[k]=COLOR[v]
|
||||
|
||||
@@ -6,22 +6,38 @@ function FILE.load(name,args)
|
||||
local F=fs.newFile(name)
|
||||
assert(F:open'r','open error')
|
||||
local s=F:read()F:close()
|
||||
if args:sArg'-luaon'or args==''and s:sub(1,6)=='return{'then
|
||||
local func=loadstring(s)
|
||||
local mode=
|
||||
STRING.sArg(args,'-luaon')and'luaon'or
|
||||
STRING.sArg(args,'-lua')and'lua'or
|
||||
STRING.sArg(args,'-json')and'json'or
|
||||
STRING.sArg(args,'-string')and'string'or
|
||||
s:sub(1,6)=='return{'and'luaon'or
|
||||
(s:sub(1,1)=='['and s:sub(-1)==']'or s:sub(1,1)=='{'and s:sub(-1)=='}')and'json'or
|
||||
'string'
|
||||
if mode=='luaon'then
|
||||
local func,err_mes=loadstring(s)
|
||||
if func then
|
||||
setfenv(func,{})
|
||||
local res=func()
|
||||
return assert(res,'decode error')
|
||||
else
|
||||
error('decode error')
|
||||
error('decode error: '..err_mes)
|
||||
end
|
||||
elseif args:sArg'-json'or args==''and s:sub(1,1)=='['and s:sub(-1)==']'or s:sub(1,1)=='{'and s:sub(-1)=='}'then
|
||||
elseif mode=='lua'then
|
||||
local func,err_mes=loadstring(s)
|
||||
if func then
|
||||
local res=func()
|
||||
return assert(res,'run error')
|
||||
else
|
||||
error('compile error: '..err_mes)
|
||||
end
|
||||
elseif mode=='json'then
|
||||
local res=JSON.decode(s)
|
||||
if res then
|
||||
return res
|
||||
end
|
||||
error('decode error')
|
||||
elseif args:sArg'-string'or args==''then
|
||||
elseif mode=='string'then
|
||||
return s
|
||||
else
|
||||
error('unknown mode')
|
||||
@@ -32,12 +48,12 @@ function FILE.load(name,args)
|
||||
end
|
||||
function FILE.save(data,name,args)
|
||||
if not args then args=''end
|
||||
if args:sArg'-d'and fs.getInfo(name)then
|
||||
if STRING.sArg(args,'-d')and fs.getInfo(name)then
|
||||
error('duplicate')
|
||||
end
|
||||
|
||||
if type(data)=='table'then
|
||||
if args:sArg'-luaon'then
|
||||
if STRING.sArg(args,'-luaon')then
|
||||
data=TABLE.dump(data)
|
||||
if not data then
|
||||
error('encode error')
|
||||
|
||||
@@ -18,7 +18,7 @@ function FONT.rawset(s)
|
||||
end
|
||||
function FONT.load(fonts)
|
||||
for name,path in next,fonts do
|
||||
assert(love.filesystem.getInfo(path),("Font file $1($2) not exist!"):repD(name,path))
|
||||
assert(love.filesystem.getInfo(path),STRING.repD("Font file $1($2) not exist!",name,path))
|
||||
fontFiles[name]=love.filesystem.newFile(path)
|
||||
fontCache[name]={}
|
||||
end
|
||||
|
||||
@@ -2,7 +2,6 @@ local IMG={}
|
||||
function IMG.init(list)
|
||||
IMG.init=nil
|
||||
|
||||
local null=love.graphics.newCanvas(1,1)
|
||||
setmetatable(IMG,{__index=function(self,name)
|
||||
if type(list[name])=='table'then
|
||||
self[name]={}
|
||||
@@ -13,7 +12,7 @@ function IMG.init(list)
|
||||
self[name]=love.graphics.newImage(list[name])
|
||||
else
|
||||
LOG("No IMG: "..name)
|
||||
self[name]=null
|
||||
self[name]=PAPER
|
||||
end
|
||||
return self[name]
|
||||
end})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
NONE={}function NULL()end
|
||||
NONE={}function NULL()end PAPER=love.graphics.newCanvas(1,1)
|
||||
EDITING=""
|
||||
LOADED=false
|
||||
|
||||
@@ -70,15 +70,26 @@ local gc_draw,gc_line,gc_circle,gc_print=gc.draw,gc.line,gc.circle,gc.print
|
||||
|
||||
local WIDGET,SCR,SCN=WIDGET,SCR,SCN
|
||||
local xOy=SCR.xOy
|
||||
|
||||
local ITP=xOy.inverseTransformPoint
|
||||
|
||||
local max,min=math.max,math.min
|
||||
|
||||
local devMode
|
||||
local mx,my,mouseShow,cursorSpd=640,360,false,0
|
||||
local jsState={}--map, joystickID->axisStates: {axisName->axisVal}
|
||||
local errData={}--list, each error create {mes={errMes strings},scene=sceneNameStr}
|
||||
|
||||
local devMode
|
||||
local function drawCursor(_,x,y)
|
||||
gc_setColor(1,1,1)
|
||||
gc_setLineWidth(2)
|
||||
gc_circle(ms.isDown(1)and'fill'or'line',x,y,6)
|
||||
end
|
||||
local showPowerInfo=true
|
||||
local showClickFX=true
|
||||
local discardCanvas=false
|
||||
local frameMul=100
|
||||
local sleepInterval=1/60
|
||||
local onQuit=NULL
|
||||
|
||||
local batteryImg=GC.DO{31,20,
|
||||
{'fRect',1,0,26,2},
|
||||
@@ -96,17 +107,16 @@ local function updatePowerInfo()
|
||||
gc_clear(0,0,0,.25)
|
||||
if state~='unknown'then
|
||||
gc_setLineWidth(4)
|
||||
local charging=state=='charging'
|
||||
if state=='nobattery'then
|
||||
gc_setColor(1,1,1)
|
||||
gc_setLineWidth(2)
|
||||
gc_line(74,SCR.safeX+5,100,22)
|
||||
gc_line(74,5,100,22)
|
||||
elseif pow then
|
||||
if charging then gc_setColor(0,1,0)
|
||||
elseif pow>50 then gc_setColor(1,1,1)
|
||||
elseif pow>26 then gc_setColor(1,1,0)
|
||||
elseif pow==26 then gc_setColor(.5,0,1)
|
||||
else gc_setColor(1,0,0)
|
||||
if state=='charging'then gc_setColor(0,1,0)
|
||||
elseif pow>50 then gc_setColor(1,1,1)
|
||||
elseif pow>26 then gc_setColor(1,1,0)
|
||||
elseif pow==26 then gc_setColor(.5,0,1)
|
||||
else gc_setColor(1,0,0)
|
||||
end
|
||||
gc.rectangle('fill',76,6,pow*.22,14)
|
||||
if pow<100 then
|
||||
@@ -152,7 +162,7 @@ local function _triggerMouseDown(x,y,k)
|
||||
if SCN.mouseDown then SCN.mouseDown(x,y,k)end
|
||||
WIDGET.press(x,y,k)
|
||||
lastX,lastY=x,y
|
||||
if SETTING.clickFX then SYSFX.newTap(3,x,y)end
|
||||
if showClickFX then SYSFX.newTap(3,x,y)end
|
||||
end
|
||||
local function mouse_update(dt)
|
||||
if not KBisDown('lctrl','rctrl')and KBisDown('up','down','left','right')then
|
||||
@@ -238,13 +248,13 @@ function love.touchpressed(id,x,y)
|
||||
x,y=ITP(xOy,x,y)
|
||||
lastX,lastY=x,y
|
||||
WIDGET.cursorMove(x,y)
|
||||
if SCN.touchDown then SCN.touchDown(x,y)end
|
||||
if SCN.touchDown then SCN.touchDown(x,y,id)end
|
||||
if kb.hasTextInput()then kb.setTextInput(false)end
|
||||
end
|
||||
function love.touchmoved(_,x,y,dx,dy)
|
||||
function love.touchmoved(id,x,y,dx,dy)
|
||||
if SCN.swapping then return end
|
||||
x,y=ITP(xOy,x,y)
|
||||
if SCN.touchMove then SCN.touchMove(x,y,dx/SCR.k,dy/SCR.k)end
|
||||
if SCN.touchMove then SCN.touchMove(x,y,dx/SCR.k,dy/SCR.k,id)end
|
||||
WIDGET.drag(x,y,dx/SCR.k,dy/SCR.k)
|
||||
end
|
||||
function love.touchreleased(id,x,y)
|
||||
@@ -257,10 +267,10 @@ function love.touchreleased(id,x,y)
|
||||
WIDGET.unFocus()
|
||||
SCN.mainTouchID=false
|
||||
end
|
||||
if SCN.touchUp then SCN.touchUp(x,y)end
|
||||
if SCN.touchUp then SCN.touchUp(x,y,id)end
|
||||
if(x-lastX)^2+(y-lastY)^2<62 then
|
||||
if SCN.touchClick then SCN.touchClick(x,y)end
|
||||
if SETTING.clickFX then SYSFX.newTap(3,x,y)end
|
||||
if showClickFX then SYSFX.newTap(3,x,y)end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -309,7 +319,7 @@ function love.keypressed(key,_,isRep)
|
||||
MES.new('info',"DEBUG ON",.2)
|
||||
elseif key=='f11'then
|
||||
SETTING.fullscreen=not SETTING.fullscreen
|
||||
applyFullscreen()
|
||||
applySettings()
|
||||
saveSettings()
|
||||
elseif not SCN.swapping then
|
||||
if EDITING==""and(not SCN.keyDown or SCN.keyDown(key,isRep))then
|
||||
@@ -324,7 +334,7 @@ function love.keypressed(key,_,isRep)
|
||||
elseif key=='space'or key=='return'then
|
||||
mouseShow=true
|
||||
if not isRep then
|
||||
if SETTING.clickFX then SYSFX.newTap(3,mx,my)end
|
||||
if showClickFX then SYSFX.newTap(3,mx,my)end
|
||||
_triggerMouseDown(mx,my,1)
|
||||
end
|
||||
else
|
||||
@@ -397,7 +407,7 @@ function love.joystickremoved(JS)
|
||||
end
|
||||
end
|
||||
function love.gamepadaxis(JS,axis,val)
|
||||
if JS==jsState[1]._jsObj then
|
||||
if jsState[1]and JS==jsState[1]._jsObj then
|
||||
local js=jsState[1]
|
||||
if axis=='leftx'or axis=='lefty'or axis=='rightx'or axis=='righty'then
|
||||
local newVal=--range: [0,1]
|
||||
@@ -452,7 +462,7 @@ function love.gamepadpressed(_,key)
|
||||
if W and W.arrowKey then W:arrowKey(key)end
|
||||
elseif key=='return'then
|
||||
mouseShow=true
|
||||
if SETTING.clickFX then SYSFX.newTap(3,mx,my)end
|
||||
if showClickFX then SYSFX.newTap(3,mx,my)end
|
||||
_triggerMouseDown(mx,my,1)
|
||||
else
|
||||
if W and W.keypress then
|
||||
@@ -481,14 +491,16 @@ function love.lowmemory()
|
||||
MES.new('check',"[auto GC] low MEM 设备内存过低")
|
||||
end
|
||||
end
|
||||
|
||||
local onResize=NULL
|
||||
function love.resize(w,h)
|
||||
if SCR.w==w and SCR.h==h then return end
|
||||
SCR.resize(w,h)
|
||||
if BG.resize then BG.resize(w,h)end
|
||||
if SCN.resize then SCN.resize(w,h)end
|
||||
WIDGET.resize(w,h)
|
||||
FONT.reset()
|
||||
|
||||
SHADER.warning:send('w',w*SCR.dpi)
|
||||
onResize(w,h)
|
||||
end
|
||||
|
||||
local onFocus=NULL
|
||||
@@ -627,14 +639,9 @@ local wsImg={}do
|
||||
}
|
||||
end
|
||||
|
||||
local function drawCursor(_,x,y)
|
||||
gc_setColor(1,1,1)
|
||||
gc_setLineWidth(2)
|
||||
gc_circle(ms.isDown(1)and'fill'or'line',x,y,6)
|
||||
end
|
||||
local function showPowerInfo()return true end
|
||||
local onQuit=NULL
|
||||
|
||||
local debugInfos={
|
||||
{"Cache",gcinfo},
|
||||
}
|
||||
function love.run()
|
||||
local love=love
|
||||
|
||||
@@ -649,7 +656,7 @@ function love.run()
|
||||
local FPS,MINI=love.timer.getFPS,love.window.isMinimized
|
||||
local PUMP,POLL=love.event.pump,love.event.poll
|
||||
|
||||
local timer,SETTING,VERSION=love.timer.getTime,SETTING,VERSION
|
||||
local timer,VERSION=love.timer.getTime,VERSION
|
||||
|
||||
local frameTimeList={}
|
||||
local lastFrame=timer()
|
||||
@@ -698,11 +705,10 @@ function love.run()
|
||||
|
||||
--DRAW
|
||||
if not MINI()then
|
||||
FCT=FCT+SETTING.frameMul
|
||||
FCT=FCT+frameMul
|
||||
if FCT>=100 then
|
||||
FCT=FCT-100
|
||||
|
||||
local safeX=SCR.safeX
|
||||
gc_replaceTransform(SCR.origin)
|
||||
gc_setColor(1,1,1)
|
||||
BG.draw()
|
||||
@@ -713,16 +719,14 @@ function love.run()
|
||||
TEXT_draw()
|
||||
|
||||
--Draw cursor
|
||||
if mouseShow then
|
||||
drawCursor(time,mx,my)
|
||||
end
|
||||
if mouseShow then drawCursor(time,mx,my)end
|
||||
gc_replaceTransform(SCR.xOy_ul)
|
||||
MES_draw()
|
||||
gc_replaceTransform(SCR.origin)
|
||||
--Draw power info.
|
||||
if showPowerInfo()then
|
||||
if showPowerInfo then
|
||||
gc_setColor(1,1,1)
|
||||
gc_draw(infoCanvas,safeX,0,0,SCR.k)
|
||||
gc_draw(infoCanvas,SCR.safeX,0,0,SCR.k)
|
||||
end
|
||||
|
||||
--Draw scene swapping animation
|
||||
@@ -733,10 +737,12 @@ function love.run()
|
||||
end
|
||||
gc_replaceTransform(SCR.xOy_d)
|
||||
--Draw Version string
|
||||
gc_setColor(.8,.8,.8,.4)
|
||||
gc_setColor(.9,.9,.9,.42)
|
||||
FONT.set(20)
|
||||
mStr(VERSION.string,0,-30)
|
||||
gc_replaceTransform(SCR.xOy_dl)
|
||||
local safeX=SCR.safeX/SCR.k
|
||||
|
||||
--Draw FPS
|
||||
FONT.set(15)
|
||||
gc_setColor(1,1,1)
|
||||
@@ -744,11 +750,14 @@ function love.run()
|
||||
|
||||
--Debug info.
|
||||
if devMode then
|
||||
--Left-down infos
|
||||
--Debug infos at left-down
|
||||
gc_setColor(devColor[devMode])
|
||||
gc_print("MEM "..gcinfo(),safeX+5,-40)
|
||||
gc_print("Tasks "..TASK.getCount(),safeX+5,-60)
|
||||
gc_print("Voices "..VOC.getQueueCount(),safeX+5,-80)
|
||||
|
||||
--Text infos
|
||||
for i=1,#debugInfos do
|
||||
gc_print(debugInfos[i][1],safeX+5,-20-20*i)
|
||||
gc_print(debugInfos[i][2](),safeX+62.6,-20-20*i)
|
||||
end
|
||||
|
||||
--Update & draw frame time
|
||||
table.insert(frameTimeList,1,dt)table.remove(frameTimeList,126)
|
||||
@@ -794,13 +803,13 @@ function love.run()
|
||||
gc_present()
|
||||
|
||||
--SPEED UPUPUP!
|
||||
if SETTING.cleanCanvas then gc_discard()end
|
||||
if discardCanvas then gc_discard()end
|
||||
end
|
||||
end
|
||||
|
||||
--Fresh power info.
|
||||
if time-lastFreshPow>2.6 then
|
||||
if showPowerInfo()then
|
||||
if showPowerInfo then
|
||||
updatePowerInfo()
|
||||
lastFreshPow=time
|
||||
end
|
||||
@@ -818,31 +827,59 @@ function love.run()
|
||||
end
|
||||
end
|
||||
|
||||
--Keep 60fps
|
||||
_=timer()-lastFrame
|
||||
if _<.0162 then WAIT(.0162-_)end
|
||||
while timer()-lastFrame<1/60 do end
|
||||
if _<sleepInterval*.9626 then WAIT(sleepInterval*.9626-_)end
|
||||
while timer()-lastFrame<sleepInterval do end
|
||||
end
|
||||
end
|
||||
|
||||
local Z={}
|
||||
|
||||
Z.js=jsState
|
||||
Z.errData=errData
|
||||
function Z.getJsState()return jsState end
|
||||
function Z.getErr(i)
|
||||
if i=='#'then
|
||||
return errData[#errData]
|
||||
elseif i then
|
||||
return errData[i]
|
||||
else
|
||||
return errData
|
||||
end
|
||||
end
|
||||
|
||||
function Z.setIfPowerInfo(func)showPowerInfo=func end
|
||||
function Z.setPowerInfo(bool)showPowerInfo=bool end
|
||||
function Z.setCleanCanvas(bool)discardCanvas=bool end
|
||||
function Z.setFrameMul(n)frameMul=n end
|
||||
function Z.setMaxFPS(fps)sleepInterval=1/fps end
|
||||
function Z.setClickFX(bool)showClickFX=bool end
|
||||
|
||||
--[Warning] Color and line width is uncertain value, set it in the function.
|
||||
function Z.setCursor(func)drawCursor=func end
|
||||
|
||||
--Change F1~F7 events of devmode (F8 mode)
|
||||
function Z.setOnFnKeys(list)
|
||||
assert(type(list)=='table')
|
||||
for i=1,7 do fnKey[i]=type(list[i])=='function'and list[i]or NULL end
|
||||
assert(type(list)=='table',"Z.setOnFnKeys(list): list must be a table")
|
||||
for i=1,7 do fnKey[i]=assert(type(list[i])=='function'and list[i])end
|
||||
end
|
||||
|
||||
function Z.setOnFocus(func)onFocus=type(func)=='function'and func or NULL end
|
||||
function Z.setDebugInfo(list)
|
||||
assert(type(list)=='table',"Z.setDebugInfo(list): list must be a table")
|
||||
for i=1,#list do
|
||||
assert(type(list[i][1])=='string',"Z.setDebugInfo(list): list[i][1] must be a string")
|
||||
assert(type(list[i][2])=='function',"Z.setDebugInfo(list): list[i][2] must be a function")
|
||||
end
|
||||
debugInfos=list
|
||||
end
|
||||
|
||||
function Z.setOnQuit(func)onQuit=type(func)=='function'and func or NULL end
|
||||
function Z.setOnFocus(func)
|
||||
onFocus=assert(type(func)=='function'and func,"Z.setOnFocus(func): func must be a function")
|
||||
end
|
||||
|
||||
function Z.setOnResize(func)
|
||||
onResize=assert(type(func)=='function'and func,"Z.setOnResize(func): func must be a function")
|
||||
end
|
||||
|
||||
function Z.setOnQuit(func)
|
||||
onQuit=assert(type(func)=='function'and func,"Z.setOnQuit(func): func must be a function")
|
||||
end
|
||||
|
||||
return Z
|
||||
|
||||
@@ -20,4 +20,18 @@ function MATH.coin(a,b)
|
||||
end
|
||||
end
|
||||
|
||||
function MATH.interval(v,low,high)
|
||||
if v<=low then
|
||||
return low
|
||||
elseif v>=high then
|
||||
return high
|
||||
else
|
||||
return v
|
||||
end
|
||||
end
|
||||
|
||||
function MATH.expApproach(a,b,k)
|
||||
return b+(a-b)*2.718281828459045^-k
|
||||
end
|
||||
|
||||
return MATH
|
||||
@@ -140,11 +140,11 @@ function profile.switch()
|
||||
switch=not switch
|
||||
if not switch then
|
||||
profile.stop()
|
||||
love.system.setClipboardText(PROFILE.report())
|
||||
PROFILE.reset()
|
||||
love.system.setClipboardText(profile.report())
|
||||
profile.reset()
|
||||
return false
|
||||
else
|
||||
PROFILE.start()
|
||||
profile.start()
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,6 +15,8 @@ local SCN={
|
||||
draw=false, --Swap draw func
|
||||
},
|
||||
stack={},--Scene stack
|
||||
prev=false,
|
||||
args={},--Arguments from previous scene
|
||||
|
||||
scenes=scenes,
|
||||
|
||||
@@ -52,14 +54,15 @@ function SCN.swapUpdate(dt)
|
||||
S.time=S.time-dt
|
||||
if S.time<S.changeTime and S.time+dt>=S.changeTime then
|
||||
--Scene swapped this frame
|
||||
SCN.init(S.tar,SCN.cur)
|
||||
SCN.prev=SCN.cur
|
||||
SCN.init(S.tar)
|
||||
SCN.mainTouchID=nil
|
||||
end
|
||||
if S.time<0 then
|
||||
SCN.swapping=false
|
||||
end
|
||||
end
|
||||
function SCN.init(s,org)
|
||||
function SCN.init(s)
|
||||
love.keyboard.setTextInput(false)
|
||||
|
||||
local S=scenes[s]
|
||||
@@ -89,7 +92,7 @@ function SCN.init(s,org)
|
||||
SCN.update=S.update
|
||||
SCN.draw=S.draw
|
||||
if S.sceneInit then
|
||||
S.sceneInit(org)
|
||||
S.sceneInit()
|
||||
end
|
||||
end
|
||||
function SCN.push(tar,style)
|
||||
@@ -165,11 +168,12 @@ local swap={
|
||||
end
|
||||
},
|
||||
}--Scene swapping animations
|
||||
function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back
|
||||
function SCN.swapTo(tar,style,...)--Parallel scene swapping, cannot back
|
||||
if scenes[tar]then
|
||||
if not SCN.swapping and tar~=SCN.cur then
|
||||
style=style or'fade'
|
||||
SCN.swapping=true
|
||||
SCN.args={...}
|
||||
local S=SCN.stat
|
||||
S.tar,S.style=tar,style
|
||||
S.time=swap[style].duration
|
||||
@@ -180,15 +184,15 @@ function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back
|
||||
MES.new('warn',"No Scene: "..tar)
|
||||
end
|
||||
end
|
||||
function SCN.go(tar,style)--Normal scene swapping, can back
|
||||
function SCN.go(tar,style,...)--Normal scene swapping, can back
|
||||
if scenes[tar]then
|
||||
SCN.push()
|
||||
SCN.swapTo(tar,style)
|
||||
SCN.swapTo(tar,style,...)
|
||||
else
|
||||
MES.new('warn',"No Scene: "..tar)
|
||||
end
|
||||
end
|
||||
function SCN.back()
|
||||
function SCN.back(...)
|
||||
if SCN.swapping then return end
|
||||
|
||||
--Leave scene
|
||||
@@ -199,7 +203,7 @@ function SCN.back()
|
||||
--Poll&Back to previous Scene
|
||||
local m=#SCN.stack
|
||||
if m>0 then
|
||||
SCN.swapTo(SCN.stack[m-1],SCN.stack[m])
|
||||
SCN.swapTo(SCN.stack[m-1],SCN.stack[m],...)
|
||||
SCN.stack[m],SCN.stack[m-1]=nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
local type,rem=type,table.remove
|
||||
local int,rnd=math.floor,math.random
|
||||
local interval=MATH.interval
|
||||
|
||||
local sfxList={}
|
||||
local packSetting={}
|
||||
@@ -42,16 +43,28 @@ function SFX.init(list)
|
||||
end
|
||||
function SFX.load(path)
|
||||
local c=0
|
||||
local missing=0
|
||||
for i=1,#sfxList do
|
||||
local fullPath=path..sfxList[i]..'.ogg'
|
||||
if love.filesystem.getInfo(fullPath)then
|
||||
if Sources[sfxList[i]]then
|
||||
for j=1,#Sources[sfxList[i]]do
|
||||
Sources[sfxList[i]][j]:release()
|
||||
end
|
||||
end
|
||||
Sources[sfxList[i]]={love.audio.newSource(fullPath,'static')}
|
||||
c=c+1
|
||||
else
|
||||
LOG("No SFX: "..sfxList[i]..'.ogg',.1)
|
||||
missing=missing+1
|
||||
end
|
||||
end
|
||||
LOG(c.."/"..#sfxList.." SFX files loaded")
|
||||
LOG(missing.." SFX files missing")
|
||||
if missing>0 then
|
||||
MES.new('info',missing.." SFX files missing")
|
||||
end
|
||||
collectgarbage()
|
||||
end
|
||||
function SFX.loadSample(pack)
|
||||
assert(type(pack)=='table',"Usage: SFX.loadsample([table])")
|
||||
@@ -128,7 +141,7 @@ local function _play(name,vol,pos,pitch)
|
||||
S=S[n]--AU_SRC
|
||||
if S:getChannelCount()==1 then
|
||||
if pos then
|
||||
pos=pos*stereo
|
||||
pos=interval(pos,-1,1)*stereo
|
||||
S:setPosition(pos,1-pos^2,0)
|
||||
else
|
||||
S:setPosition(0,0,0)
|
||||
|
||||
@@ -6,7 +6,7 @@ local find,sub,gsub,upper=string.find,string.sub,string.gsub,string.upper
|
||||
local char,byte=string.char,string.byte
|
||||
|
||||
--"Replace dollars", replace all $n with ...
|
||||
function string.repD(str,...)
|
||||
function STRING.repD(str,...)
|
||||
local l={...}
|
||||
for i=#l,1,-1 do
|
||||
str=gsub(str,'$'..i,l[i])
|
||||
@@ -15,7 +15,7 @@ function string.repD(str,...)
|
||||
end
|
||||
|
||||
--"Scan arg", scan if str has the arg (format of str is like "-json -q", arg is like "-q")
|
||||
function string.sArg(str,switch)
|
||||
function STRING.sArg(str,switch)
|
||||
if find(str.." ",switch.." ")then
|
||||
return true
|
||||
end
|
||||
@@ -77,11 +77,11 @@ end
|
||||
|
||||
function STRING.time(t)
|
||||
if t<60 then
|
||||
return format("%.3f\"",t)
|
||||
return format("%.3f″",t)
|
||||
elseif t<3600 then
|
||||
return format("%d'%05.2f\"",int(t/60),int(t%60*100)/100)
|
||||
return format("%d′%05.2f″",int(t/60),int(t%60*100)/100)
|
||||
else
|
||||
return format("%d:%.2d'%05.2f\"",int(t/3600),int(t/60%60),int(t%60*100)/100)
|
||||
return format("%d:%.2d′%05.2f″",int(t/3600),int(t/60%60),int(t%60*100)/100)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -169,6 +169,25 @@ function STRING.vcsDecrypt(text,key)
|
||||
end
|
||||
return result..buffer
|
||||
end
|
||||
function STRING.digezt(text)--Not powerful hash, just protect the original text
|
||||
local out={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
|
||||
local seed=26
|
||||
for i=1,#text do
|
||||
local c=byte(text,i)
|
||||
seed=(seed+c)%26
|
||||
c=c+seed
|
||||
local pos=c*i%16
|
||||
local step=(c+i)%4+1
|
||||
local times=2+(c%6)
|
||||
for _=1,times do
|
||||
out[pos+1]=(out[pos+1]+c)%256
|
||||
pos=(pos+step)%16
|
||||
end
|
||||
end
|
||||
local result=""
|
||||
for i=1,16 do result=result..char(out[i])end
|
||||
return result
|
||||
end
|
||||
|
||||
function STRING.readLine(str)
|
||||
local p=str:find("\n")
|
||||
@@ -178,6 +197,9 @@ function STRING.readLine(str)
|
||||
return str,""
|
||||
end
|
||||
end
|
||||
function STRING.readChars(str,n)
|
||||
return sub(str,1,n),sub(str,n+1)
|
||||
end
|
||||
|
||||
function STRING.packBin(s)
|
||||
return data.encode('string','base64',data.compress('string','zlib',s))
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
local rnd=math.random
|
||||
local find=string.find
|
||||
local rem=table.remove
|
||||
local next,type=next,type
|
||||
@@ -58,7 +59,6 @@ function TABLE.coverR(new,old)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--For all things in new if same type in old, push to old
|
||||
function TABLE.update(new,old)
|
||||
for k,v in next,new do
|
||||
@@ -84,6 +84,19 @@ function TABLE.complete(new,old)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------
|
||||
|
||||
--Pop & return random [1~#] of table
|
||||
function TABLE.popRandom(t)
|
||||
local l=#t
|
||||
if l>0 then
|
||||
local r=rnd(l)
|
||||
r,t[r]=t[r],t[l]
|
||||
t[l]=nil
|
||||
return r
|
||||
end
|
||||
end
|
||||
|
||||
--Remove [1~#] of table
|
||||
function TABLE.cut(G)
|
||||
for i=1,#G do
|
||||
@@ -98,6 +111,8 @@ function TABLE.clear(G)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------
|
||||
|
||||
--Remove duplicated value of [1~#]
|
||||
function TABLE.trimDuplicate(org)
|
||||
local cache={}
|
||||
@@ -122,6 +137,7 @@ function TABLE.remDuplicate(org)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------
|
||||
|
||||
--Reverse [1~#]
|
||||
function TABLE.reverse(org)
|
||||
|
||||
@@ -19,6 +19,7 @@ local sub,ins,rem=string.sub,table.insert,table.remove
|
||||
local xOy=SCR.xOy
|
||||
local FONT=FONT
|
||||
local mStr=GC.mStr
|
||||
local approach=MATH.expApproach
|
||||
|
||||
local downArrowIcon=GC.DO{40,25,{'fPoly',0,0,20,25,40,0}}
|
||||
local upArrowIcon=GC.DO{40,25,{'fPoly',0,25,20,0,40,25}}
|
||||
@@ -45,7 +46,12 @@ local function _rectangleStencil()
|
||||
gc.rectangle('fill',1,1,STW-2,STH-2)
|
||||
end
|
||||
|
||||
local onChange=NULL
|
||||
|
||||
local WIDGET={}
|
||||
|
||||
function WIDGET.setOnChange(func)onChange=assert(type(func)=='function'and func,"WIDGET.setOnChange(func): func must be a function")end
|
||||
|
||||
local widgetMetatable={
|
||||
__tostring=function(self)
|
||||
return self:getInfo()
|
||||
@@ -72,20 +78,23 @@ function text:draw()
|
||||
if self.alpha>0 then
|
||||
local c=self.color
|
||||
gc_setColor(c[1],c[2],c[3],self.alpha)
|
||||
local w=self.obj:getWidth()
|
||||
local k=min(self.lim/self.obj:getWidth(),1)
|
||||
if self.align=='M'then
|
||||
gc_draw(self.obj,self.x-self.obj:getWidth()*.5,self.y)
|
||||
gc_draw(self.obj,self.x,self.y,nil,k,1,w*.5,0)
|
||||
elseif self.align=='L'then
|
||||
gc_draw(self.obj,self.x,self.y)
|
||||
gc_draw(self.obj,self.x,self.y,nil,k,1)
|
||||
elseif self.align=='R'then
|
||||
gc_draw(self.obj,self.x-self.obj:getWidth(),self.y)
|
||||
gc_draw(self.obj,self.x,self.y,nil,k,1,w,0)
|
||||
end
|
||||
end
|
||||
end
|
||||
function WIDGET.newText(D)--name,x,y[,fText][,color][,font=30][,fType][,align='M'][,hideF][,hide]
|
||||
function WIDGET.newText(D)--name,x,y[,lim][,fText][,color][,font=30][,fType][,align='M'][,hideF][,hide]
|
||||
local _={
|
||||
name= D.name or"_",
|
||||
x= D.x,
|
||||
y= D.y,
|
||||
lim= D.lim or 1e99,
|
||||
|
||||
fText=D.fText,
|
||||
color=D.color and(COLOR[D.color]or D.color)or COLOR.Z,
|
||||
@@ -148,9 +157,9 @@ function button:isAbove(x,y)
|
||||
local ATV=self.ATV
|
||||
return
|
||||
x>self.x-ATV and
|
||||
y>self.y-ATV and
|
||||
y>self.y and
|
||||
x<self.x+self.w+2*ATV and
|
||||
y<self.y+self.h+2*ATV
|
||||
y<self.y+self.h
|
||||
end
|
||||
function button:getCenter()
|
||||
return self.x+self.w*.5,self.y+self.h*.5
|
||||
@@ -171,17 +180,19 @@ function button:draw()
|
||||
|
||||
--Button
|
||||
gc_setColor(.15+r*.7,.15+g*.7,.15+b*.7,.9)
|
||||
gc_rectangle('fill',x-ATV,y-ATV,w+2*ATV,h+2*ATV,3)
|
||||
gc_rectangle('fill',x-ATV,y,w+2*ATV,h,4)
|
||||
gc_setLineWidth(2)
|
||||
gc_setColor(.3+r*.7,.3+g*.7,.3+b*.7)
|
||||
gc_rectangle('line',x-ATV,y,w+2*ATV,h,5)
|
||||
if ATV>0 then
|
||||
gc_setLineWidth(2)
|
||||
gc_setColor(.97,.97,.97,ATV*.125)
|
||||
gc_rectangle('line',x-ATV+2,y-ATV+2,w+2*ATV-4,h+2*ATV-4,3)
|
||||
gc_rectangle('line',x-ATV,y,w+2*ATV,h,3)
|
||||
end
|
||||
|
||||
--Drawable
|
||||
local obj=self.obj
|
||||
local ox,oy=obj:getWidth()*.5,obj:getHeight()*.5
|
||||
local y0=y+h*.5-ATV*.5
|
||||
local y0=y+h*.5
|
||||
gc_setColor(1,1,1,.2+ATV*.05)
|
||||
if self.align=='M'then
|
||||
local x0=x+w*.5
|
||||
@@ -219,15 +230,15 @@ function button:press(_,_,k)
|
||||
SYSFX.newRectRipple(
|
||||
6,
|
||||
self.x-ATV,
|
||||
self.y-ATV-WIDGET.scrollPos,
|
||||
self.y-WIDGET.scrollPos,
|
||||
self.w+2*ATV,
|
||||
self.h+2*ATV
|
||||
self.h
|
||||
)
|
||||
if self.sound then
|
||||
SFX.play('button')
|
||||
SFX.play(self.sound)
|
||||
end
|
||||
end
|
||||
function WIDGET.newButton(D)--name,x,y,w[,h][,fText][,color][,font=30][,fType][,sound=true][,align='M'][,edge=0][,code][,hideF][,hide]
|
||||
function WIDGET.newButton(D)--name,x,y,w[,h][,fText][,color][,font=30][,fType][,sound][,align='M'][,edge=0][,code][,hideF][,hide]
|
||||
if not D.h then D.h=D.w end
|
||||
local _={
|
||||
name= D.name or"_",
|
||||
@@ -251,11 +262,18 @@ function WIDGET.newButton(D)--name,x,y,w[,h][,fText][,color][,font=30][,fType][,
|
||||
fType=D.fType,
|
||||
align=D.align or'M',
|
||||
edge= D.edge or 0,
|
||||
sound=D.sound~=false,
|
||||
code= D.code or NULL,
|
||||
hideF=D.hideF,
|
||||
hide= D.hide,
|
||||
}
|
||||
if D.sound==false then
|
||||
_.sound=false
|
||||
elseif type(D.sound)=='string'then
|
||||
_.sound=D.sound
|
||||
else
|
||||
_.sound='button'
|
||||
end
|
||||
|
||||
for k,v in next,button do _[k]=v end
|
||||
setmetatable(_,widgetMetatable)
|
||||
return _
|
||||
@@ -301,13 +319,6 @@ function key:draw()
|
||||
local align=self.align
|
||||
local r,g,b=c[1],c[2],c[3]
|
||||
|
||||
--Frame
|
||||
if not self.noFrame then
|
||||
gc_setColor(.2+r*.8,.2+g*.8,.2+b*.8,.7)
|
||||
gc_setLineWidth(2)
|
||||
gc_rectangle('line',x,y,w,h,3)
|
||||
end
|
||||
|
||||
--Fill
|
||||
if self.fShade then
|
||||
gc_setColor(r,g,b,ATV*.25)
|
||||
@@ -319,6 +330,16 @@ function key:draw()
|
||||
gc_draw(self.fShade,x+w-self.edge-self.fShade:getWidth(),y+h*.5-self.fShade:getHeight()*.5)
|
||||
end
|
||||
else
|
||||
--Background
|
||||
gc_setColor(0,0,0,.3)
|
||||
gc_rectangle('fill',x,y,w,h,4)
|
||||
|
||||
--Frame
|
||||
gc_setColor(.2+r*.8,.2+g*.8,.2+b*.8,.7)
|
||||
gc_setLineWidth(2)
|
||||
gc_rectangle('line',x,y,w,h,3)
|
||||
|
||||
--Shade
|
||||
gc_setColor(1,1,1,ATV*.05)
|
||||
gc_rectangle('fill',x,y,w,h,3)
|
||||
end
|
||||
@@ -342,10 +363,10 @@ end
|
||||
function key:press(_,_,k)
|
||||
self.code(k)
|
||||
if self.sound then
|
||||
SFX.play('key')
|
||||
SFX.play(self.sound)
|
||||
end
|
||||
end
|
||||
function WIDGET.newKey(D)--name,x,y,w[,h][,fText][,fShade][,noFrame][,color][,font=30][,fType][,sound=true][,align='M'][,edge=0][,code][,hideF][,hide]
|
||||
function WIDGET.newKey(D)--name,x,y,w[,h][,fText][,fShade][,color][,font=30][,fType][,sound][,align='M'][,edge=0][,code][,hideF][,hide]
|
||||
if not D.h then D.h=D.w end
|
||||
local _={
|
||||
name= D.name or"_",
|
||||
@@ -365,17 +386,22 @@ function WIDGET.newKey(D)--name,x,y,w[,h][,fText][,fShade][,noFrame][,color][,fo
|
||||
|
||||
fText= D.fText,
|
||||
fShade= D.fShade,
|
||||
noFrame=D.noFrame,
|
||||
color= D.color and(COLOR[D.color]or D.color)or COLOR.Z,
|
||||
font= D.font or 30,
|
||||
fType=D.fType,
|
||||
sound= D.sound~=false,
|
||||
fType= D.fType,
|
||||
align= D.align or'M',
|
||||
edge= D.edge or 0,
|
||||
code= D.code or NULL,
|
||||
hideF= D.hideF,
|
||||
hide= D.hide,
|
||||
}
|
||||
if D.sound==false then
|
||||
_.sound=false
|
||||
elseif type(D.sound)=='string'then
|
||||
_.sound=D.sound
|
||||
else
|
||||
_.sound='key'
|
||||
end
|
||||
for k,v in next,key do _[k]=v end
|
||||
setmetatable(_,widgetMetatable)
|
||||
return _
|
||||
@@ -415,6 +441,10 @@ function switch:draw()
|
||||
local x,y=self.x,self.y
|
||||
local ATV=self.ATV
|
||||
|
||||
--Background
|
||||
gc_setColor(0,0,0,.3)
|
||||
gc_rectangle('fill',x,y-25,50,50,4)
|
||||
|
||||
--Frame
|
||||
gc_setLineWidth(2)
|
||||
gc_setColor(1,1,1,.6+ATV*.1)
|
||||
@@ -499,7 +529,7 @@ function slider:isAbove(x,y)
|
||||
return x>self.x-10 and x<self.x+self.w+10 and y>self.y-25 and y<self.y+25
|
||||
end
|
||||
function slider:getCenter()
|
||||
return self.x+self.w*(self.pos/self.unit),self.y
|
||||
return self.x+self.w*((self.pos-self.rangeL)/(self.rangeR-self.rangeL)),self.y
|
||||
end
|
||||
function slider:update(dt)
|
||||
local ATV=self.ATV
|
||||
@@ -513,7 +543,7 @@ function slider:update(dt)
|
||||
if ATV>0 then self.ATV=max(ATV-dt*30,0)end
|
||||
end
|
||||
if not self.hide then
|
||||
self.pos=self.pos*.7+self.disp()*.3
|
||||
self.pos=approach(self.pos,self.disp(),dt*26)
|
||||
end
|
||||
end
|
||||
function slider:draw()
|
||||
@@ -526,8 +556,8 @@ function slider:draw()
|
||||
--Units
|
||||
if not self.smooth then
|
||||
gc_setLineWidth(2)
|
||||
for p=0,self.unit do
|
||||
local X=x+(x2-x)*p/self.unit
|
||||
for p=self.rangeL,self.rangeR,self.unit do
|
||||
local X=x+(x2-x)*(p-self.rangeL)/(self.rangeR-self.rangeL)
|
||||
gc_line(X,y+7,X,y-7)
|
||||
end
|
||||
end
|
||||
@@ -537,7 +567,7 @@ function slider:draw()
|
||||
gc_line(x,y,x2,y)
|
||||
|
||||
--Block
|
||||
local cx=x+(x2-x)*self.pos/self.unit
|
||||
local cx=x+(x2-x)*(self.pos-self.rangeL)/(self.rangeR-self.rangeL)
|
||||
local bx,by,bw,bh=cx-10-ATV*.5,y-16-ATV,20+ATV,32+2*ATV
|
||||
gc_setColor(.8,.8,.8)
|
||||
gc_rectangle('fill',bx,by,bw,bh,3)
|
||||
@@ -572,13 +602,16 @@ end
|
||||
function slider:drag(x)
|
||||
if not x then return end
|
||||
x=x-self.x
|
||||
local p=self.disp()
|
||||
local P=x<0 and 0 or x>self.w and self.unit or x/self.w*self.unit
|
||||
if not self.smooth then
|
||||
P=int(P+.5)
|
||||
local newPos=MATH.interval(x/self.w,0,1)
|
||||
local newVal
|
||||
if not self.unit then
|
||||
newVal=(1-newPos)*self.rangeL+newPos*self.rangeR
|
||||
else
|
||||
newVal=newPos*(self.rangeR-self.rangeL)
|
||||
newVal=self.rangeL+newVal-newVal%self.unit
|
||||
end
|
||||
if p~=P then
|
||||
self.code(P)
|
||||
if newVal~=self.disp()then
|
||||
self.code(newVal)
|
||||
end
|
||||
if self.change and timer()-self.lastTime>.5 then
|
||||
self.lastTime=timer()
|
||||
@@ -591,8 +624,8 @@ function slider:release(x)
|
||||
end
|
||||
function slider:scroll(n)
|
||||
local p=self.disp()
|
||||
local u=self.smooth and .01 or 1
|
||||
local P=n==-1 and max(p-u,0)or min(p+u,self.unit)
|
||||
local u=self.unit or .01
|
||||
local P=MATH.interval(p+u*n,self.rangeL,self.rangeR)
|
||||
if p==P or not P then return end
|
||||
self.code(P)
|
||||
if self.change and timer()-self.lastTime>.18 then
|
||||
@@ -603,7 +636,13 @@ end
|
||||
function slider:arrowKey(k)
|
||||
self:scroll((k=='left'or k=='up')and -1 or 1)
|
||||
end
|
||||
function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,unit][,smooth][,font=30][,fType][,change],disp[,show][,code],hide
|
||||
function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,axis][,smooth][,font=30][,fType][,change],disp[,show][,code],hide
|
||||
if not D.axis then
|
||||
D.axis={0,1,false}
|
||||
D.smooth=true
|
||||
elseif not D.axis[3]then
|
||||
D.smooth=true
|
||||
end
|
||||
local _={
|
||||
name= D.name or"_",
|
||||
|
||||
@@ -622,10 +661,12 @@ function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,unit][,smooth][,
|
||||
|
||||
fText= D.fText,
|
||||
color= D.color and(COLOR[D.color]or D.color)or COLOR.Z,
|
||||
unit= D.unit or 1,
|
||||
smooth=false,
|
||||
rangeL=D.axis[1],
|
||||
rangeR=D.axis[2],
|
||||
unit= D.axis[3],
|
||||
smooth=D.smooth,
|
||||
font= D.font or 30,
|
||||
fType=D.fType,
|
||||
fType= D.fType,
|
||||
change=D.change,
|
||||
disp= D.disp,
|
||||
code= D.code or NULL,
|
||||
@@ -633,22 +674,17 @@ function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,unit][,smooth][,
|
||||
hide= D.hide,
|
||||
show= false,
|
||||
}
|
||||
if D.smooth~=nil then
|
||||
_.smooth=D.smooth
|
||||
else
|
||||
_.smooth=_.unit<=1
|
||||
end
|
||||
if D.show then
|
||||
if type(D.show)=='function'then
|
||||
_.show=D.show
|
||||
else
|
||||
_.show=sliderShowFunc[D.show]
|
||||
end
|
||||
elseif D.show~=false then
|
||||
if _.unit<=1 then
|
||||
_.show=sliderShowFunc.percent
|
||||
else
|
||||
elseif D.show~=false then--Use default if nil
|
||||
if _.unit and _.unit%1==0 then
|
||||
_.show=sliderShowFunc.int
|
||||
else
|
||||
_.show=sliderShowFunc.percent
|
||||
end
|
||||
end
|
||||
for k,v in next,slider do _[k]=v end
|
||||
@@ -700,6 +736,10 @@ function selector:draw()
|
||||
local w=self.w
|
||||
local ATV=self.ATV
|
||||
|
||||
--Background
|
||||
gc_setColor(0,0,0,.3)
|
||||
gc_rectangle('fill',x,y,w,60,4)
|
||||
|
||||
--Frame
|
||||
gc_setColor(1,1,1,.6+ATV*.1)
|
||||
gc_setLineWidth(2)
|
||||
@@ -863,9 +903,15 @@ function inputBox:draw()
|
||||
local x,y,w,h=self.x,self.y,self.w,self.h
|
||||
local ATV=self.ATV
|
||||
|
||||
gc_setColor(1,1,1,ATV*.08)
|
||||
gc_rectangle('fill',x,y,w,h,3)
|
||||
--Background
|
||||
gc_setColor(0,0,0,.4)
|
||||
gc_rectangle('fill',x,y,w,h,4)
|
||||
|
||||
--Highlight
|
||||
gc_setColor(1,1,1,ATV*.08*(math.sin(TIME()*4.2)*.2+.8))
|
||||
gc_rectangle('fill',x,y,w,h,4)
|
||||
|
||||
--Frame
|
||||
gc_setColor(1,1,1)
|
||||
gc_setLineWidth(3)
|
||||
gc_rectangle('line',x,y,w,h,3)
|
||||
@@ -931,7 +977,7 @@ function WIDGET.newInputBox(D)--name,x,y,w[,h][,font=30][,fType][,secret][,regex
|
||||
},
|
||||
|
||||
font= D.font or int(D.h/7-1)*5,
|
||||
fType=D.fType,
|
||||
fType= D.fType,
|
||||
secret=D.secret==true,
|
||||
regex= D.regex,
|
||||
limit= D.limit,
|
||||
@@ -1023,8 +1069,8 @@ function textBox:draw()
|
||||
local lineH=self.lineH
|
||||
|
||||
--Background
|
||||
gc_setColor(0,0,0,.4)
|
||||
gc_rectangle('fill',x,y,w,h,3)
|
||||
gc_setColor(0,0,0,.3)
|
||||
gc_rectangle('fill',x,y,w,h,4)
|
||||
|
||||
--Frame
|
||||
gc_setLineWidth(2)
|
||||
@@ -1187,6 +1233,14 @@ function listBox:arrowKey(dir)
|
||||
end
|
||||
end
|
||||
end
|
||||
function listBox:select(i)
|
||||
self.selected=i
|
||||
if self.selected<int(self.scrollPos/self.lineH)+2 then
|
||||
self:drag(nil,nil,nil,1e99)
|
||||
elseif self.selected>int(self.scrollPos/self.lineH)+self.capacity-1 then
|
||||
self:drag(nil,nil,nil,-1e99)
|
||||
end
|
||||
end
|
||||
function listBox:draw()
|
||||
local x,y,w,h=self.x,self.y,self.w,self.h
|
||||
local list=self.list
|
||||
@@ -1197,6 +1251,10 @@ function listBox:draw()
|
||||
gc_push('transform')
|
||||
gc_translate(x,y)
|
||||
|
||||
--Background
|
||||
gc_setColor(0,0,0,.4)
|
||||
gc_rectangle('fill',0,0,w,h,4)
|
||||
|
||||
--Frame
|
||||
gc_setColor(WIDGET.sel==self and COLOR.lN or COLOR.Z)
|
||||
gc_setLineWidth(2)
|
||||
@@ -1225,7 +1283,7 @@ end
|
||||
function listBox:getInfo()
|
||||
return("x=%d,y=%d,w=%d,h=%d"):format(self.x+self.w*.5,self.y+self.h*.5,self.w,self.h)
|
||||
end
|
||||
function WIDGET.newListBox(D)--name,x,y,w,h,lineH[,hideF][,hide][,drawF]
|
||||
function WIDGET.newListBox(D)--name,x,y,w,h,lineH,drawF[,hideF][,hide]
|
||||
local _={
|
||||
name= D.name or"_",
|
||||
|
||||
@@ -1282,16 +1340,7 @@ function WIDGET.setWidgetList(list)
|
||||
for i=1,#list do
|
||||
list[i]:reset()
|
||||
end
|
||||
if SCN.cur~='custom_field'then
|
||||
local colorList=THEME.getThemeColor()
|
||||
if not colorList then return end
|
||||
local rnd=math.random
|
||||
for _,W in next,list do
|
||||
if W.color and not W.fText then
|
||||
W.color=colorList[rnd(#colorList)]
|
||||
end
|
||||
end
|
||||
end
|
||||
onChange()
|
||||
end
|
||||
end
|
||||
function WIDGET.setScrollHeight(height)
|
||||
|
||||
73
main.lua
@@ -23,14 +23,14 @@ local fs=love.filesystem
|
||||
VERSION=require"version"
|
||||
TIME=love.timer.getTime
|
||||
YIELD=coroutine.yield
|
||||
SYSTEM=love.system.getOS()
|
||||
FNSF=SYSTEM:find'\79\83'--What does FNSF stand for? IDK so don't ask me lol
|
||||
SYSTEM=love.system.getOS()if SYSTEM=='OS X'then SYSTEM='macOS'end
|
||||
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()
|
||||
|
||||
--Global Vars & Settings
|
||||
SFXPACKS={'chiptune'}
|
||||
VOCPACKS={'miya','mono','xiaoya','miku'}
|
||||
VOCPACKS={'miya',--[['mono',]]'xiaoya','miku'}
|
||||
FIRSTLAUNCH=false
|
||||
DAILYLAUNCH=false
|
||||
|
||||
@@ -60,7 +60,20 @@ FONT.setFallback('norm')
|
||||
SCR.setSize(1280,720)--Initialize Screen size
|
||||
BGM.setMaxSources(5)
|
||||
BGM.setChange(function(name)MES.new('music',text.nowPlaying..name,5)end)
|
||||
VOC.setDiversion(1)
|
||||
VOC.setDiversion(.62)
|
||||
|
||||
WIDGET.setOnChange(function()
|
||||
if SCN.cur~='custom_field'then
|
||||
local colorList=THEME.getThemeColor()
|
||||
if not colorList then return end
|
||||
local rnd=math.random
|
||||
for _,W in next,SCN.scenes[SCN.cur].widgetList do
|
||||
if W.color then
|
||||
W.color=colorList[rnd(#colorList)]
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
table.insert(_LOADTIMELIST_,("Load Zframework: %.3fs"):format(TIME()-_LOADTIME_))
|
||||
|
||||
@@ -71,6 +84,9 @@ mStr=GC.mStr
|
||||
mText=GC.simpX
|
||||
mDraw=GC.draw
|
||||
Snd=SFX.playSample
|
||||
string.repD=STRING.repD
|
||||
string.sArg=STRING.sArg
|
||||
string.split=STRING.split
|
||||
|
||||
--Delete all naked files (from too old version)
|
||||
FILE.clear('')
|
||||
@@ -116,16 +132,13 @@ MODES= require'parts.modes'
|
||||
|
||||
setmetatable(TEXTURE,{__index=function(self,k)
|
||||
MES.new('warn',"No texture called: "..k)
|
||||
self[k]=love.graphics.newCanvas(1,1)
|
||||
self[k]=PAPER
|
||||
return self[k]
|
||||
end})
|
||||
|
||||
table.insert(_LOADTIMELIST_,("Load Parts: %.3fs"):format(TIME()-_LOADTIME_))
|
||||
|
||||
--Init Zframework
|
||||
Z.setIfPowerInfo(function()
|
||||
return SETTING.powerInfo and LOADED
|
||||
end)
|
||||
do--Z.setCursor
|
||||
local normImg=GC.DO{16,16,
|
||||
{'fCirc',8,8,4},
|
||||
@@ -171,6 +184,15 @@ Z.setOnFnKeys({
|
||||
function()for k,v in next,_G do print(k,v)end end,
|
||||
function()if love['_openConsole']then love['_openConsole']()end end,
|
||||
})
|
||||
Z.setDebugInfo{
|
||||
{"Cache",gcinfo},
|
||||
{"Tasks",TASK.getCount},
|
||||
{"Voices",VOC.getQueueCount},
|
||||
{"Audios",love.audio.getSourceCount},
|
||||
}
|
||||
Z.setOnResize(function(w,_)
|
||||
SHADER.warning:send('w',w*SCR.dpi)
|
||||
end)
|
||||
do--Z.setOnFocus
|
||||
local function task_autoSoundOff()
|
||||
while true do
|
||||
@@ -256,13 +278,15 @@ IMG.init{
|
||||
pay1='media/image/mess/pay1.png',
|
||||
pay2='media/image/mess/pay2.png',
|
||||
|
||||
miyaCH='media/image/characters/miya.png',
|
||||
miyaF1='media/image/characters/miya_f1.png',
|
||||
miyaF2='media/image/characters/miya_f2.png',
|
||||
miyaF3='media/image/characters/miya_f3.png',
|
||||
miyaF4='media/image/characters/miya_f4.png',
|
||||
miyaCH1='media/image/characters/miya1.png',
|
||||
miyaCH2='media/image/characters/miya2.png',
|
||||
miyaCH3='media/image/characters/miya3.png',
|
||||
miyaCH4='media/image/characters/miya4.png',
|
||||
miyaHeart='media/image/characters/miya_heart.png',
|
||||
miyaGlow='media/image/characters/miya_glow.png',
|
||||
monoCH='media/image/characters/mono.png',
|
||||
xiaoyaCH='media/image/characters/xiaoya.png',
|
||||
xiaoyaOmino='media/image/characters/xiaoya_Omino.png',
|
||||
mikuCH='media/image/characters/miku.png',
|
||||
electric='media/image/characters/electric.png',
|
||||
hbm='media/image/characters/hbm.png',
|
||||
@@ -279,7 +303,7 @@ IMG.init{
|
||||
SKIN.load{
|
||||
{name="crystal_scf",path='media/image/skin/crystal_scf.png'},
|
||||
{name="matte_mrz",path='media/image/skin/matte_mrz.png'},
|
||||
{name="shiny_cho",path='media/image/skin/shiny_cho.png'},
|
||||
{name="shiny_chno",path='media/image/skin/shiny_chno.png'},
|
||||
{name="contrast_mrz",path='media/image/skin/contrast_mrz.png'},
|
||||
{name="polkadots_scf",path='media/image/skin/polkadots_scf.png'},
|
||||
{name="toy_scf",path='media/image/skin/toy_scf.png'},
|
||||
@@ -302,6 +326,7 @@ SKIN.load{
|
||||
{name="classic",path='media/image/skin/classic_unknown.png'},
|
||||
{name="ball_shaw",path='media/image/skin/ball_shaw.png'},
|
||||
{name="retro_notypey",path='media/image/skin/retro_notypey.png'},
|
||||
{name="pixel_chno",path='media/image/skin/pixel_chno.png'},
|
||||
{name="textbone_mrz",path='media/image/skin/textbone_mrz.png'},
|
||||
{name="coloredbone_mrz",path='media/image/skin/coloredbone_mrz.png'},
|
||||
{name="wtf",path='media/image/skin/wtf_mrz.png'},
|
||||
@@ -317,11 +342,11 @@ SFX.init((function()--[Warning] Not loading files here, just get the list of sou
|
||||
end
|
||||
return L
|
||||
end)())
|
||||
BGM.init((function()
|
||||
BGM.load((function()
|
||||
local L={}
|
||||
for _,v in next,fs.getDirectoryItems('media/music')do
|
||||
if isSafeFile('media/music/'..v,"Dangerous file : %SAVE%/media/music/"..v)then
|
||||
table.insert(L,{name=v:sub(1,-5),path='media/music/'..v})
|
||||
L[v:sub(1,-5)]='media/music/'..v
|
||||
end
|
||||
end
|
||||
return L
|
||||
@@ -340,14 +365,15 @@ VOC.init{
|
||||
LANG.init('zh',
|
||||
{
|
||||
zh=require'parts.language.lang_zh',
|
||||
zh_full=require'parts.language.lang_zh_full',
|
||||
zh_trad=require'parts.language.lang_zh_trad',
|
||||
zh_full=require'parts.language.lang_zh_full',
|
||||
en=require'parts.language.lang_en',
|
||||
fr=require'parts.language.lang_fr',
|
||||
es=require'parts.language.lang_es',
|
||||
pt=require'parts.language.lang_pt',
|
||||
id=require'parts.language.lang_id',
|
||||
ja=require'parts.language.lang_ja',
|
||||
zh_grass=require'parts.language.lang_zh_grass',
|
||||
zh_yygq=require'parts.language.lang_yygq',
|
||||
symbol=require'parts.language.lang_symbol',
|
||||
--1. Add language file to LANG folder;
|
||||
--2. Require it;
|
||||
@@ -463,6 +489,9 @@ do
|
||||
SETTING.dascut=SETTING.dascut+1
|
||||
needSave=true
|
||||
end
|
||||
if SETTING.vocPack=='mono'then
|
||||
SETTING.vocPack='miya'
|
||||
end
|
||||
if RANKS.stack_e then
|
||||
RANKS.stack_e=nil
|
||||
RANKS.stack_h=nil
|
||||
@@ -519,6 +548,8 @@ do
|
||||
if not TABLE.find({8,10,13,17,22,29,37,47,62,80,100},SETTING.frameMul)then SETTING.frameMul=100 end
|
||||
if SETTING.cv then SETTING.vocPack,SETTING.cv=SETTING.cv end
|
||||
if type(SETTING.bg)~='string'then SETTING.bg='on'end
|
||||
if SETTING.skin[18]==10 then SETTING.skin[18]=4 end
|
||||
if SETTING.reTime>3 or SETTING.reTime<.5 then SETTING.reTime=2 end
|
||||
if RANKS.infinite then RANKS.infinite=0 end
|
||||
if RANKS.infinite_dig then RANKS.infinite_dig=0 end
|
||||
if not RANKS.sprint_10l then RANKS.sprint_10l=0 end
|
||||
@@ -567,7 +598,7 @@ if FIRSTLAUNCH and MOBILE then
|
||||
end
|
||||
|
||||
--Apply system setting
|
||||
applyAllSettings()
|
||||
applySettings()
|
||||
|
||||
--Load replays
|
||||
for _,fileName in next,fs.getDirectoryItems('replay')do
|
||||
@@ -645,9 +676,9 @@ if TABLE.find(arg,'--test')then
|
||||
TASK.new(function()
|
||||
while true do
|
||||
YIELD()
|
||||
if Z.errData[1]then break end
|
||||
if Z.getErr(1)then break end
|
||||
end
|
||||
LOG("\27[91m\27[1mAutomatic Test Failed :(\27[0m\nThe error message is:\n"..table.concat(Z.errData[1].mes,"\n").."\27[91m\nAborting\27[0m")
|
||||
LOG("\27[91m\27[1mAutomatic Test Failed :(\27[0m\nThe error message is:\n"..table.concat(Z.getErr(1).mes,"\n").."\27[91m\nAborting\27[0m")
|
||||
TEST.yieldN(60)
|
||||
love.event.quit(1)
|
||||
end)
|
||||
|
||||
BIN
media/effect/chiptune/back.ogg
Normal file
BIN
media/effect/chiptune/clear.ogg
Normal file
BIN
media/effect/chiptune/uncheck .ogg
Normal file
BIN
media/effect/chiptune/warn_1.ogg
Normal file
BIN
media/effect/chiptune/warn_2.ogg
Normal file
BIN
media/effect/chiptune/warn_beep.ogg
Normal file
|
Before Width: | Height: | Size: 74 KiB |
BIN
media/image/characters/miya1.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
media/image/characters/miya2.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
media/image/characters/miya3.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
media/image/characters/miya4.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
media/image/characters/miya_glow.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
media/image/characters/miya_heart.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
BIN
media/image/characters/xiaoya_Omino.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
media/image/skin/pixel_chno.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 41 KiB |
BIN
media/music/lounge.ogg
Normal file
@@ -376,8 +376,8 @@ do
|
||||
},--R
|
||||
false,--Y
|
||||
{
|
||||
[01]={'+0+0','-1+0','-1+1','+0+1','+1+0','-1+2','-2+0','+0-2'},
|
||||
[10]={'+0+0','+1+0','-1+0','+0-1','+1-1','+1-2','+2+0','+0+2'},
|
||||
[01]={'+0+0','-1+0','-1+1','+0+1','+1+0','+1+1','-1+2','-2+0','+0-2'},
|
||||
[10]={'+0+0','+1+0','-1+0','+0-1','-1-1','+1-1','+1-2','+2+0','+0+2'},
|
||||
[03]={'+0+0','-1+0','+1-1','+0-2','+0-3','+1+0','+1-2','+1-3','+0+1','-1+1'},
|
||||
[30]={'+0+0','-1+0','+1-1','+1-2','+1+0','+0-2','+1-3','-1+2','+0+3','-1+3'},
|
||||
[12]={'+0+0','-1+0','+1-1','-1-1','+1-2','+1+0','+0-2','+1-3','-1+2','+0+3','-1+3'},
|
||||
|
||||
@@ -22,12 +22,12 @@ function back.resize(w,h)
|
||||
S[i+4]=(rnd()-.5)*.01*s--Vy
|
||||
end
|
||||
end
|
||||
function back.update()
|
||||
function back.update(dt)
|
||||
local S=stars
|
||||
--Star moving
|
||||
for i=1,1260,5 do
|
||||
S[i+1]=(S[i+1]+S[i+3])%W
|
||||
S[i+2]=(S[i+2]+S[i+4])%H
|
||||
S[i+1]=(S[i+1]+S[i+3]*dt*60)%W
|
||||
S[i+2]=(S[i+2]+S[i+4]*dt*60)%H
|
||||
end
|
||||
end
|
||||
function back.draw()
|
||||
|
||||
@@ -25,8 +25,8 @@ function bot_cc:revive()
|
||||
self.P:loadAI(self.data)
|
||||
end
|
||||
function bot_cc:pushNewNext(id)
|
||||
self.ccBot:addNext(rem(self.nexts,1))
|
||||
ins(self.nexts,id)
|
||||
self.ccBot:addNext(rem(self.bufferedNexts,1))
|
||||
ins(self.bufferedNexts,id)
|
||||
end
|
||||
function bot_cc:thread()
|
||||
local P,keys=self.P,self.keys
|
||||
|
||||
@@ -12,7 +12,7 @@ local baseBot={
|
||||
function baseBot.update(bot)
|
||||
local P=bot.P
|
||||
local keys=bot.keys
|
||||
if P.control and P.waiting==0 then
|
||||
if P.control and P.cur then
|
||||
bot.delay=bot.delay-1
|
||||
if not keys[1]then
|
||||
if bot.runningThread then
|
||||
@@ -85,7 +85,7 @@ function BOT.new(P,data)
|
||||
if data.type=="CC"then
|
||||
P:setRS('SRS')
|
||||
bot.keys={}
|
||||
bot.nexts={}
|
||||
bot.bufferedNexts={}
|
||||
bot.delay=data.delay
|
||||
bot.delay0=data.delay
|
||||
if P.gameEnv.holdCount>1 then
|
||||
@@ -109,20 +109,25 @@ function BOT.new(P,data)
|
||||
return
|
||||
self.ccBot[k]and function(_,...)self.ccBot[k](self.ccBot,...)end or
|
||||
cc_lua[k]and function(_,...)cc_lua[k](self,...)end or
|
||||
baseBot[k]and baseBot[k]or
|
||||
error("No actions called "..k)
|
||||
assert(baseBot[k],"No CC action called "..k)
|
||||
end})
|
||||
|
||||
for i,B in next,P.nextQueue do
|
||||
if i<=data.next then
|
||||
local pushed=0
|
||||
if P.cur then
|
||||
bot:addNext(P.cur.id)
|
||||
pushed=pushed+1
|
||||
end
|
||||
for _,B in next,P.nextQueue do
|
||||
if pushed<=data.next then
|
||||
bot:addNext(B.id)
|
||||
pushed=pushed+1
|
||||
else
|
||||
ins(bot.nexts,B.id)
|
||||
ins(bot.bufferedNexts,B.id)
|
||||
end
|
||||
end
|
||||
bot.runningThread=coroutine.wrap(cc_lua.thread)
|
||||
bot.runningThread(bot)
|
||||
elseif data.type=="9S"or true then--9s or else
|
||||
else--if data.type=="9S"then--9s or else
|
||||
TABLE.cover(baseBot,bot)
|
||||
TABLE.cover(require"parts.bot.bot_9s",bot)
|
||||
P:setRS('TRS')
|
||||
|
||||
18
parts/eventsets/bigWallGen.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return{
|
||||
hook_drop=function(P)
|
||||
if P.lastPiece.row>0 then
|
||||
for _=1,#P.clearedRow do
|
||||
local h=#P.field
|
||||
P.field[h+1]=LINE.new(20)
|
||||
P.visTime[h+1]=LINE.new(20)
|
||||
for i=3,7 do P.field[h+1][i]=0 end
|
||||
end
|
||||
if P.combo>P.modeData.maxCombo then
|
||||
P.modeData.maxCombo=P.combo
|
||||
end
|
||||
if P.stat.row>=200 then
|
||||
P:win('finish')
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
39
parts/eventsets/big_h.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
return
|
||||
{
|
||||
drop=1,
|
||||
wait=8,
|
||||
fall=20,
|
||||
fieldH=10,
|
||||
mesDisp=function(P)
|
||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||
PLY.draw.drawTargetLine(P,200-P.stat.row)
|
||||
end,
|
||||
task=function(P)
|
||||
local F=P.field
|
||||
for i=1,24 do
|
||||
F[i]=LINE.new(20)
|
||||
P.visTime[i]=LINE.new(20)
|
||||
for x=3,7 do F[i][x]=0 end
|
||||
end
|
||||
P.modeData.target=50
|
||||
end,
|
||||
hook_drop=function(P)
|
||||
if P.stat.row>=P.modeData.target then
|
||||
if P.modeData.target==50 then
|
||||
P.gameEnv.drop=.5
|
||||
P.modeData.target=100
|
||||
SFX.play('reach')
|
||||
elseif P.modeData.target==100 then
|
||||
P.gameEnv.drop=.25
|
||||
P.modeData.target=150
|
||||
SFX.play('reach')
|
||||
elseif P.modeData.target==150 then
|
||||
P:set20G(true)
|
||||
P.modeData.target=200
|
||||
SFX.play('reach')
|
||||
else
|
||||
P:win('finish')
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
33
parts/eventsets/big_n.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
local dropSpeed={100,80,60,48,36,28,20,16,12,10,8,6,4,2,2,1,1,.5,.5}
|
||||
|
||||
return
|
||||
{
|
||||
drop=120,
|
||||
wait=8,
|
||||
fall=20,
|
||||
fieldH=10,
|
||||
mesDisp=function(P)
|
||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||
PLY.draw.drawTargetLine(P,200-P.stat.row)
|
||||
end,
|
||||
task=function(P)
|
||||
local F=P.field
|
||||
for i=1,24 do
|
||||
F[i]=LINE.new(20)
|
||||
P.visTime[i]=LINE.new(20)
|
||||
for x=3,7 do F[i][x]=0 end
|
||||
end
|
||||
P.modeData.target=10
|
||||
end,
|
||||
hook_drop=function(P)
|
||||
if P.stat.row>=P.modeData.target then
|
||||
if P.modeData.target==200 then
|
||||
P:win('finish')
|
||||
else
|
||||
P.gameEnv.drop=dropSpeed[P.modeData.target/10]
|
||||
P.modeData.target=P.modeData.target+10
|
||||
SFX.play('reach')
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
@@ -10,7 +10,7 @@ return{
|
||||
end
|
||||
setField(P,D.finished+1)
|
||||
SYSFX.newShade(1.4,P.absFieldX,P.absFieldY,300*P.size,610*P.size,.6,.8,.6)
|
||||
SFX.play('blip_1')
|
||||
SFX.play('warn_1')
|
||||
else
|
||||
P:win('finish')
|
||||
end
|
||||
|
||||
@@ -41,15 +41,15 @@ return{
|
||||
if D.target==110 then
|
||||
P.gameEnv.drop,P.gameEnv.lock=5,5
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=5,5
|
||||
SFX.play('blip_2',.7)
|
||||
SFX.play('warn_2',.7)
|
||||
elseif D.target==140 then
|
||||
P.gameEnv.drop,P.gameEnv.lock=4,4
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=4,4
|
||||
SFX.play('blip_2',.7)
|
||||
SFX.play('warn_2',.7)
|
||||
elseif D.target==170 then
|
||||
P.gameEnv.drop,P.gameEnv.lock=3,3
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=3,3
|
||||
SFX.play('blip_2',.7)
|
||||
SFX.play('warn_2',.7)
|
||||
elseif D.target==200 then
|
||||
P:win('finish')
|
||||
return
|
||||
|
||||
@@ -36,11 +36,12 @@ return{
|
||||
end,
|
||||
hook_drop=function(P)
|
||||
local D=P.modeData
|
||||
D.drought=P.lastPiece.id==7 and 0 or D.drought+1
|
||||
if P.stat.row>=D.target then
|
||||
if D.target==110 then
|
||||
P.gameEnv.drop,P.gameEnv.lock=2,2
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=2,2
|
||||
SFX.play('blip_1')
|
||||
SFX.play('warn_1')
|
||||
elseif D.target==200 then
|
||||
P:win('finish')
|
||||
return
|
||||
|
||||
@@ -36,6 +36,7 @@ return{
|
||||
end,
|
||||
hook_drop=function(P)
|
||||
local D=P.modeData
|
||||
D.drought=P.lastPiece.id==7 and 0 or D.drought+1
|
||||
if P.stat.row>=D.target then
|
||||
if D.target==100 then
|
||||
P:win('finish')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local dropSpeed={50,40,30,24,18,14,10,8,6,5,4,3,2,1,1,.5,.5,.25,.25}
|
||||
local dropSpeed={50,40,30,24,18,13,9,6,4,3,2,2,1,1,.5,.5,.5,.25,.25}
|
||||
|
||||
return
|
||||
{
|
||||
|
||||