Merge branch 'main' of https://github.com/26F-Studio/Techmino into mod-patch

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-01-21 10:33:03 +07:00
7 changed files with 197 additions and 9 deletions

View File

@@ -690,7 +690,7 @@ do
local sfx
if ifpre then
sfx='prerotate'
elseif P:ifoverlap(icb,x,y+1) and P:ifoverlap(icb,x-1,y) and P:ifoverlap(icb,x+1,y) then
elseif y==P.ghoY and P:ifoverlap(icb,x,y+1) and P:ifoverlap(icb,x-1,y) and P:ifoverlap(icb,x+1,y) then
sfx='rotatekick'
P:_rotateField(d)
else

Binary file not shown.

View File

@@ -596,10 +596,10 @@ C. ゲームパッド
bg_on="通常背景",
bg_off="背景なし ",
bg_custom="カスタム背景",
-- defaultBG="Default B.G.",
-- resetDbg="Reset to default",
-- lockBG="Lock B.G.",
-- noTheme="Disable theme",
defaultBG="デフォルト背景",
resetDbg="背景リセット",
lockBG="背景固定",
noTheme="テーマ無効化",
blockSatur="ブロックデザイン",
fieldSatur="設置ブロックデザイン",

View File

@@ -150,4 +150,5 @@ return {
{font=25,name="V我50吃肉讨饭人"},
{font=25,name="电蜥蜴"},
{font=25,name="浮芙fufu"},
{font=25,name="NOname_awa"},
}

View File

@@ -1232,7 +1232,7 @@ function Player:spin(d,ifpre)
local sfx
if ifpre then
sfx='prerotate'
elseif self:ifoverlap(icb,ix,iy+1) and self:ifoverlap(icb,ix-1,iy) and self:ifoverlap(icb,ix+1,iy) then
elseif iy==self.ghoY and self:ifoverlap(icb,ix,iy+1) and self:ifoverlap(icb,ix-1,iy) and self:ifoverlap(icb,ix+1,iy) then
sfx='rotatekick'
self:_rotateField(d)
else

View File

