Refactoring: step 1

druid.lua:
- `factory` replaced with `self`
- set new name for metatable
- replaced `ipairs` with `for `i loop

data.lua:
- renamed custom messages
This commit is contained in:
Alexey Gulev
2019-08-04 22:15:22 +02:00
parent fdbacd033d
commit 4ce8e85d15
3 changed files with 97 additions and 68 deletions

View File

@@ -1,20 +1,37 @@
local M = {}
-- actions
M.A_TOUCH = hash("touch")
M.A_TEXT = hash("text")
M.A_BACKSPACE = hash("backspace")
M.A_ENTER = hash("enter")
M.A_ANDR_BACK = hash("back")
-- interest
M.LAYOUT_CHANGED = hash("layout_changed")
M.ON_MESSAGE = hash("on_message")
M.ON_INPUT = hash("on_input")
M.ON_SWIPE = hash("on_swipe")
M.ON_UPDATE = hash("on_update")
M.TRANSLATABLE = hash("TRANSLATABLE")
M.RELEASED = "released"
M.PRESSED = "pressed"
--- interests
M.ON_MESSAGE = hash("on_message")
M.ON_UPDATE = hash("on_update")
-- input
M.ON_SWIPE = hash("on_swipe")
M.ON_INPUT = hash("on_input")
M.ui_input = {
[M.ON_SWIPE] = true,
[M.ON_INPUT] = true
}
-- ui messages
M.ON_CHANGE_LANGUAGE = hash("on_change_language")
M.ON_LAYOUT_CHANGED = hash("on_layout_changed")
M.specific_ui_messages = {
[M.ON_CHANGE_LANGUAGE] = "on_change_language",
[M.ON_LAYOUT_CHANGED] = "on_layout_changed"
}
return M