move settings node from factory to component (#8)

This commit is contained in:
Maxim Tuprikov
2019-03-29 00:51:37 +03:00
committed by GitHub
parent 12f5f22b69
commit 7395f029e0
6 changed files with 25 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
local data = require("druid.data")
local ui_animate = require "druid.helper.druid_animate"
local ui_animate = require("druid.helper.druid_animate")
local settings = require("druid.settings")
local helper = require("druid.helper.helper")
local b_settings = settings.button
local M = {}
@@ -14,7 +15,8 @@ M.DEFAULT_ACTIVATE_SCALE = vmath.vector3(1, 1, 1)
M.DEFAUL_ACTIVATION_TIME = 0.2
function M.init(instance, callback, params, anim_node)
function M.init(instance, node, callback, params, anim_node, event)
instance.node = helper.get_node(node)
instance.event = data.A_TOUCH
instance.anim_node = anim_node and gui.get_node(anim_node) or instance.node
instance.scale_from = gui.get_scale(instance.anim_node)

View File

@@ -1,5 +1,6 @@
local data = require("druid.data")
local settings = require("druid.settings")
local helper = require("druid.helper.helper")
local M = {}
M.interest = {
@@ -8,7 +9,8 @@ M.interest = {
}
function M.init(instance, value, is_locale)
function M.init(instance, node, value, is_locale)
instance.node = helper.get_node(node)
instance.last_color = gui.get_color(instance.node)
if is_locale then
instance.text_id = value

View File

@@ -1,6 +1,6 @@
local data = require("druid.data")
local formats = require("druid.helper.formats")
local helper = require("druid.helper.ui_helper")
local helper = require("druid.helper.helper")
local M = {}
M.interest = {
@@ -10,7 +10,8 @@ M.interest = {
local empty = function() end
function M.init(instance, seconds_from, seconds_to, callback)
function M.init(instance, node, seconds_from, seconds_to, callback)
instance.node = helper.get_node(node)
seconds_from = math.max(seconds_from, 0)
seconds_to = math.max(seconds_to or 0, 0)
callback = callback or empty