mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
Add set/reset input priority functions
This commit is contained in:
parent
731a47e01d
commit
44842f78dc
@ -163,6 +163,26 @@ function BaseComponent.get_input_priority(self)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Set component input priority
|
||||||
|
-- @tparam BaseComponent self
|
||||||
|
-- @tparam number value The new input priority value
|
||||||
|
-- @treturn number The component input priority
|
||||||
|
function BaseComponent.set_input_priority(self, value)
|
||||||
|
assert(value)
|
||||||
|
self._component.input_priority = value
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Reset component input priority to default value
|
||||||
|
-- @tparam BaseComponent self
|
||||||
|
-- @treturn number The component input priority
|
||||||
|
function BaseComponent.reset_input_priority(self)
|
||||||
|
self:set_input_priority(self._component.default_input_priority)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Return component uid. UID generated in component creation order
|
--- Return component uid. UID generated in component creation order
|
||||||
-- @tparam BaseComponent self
|
-- @tparam BaseComponent self
|
||||||
-- @treturn number The component uid
|
-- @treturn number The component uid
|
||||||
@ -245,6 +265,7 @@ function BaseComponent.initialize(self, name, interest, input_priority)
|
|||||||
name = name,
|
name = name,
|
||||||
interest = interest,
|
interest = interest,
|
||||||
input_priority = input_priority or const.PRIORITY_INPUT,
|
input_priority = input_priority or const.PRIORITY_INPUT,
|
||||||
|
default_input_priority = input_priority or const.PRIORITY_INPUT,
|
||||||
uid = BaseComponent.get_uid()
|
uid = BaseComponent.get_uid()
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user