Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not really rewrite mod system #1072

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
478eb07
Test
SweetSea-ButImNotSweet Jan 1, 2024
b3ca43f
Final push
SweetSea-ButImNotSweet Jan 2, 2024
7723288
small update
SweetSea-ButImNotSweet Jan 3, 2024
8252f85
Fix some bugs
SweetSea-ButImNotSweet Jan 4, 2024
e6f416e
Shorten code, remove ``unranked``
SweetSea-ButImNotSweet Jan 4, 2024
47fc75b
Modify some mods' behavior
SweetSea-ButImNotSweet Jan 4, 2024
b8ec5df
Fix redundant "end"
SweetSea-ButImNotSweet Jan 4, 2024
1117b53
Fix bug (again)
SweetSea-ButImNotSweet Jan 4, 2024
c47ddf2
Merge remote-tracking branch 'upstream/main' into mod-patch
SweetSea-ButImNotSweet Jan 5, 2024
72d5e46
Change "modSystem" to "modApplyAt"
SweetSea-ButImNotSweet Jan 6, 2024
4c3abc4
Add TABLE.newWithLockMetamethod()
SweetSea-ButImNotSweet Jan 6, 2024
f0a45b8
Change most mods' configuration
SweetSea-ButImNotSweet Jan 6, 2024
2cd330f
Modify how executing mods again
SweetSea-ButImNotSweet Jan 6, 2024
6873317
Fix mods, update UI
SweetSea-ButImNotSweet Jan 6, 2024
3825b7c
Add VI translation
SweetSea-ButImNotSweet Jan 6, 2024
869135a
Add English translation
SweetSea-ButImNotSweet Jan 6, 2024
766b32b
Final update
SweetSea-ButImNotSweet Jan 6, 2024
70558e8
Add viewLog
SweetSea-ButImNotSweet Jan 6, 2024
6594b4a
Fix viewLog
SweetSea-ButImNotSweet Jan 6, 2024
d09f5b0
update viewlog
SweetSea-ButImNotSweet Jan 7, 2024
898539c
update viewLog
SweetSea-ButImNotSweet Jan 7, 2024
65c050f
Small update for viewLog
SweetSea-ButImNotSweet Jan 7, 2024
2816a76
Fix bugs and small changes to other thing
SweetSea-ButImNotSweet Jan 7, 2024
d61372c
Small tweak
SweetSea-ButImNotSweet Jan 7, 2024
3cda61b
Add a short delay before displaying username
SweetSea-ButImNotSweet Jan 7, 2024
dc8488f
Clean-up
SweetSea-ButImNotSweet Jan 7, 2024
5361742
Resolves change requests
SweetSea-ButImNotSweet Jan 8, 2024
888f2f6
Resolve change requests part 2
SweetSea-ButImNotSweet Jan 8, 2024
f2686fb
Resolve change requests part 3
SweetSea-ButImNotSweet Jan 8, 2024
c20e4ac
Add short delay before showing nickname (again)
SweetSea-ButImNotSweet Jan 8, 2024
9c47e95
Revert the default username from SweetSea to <nil>
SweetSea-ButImNotSweet Jan 8, 2024
4928f19
Remove an unused arg
SweetSea-ButImNotSweet Jan 8, 2024
97b1abb
Resolve change request part Tetra
SweetSea-ButImNotSweet Jan 9, 2024
d399f3c
Moving part 1
SweetSea-ButImNotSweet Jan 11, 2024
519687a
Moving part 2
SweetSea-ButImNotSweet Jan 11, 2024
c143e8e
Moving part 3
SweetSea-ButImNotSweet Jan 11, 2024
58648f7
Remove some texts (most deprecated)
SweetSea-ButImNotSweet Jan 11, 2024
378d88c
Small edit to manual_vi
SweetSea-ButImNotSweet Jan 11, 2024
44ff5e8
Merge branch 'main' of https://github.com/26F-Studio/Techmino into mo…
SweetSea-ButImNotSweet Jan 21, 2024
387bbfa
Moving changes to #1085
SweetSea-ButImNotSweet Jan 21, 2024
271769c
Merge branch 'main' into mod-patch
SweetSea-ButImNotSweet Jun 6, 2024
c6903c8
Merge branch 'main' of https://github.com/26F-Studio/Techmino into mo…
SweetSea-ButImNotSweet Nov 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update viewLog
  • Loading branch information
