File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ function Widgets.base:getInfo()
226
226
end
227
227
return str
228
228
end
229
- function Widgets .base :reset ()
229
+ function Widgets .base :reset (init )
230
230
assert (not self .name or type (self .name )== ' string' ," [widget].name need string" )
231
231
232
232
assert (type (self .x )== ' number' ," [widget].x need number" )
@@ -304,10 +304,12 @@ function Widgets.base:reset()
304
304
if self ._visible == nil then
305
305
self ._visible = true
306
306
end
307
- if self .visibleFunc then
308
- self ._visible = self .visibleFunc ()
309
- elseif self .visibleTick then
310
- self ._visible = self .visibleTick ()
307
+ if not init then
308
+ if self .visibleFunc then
309
+ self ._visible = self .visibleFunc ()
310
+ elseif self .visibleTick then
311
+ self ._visible = self .visibleTick ()
312
+ end
311
313
end
312
314
end
313
315
function Widgets .base :setVisible (bool )
@@ -2321,7 +2323,7 @@ function WIDGET.new(args)
2321
2323
errorf (" WIDGET.new(args): Illegal argument %s for widget %s" ,k ,t )
2322
2324
end
2323
2325
end
2324
- w :reset ()
2326
+ w :reset (true )
2325
2327
2326
2328
return w
2327
2329
end
You can’t perform that action at this time.
0 commit comments