@@ -377,6 +377,15 @@ local commands={} do
"Usage: openurl [url]",
},
}
commands.viewlog={
code=goScene('viewlog'),
description="View crash logs",
details={
"Open the crash logs menu",
"",
"Usage: viewlog"
}
}
commands.scrinfo={
code=function()
for _,v in next,SCR.info() do
@@ -478,7 +487,9 @@ local commands={} do
commands.setbg={
code=function(name)
if name~="" then
if name~=BG.cur then
if SETTING.lockBG then
log{"Background is currently ",C.R,"locked",C.Z,"! You can unlock it in Video settings."}
elseif name~=BG.cur then
if BG.set(name) then
log(("Background set to '%s'"):format(name))
else
@@ -502,7 +513,7 @@ local commands={} do
code=function(name)
if name~="" then
if SETTING.noTheme then
log{"Theme is ",C.R,"disabled",C.Z,"! Please re-enable it before trying this command again"}
log{"Themes are currently ",C.R,"disabled",C.Z,"! You can re-enable it in Video settings."}
else
if THEME.set(name) then
log("Theme set to: "..name)
@@ -1153,4 +1164,4 @@ scene.widgetList={
inputBox,
}
return scene
return scene

176
parts/scenes/viewlog.lua Normal file
View File

@@ -0,0 +1,176 @@
local fullLog,currentLogID
local logTimeList={}
local currentLogText={}
local gc=love.graphics
local min,max=math.min,math.max
local scene={}
local textBox=WIDGET.newTextBox {x= 30,y= 45,w=1000,h=540,font=25,fix=true}
local logList=WIDGET.newSelector{x=305,y=640,w= 550,name='list',color='O',fText='Crash log',list={''},disp=function() return '' end,code=function() end}
local function updateText()
currentLogText=fullLog[currentLogID]:split('\n')
do
local _,wt=getFont(25):getWrap(fullLog[currentLogID],975)
textBox:setTexts(wt)
end
logList.select=currentLogID
logList.selText=currentLogText[1]
end
local function noLogFound()
local _w=scene.widgetList
_w.home.hide=true;_w.list.hide=true
_w.endd.hide=true;_w.del .hide=true
_w.copy.hide=true;_w.delA.hide=true
logList.list={''}
logList.select=false
logList.disp=function() return '' end
logList.code=function() end
logList:reset()
end
function scene.enter()
fullLog=FILE.load('/conf/error.log','-string -canskip') or '/conf/error.log not found'
if fullLog=='/conf/error.log not found' then noLogFound()
else
-- Fix data first
fullLog=table.concat(fullLog:split('\n\nTraceback'),'\nTraceback'):split('\n\n')
-- Get timestamps and add into logTimeList for the selector
TABLE.reverse(fullLog)
for i,d in pairs(fullLog) do logTimeList[i]=d:split('\n')[1] end
currentLogID=1
updateText()
local _w=scene.widgetList
_w.home.hide=false;_w.list.hide=false
_w.endd.hide=false;_w.del .hide=false
_w.copy.hide=false;_w.delA.hide=false
logList.list=logTimeList
logList.select=false
logList.disp=function() return currentLogText[1] end
logList.code=function(_,s)
if s>currentLogID
then scene.keyDown('right')
else scene.keyDown('left') end
updateText()
end
logList:reset()
end
end
local deleteOld,deleteAll
do
local sureTime=-1e99
function deleteOld()
local function task_redButton()
scene.widgetList.del.color=COLOR.Y
for _=1,120 do coroutine.yield() end
scene.widgetList.del.color=COLOR.dY
end
if TIME()-sureTime<1 then
sureTime=-1e99
scene.widgetList.del.color=COLOR.dY
do
local temp=TABLE.sub(TABLE.copy(fullLog),1,25)
fullLog=TABLE.copy(temp)
temp=table.concat(temp,'\n\n')..'\n\n'
logTimeList=TABLE.sub(logTimeList,1,25)
currentLogID=min(logList.select,25)
logList.select=currentLogID
logList.list=logTimeList
updateText()
TASK.removeTask_code(task_redButton)
FILE.save(temp,'/conf/error.log','-string')
end
else
sureTime=TIME()
MES.new('warn',text.sureDelete)
TASK.removeTask_code(task_redButton)
TASK.new(task_redButton)
end
end
end
do
local sureTime=-1e99
function deleteAll()
local function task_redButton()
scene.widgetList.delA.color=COLOR.R
for _=1,120 do coroutine.yield() end
scene.widgetList.delA.color=COLOR.dR
end
if TIME()-sureTime<1 then
sureTime=-1e99
scene.widgetList.delA.color=COLOR.dR
love.filesystem.remove('/conf/error.log')
noLogFound()
TASK.removeTask_code(task_redButton)
SCN.swapTo('viewLog','none')
else
sureTime=TIME()
MES.new('warn',text.sureDelete)
TASK.removeTask_code(task_redButton)
TASK.new(task_redButton)
end
end
end
function scene.wheelMoved(_,y)
WHEELMOV(y)
end
function scene.keyDown(key)
if key=='left' then
currentLogID=math.max(1,currentLogID-1)
updateText()
elseif key=='right' then
currentLogID=math.min(currentLogID+1,#fullLog)
updateText()
elseif key=='home' then
currentLogID=1
updateText()
elseif key=='end' then
currentLogID=#fullLog
updateText()
elseif key=='up' then
textBox:scroll(-5)
elseif key=='down' then
textBox:scroll(5)
elseif key=='pageup' then
textBox:scroll(-20)
elseif key=='pagedown' then
textBox:scroll(20)
elseif key=='escape' then
SCN.back()
end
end
function scene.draw()
setFont(40)
gc.print(currentLogID..' / '..#fullLog,1000,800)
end
scene.widgetList={
textBox,
WIDGET.newButton {name='home',x=1140,y= 90,w=170,h=80,sound='click',font=60,fText=CHAR.key.macHome,code=pressKey('home')},
WIDGET.newButton {name='endd',x=1140,y=190,w=170,h=80,sound='click',font=60,fText=CHAR.key.macEnd ,code=pressKey('end')},
WIDGET.newButton {name='copy',x=1140,y=290,w=170,h=80,sound='click',font=60,fText=CHAR.icon.copy ,code=function()love.system.setClipboardText(table.concat(textBox.texts,'\n'))end,color='lC'},
logList,
WIDGET.newKey {name='del' ,x= 710,y=640,w=200,h=80,sound=false, font=30,fText='Clear old' ,color='dY',code=deleteOld},
WIDGET.newKey {name='delA',x= 930,y=640,w=200,h=80,sound=false, font=30,fText='DELETE ALL!',color='dR',code=deleteAll},
WIDGET.newButton {name='back',x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}
return scene