#110 Add set_check_function for Buttom component

This commit is contained in:
Insality
2021-10-23 15:04:12 +03:00
parent 273dd33843
commit a4a03db813
4 changed files with 346 additions and 6 deletions

View File

@@ -238,7 +238,12 @@ Have a good day.
- Add Druid component interest: `component.ON_MESSAGE_INPUT`
- Implement new interest via function `component:on_message_input(node_id, message)`
- See **System: Message input** example
- **#111**: Add autocheck for input and stencil nodes. To enable this feature, add `druid.stencil_check = 1` to your game.project file.
- **#111** Add autocheck for input and stencil nodes. To enable this feature, add `druid.stencil_check = 1` to your game.project file.
- Add `helper.get_closest_stencil_node` function to get closest parent non inverted stencil node
- Add `component.ON_LATE_INIT` interest. If component with with interest, it will call `component.on_late_init` function once after component init on update step. This can be used to do something after all gui components are was initialized and setup.
- This feature is using for auto setup `component:set_click_zone` to restrict clicks outside scrolls zone for example. Now you can don't think about click zone and let Druid do it instead of you!
- This feature is using for auto setup `component:set_click_zone` to restrict clicks outside scrolls zone for example. Now you can don't think about click zone and let Druid do it instead of you!
- **#110** Add `Button:set_check_function(check_function, failure_callback)` function to add your custom click condition to button.
- `Button:set_enabled` has more priority than this to check button availability
- The `check_function` should return _true_ of _false_. If true - button can be clicked
- The `failure_callback`will be called if `check_function` will return false. It's callback for you if button is not available
- Example with `set_check_function` exists in general:buttons example collection