Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
- Added static window scaling
- Added slider buttons for custom mode
- Disabled unused modules
- General code cleanup
  • Loading branch information
GreffMASTER committed Nov 18, 2022
1 parent a40c73b commit 6424bcf
Show file tree
Hide file tree
Showing 8 changed files with 315 additions and 217 deletions.
18 changes: 12 additions & 6 deletions conf.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
function love.conf(t)
t.identity = "gmsweeper"
t.appendidentity = true
t.version = "11.3"
t.window.highdpi = true
t.console = false
t.externalstorage = true

t.window.title = "GMSweeper"
t.window.icon = "graphics/mine.png"
t.window.width = 280
t.window.height = 320
t.window.resizable = false

t.modules.audio = false
t.modules.data = false
t.modules.joystick = false
t.modules.physics = false
t.window.usedpiscale = false
t.externalstorage = true
t.console = false
t.window.icon = "graphics/mine.png"
t.modules.sound = false
t.modules.thread = false
t.modules.touch = false
t.modules.video = false
end
30 changes: 30 additions & 0 deletions fileparser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,34 @@ function fileparser.saveScores(diffi)
wfile:close()
end

function fileparser.loadScale()
local sfile = love.filesystem.getInfo("scale.txt")
if sfile then
local rfile = love.filesystem.newFile("scale.txt","r")
local outs = rfile:read()
rfile:close()
local out = tonumber(outs)
if type(out) == "number" then
if out % 0.5 ~= 0 then
_Scale = 1
return
end
if out > _MaxScale then out = _MaxScale end
if out < _MinScale then out = _MinScale end
_Scale = out
return
end
_Scale = 1
end
local wfile = love.filesystem.newFile("scale.txt","w")
wfile:write(tostring(_Scale))
wfile:close()
end

function fileparser.saveScale()
local wfile = love.filesystem.newFile("scale.txt","w")
wfile:write(tostring(_Scale))
wfile:close()
end

return fileparser
7 changes: 4 additions & 3 deletions lib/gmui/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ function Panel:wheelmoved( x, y )
end

function Panel:resize( w, h )
_Scale = _Scale or 1
if self.anchor == "bottom" then

self.w = w-4
self.ypos = h-self.h-2
self.w = w/_Scale-4
self.ypos = h/_Scale-self.h-2
self.y = self.ypos

if self.children then
Expand All @@ -97,7 +98,7 @@ function Panel:resize( w, h )
end
end
elseif self.anchor == "top" then
self.w = w-4
self.w = w/_Scale-4
self.ypos = 2
self.y = self.ypos

Expand Down
Loading

0 comments on commit 6424bcf

Please sign in to comment.