naming conventions act 2: the end

This commit is contained in:
lustlion
2022-03-06 09:35:45 +01:00
parent edd064c2fd
commit 05bf757ea5
29 changed files with 509 additions and 536 deletions

View File

@@ -17,7 +17,7 @@ Keybind.debug = {}
Keybind.editor = {}
Keybind.generic = {}
function Keybind:CheckDown(action)
function Keybind:checkDown(action)
if DemoPlayback then
for _, demo_action in pairs(DemoAction[CurrentDemoFrame]) do
if demo_action == action.demo then
@@ -45,8 +45,8 @@ function Keybind:CheckDown(action)
end
-- relies on being called exactly once per frame to be accurate.
function Keybind:CheckPressed(action)
if Keybind:CheckDown(action) then
function Keybind:checkPressed(action)
if Keybind:checkDown(action) then
if not action.pressed then
action.pressed = true
return true
@@ -57,7 +57,7 @@ function Keybind:CheckPressed(action)
return false
end
function Keybind:CheckCollision(cat, key)
function Keybind:checkCollision(cat, key)
for _, action in pairs(cat) do
for _, keyname in pairs(action.keys) do
if key == keyname then return true end
@@ -66,15 +66,15 @@ function Keybind:CheckCollision(cat, key)
return false
end
function Keybind:AddKey(action, key)
function Keybind:addKey(action, key)
table.insert(action.keys, key)
end
function Keybind:ChangeKey(action, position, key)
function Keybind:changeKey(action, position, key)
action.keys[position] = key
end
function Keybind:RemoveKeys(action)
function Keybind:removeKeys(action)
action.keys = {}
end
@@ -89,7 +89,7 @@ function Keybind:hasKey(action, key)
return false
end
function Keybind:Default()
function Keybind:default()
--Menu
Keybind.menu.pause.keys = {"escape"}
Keybind.menu.confirm.keys = {"z", "space", 1}
@@ -114,6 +114,8 @@ function Keybind:Default()
-- Editor
Keybind.editor.palette = { keys = {"tab"}}
Keybind.editor.room_mode = { keys = {"r"}}
Keybind.editor.entity_mode = { keys = {"e"}}
Keybind.editor.properties_mode = { keys = {"p"}}
-- Generic
Keybind.generic.lclick = { keys = {1}}
@@ -123,4 +125,4 @@ function Keybind:Default()
end
-- Set default values at start
Keybind:Default()
Keybind:default()