Skip to content

Commit

Permalink
给大多数场景加上鼠标右键返回
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Jul 12, 2024
1 parent f2290ca commit c072d09
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 18 deletions.
30 changes: 17 additions & 13 deletions assets/scene/about_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,25 @@ function scene.load()
timer,score=12.6,0
end

function scene.mouseDown(x,y)
x,y=SCR.xOy:transformPoint(x,y)
x,y=SCR.xOy_d:inverseTransformPoint(x,y)
for i=1,#obj do
local o=obj[i]
if math.abs(x-o.x)<=o.r and math.abs(y+o.y)<=o.r then
if not o.name then
setName(o)
function scene.mouseDown(x,y,k)
if k==1 then
x,y=SCR.xOy:transformPoint(x,y)
x,y=SCR.xOy_d:inverseTransformPoint(x,y)
for i=1,#obj do
local o=obj[i]
if math.abs(x-o.x)<=o.r and math.abs(y+o.y)<=o.r then
if not o.name then
setName(o)
end
o.vx=(o.vx+(o.x-x)*6.26)*.626
o.vy=math.min((o.vy+math.random(620,1260))*.8,600)
o.va=o.va+(o.x-x)/26*(.8+.4*math.random())
score=score+o.score+(60-o.r/1.62)+math.random(2,6)
break
end
o.vx=(o.vx+(o.x-x)*6.26)*.626
o.vy=math.min((o.vy+math.random(620,1260))*.8,600)
o.va=o.va+(o.x-x)/26*(.8+.4*math.random())
score=score+o.score+(60-o.r/1.62)+math.random(2,6)
break
end
elseif k==2 then
SCN.back('fadeHeader')
end
end

Expand Down
1 change: 1 addition & 0 deletions assets/scene/keyset_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function scene.unload()
saveKey()
end

function scene.mouseDown(_,_,k) if k==2 then SCN.back('none') end end
function scene.keyDown(key,isRep)
if isRep then return true end
if KEYMAP.sys:getAction(key)=='back' then
Expand Down
1 change: 1 addition & 0 deletions assets/scene/keyset_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function scene.unload()
saveKey()
end

function scene.mouseDown(_,_,k) if k==2 then SCN.back('fadeHeader') end end
function scene.keyDown(key,isRep)
if isRep then return true end
if key=='`' and isAltPressed then
Expand Down
1 change: 1 addition & 0 deletions assets/scene/keyset_press.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function scene.load()
if SETTINGS.system.touchControl then resetVirtualKeyMode(mode) end
end

function scene.mouseDown(_,_,k) if k==2 then escTimerWTF=.26 end end
function scene.keyDown(key,isRep)
if isRep then return true end
if result then return true end
Expand Down
2 changes: 1 addition & 1 deletion assets/scene/keyset_touch_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ end
function scene.touchMove(_,_,dx,dy,id) VCTRL.drag(dx,dy,id) end
function scene.touchUp(_,_,id) VCTRL.release(id) end

function scene.mouseDown(x,y,k) if k==1 then scene.touchDown(x,y,1) end end
function scene.mouseDown(x,y,k) if k==1 then scene.touchDown(x,y,1) elseif k==2 then SCN.back(SCN.cur=='keyset_touch_in' and 'none' or nil) end end
function scene.mouseMove(x,y,dx,dy) scene.touchMove(x,y,dx,dy,1) end
function scene.mouseUp(x,y,k) if k==1 then scene.touchUp(x,y,1) end end

Expand Down
1 change: 1 addition & 0 deletions assets/scene/lang_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function scene.unload()
end
end

function scene.mouseDown(_,_,k) if k==2 then SCN.back('none') end end
function scene.keyDown(key)
if KEYMAP.sys:getAction(key)=='back' then
SCN.back('none')
Expand Down
1 change: 1 addition & 0 deletions assets/scene/lang_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function scene.unload()
end
end

