diff --git a/sqr/User/UI/Window/2_Create_Character.nut b/sqr/User/UI/Window/2_Create_Character.nut index 3c021af..b37af50 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,9 +361,9 @@ class _CreateCharacter extends Yosin_Window { // 确定 enter.OnClick = function (enterName) { local jobEnum = getJobEnum(jobIndex); - MySocket.Send(9, { + MySocket.Send(7, { name = enterName, - gkb = jobEnum, + job = jobEnum, }) }.bindenv(this); @@ -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; - // } - } }