改回场景先初始化再加载控件,修复之前调顺序致控件读错误scnTmp,chat场景使用task更改焦点
This commit is contained in:
@@ -10,6 +10,10 @@ local scroll--Bottom message no.
|
||||
local newMessasge=false--If there is a new message
|
||||
local heartBeatTimer
|
||||
|
||||
local function focusAtTextbox()
|
||||
coroutine.yield()
|
||||
WIDGET.sel=WIDGET.active.text
|
||||
end
|
||||
local function sendMessage()
|
||||
local W=WIDGET.active.text
|
||||
if #W.value>0 and wsWrite(W.value)then
|
||||
@@ -38,7 +42,7 @@ function scene.sceneInit()
|
||||
scroll=scroll+1
|
||||
end
|
||||
end
|
||||
WIDGET.sel=WIDGET.active.text
|
||||
TASK.new(focusAtTextbox)--Widgets are not initialized, so active after 1 frame
|
||||
BG.set("none")
|
||||
wsConnect(
|
||||
TICK.wsCONN_connect,
|
||||
|
||||
Reference in New Issue
Block a user