aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2016-06-14 14:28:20 -0700
committer1029chris <1029chris@gmail.com>2016-06-14 14:28:20 -0700
commit2ab453ac53e4c2a9d23a58a12c5403d2b6b96b69 (patch)
tree3a5558ba396ac570f26ea50f7e8e5a9f473efe6e
parent613be346449b5420de616978d22c82ed16baa5c5 (diff)
Window resolution settings work now
Detect computers supported resolutions
-rw-r--r--settings.lua42
-rw-r--r--var.lua26
2 files changed, 32 insertions, 36 deletions
diff --git a/settings.lua b/settings.lua
index 1745cfd..5d5a603 100644
--- a/settings.lua
+++ b/settings.lua
@@ -117,7 +117,7 @@ function updateSettings()
if (layer[1] == 6 and win[6].hover == true and sys.mouse.p.p == true and sys.mouse.drag == false and
sys.mouse.p.x >= win[6].x+13 and sys.mouse.p.x <= win[6].x+13+120 and
sys.mouse.p.y >= win[6].y+342+(20*(i-1)) and sys.mouse.y <= win[6].y+342+(20*(i-1))+20) then
- for i=1,6 do
+ for i=1,#std do
std[i].hl = false
end
std[i].hl = true
@@ -125,32 +125,32 @@ function updateSettings()
end
end
for i=1,#stre do
- if (layer[1] == 6 and win[6].hover == true and sys.mouse.p.p == true and sys.mouse.drag == false and
+ if layer[1] == 6 and win[6].hover == true and sys.mouse.p.p == true and sys.mouse.drag == false and
sys.mouse.p.x >= win[6].x+13+384/2+4 and sys.mouse.p.x <= win[6].x+13+384/2+4+120 and
- sys.mouse.p.y >= win[6].y+342+(20*(i-1)) and sys.mouse.y <= win[6].y+342+(20*(i-1))+20) then
- for i=1,6 do
- stre[i].hl = false
+ sys.mouse.p.y >= win[6].y+342+(20*(i-1)) and sys.mouse.y <= win[6].y+342+(20*(i-1))+20 and
+ stre[i].hl ~= true then
+ for ayy=1,#stre do
+ stre[ayy].hl = false
end
+ stre[i].hl = true
win[6].update = true
- --[[if stre[i].hl ~= true then
+ if stre[i].hl == true then
+ sys.mouse.p.p = false
if i == 1 then
- love.window.setMode(1,1,{fullscreen=true, fullscreentype="desktop"})
- elseif i == 2 then
- love.window.setMode(1280,720,{fullscreen=true, fullscreentype="exclusive"})
- elseif i == 3 then
- love.window.setMode(1920,1080,{fullscreen=true, fullscreentype="exclusive"})
- elseif i == 4 then
- love.window.setMode(1280,1024,{fullscreen=true, fullscreentype="exclusive"})
- elseif i == 5 then
- love.window.setMode(1440,900,{fullscreen=true, fullscreentype="exclusive"})
- elseif i == 6 then
- love.window.setMode(1366,768,{fullscreen=true, fullscreentype="exclusive"})
+ local fullscreen, fstype = love.window.getFullscreen()
+ if fstype ~= "desktop" then
+ love.window.setMode(800,600,{fullscreen=true, fullscreentype="desktop"})
+ end
+ elseif i ~= 1 then
+ local fullscreen, fstype = love.window.getFullscreen()
+ if sys.w ~= stre[i].w or sys.h ~= stre[i].h or fstype ~= "exclusive" then
+ love.window.setMode(stre[i].w,stre[i].h,{fullscreen=true, fullscreentype="exclusive"})
+ end
end
- for i=1,#win do
- win[i].update = true
+ for fart=1,#win do
+ win[fart].update = true
end
- stre[i].hl = true
- end]]--
+ end
end
end
end
diff --git a/var.lua b/var.lua
index 5848ac5..def6b2d 100644
--- a/var.lua
+++ b/var.lua
@@ -209,21 +209,17 @@ function loadVar()
stre[1] = {}
stre[1].title = "Native"
stre[1].hl = true
- stre[2] = {}
- stre[2].title = "1280x720"
- stre[2].hl = false
- stre[3] = {}
- stre[3].title = "1920x1080"
- stre[3].hl = false
- stre[4] = {}
- stre[4].title = "1280x1024"
- stre[4].hl = false
- stre[5] = {}
- stre[5].title = "1440x900"
- stre[5].hl = false
- stre[6] = {}
- stre[6].title = "1366x768"
- stre[6].hl = false
+ modes = love.window.getFullscreenModes()
+ for i=1,#modes do
+ if modes[i].width >= 1000 and modes[i].height >= 720 and i <= 10 then
+ table.insert(stre, {
+ title = modes[i].width .. "x" .. modes[i].height,
+ hl = false,
+ w = modes[i].width,
+ h = modes[i].height,
+ })
+ end
+ end
f = {}
f.home = {}
f.home[1] = {name="Documents",x=0,y=0,hl=false}