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

Love 0.10.0+ support #2

Merged
merged 1 commit into from Dec 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions game.lua
Expand Up @@ -1163,7 +1163,7 @@ function game_mousepressed(x, y, button)
end

print(fadegoal)
if button == "r" or button == "l" and (not gamepaused and fadegoal ~= "menu") then
if button == rbutton or button == lbutton and (not gamepaused and fadegoal ~= "menu") then
updateperspective("none")
rotatedrag = true
rotatedragX = x
Expand All @@ -1175,7 +1175,7 @@ function game_mousepressed(x, y, button)
end

function game_mousereleased(x, y, button)
if (button == "r" or button == "l") and love.mouse.isDown("l") == false and love.mouse.isDown("r") == false and fadegoal ~= "menu" then
if (button == rbutton or button == lbutton) and love.mouse.isDown(lbutton) == false and love.mouse.isDown(rbutton) == false and fadegoal ~= "menu" then
rotatedrag = false
if won == false then
--check if current pitch is good
Expand Down Expand Up @@ -1226,4 +1226,4 @@ function game_mousereleased(x, y, button)
end
end
end
end
end
4 changes: 2 additions & 2 deletions levelbutton.lua
Expand Up @@ -184,7 +184,7 @@ function levelbutton:draw()
end

function levelbutton:mousepressed(x, y, button)
if self.unlocked and self.active and button == "l" then
if self.unlocked and self.active and button == lbutton then
if self:gethighlight(x, y) then
for i, v in pairs(levelbuttons) do
v.active = false
Expand All @@ -202,4 +202,4 @@ function levelbutton:gethighlight(x, y)
return true
end
return false
end
end
12 changes: 10 additions & 2 deletions main.lua
Expand Up @@ -27,7 +27,15 @@
0. You just DO WHAT THE FUCK YOU WANT TO.
]]

--0.9.0 stuff
--Version compatibility stuff
major, minor, revision, codename = love.getVersion()
if major == 0 and minor <= 9 then
lbutton = "l"
rbutton = "r"
else
lbutton = 1
rbutton = 2
end
math.mod = math.fmod
if not love.graphics.drawq then
love.graphics.drawq = love.graphics.draw
Expand Down Expand Up @@ -890,4 +898,4 @@ function playsound(sound)
sound:stop()
sound:play()
end
end
end
4 changes: 2 additions & 2 deletions menubutton.lua
Expand Up @@ -58,7 +58,7 @@ function menubutton:draw()
end

function menubutton:mousepressed(x, y, button)
if self.active and button == "l" then
if self.active and button == lbutton then
if self:gethighlight(x, y) then
self:func()
return true
Expand All @@ -72,4 +72,4 @@ function menubutton:gethighlight(x, y)
return true
end
return false
end
end
4 changes: 2 additions & 2 deletions pausebutton.lua
Expand Up @@ -76,7 +76,7 @@ end

function pausebutton:mousepressed(x, y, button)
if self.active then
if button == "l" then
if button == lbutton then
if self:gethighlight(x, y) then
self:func()
end
Expand All @@ -90,4 +90,4 @@ function pausebutton:gethighlight(x, y)
return true
end
return false
end
end