Compare commits

...

4 Commits

Author SHA1 Message Date
C29H25N3O5
f9ee43b1f0 Symbol update and more
- Added a few more icon symbols
- Added symbols for playing cards
- Added a note for translators in the English Zictionary
2024-01-21 00:04:35 -06:00
C29H25N3O5
bb2ede229c Merge branch 'main' of https://github.com/C29H25N3O5/Techmino 2024-01-20 22:45:26 -06:00
C6H12O6 + NaCl + H2O
2d12ab3a19 Log viewer (#1076)
* Add scene

* Modify app_console.lua

* Add fix ability to viewlog in case log got messed a bit
2024-01-16 15:19:19 +08:00
C₂₉H₂₅N₃O₅
efeb24b0f0 Updated monospaced font (#1084)
Redesigned the monospaced font based on the main UI font of the game (Exo 2).
2024-01-16 15:09:45 +08:00
6 changed files with 264 additions and 11 deletions

View File

@@ -803,7 +803,7 @@ function selector:press(x)
end
end
if self.select~=s then
self.code(self.list[s])
self.code(self.list[s],s)
self.select=s
self.selText=self.list[s]
if self.sound then

View File

@@ -1,5 +1,5 @@
local L={
zChan={-- F0000~F003F
zChan={-- F0000 - F003F
none= 0xF0000,
normal= 0xF0001,
full= 0xF0002,
@@ -15,7 +15,7 @@ local L={
angry= 0xF000C,
shocked= 0xF000D,
ellipses= 0xF000E,
sweat_drop= 0xF000F,
sweatDrop= 0xF000F,
cry= 0xF0010,
cracked= 0xF0011,
qualified= 0xF0012,
@@ -24,7 +24,7 @@ local L={
thinking= 0xF0015,
spark= 0xF0016,
},
mino={-- F0040~F007F
mino={-- F0040 - F007F
Z=0xF0040,
S=0xF0041,
J=0xF0042,
@@ -57,7 +57,7 @@ local L={
I2=0xF005B,
O1=0xF005C,
},
icon={-- F0080~F00FF
icon={-- F0080 - F00FF
menu= 0xF0080,
music= 0xF0081,
language= 0xF0082,
@@ -154,8 +154,12 @@ local L={
rewind30= 0xF00DD,
foward10= 0xF00DE,
foward30= 0xF00DF,
fontUp= 0xF00E0,
fontDown= 0xF00E1,
erase= 0xF00E2,
auto= 0xF00E3,
},
key={-- F0100~F017F
key={-- F0100 - F017F
macCmd= 0xF0100,
macOpt= 0xF0101,
macCtrl= 0xF0102,
@@ -196,7 +200,7 @@ local L={
macPgdnAlt= 0xF0125,
iecPower= 0xF0126,
},
controller={-- F0180~F01FF
controller={-- F0180 - F01FF
xbox= 0xF0180,
lt= 0xF0181,
rt= 0xF0182,
@@ -236,7 +240,7 @@ local L={
psCreate= 0xF01A4,
psOption= 0xF01A5,
},
mahjong={-- F0200~F027F
mahjong={-- F0200 - F027F
m1= 0xF0200,
m2= 0xF0201,
m3= 0xF0202,
@@ -323,6 +327,67 @@ local L={
s1j= 0xF0253,
s1jBase= 0xF0254,
s1jComb= 0xF0255,
},
cards={-- F0300 - F070F
cardBack= 0xF0300,
clubA= 0xF0301,
club2= 0xF0302,
club3= 0xF0303,
club4= 0xF0304,
club5= 0xF0305,
club6= 0xF0306,
club7= 0xF0307,
club8= 0xF0308,
club9= 0xF0309,
club10= 0xF030A,
clubJ= 0xF030B,
clubC= 0xF030C,
clubQ= 0xF030D,
clubK= 0xF030E,
heartA= 0xF0401,
heart2= 0xF0402,
heart3= 0xF0403,
heart4= 0xF0404,
heart5= 0xF0405,
heart6= 0xF0406,
heart7= 0xF0407,
heart8= 0xF0408,
heart9= 0xF0409,
heart10= 0xF040A,
heartJ= 0xF040B,
heartC= 0xF040C,
heartQ= 0xF040D,
heartK= 0xF040E,
diamondA= 0xF0501,
diamond2= 0xF0502,
diamond3= 0xF0503,
diamond4= 0xF0504,
diamond5= 0xF0505,
diamond6= 0xF0506,
diamond7= 0xF0507,
diamond8= 0xF0508,
diamond9= 0xF0509,
diamond10= 0xF050A,
diamondJ= 0xF050B,
diamondC= 0xF050C,
diamondQ= 0xF050D,
diamondK= 0xF050E,
jokerBlack= 0xF050F,
clubA= 0xF0601,
club2= 0xF0602,
club3= 0xF0603,
club4= 0xF0604,
club5= 0xF0605,
club6= 0xF0606,
club7= 0xF0607,
club8= 0xF0608,
club9= 0xF0609,
club10= 0xF060A,
clubJ= 0xF060B,
clubC= 0xF060C,
clubQ= 0xF060D,
clubK= 0xF060E,
jokerWhite= 0xF060F,
}
}

Binary file not shown.

View File

@@ -1,5 +1,6 @@
-- Automatically generated by a Python script, from a markdown source file.
-- The script can be found here: https://github.com/user670/techmino-dictionary-converter/blob/master/tool.py
-- **NOTE TO TRANSLATORS**: In English (and in this file) the symbol ~ (tilde) is commonly used to express "approximately". Some languages use this symbol to express ranges or "from/up to a value", but it is not commonly used in English.
return {
{"Translator Note 1",
"",

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