mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
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:
@@ -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
|
Reference in New Issue
Block a user