Update docs, annotations and style for checkbox

This commit is contained in:
Insality 2022-02-12 17:17:36 +02:00
parent 4e0fd264b1
commit 3b329f9c25
38 changed files with 67 additions and 48 deletions

View File

@ -304,7 +304,8 @@ function druid__checkbox_group.init(self, nodes, callback, click_nodes) end
--- Set checkbox group state --- Set checkbox group state
---@param self druid.checkbox_group ---@param self druid.checkbox_group
---@param indexes bool[] Array of checkbox state ---@param indexes bool[] Array of checkbox state
function druid__checkbox_group.set_state(self, indexes) end ---@param is_instant boolean If instant state change
function druid__checkbox_group.set_state(self, indexes, is_instant) end
---@class druid.data_list : druid.base_component ---@class druid.data_list : druid.base_component
@ -687,7 +688,8 @@ function druid__radio_group.init(self, nodes, callback, click_nodes) end
--- Set radio group state --- Set radio group state
---@param self druid.radio_group ---@param self druid.radio_group
---@param index number Index in radio group ---@param index number Index in radio group
function druid__radio_group.set_state(self, index) end ---@param is_instant boolean If is instant state change
function druid__radio_group.set_state(self, index, is_instant) end
---@class druid.scroll : druid.base_component ---@class druid.scroll : druid.base_component

View File