function scene.mouseDown(_,_,k) if k==2 then SCN.back('fadeHeader') end end
function scene.keyDown(key)
if KEYMAP.sys:getAction(key)=='back' then
SCN.back()
Expand Down
1 change: 1 addition & 0 deletions assets/scene/main_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local function sysAction(action)
end
end
end
function scene.mouseDown(_,_,k) if k==2 then sysAction('back') end end
function scene.keyDown(key,isRep)
if isRep then return true end
sysAction(KEYMAP.sys:getAction(key))
Expand Down
5 changes: 2 additions & 3 deletions assets/scene/main_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ local scene={}
local textOffset=6
local versionText=GC.newText(FONT.get(35,'bold'))
local terminalName=GC.newText(FONT.get(35))
versionText:set(VERSION.appVer)
terminalName:set(("TERM[%s]"):format(SYSTEM:sub(1,3):upper()))

function scene.load()
if MATH.roll(.026) then textOffset=26 end
PROGRESS.applyEnv('exterior')
versionText:set(VERSION.appVer)
terminalName:set(("TERM[%s]"):format(SYSTEM:sub(1,3):upper()))
end

local function sysAction(action)
Expand Down
1 change: 1 addition & 0 deletions assets/scene/mode_exterior.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ local function sysAction(action)
SCN.back('fadeHeader')
end
end
function scene.mouseDown(_,_,k) if k==2 then sysAction('back') end end
function scene.keyDown(key,isRep)
if isRep then return true end
if key=='f6' then exMap:_printModePos() return true end
Expand Down
2 changes: 1 addition & 1 deletion assets/scene/musicroom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function scene.keyDown(key,isRep)
return true
end
function scene.mouseMove() scene.focus(true) end
function scene.mouseDown() scene.focus(true) end
function scene.mouseDown(_,_,k) scene.focus(true) if k==2 then SCN.back('fadeHeader') end end
function scene.wheelMove() scene.focus(true) end
function scene.touchDown() scene.focus(true) end
function scene.focus(f) -- Reduce carbon footprint for music lovers
Expand Down
1 change: 1 addition & 0 deletions assets/scene/result_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function scene.load()
time=0
end

function scene.mouseDown(_,_,k) if k==2 then SCN.back('none') end end
function scene.keyDown(key)
local action=KEYMAP.sys:getAction(key)
if action=='restart' then
Expand Down
1 change: 1 addition & 0 deletions assets/scene/result_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function scene.load()
time=0
end

function scene.mouseDown(_,_,k) if k==2 then SCN.back() end end
function scene.keyDown(key)
local action=KEYMAP.sys:getAction(key)
if action=='restart' then
Expand Down
1 change: 1 addition & 0 deletions assets/scene/setting_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function scene.unload()
saveSettings()
end

function scene.mouseDown(_,_,k) if k==2 then SCN.back('none') end end
function scene.keyDown(key)
if KEYMAP.sys:getAction(key)=='back' then
SCN.back('none')
Expand Down
2 changes: 2 additions & 0 deletions assets/scene/setting_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function scene.unload()
saveSettings()
end

function scene.mouseDown(_,_,k) if k==2 then SCN.back('fadeHeader') end end

function scene.keyDown(key,isRep)
if isRep then return true end
local act=KEYMAP.sys:getAction(key)
Expand Down
2 changes: 2 additions & 0 deletions assets/scene/simulation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ function scene.mouseDown(x,y,k)
subjectFocused=s
end
end
elseif k==2 then
SCN.back('fadeHeader')
end
end

Expand Down
1 change: 1 addition & 0 deletions assets/scene/tutorial_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function scene.load()
PROGRESS.applyInteriorBGM()
end

function scene.mouseDown(_,_,k) if k==2 then SCN.back('none') end end
function scene.keyDown(key)
if KEYMAP.sys:getAction(key)=='back' then
SCN.back('none')
Expand Down

0 comments on commit c072d09

Please sign in to comment.