rename data to const

This commit is contained in:
Insality
2019-09-25 20:54:50 +03:00
parent 711b28ede1
commit aaac514a3d
8 changed files with 27 additions and 27 deletions

View File

@@ -1,11 +1,11 @@
--- Component to handle back key
-- @module base.back_handler
local data = require("druid.data")
local const = require("druid.const")
local M = {}
M.interest = {
data.ON_INPUT
const.ON_INPUT
}
--- Component init function
@@ -13,7 +13,7 @@ M.interest = {
-- @tparam callback callback on back button
-- @tparam[opt] params callback argument
function M.init(self, callback, params)
self.event = data.ACTION_BACK
self.event = const.ACTION_BACK
self.callback = callback
self.params = params
end
@@ -23,7 +23,7 @@ end
-- @tparam string action_id on_input action id
-- @tparam table action on_input action
function M.on_input(self, action_id, action)
if action[data.RELEASED] then
if action[const.RELEASED] then
self.callback(self.parent.parent, self.params)
end

View File

@@ -5,7 +5,7 @@
-- Long tap
-- Repeated tap
local data = require("druid.data")
local const = require("druid.const")
local ui_animate = require("druid.helper.druid_animate")
local settings = require("druid.settings")
local helper = require("druid.helper")
@@ -13,7 +13,7 @@ local b_settings = settings.button
local M = {}
M.interest = {
data.ON_INPUT
const.ON_INPUT
}
M.DEFAULT_DEACTIVATE_COLOR = vmath.vector4(0, 0, 0, 0)
@@ -24,7 +24,7 @@ M.DEFAULT_ACTIVATION_TIME = 0.2
function M.init(self, node, callback, params, anim_node, event)
self.node = helper.get_node(node)
self.event = data.ACTION_TOUCH
self.event = const.ACTION_TOUCH
self.anim_node = anim_node and helper.get_node(anim_node) or self.node
self.scale_from = gui.get_scale(self.anim_node)
self.scale_to = self.scale_from + b_settings.SCALE_CHANGE

View File

@@ -1,7 +1,7 @@
--- Component to handle progress bars
-- @module base.progress
local data = require("druid.data")
local const = require("druid.const")
local helper = require("druid.helper")
local settings = require("druid.settings")
local p_settings = settings.progress
@@ -9,7 +9,7 @@ local p_settings = settings.progress
local M = {}
M.interest = {
data.ON_UPDATE,
const.ON_UPDATE,
}
local PROP_Y = "y"

View File

@@ -2,7 +2,7 @@
-- @module base.scroll
local helper = require("druid.helper")
local data = require("druid.data")
local const = require("druid.const")
local settings = require("druid.settings").scroll
local M = {}
@@ -11,8 +11,8 @@ local SIDE_X = "x"
local SIDE_Y = "y"
M.interest = {
data.ON_UPDATE,
data.ON_SWIPE,
const.ON_UPDATE,
const.ON_SWIPE,
}
-- Global on all scrolls
@@ -257,7 +257,7 @@ end
function M.on_input(self, action_id, action)
if action_id ~= data.ACTION_TOUCH then
if action_id ~= const.ACTION_TOUCH then
return false
end
local inp = self.input

View File

@@ -2,13 +2,13 @@
-- Good working with localization system
-- @module base.text
local data = require("druid.data")
local const = require("druid.const")
local settings = require("druid.settings")
local helper = require("druid.helper")
local M = {}
M.interest = {
data.ON_CHANGE_LANGUAGE,
const.ON_CHANGE_LANGUAGE,
}

View File

@@ -1,13 +1,13 @@
--- Component to handle GUI timers
-- @module base.timer
local data = require("druid.data")
local const = require("druid.const")
local formats = require("druid.helper.formats")
local helper = require("druid.helper")
local M = {}
M.interest = {
data.ON_UPDATE
const.ON_UPDATE
}
local empty = function() end