电脑不再默认全屏,增加f11开关全屏功能,整理代码

This commit is contained in:
MrZ626
2021-01-24 13:45:13 +08:00
parent 515c6f93a8
commit aad36f44c1
5 changed files with 14 additions and 8 deletions

View File

@@ -217,6 +217,8 @@ function love.keypressed(i)
if i=="f8"then if i=="f8"then
devMode=1 devMode=1
LOG.print("DEBUG ON",COLOR.yellow) LOG.print("DEBUG ON",COLOR.yellow)
elseif i=="f11"then
switchFullscreen()
else else
if SCN.swapping then return end if SCN.swapping then return end

View File

@@ -103,7 +103,7 @@ do--setFont
end end
do--upperChar do--upperChar
local upper=string.upper local upper=string.upper
upperList={ local upperList={
["1"]="!",["2"]="@",["3"]="#",["4"]="$",["5"]="%", ["1"]="!",["2"]="@",["3"]="#",["4"]="$",["5"]="%",
["6"]="^",["7"]="&",["8"]="*",["9"]="(",["0"]=")", ["6"]="^",["7"]="&",["8"]="*",["9"]="(",["0"]=")",
["`"]="~",["-"]="_",["="]="+", ["`"]="~",["-"]="_",["="]="+",

View File

@@ -9,6 +9,15 @@ local ins,rem=table.insert,table.remove
--System
function switchFullscreen()
SETTING.fullscreen=not SETTING.fullscreen
love.window.setFullscreen(SETTING.fullscreen)
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end
--Encoding Functions --Encoding Functions
--Sep symbol: 33 (!) --Sep symbol: 33 (!)
--Safe char: 34~126 --Safe char: 34~126

View File

@@ -290,7 +290,7 @@ SETTING={--Settings
warn=true, warn=true,
highCam=false, highCam=false,
nextPos=false, nextPos=false,
fullscreen=true, fullscreen=false,
bg=true, bg=true,
powerInfo=false, powerInfo=false,

View File

@@ -41,12 +41,7 @@ scene.widgetList={
WIDGET.newSwitch{name="warn", x=1100, y=300,font=35,disp=lnk_SETval("warn"), code=lnk_SETrev("warn")}, WIDGET.newSwitch{name="warn", x=1100, y=300,font=35,disp=lnk_SETval("warn"), code=lnk_SETrev("warn")},
WIDGET.newSwitch{name="highCam", x=1100, y=360,font=35,disp=lnk_SETval("highCam"),code=lnk_SETrev("highCam")}, WIDGET.newSwitch{name="highCam", x=1100, y=360,font=35,disp=lnk_SETval("highCam"),code=lnk_SETrev("highCam")},
WIDGET.newSwitch{name="nextPos", x=1100, y=420,font=35,disp=lnk_SETval("nextPos"),code=lnk_SETrev("nextPos")}, WIDGET.newSwitch{name="nextPos", x=1100, y=420,font=35,disp=lnk_SETval("nextPos"),code=lnk_SETrev("nextPos")},
WIDGET.newSwitch{name="fullscreen",x=1100, y=480,disp=lnk_SETval("fullscreen"), WIDGET.newSwitch{name="fullscreen",x=1100, y=480,disp=lnk_SETval("fullscreen"), code=switchFullscreen},
code=function()
SETTING.fullscreen=not SETTING.fullscreen
love.window.setFullscreen(SETTING.fullscreen)
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end},
WIDGET.newSwitch{name="bg", x=1100, y=540,font=35,disp=lnk_SETval("bg"), WIDGET.newSwitch{name="bg", x=1100, y=540,font=35,disp=lnk_SETval("bg"),
code=function() code=function()
BG.set("none") BG.set("none")