mirror of
https://github.com/Insality/druid.git
synced 2025-09-28 02:22:18 +02:00
first iteration of trash cleaning
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
local ui_animate = require "modules.ui.ui_animate"
|
||||
local ui_animate = require "druid.help_modules.druid_animate"
|
||||
|
||||
M.DEFAULT_SCALE_CHANGE = vmath.vector3(-0.05, - 0.1, 1)
|
||||
M.DEFAULT_POS_CHANGE = vmath.vector3(0, - 10, 0)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
local text_field = require "modules.ui.components.text_field"
|
||||
local text_field = require "druid.components.text_field"
|
||||
|
||||
local FRAMES = 60
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
local ui_animate = require "modules.ui.ui_animate"
|
||||
local ui_animate = require "druid.help_modules.druid_animate"
|
||||
|
||||
local function fly_to(instance, pos_from, speed, callback)
|
||||
local pos_to = instance.get_pos_func()
|
||||
|
@@ -1,6 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
local ui_animate = require "modules.ui.ui_animate"
|
||||
local ui_animate = require "druid.help_modules.druid_animate"
|
||||
|
||||
--- Bounce image
|
||||
function M.bounce(instance)
|
||||
|
@@ -1,8 +1,7 @@
|
||||
local M = {}
|
||||
|
||||
local input = require "modules.input.input"
|
||||
local ui_animate = require "modules.ui.ui_animate"
|
||||
local extra_math = require "modules.utils.extra_math"
|
||||
local druid_input = require "druid.help_modules.druid_input"
|
||||
local ui_animate = require "druid.help_modules.druid_animate"
|
||||
|
||||
M.START = hash("START")
|
||||
M.FINISH = hash("FINISH")
|
||||
@@ -62,13 +61,18 @@ local function checkSwipeDirection(swipe, action)
|
||||
end
|
||||
end
|
||||
|
||||
function lenght(x1, y1, x2, y2)
|
||||
local a, b = x1 - x2, y1 - y2
|
||||
return math.sqrt(a * a + b * b)
|
||||
end
|
||||
|
||||
local function back_move(instance)
|
||||
if not instance.swipe.end_position_x and not instance.swipe.end_position_y then
|
||||
if instance.points_of_interest then
|
||||
local min_index, min_lenght = 0, math.huge
|
||||
local len
|
||||
for k, v in pairs(instance.points_of_interest) do
|
||||
len = extra_math.lenght(instance.pos.x, instance.pos.y, v.x, v.y)
|
||||
len = lenght(instance.pos.x, instance.pos.y, v.x, v.y)
|
||||
if len < min_lenght then
|
||||
min_lenght = len
|
||||
min_index = k
|
||||
@@ -130,14 +134,14 @@ end
|
||||
-- @param action_id - input action id
|
||||
-- @param action - input action
|
||||
function M.on_input(instance, action_id, action)
|
||||
if action_id == input.A_CLICK then
|
||||
if action_id == druid_input.A_CLICK then
|
||||
if gui.pick_node(instance.scrolling_zone, action.x, action.y) then
|
||||
local swipe = instance.swipe
|
||||
if action.pressed then
|
||||
swipe.pressed = true
|
||||
swipe.beginX = action.x
|
||||
swipe.beginY = action.y
|
||||
input.is_swipe = false
|
||||
druid_input.is_swipe = false
|
||||
swipe.end_move_coef_x = 1
|
||||
elseif not action.released and not action.pressed and not swipe.special_move then
|
||||
swipe.endX = action.x
|
||||
|
@@ -1,19 +1,19 @@
|
||||
local M = {}
|
||||
|
||||
local helper = require "modules.render.helper"
|
||||
local tab_page = require "modules.ui.components.tab_page"
|
||||
--local helper = require "modules.render.helper"
|
||||
local tab_page = require "druid.components.tab_page"
|
||||
|
||||
local DISABLE = hash("disable")
|
||||
|
||||
function M.update_sizes(instance, width)
|
||||
width = width or helper.config_x
|
||||
-- width = width or helper.config_x
|
||||
instance.left = vmath.vector3(width * - 1, 0, 0)
|
||||
instance.right = vmath.vector3(width * 1, 0, 0)
|
||||
end
|
||||
|
||||
--- Called when layout updated (rotate for example)
|
||||
function M.on_layout_updated(instance, message)
|
||||
local width = helper.settings_x
|
||||
-- local width = helper.settings_x
|
||||
M.update_sizes(instance, width)
|
||||
end
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
local ui_animate = require "modules.ui.ui_animate"
|
||||
local ui_animate = require "druid.help_modules.druid_animate"
|
||||
|
||||
--- Bounce text field
|
||||
function M.bounce(instance, callback)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
local formats = require "modules.utils.formats"
|
||||
local formats = require "druid.help_modules.formats"
|
||||
|
||||
--- Set text to text field
|
||||
-- @param set_to - set value in seconds
|
||||
|
Reference in New Issue
Block a user