Input priority little rework? Remove on_swipe

This commit is contained in:
Insality
2020-02-23 12:17:25 +03:00
parent 44016bc4f3
commit c2b65eb4e2
9 changed files with 61 additions and 87 deletions

View File

@@ -5,7 +5,7 @@ local const = require("druid.const")
local helper = require("druid.helper")
local component = require("druid.component")
local M = component.create("blocker", { const.ON_SWIPE })
local M = component.create("blocker", { const.ON_INPUT_HIGH })
function M.init(self, node)

View File

@@ -1,6 +1,7 @@
--- Component to handle basic GUI button
-- @module druid.button
local Event = require("druid.event")
local const = require("druid.const")
local helper = require("druid.helper")
local component = require("druid.component")
@@ -60,6 +61,12 @@ function M.init(self, node, callback, params, anim_node, event)
self.hover_anim = self.style.IS_HOVER
self.hover = self.druid:new_hover(node, self, on_button_hover)
-- Event stubs
self.on_click = Event()
self.on_hold_click = Event()
self.on_long_click = Event()
self.on_double_click = Event()
self.click_zone = nil
end
@@ -99,7 +106,7 @@ function M.on_input(self, action_id, action)
end
function M.on_swipe(self)
function M.on_input_interrupt(self)
self.can_action = false
end

View File

@@ -59,7 +59,7 @@ function M.on_input(self, action_id, action)
end
function M.on_swipe(self)
function M.on_input_interrupt(self)
set_hover(self, false)
end

View File

@@ -5,7 +5,7 @@ local helper = require("druid.helper")
local const = require("druid.const")
local component = require("druid.component")
local M = component.create("scroll", { const.ON_UPDATE, const.ON_SWIPE })
local M = component.create("scroll", { const.ON_UPDATE, const.ON_INPUT_HIGH })
-- Global on all scrolls

View File

@@ -5,7 +5,7 @@ local helper = require("druid.helper")
local const = require("druid.const")
local component = require("druid.component")
local M = component.create("slider", { const.ON_SWIPE })
local M = component.create("slider", { const.ON_INPUT_HIGH })
local function on_change_value(self)