no message

This commit is contained in:
2025-11-08 12:21:06 +08:00
parent e195b0f168
commit 204151d95c
82 changed files with 151530 additions and 12 deletions

View File

@@ -12,8 +12,9 @@ class NpcTransactionC extends LenheartNewUI_Windows {
// NoWindow = true;
//是否可见
// Visible = false;
Visible = false;
NPCPath = null;
EquList = null;
NPCList = null;
Dialog = null;
@@ -41,8 +42,15 @@ class NpcTransactionC extends LenheartNewUI_Windows {
CurNpcId = -1;
NPCAvatar = null;
//当前交易NPC头像信息
CurNpcAvatar = null;
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
NPCAvatar = {};
//注册控件
RegisterWidget();
@@ -81,7 +89,7 @@ class NpcTransactionC extends LenheartNewUI_Windows {
if (Jso.rawin("glod")) {
TransactionGlod = Jso.glod;
}
if(Jso.rawin("equ")){
if (Jso.rawin("equ")) {
TransactionEqu = Jso.equ;
}
}.bindenv(this));
@@ -115,7 +123,7 @@ class NpcTransactionC extends LenheartNewUI_Windows {
CloseWindow();
}.bindenv(this);
ConfirmButton.SetCallBackFunc(function(Btn) {
if (mode >= 1 && mode < 3) {
if (mode >= 1 && mode< 3) {
Btn.Visible = true;
} else {
Btn.Visible = false;
@@ -146,9 +154,11 @@ class NpcTransactionC extends LenheartNewUI_Windows {
L_sq_DrawCode("Lv." + PlayerLevel.tostring(), X + 46, Y + 185, sq_RGBA(179, 169, 135, 255), 0, 1);
L_sq_DrawCode(PlayerName, X + 46, Y + 196, sq_RGBA(179, 169, 135, 255), 0, 1);
L_sq_DrawImg("map/npc/npcface02.img", 5, X + 20, Y + 44);
L_sq_DrawCode("Lv.99", X + 46, Y + 41, sq_RGBA(179, 169, 135, 255), 0, 1);
L_sq_DrawCode(NpcName, X + 46, Y + 53, sq_RGBA(179, 169, 135, 255), 0, 1);
if (CurNpcAvatar) {
L_sq_DrawImg(CurNpcAvatar.Path, CurNpcAvatar.Index, X + 20, Y + 44);
L_sq_DrawCode(CurNpcAvatar.Name, X + 46, Y + 47, sq_RGBA(179, 169, 135, 255), 0, 1);
}
//置换装备
@@ -162,7 +172,7 @@ class NpcTransactionC extends LenheartNewUI_Windows {
}
//交易装备
if(TransactionEqu){
if (TransactionEqu) {
DrawItemBase(X + 122, Y + 98, TransactionEqu, 1);
}
@@ -248,7 +258,7 @@ class NpcTransactionC extends LenheartNewUI_Windows {
}
Dialog.append(T);
}
}else if (Fragment == "[value]") {
} else if (Fragment == "[value]") {
while (true) {
local Fbuf = Data.Get();
if (Fbuf == "[/value]") {
@@ -260,6 +270,15 @@ class NpcTransactionC extends LenheartNewUI_Windows {
}
}
});
NPCPath = {};
Rindro_Script.GetFileData("npc/npc.lst", function(DataTable, Data) {
while (!Data.Eof()) {
local Id = Data.Get();
local Path = "npc/" + Data.Get().tolower();
NPCPath.rawset(Id, Path);
}
});
}
function RegNpc() {
@@ -311,8 +330,33 @@ class NpcTransactionC extends LenheartNewUI_Windows {
}
}
function GetNpcAvatar(Id) {
if (NPCAvatar.rawin(Id)) return NPCAvatar[Id];
//获取NPC路径
local Path = NPCPath.rawget(CurNpcId);
local Info = Rindro_Script.GetFileData(Path, function(DataTable, Data) {
while (!Data.Eof()) {
local Fragment = Data.Get();
if (Fragment == "[popup face]") {
DataTable.ImgPath <- Data.Get().tolower();
DataTable.Index <- Data.Get();
} else if (Fragment == "[name]") {
DataTable.Name <- Sq_ConvertWideChar(Data.Get(), "big5");
}
}
});
NPCAvatar.rawset(Id, {
Path = Info.ImgPath,
Index = Info.Index,
Name = Info.Name
});
return NPCAvatar[Id];
}
function InitWindow() {
//TODO 读NPC头像 读NPC名字
CurNpcAvatar = GetNpcAvatar(CurNpcId);
Visible = true;
}
}