创建角色 包调式

This commit is contained in:
WONIU 2024-12-20 23:46:01 +08:00
parent 11b0a8b3e4
commit 89e51c4123
1 changed files with 11 additions and 13 deletions

View File

@ -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;
// }
}
}