@ -1 +1 @@
{"content":[{"name":"game.projectc","size":3748,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":13488,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":948337,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":13875,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]} {"content":[{"name":"game.projectc","size":3748,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":13488,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":948433,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":13875,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +1,12 @@
[project] [project]
title = druid title = druid
version = 0.8.518 version = 0.8.519
write_log = 0 write_log = 0
compress_archive = 1 compress_archive = 1
publisher = Insality publisher = Insality
developer = Insality developer = Insality
commit_sha = a75dd5a6f9b00345cb370451b473df678a3fee7d commit_sha = 4e0fd264b169693d088a47f2bb53376a1808fb1e
build_time = 2022-02-12T15:00:03Z build_time = 2022-02-12T15:15:53Z
[display] [display]
width = 600 width = 600
@ -121,7 +121,7 @@ default_language = en
localizations = en localizations = en
[android] [android]
version_code = 518 version_code = 519
minimum_sdk_version = 16 minimum_sdk_version = 16
target_sdk_version = 30 target_sdk_version = 30
package = com.insality.druid package = com.insality.druid

Binary file not shown.

View File

@ -7,7 +7,7 @@
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags --> <!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>druid 0.8.518</title> <title>druid 0.8.519</title>
<style type='text/css'> <style type='text/css'>
/* Disable user selection to avoid strange bug in Chrome on Windows: /* Disable user selection to avoid strange bug in Chrome on Windows:
* Selecting a text outside the canvas, then clicking+draging would * Selecting a text outside the canvas, then clicking+draging would

View File

@ -169,7 +169,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -214,7 +214,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -608,7 +608,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -212,7 +212,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -775,7 +775,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -342,7 +342,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -81,7 +81,7 @@
<td class="summary">Component init function</td> <td class="summary">Component init function</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#set_state">set_state(self, indexes)</a></td> <td class="name" nowrap><a href="#set_state">set_state(self, indexes, is_instant)</a></td>
<td class="summary">Set checkbox group state</td> <td class="summary">Set checkbox group state</td>
</tr> </tr>
<tr> <tr>
@ -144,7 +144,7 @@
</dd> </dd>
<dt> <dt>
<a name = "set_state"></a> <a name = "set_state"></a>
<strong>set_state(self, indexes)</strong> <strong>set_state(self, indexes, is_instant)</strong>
</dt> </dt>
<dd> <dd>
Set checkbox group state Set checkbox group state
@ -160,6 +160,10 @@
<span class="types"><span class="type">bool[]</span></span> <span class="types"><span class="type">bool[]</span></span>
Array of checkbox state Array of checkbox state
</li> </li>
<li><span class="parameter">is_instant</span>
<span class="types"><span class="type">boolean</span></span>
If instant state change
</li>
</ul> </ul>
@ -245,7 +249,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -499,7 +499,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -489,7 +489,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -271,7 +271,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -1365,7 +1365,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -786,7 +786,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -330,7 +330,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -688,7 +688,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -294,7 +294,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -522,7 +522,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -81,7 +81,7 @@
<td class="summary">Component init function</td> <td class="summary">Component init function</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#set_state">set_state(self, index)</a></td> <td class="name" nowrap><a href="#set_state">set_state(self, index, is_instant)</a></td>
<td class="summary">Set radio group state</td> <td class="summary">Set radio group state</td>
</tr> </tr>
<tr> <tr>
@ -144,7 +144,7 @@
</dd> </dd>
<dt> <dt>
<a name = "set_state"></a> <a name = "set_state"></a>
<strong>set_state(self, index)</strong> <strong>set_state(self, index, is_instant)</strong>
</dt> </dt>
<dd> <dd>
Set radio group state Set radio group state
@ -160,6 +160,10 @@
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span></span>
Index in radio group Index in radio group
</li> </li>
<li><span class="parameter">is_instant</span>
<span class="types"><span class="type">boolean</span></span>
If is instant state change
</li>
</ul> </ul>
@ -245,7 +249,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -1118,7 +1118,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -421,7 +421,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -882,7 +882,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -283,7 +283,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -814,7 +814,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -403,7 +403,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -387,7 +387,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -314,7 +314,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-02-12 16:59:51 </i> <i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -309,6 +309,7 @@ Have a nice day!
- [Input] Add current text argument to _on_input_unselect_ event - [Input] Add current text argument to _on_input_unselect_ event
- **#152** [Checkbox] Add _is_instant_ argument to `set_state` function - **#152** [Checkbox] Add _is_instant_ argument to `set_state` function
- Add _initial_state_ argument to Checkbox component constructor - Add _initial_state_ argument to Checkbox component constructor
- Update Checkbox style, add _is_instant_ param
- **#149** [Button] Call button style functions after actual callback - **#149** [Button] Call button style functions after actual callback
- **#153** System: Mode Druid acquire input to late_init step - **#153** System: Mode Druid acquire input to late_init step
- Required to solve issues, when go input acquire can be later, when gui input acquire (on init step) - Required to solve issues, when go input acquire can be later, when gui input acquire (on init step)

View File

@ -44,10 +44,11 @@ end
--- Set checkbox group state --- Set checkbox group state
-- @tparam CheckboxGroup self -- @tparam CheckboxGroup self
-- @tparam bool[] indexes Array of checkbox state -- @tparam bool[] indexes Array of checkbox state
function CheckboxGroup.set_state(self, indexes) -- @tparam boolean is_instant If instant state change
function CheckboxGroup.set_state(self, indexes, is_instant)
for i = 1, #indexes do for i = 1, #indexes do
if self.checkboxes[i] then if self.checkboxes[i] then
self.checkboxes[i]:set_state(indexes[i], true) self.checkboxes[i]:set_state(indexes[i], true, is_instant)
end end
end end
end end

View File

@ -19,9 +19,9 @@ local component = require("druid.component")
local RadioGroup = component.create("radio_group") local RadioGroup = component.create("radio_group")
local function on_checkbox_click(self, index) local function on_checkbox_click(self, index, is_instant)
for i = 1, #self.checkboxes do for i = 1, #self.checkboxes do
self.checkboxes[i]:set_state(i == index, true) self.checkboxes[i]:set_state(i == index, true, is_instant)
end end
self.on_radio_click:trigger(self:get_context(), index) self.on_radio_click:trigger(self:get_context(), index)
@ -53,8 +53,9 @@ end
--- Set radio group state --- Set radio group state
-- @tparam RadioGroup self -- @tparam RadioGroup self
-- @tparam number index Index in radio group -- @tparam number index Index in radio group
function RadioGroup.set_state(self, index) -- @tparam boolean is_instant If is instant state change
on_checkbox_click(self, index) function RadioGroup.set_state(self, index, is_instant)
on_checkbox_click(self, index, is_instant)
end end

View File

@ -88,9 +88,15 @@ M["progress"] = {
M["checkbox"] = { M["checkbox"] = {
on_change_state = function(self, node, state) on_change_state = function(self, node, state, is_instant)
local target = state and 1 or 0 local target = state and 1 or 0
gui.animate(node, "color.w", target, gui.EASING_OUTSINE, 0.1) if not is_instant then
gui.animate(node, "color.w", target, gui.EASING_OUTSINE, 0.1)
else
local color = gui.get_color(node)
color.w = target
gui.set_color(node, color)
end
end end
} }

View File

@ -69,8 +69,8 @@ local function setup_checkbox(self)
nil, nil,
{"checkbox1/back", "checkbox2/back", "checkbox3/back"}) {"checkbox1/back", "checkbox2/back", "checkbox3/back"})
radio_group:set_state(2) radio_group:set_state(2, true)
checkbox_group:set_state({true, false, true}) checkbox_group:set_state({true, false, true}, true)
end end