From 89e51c41239fecdd0cad496fbb97d743244ebc80 Mon Sep 17 00:00:00 2001 From: WONIU Date: Fri, 20 Dec 2024 23:46:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=A7=92=E8=89=B2=20?= =?UTF-8?q?=E5=8C=85=E8=B0=83=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqr/User/UI/Window/2_Create_Character.nut | 24 +++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/sqr/User/UI/Window/2_Create_Character.nut b/sqr/User/UI/Window/2_Create_Character.nut index 3c021af..827f873 100644 --- a/sqr/User/UI/Window/2_Create_Character.nut +++ b/sqr/User/UI/Window/2_Create_Character.nut @@ -235,6 +235,8 @@ class _CreateCharacter extends Yosin_Window { jobIndex = 0; + NoticeBox = null; + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); @@ -246,9 +248,12 @@ class _CreateCharacter extends Yosin_Window { // 创建角色回包 MySocket.RegisterHandler(4, function(Jso) { + if (NoticeBox) NoticeBox.CloseWindow(); if (Jso.type == 0){ // 创建成功. - NoticeBox = _Yosin_MessageBox("创建成功."); + //关闭创建界面 + NoticeBox.DestroyWindow(); + DestroyWindow(); }else{ // 创建失败. NoticeBox = _Yosin_MessageBox("创建失败."); @@ -356,7 +361,7 @@ class _CreateCharacter extends Yosin_Window { // 确定 enter.OnClick = function (enterName) { local jobEnum = getJobEnum(jobIndex); - MySocket.Send(9, { + MySocket.Send(7, { name = enterName, gkb = jobEnum, }) @@ -767,9 +772,6 @@ class _create_Character_enterName extends Yosin_Window { OnClick = null; - //公告框 - NoticeBox = null; - // 检查过的名称 checkName = null; // 当前名称 @@ -875,15 +877,15 @@ class _create_Character_enterName extends Yosin_Window { // 昵称重复检查回包 MySocket.RegisterHandler(3, function(Jso) { - if (NoticeBox) NoticeBox.CloseWindow(); + if (Parent.NoticeBox) Parent.NoticeBox.CloseWindow(); if (Jso.type == 0){ // 可以使用的ID 确认按钮可以使用. - NoticeBox = _Yosin_MessageBox("可以使用的ID."); - checkName = nameInputBox.str; + Parent.NoticeBox = _Yosin_MessageBox("可以使用的ID."); + checkName = name; affirmButton.State = 0; }else{ // 名称重复. - NoticeBox = _Yosin_MessageBox("名称重复."); + Parent.NoticeBox = _Yosin_MessageBox("名称重复."); } }.bindenv(this)); @@ -895,10 +897,6 @@ class _create_Character_enterName extends Yosin_Window { SyncPos(X, Y); base.Proc(Dt); - // if (nameInputBox.str != checkName && affirmButton.State != 3) { - // affirmButton.State = 3; - // } - } }