mirror of
https://github.com/TangentFoxy/baton.git
synced 2025-07-28 02:52:19 +00:00
remove section headers
they're more of a distraction than a help
This commit is contained in:
4
.luacheckrc
Normal file
4
.luacheckrc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
std = 'lua51+love',
|
||||||
|
ignore = {'212'},
|
||||||
|
}
|
10
baton.lua
10
baton.lua
@@ -27,8 +27,6 @@ local baton = {
|
|||||||
]]
|
]]
|
||||||
}
|
}
|
||||||
|
|
||||||
-- utility functions --
|
|
||||||
|
|
||||||
local function parseSource(source)
|
local function parseSource(source)
|
||||||
return source:match '(.+):(.+)'
|
return source:match '(.+):(.+)'
|
||||||
end
|
end
|
||||||
@@ -41,8 +39,6 @@ local function parseHat(value)
|
|||||||
return value:match '(%d)(.+)'
|
return value:match '(%d)(.+)'
|
||||||
end
|
end
|
||||||
|
|
||||||
-- source functions --
|
|
||||||
|
|
||||||
local sf = {kbm = {}, joy = {}}
|
local sf = {kbm = {}, joy = {}}
|
||||||
|
|
||||||
function sf.kbm.key(key)
|
function sf.kbm.key(key)
|
||||||
@@ -81,8 +77,6 @@ function sf.joy.hat(joystick, value)
|
|||||||
return joystick:getHat(hat) == direction and 1 or 0
|
return joystick:getHat(hat) == direction and 1 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- player class - internal functions --
|
|
||||||
|
|
||||||
local Player = {}
|
local Player = {}
|
||||||
Player.__index = Player
|
Player.__index = Player
|
||||||
|
|
||||||
@@ -219,8 +213,6 @@ function Player:_updatePairs()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- player class - public API --
|
|
||||||
|
|
||||||
function Player:update()
|
function Player:update()
|
||||||
self:_setActiveDevice()
|
self:_setActiveDevice()
|
||||||
self:_updateControls()
|
self:_updateControls()
|
||||||
@@ -281,8 +273,6 @@ function Player:getActiveDevice()
|
|||||||
return self._activeDevice
|
return self._activeDevice
|
||||||
end
|
end
|
||||||
|
|
||||||
-- baton functions --
|
|
||||||
|
|
||||||
function baton.new(config)
|
function baton.new(config)
|
||||||
local player = setmetatable({}, Player)
|
local player = setmetatable({}, Player)
|
||||||
player:_init(config)
|
player:_init(config)
|
||||||
|
Reference in New Issue
Block a user