refactor + new transitions

This commit is contained in:
kepler155c@gmail.com
2020-04-06 00:12:46 -06:00
parent 7659b81d49
commit 8fe6e0806c
5 changed files with 119 additions and 24 deletions

View File

@@ -0,0 +1,27 @@
local class = require('opus.class')
local UI = require('opus.ui')
UI.Question = class(UI.MiniSlideOut)
UI.Question.defaults = {
UIElement = 'Question',
accelerators = {
y = 'question_yes',
n = 'question_no',
}
}
function UI.Question:postInit()
local x = self.label and #self.label + 3 or 1
self.yes_button = UI.Button {
x = x,
text = 'Yes',
backgroundColor = UI.colors.primary,
event = 'question_yes',
}
self.no_button = UI.Button {
x = x + 5,
text = 'No',
backgroundColor = UI.colors.primary,
event = 'question_no',
}
end