From eca5da2ff9ff26a95f1e8b4e7b0a4058cad737e1 Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Sun, 15 Dec 2024 20:16:26 +0800 Subject: [PATCH] =?UTF-8?q?UI=E6=A0=B8=E5=BF=83=E7=B1=BB=E7=9A=84=20Proc?= =?UTF-8?q?=E4=B8=8EUpdate=E5=86=B2=E7=AA=81=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqr/Core/UI_Class/UI_Core.nut | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sqr/Core/UI_Class/UI_Core.nut b/sqr/Core/UI_Class/UI_Core.nut index 8ddbc4c..4f4216e 100644 --- a/sqr/Core/UI_Class/UI_Core.nut +++ b/sqr/Core/UI_Class/UI_Core.nut @@ -25,6 +25,11 @@ class Yosin_BaseWindow extends Layer { Y = null; B_Y = null; + function _typeof() { + return "Yosin_BaseWindow"; + } + + //构造函数 constructor(IsWindowFlag = false) { local ObjectBuf; //如果是游戏窗口类 则以Layer为基类 否则以Actor为基类 @@ -117,8 +122,6 @@ class Yosin_BaseWindow extends Layer { if (Window.UpdateFunc) Window.UpdateFunc(Window, Dt); Window.Proc(Dt); } - //显示才调用Update - if (Visible) base.OnUpdate(Dt); } //同步坐标 function SyncPos(X, Y) { @@ -199,6 +202,7 @@ class Yosin_Window extends Yosin_BaseWindow { base.constructor(true); SetSize(Width, Height); + SyncPos(X, Y); } //切换到最上层窗口 即得到焦点时 全局窗口才调用 子窗口请不要调用此函数 @@ -337,6 +341,8 @@ class Yosin_Window extends Yosin_BaseWindow { //调用原生方法 base.OnMouseWheel(Flag, MousePos_X, MousePos_Y); } + + } //创建窗口 @@ -372,6 +378,8 @@ function _Yosin_Windows_Logic_(Dt, Ui_Layer) { } //无论窗口是否显示都需要调用Proc Window.Proc(Dt); + //无论是否显示都调用Update + Window.OnUpdate(Dt); } }