use class() in more places

This commit is contained in:
binarycat
2022-03-16 21:01:04 -04:00
parent fa62e1428b
commit 8edcbe2d9b
10 changed files with 35 additions and 45 deletions

View File

@@ -13,7 +13,7 @@ local function backspace(text)
return ""
end
Prompt = {
Prompt = class(nil, {
-- defaults for instance variables
pos = { x = 10, y = 10 },
input = "",
@@ -23,7 +23,7 @@ Prompt = {
color = {1,1,1,1},
background_color = {0,0,0,1},
active_prompt = nil,
}
})
function Prompt:cancelActive()
if Prompt.active_prompt then
Prompt.active_prompt.canceled = true
@@ -33,7 +33,6 @@ end
function Prompt:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end