SweetSea-ButImNotSweet committed Jan 7, 2024
commit 898539cab901bda7a4275df2136189dc0a162a36
93 changes: 62 additions & 31 deletions parts/scenes/viewLog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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}
Expand All @@ -14,6 +15,20 @@ local function updateText()
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

Expand All @@ -25,34 +40,53 @@ function scene.enter()
updateText()

if fullLog[1]=='/conf/error.log not found' then
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

textBox.font=25
textBox:reset()

logList.list={''}
logList.select=false
logList.disp=function() return '' end
logList.code=function() end
logList:reset()
noLogFound()
else
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

textBox.font=15
textBox:reset()

for i,d in pairs(fullLog) do logTimeList[i]=d:split('\n')[1] end

function logList:press(x)
if x then
local s=self.select
if x<self.x+self.w*.5 then
if s>1 then
s=s-1
SYSFX.newShade(3,self.x,self.y-WIDGET.scrollPos,self.w*.5,60)
end
else
if s<#self.list then
s=s+1
SYSFX.newShade(3,self.x+self.w*.5,self.y-WIDGET.scrollPos,self.w*.5,60)
end
end
if self.select~=s then
self.code(s)
self.select=s
self.selText=self.list[s]
if self.sound then
SFX.play('selector')
end
end
end
end

logList.list=logTimeList
logList.select=false
logList.disp=function() return currentLogText[1] end
logList.code=function() currentLogID=logList.select updateText() end
logList.code=function(s)
if s>currentLogID then
scene.keyDown('right')
MES.new('','right')
else
scene.keyDown('left')
MES.new('','left')
end
updateText()
end
logList:reset()
end
end
Expand All @@ -61,24 +95,25 @@ do
local sureTime=-1e99
function deleteOld()
local function task_redButton()
scene.widgetList.del.color=COLOR.R
scene.widgetList.del.color=COLOR.Y
for _=1,120 do coroutine.yield() end
scene.widgetList.del.color=COLOR.Z
scene.widgetList.del.color=COLOR.dY
end

if TIME()-sureTime<1 then
sureTime=-1e99
scene.widgetList.del.color=COLOR.Z
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'
TASK.removeTask_code(task_redButton)

logTimeList=TABLE.sub(logTimeList,1,25)
currentLogID=min(logList.select,25)
logList.list=logTimeList
logList.select=25
scene.keyDown('end')
logList.select=currentLogID
updateText()

FILE.save(temp,'/conf/error.log','-string')
end
Expand All @@ -96,20 +131,16 @@ do
local function task_redButton()
scene.widgetList.delA.color=COLOR.R
for _=1,120 do coroutine.yield() end
scene.widgetList.delA.color=COLOR.Z
scene.widgetList.delA.color=COLOR.dR
end

if TIME()-sureTime<1 then
sureTime=-1e99
scene.widgetList.delA.color=COLOR.Z
scene.widgetList.delA.color=COLOR.dR
love.filesystem.remove('/conf/error.log')
TASK.removeTask_code(task_redButton)

logList.list={''}
logList.select=false
logList.disp=function() return '' end
logList.code=function() end
logList:reset()
noLogFound()
SCN.swapTo('viewLog','none')
else
sureTime=TIME()
Expand Down Expand Up @@ -163,8 +194,8 @@ scene.widgetList={

logList,

WIDGET.newKey {name='del' ,x= 710,y=640,w=200,h=80,sound=false, font=30,fText='Clear old' ,color='Z',code=deleteOld},
WIDGET.newKey {name='delA',x= 930,y=640,w=200,h=80,sound=false, font=30,fText='DELETE ALL!',color='Z',code=deleteAll},
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},
}
Expand Down
Loading