From a7c68d634a8a719d4711d658209fa5df11b2f262 Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:12:04 +0800 Subject: [PATCH 01/15] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=90=8D=E4=B8=8D=E5=90=8C=E5=96=8A=E8=AF=9D=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E7=9B=B8=E5=90=8C=E5=86=B2=E7=AA=81=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index 526f41f02..79228da4d 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -868,7 +868,7 @@ function D.CreateData(szEvent) if v.szContent then if v.szContent:find('{$me}') or v.szContent:find('{$team}') or v.bSearch or v.bReg then -- 具有通配符和搜索标记的数据不作 HIT 高速匹配策略考虑 table.insert(cache.OTHER, v) - elseif not cache.HIT[v.szContent] then -- 按照数据优先级顺序(地图>地图组>通用),同级按照下标先后顺序,只取第一个匹配结果 + elseif not (cache.HIT[v.szContent] and cache.HIT[v.szContent][v.szTarget or 'sys']) then -- 按照数据优先级顺序(地图>地图组>通用),同级按照下标先后顺序,只取第一个匹配结果 cache.HIT[v.szContent] = cache.HIT[v.szContent] or {} cache.HIT[v.szContent][v.szTarget or 'sys'] = v end From 39cb518376fedb858fd93504621f051f44b26a9d Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:14:58 +0800 Subject: [PATCH 02/15] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=AD=A3?= =?UTF-8?q?=E5=88=99=E6=A8=A1=E5=BC=8F=E6=94=AF=E6=8C=81{$team}=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 52 +++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index 79228da4d..1e4bd38c0 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -1730,18 +1730,52 @@ function D.OnCallMessage(szEvent, szContent, dwNpcID, szNpcName) dwReceiverID, szReceiver = nil end if bInParty and content:find('{$team}', nil, true) then - local c = content - for _, vv in ipairs(team.GetTeamMemberList()) do - if string.find(szContent, c:gsub('{$team}', team.GetClientTeamMemberName(vv)), nil, true) and (v.szTarget == szNpcName or v.szTarget == '%') then -- hit - data = v - dwReceiverID = vv - szReceiver = team.GetClientTeamMemberName(vv) + if v.bReg then + -- 正则模式(带{$team}):逆向排除,先遍历成员名,替换为空,若替换成功,说明命中,再将正则规则{$team}替换为空,匹配剩余的内容,如此只用一次正则,节约性能 + local nHitMemberID, szHitMemberName, szProcessedContent + local tMembers = {} + -- 按名字长度降序排序,避免名字包含关系导致误判替换 + for _, vv in ipairs(team.GetTeamMemberList()) do + tMembers[#tMembers + 1] = { dwID = vv, szName = team.GetClientTeamMemberName(vv) } + end + table.sort(tMembers, function(a, b) return #a.szName > #b.szName end) + -- 替换正则规则{$team}为空,并获取{$team}数量,决定后续成员名替换为空次数 + local szPattern, nTeamCount = content:gsub('{$team}', '') + for _, member in ipairs(tMembers) do + local szReplaced = string.gsub(szContent, member.szName, '', nTeamCount) + if #szReplaced < #szContent then + nHitMemberID = member.dwID + szHitMemberName = member.szName + szProcessedContent = szReplaced + break + end + end + if nHitMemberID and szHitMemberName then + local res = {string.find(szProcessedContent, szPattern)} + if res[1] then + table.remove(res, 1) + table.remove(res, 1) + data = v + aBackreferences = res + dwReceiverID = nHitMemberID + szReceiver = szHitMemberName + break + end + end + else + local c = content + for _, vv in ipairs(team.GetTeamMemberList()) do + if string.find(szContent, c:gsub('{$team}', team.GetClientTeamMemberName(vv)), nil, true) and (v.szTarget == szNpcName or v.szTarget == '%') then -- hit + data = v + dwReceiverID = vv + szReceiver = team.GetClientTeamMemberName(vv) + break + end + end + if dwReceiverID and szReceiver then break end end - if dwReceiverID and szReceiver then - break - end elseif v.szTarget == szNpcName or v.szTarget == '%' then if v.bReg then local res = {string.find(szContent, content)} From 97e7c002845998e4c222a78f3374b76838a5f5b0 Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:16:15 +0800 Subject: [PATCH 03/15] =?UTF-8?q?feat:=20=E7=BC=93=E5=AD=98=E5=9B=A2?= =?UTF-8?q?=E9=98=9F=E6=B0=94=E5=8A=B2=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_Cataclysm/src/MY_CataclysmMain.lua | 2 ++ MY_Cataclysm/src/MY_CataclysmParty.lua | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MY_Cataclysm/src/MY_CataclysmMain.lua b/MY_Cataclysm/src/MY_CataclysmMain.lua index 3877657ff..4640d33dc 100644 --- a/MY_Cataclysm/src/MY_CataclysmMain.lua +++ b/MY_Cataclysm/src/MY_CataclysmMain.lua @@ -111,6 +111,8 @@ local function UpdateTeamMonData() v.nLevel = data.nLevel end v.nIcon = data.nIcon + v.szDisplayName = v.szDisplayName or data.szDisplayName + v.szDisplayName = v.szDisplayName and X.RenderTemplateString(v.szDisplayName, nil, -1, false, false) table.insert(aBuff, v) end end diff --git a/MY_Cataclysm/src/MY_CataclysmParty.lua b/MY_Cataclysm/src/MY_CataclysmParty.lua index 1a0f473d7..c7445f51a 100644 --- a/MY_Cataclysm/src/MY_CataclysmParty.lua +++ b/MY_Cataclysm/src/MY_CataclysmParty.lua @@ -1725,7 +1725,7 @@ function D.UpdateCharaterBuff(p, handle, tKeep) local szCountdownKey = 'MY_CATACLYSM_' .. tBuff.dwID .. '_' .. tRule.szKey FireUIEvent('MY_LIFEBAR_COUNTDOWN', dwCharID, 'BUFF', szCountdownKey, { dwBuffID = tBuff.dwID, - szText = tBuff.szName, + szText = tRule.szDisplayName or tBuff.szName, nLogicFrame = tBuff.nEndFrame, col = tRule.colScreenHead or tRule.col, nPriority = tItem.nPriority, From d385d0e0439bfe5331e0c0c3d95b183f664932d9 Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:17:37 +0800 Subject: [PATCH 04/15] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=9D=A5=E6=BA=90=E5=9B=A2=E9=98=9F=E6=88=90=E5=91=98?= =?UTF-8?q?=E7=9A=84=E6=B0=94=E5=8A=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index 1e4bd38c0..a18c2bee6 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -1064,7 +1064,7 @@ function D.OnBuff(dwOwner, bDelete, bCanCancel, dwBuffID, nCount, nBuffLevel, dw if MY_TEAM_MON_SHIELDED_TOTAL then return end - if MY_TEAM_MON_SHIELDED_OTHER_PLAYER and X.IsPlayer(dwSkillSrcID) and dwSkillSrcID ~= MY_TEAM_MON_CORE_PLAYERID then + if MY_TEAM_MON_SHIELDED_OTHER_PLAYER and X.IsPlayer(dwSkillSrcID) and dwSkillSrcID ~= MY_TEAM_MON_CORE_PLAYERID and not X.IsTeammate(dwSkillSrcID) then return end local szType = bCanCancel and 'BUFF' or 'DEBUFF' From c46a168cc34a80321dbbb9a3348303732b65b7d4 Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Wed, 1 Jul 2026 19:39:52 +0800 Subject: [PATCH 05/15] =?UTF-8?q?fix:=20=E7=BC=93=E5=AD=98=E5=9B=A2?= =?UTF-8?q?=E9=98=9F=E6=88=90=E5=91=98=E4=B8=A5=E8=B0=A8=E6=AD=A3=E5=88=99?= =?UTF-8?q?=E7=BA=A6=E6=9D=9F=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 50 ++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index a18c2bee6..38ace3216 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -121,6 +121,8 @@ end -- 核心优化变量 local MY_TEAM_MON_CORE_PLAYERID = 0 local MY_TEAM_MON_CORE_NAME = 0 +local MY_TEAM_MON_MEMBER_CACHE = {} +local MY_TEAM_MON_MEMBER_ID_MAP = {} local MY_TEAM_MON_MAX_INTERVAL = 300 local MY_TEAM_MON_MAX_CACHE = 3000 -- 最大的cache数量 主要是UI的问题 @@ -510,6 +512,11 @@ local function ParseHPCountdown(szString) return X.Clone(CACHE.HP_CD_STR[szString][1]), CACHE.HP_CD_STR[szString][2] end +-- 判断是否为队友ID +local function IsTeamMemberID(dwID) + return dwID and MY_TEAM_MON_MEMBER_ID_MAP and MY_TEAM_MON_MEMBER_ID_MAP[dwID] +end + function D.OnFrameCreate() this:RegisterEvent('MY_TEAM_MON_LOADING_END') this:RegisterEvent('MY_TEAM_MON_CREATE_CACHE') @@ -693,6 +700,8 @@ function D.OnEvent(szEvent) D.FireCrossMapEvent('before') D.CreateData(szEvent) X.DelayCall('MY_TeamMon__FireCrossMapEvent__after', D.FireCrossMapEvent, 'after') + elseif szEvent == 'PARTY_ADD_MEMBER' or szEvent == 'PARTY_DELETE_MEMBER' or szEvent == 'PARTY_DISBAND' then + D.OnTeamEvent(szEvent) end end @@ -1064,7 +1073,7 @@ function D.OnBuff(dwOwner, bDelete, bCanCancel, dwBuffID, nCount, nBuffLevel, dw if MY_TEAM_MON_SHIELDED_TOTAL then return end - if MY_TEAM_MON_SHIELDED_OTHER_PLAYER and X.IsPlayer(dwSkillSrcID) and dwSkillSrcID ~= MY_TEAM_MON_CORE_PLAYERID and not X.IsTeammate(dwSkillSrcID) then + if MY_TEAM_MON_SHIELDED_OTHER_PLAYER and X.IsPlayer(dwSkillSrcID) and dwSkillSrcID ~= MY_TEAM_MON_CORE_PLAYERID and not IsTeamMemberID(dwSkillSrcID) then return end local szType = bCanCancel and 'BUFF' or 'DEBUFF' @@ -1731,27 +1740,21 @@ function D.OnCallMessage(szEvent, szContent, dwNpcID, szNpcName) end if bInParty and content:find('{$team}', nil, true) then if v.bReg then - -- 正则模式(带{$team}):逆向排除,先遍历成员名,替换为空,若替换成功,说明命中,再将正则规则{$team}替换为空,匹配剩余的内容,如此只用一次正则,节约性能 + -- 正则模式(带{$team}):逆向排除,先遍历成员名,替换为{$team},不替换为空防止破坏位置约束,若替换成功,说明命中,再正则匹配剩余的内容,如此只用一次正则,节约性能 local nHitMemberID, szHitMemberName, szProcessedContent - local tMembers = {} - -- 按名字长度降序排序,避免名字包含关系导致误判替换 - for _, vv in ipairs(team.GetTeamMemberList()) do - tMembers[#tMembers + 1] = { dwID = vv, szName = team.GetClientTeamMemberName(vv) } - end - table.sort(tMembers, function(a, b) return #a.szName > #b.szName end) - -- 替换正则规则{$team}为空,并获取{$team}数量,决定后续成员名替换为空次数 - local szPattern, nTeamCount = content:gsub('{$team}', '') - for _, member in ipairs(tMembers) do - local szReplaced = string.gsub(szContent, member.szName, '', nTeamCount) - if #szReplaced < #szContent then + -- 获取正则{$team}数量,决定后续成员名替换为{$team}次数 + local _, nTeamCount = content:gsub('{$team}', '{$team}') + for _, member in ipairs(MY_TEAM_MON_MEMBER_CACHE) do + local szHitContent, nHitCount = string.gsub(szContent, member.szName, '{$team}', nTeamCount) + if nHitCount > 0 then nHitMemberID = member.dwID szHitMemberName = member.szName - szProcessedContent = szReplaced + szProcessedContent = szHitContent break end end if nHitMemberID and szHitMemberName then - local res = {string.find(szProcessedContent, szPattern)} + local res = {string.find(szProcessedContent, content)} if res[1] then table.remove(res, 1) table.remove(res, 1) @@ -2042,6 +2045,23 @@ function D.FireCrossMapEvent(szWhen) end end +-- 团队成员事件 刷新团队成员排序缓存 +function D.OnTeamEvent(szEvent) + MY_TEAM_MON_MEMBER_CACHE = {} + MY_TEAM_MON_MEMBER_ID_MAP = {} + local me = X.GetClientPlayer() + if me.IsInParty() then + local team = GetClientTeam() + if team then + for _, vv in ipairs(team.GetTeamMemberList()) do + MY_TEAM_MON_MEMBER_CACHE[#MY_TEAM_MON_MEMBER_CACHE + 1] = { dwID = vv, szName = team.GetClientTeamMemberName(vv) } + MY_TEAM_MON_MEMBER_ID_MAP[vv] = true + end + table.sort(MY_TEAM_MON_MEMBER_CACHE, function(a, b) return #a.szName > #b.szName end) + end + end +end + -- RegisterMsgMonitor function D.RegisterMessage(bEnable) if bEnable then From 799829dcee9006e8f45c80563bd24914c9c61334 Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Sat, 18 Jul 2026 03:33:04 +0800 Subject: [PATCH 06/15] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=9B=A2?= =?UTF-8?q?=E9=98=9F=E9=9D=A2=E6=9D=BF=E4=BC=98=E5=85=88=E7=BA=A7=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_Cataclysm/src/MY_CataclysmMain.lua | 17 ++++++++++------- MY_Cataclysm/src/MY_CataclysmParty.lua | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/MY_Cataclysm/src/MY_CataclysmMain.lua b/MY_Cataclysm/src/MY_CataclysmMain.lua index 4640d33dc..c80403204 100644 --- a/MY_Cataclysm/src/MY_CataclysmMain.lua +++ b/MY_Cataclysm/src/MY_CataclysmMain.lua @@ -48,11 +48,14 @@ local function InsertBuffListCache(aBuffList, szVia, nViaPriority) for iid, aList in pairs(BUFF_LIST) do if iid == id or (tab.szName and type(iid) == 'number' and Table_GetBuffName(iid, 1) == tab.szName) then for i, p in X.ipairs_r(aList) do - if (not tab.nLevel or p.nLevel == tab.nLevel) - and (not tab.szStackOp or p.szStackOp == tab.szStackOp) - and (not tab.nStackNum or p.nStackNum == tab.nStackNum) - and (not tab.bOnlyMe or p.bOnlyMe == tab.bOnlyMe) - and (not tab.bOnlyMine or p.bOnlyMine == tab.bOnlyMine) then + if (not tab.nLevel or tab.nLevel == p.nLevel) + and (not tab.szStackOp or tab.szStackOp == p.szStackOp) + and (not tab.nStackNum or tab.nStackNum == p.nStackNum) + and (not tab.bOnlyMe == not p.bOnlyMe) + and (not tab.bOnlyMine == not p.bOnlyMine) + and (not tab.bCaution == not p.bCaution) + and (not tab.bAttention == not p.bAttention) + and (not tab.bScreenHead == not p.bScreenHead) then table.remove(aList, i) end end @@ -111,8 +114,8 @@ local function UpdateTeamMonData() v.nLevel = data.nLevel end v.nIcon = data.nIcon - v.szDisplayName = v.szDisplayName or data.szDisplayName - v.szDisplayName = v.szDisplayName and X.RenderTemplateString(v.szDisplayName, nil, -1, false, false) + v.szDisplay = v.szDisplay or data.szDisplay + v.szDisplay = v.szDisplay and X.RenderTemplateString(v.szDisplay, nil, -1, false, false) table.insert(aBuff, v) end end diff --git a/MY_Cataclysm/src/MY_CataclysmParty.lua b/MY_Cataclysm/src/MY_CataclysmParty.lua index c7445f51a..93649ef45 100644 --- a/MY_Cataclysm/src/MY_CataclysmParty.lua +++ b/MY_Cataclysm/src/MY_CataclysmParty.lua @@ -1725,7 +1725,7 @@ function D.UpdateCharaterBuff(p, handle, tKeep) local szCountdownKey = 'MY_CATACLYSM_' .. tBuff.dwID .. '_' .. tRule.szKey FireUIEvent('MY_LIFEBAR_COUNTDOWN', dwCharID, 'BUFF', szCountdownKey, { dwBuffID = tBuff.dwID, - szText = tRule.szDisplayName or tBuff.szName, + szText = tRule.szDisplay or tBuff.szName, nLogicFrame = tBuff.nEndFrame, col = tRule.colScreenHead or tRule.col, nPriority = tItem.nPriority, From 8300ef40f047ceddf9ebf606e5bad52ebfec7fdc Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Sat, 18 Jul 2026 04:26:21 +0800 Subject: [PATCH 07/15] =?UTF-8?q?fix:=20=E7=BC=93=E5=AD=98=E5=9B=A2?= =?UTF-8?q?=E9=98=9F=E6=88=90=E5=91=98=E5=A2=9E=E5=8A=A0=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index 38ace3216..a3ce0b44a 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -2047,18 +2047,32 @@ end -- 团队成员事件 刷新团队成员排序缓存 function D.OnTeamEvent(szEvent) + local me = X.GetClientPlayer() + if not me then + return + end MY_TEAM_MON_MEMBER_CACHE = {} MY_TEAM_MON_MEMBER_ID_MAP = {} - local me = X.GetClientPlayer() if me.IsInParty() then local team = GetClientTeam() if team then for _, vv in ipairs(team.GetTeamMemberList()) do - MY_TEAM_MON_MEMBER_CACHE[#MY_TEAM_MON_MEMBER_CACHE + 1] = { dwID = vv, szName = team.GetClientTeamMemberName(vv) } - MY_TEAM_MON_MEMBER_ID_MAP[vv] = true + local tMemberData = { + dwID = vv, + szName = team.GetClientTeamMemberName(vv) + } + MY_TEAM_MON_MEMBER_ID_MAP[vv] = tMemberData + table.insert(MY_TEAM_MON_MEMBER_CACHE, tMemberData) end table.sort(MY_TEAM_MON_MEMBER_CACHE, function(a, b) return #a.szName > #b.szName end) end + else + local tMemberData = { + dwID = MY_TEAM_MON_CORE_PLAYERID, + szName = MY_TEAM_MON_CORE_NAME + } + MY_TEAM_MON_MEMBER_ID_MAP[MY_TEAM_MON_CORE_PLAYERID] = tMemberData + table.insert(MY_TEAM_MON_MEMBER_CACHE, tMemberData) end end From ab2ce101fe8f5269a4b89d6da8707ab054263e7d Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Sat, 18 Jul 2026 16:55:41 +0800 Subject: [PATCH 08/15] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=88=B7=E6=96=B0=E9=80=BB=E8=BE=91=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E7=8A=B6=E6=80=81=E6=95=B0=E6=8D=AE=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 37 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index a3ce0b44a..08f40a10f 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -2048,32 +2048,35 @@ end -- 团队成员事件 刷新团队成员排序缓存 function D.OnTeamEvent(szEvent) local me = X.GetClientPlayer() - if not me then - return + if not me then + return end - MY_TEAM_MON_MEMBER_CACHE = {} - MY_TEAM_MON_MEMBER_ID_MAP = {} + local tMemberID = {} + local tMemberList = {} if me.IsInParty() then local team = GetClientTeam() if team then for _, vv in ipairs(team.GetTeamMemberList()) do - local tMemberData = { - dwID = vv, - szName = team.GetClientTeamMemberName(vv) + local tMemberData = { + dwID = vv, + szName = team.GetClientTeamMemberName(vv) } - MY_TEAM_MON_MEMBER_ID_MAP[vv] = tMemberData - table.insert(MY_TEAM_MON_MEMBER_CACHE, tMemberData) + tMemberID[vv] = tMemberData + table.insert(tMemberList, tMemberData) end - table.sort(MY_TEAM_MON_MEMBER_CACHE, function(a, b) return #a.szName > #b.szName end) + table.sort(tMemberList, function(a, b) return #a.szName > #b.szName end) end - else - local tMemberData = { - dwID = MY_TEAM_MON_CORE_PLAYERID, - szName = MY_TEAM_MON_CORE_NAME - } - MY_TEAM_MON_MEMBER_ID_MAP[MY_TEAM_MON_CORE_PLAYERID] = tMemberData - table.insert(MY_TEAM_MON_MEMBER_CACHE, tMemberData) end + if #tMemberList == 0 then + local tMemberData = { + dwID = MY_TEAM_MON_CORE_PLAYERID, + szName = MY_TEAM_MON_CORE_NAME + } + tMemberID[MY_TEAM_MON_CORE_PLAYERID] = tMemberData + table.insert(tMemberList, tMemberData) + end + MY_TEAM_MON_MEMBER_CACHE = tMemberList + MY_TEAM_MON_MEMBER_ID_MAP = tMemberID end -- RegisterMsgMonitor From 5f03b7695a6febb88c51c291ced2a6c0ba92536e Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Sat, 18 Jul 2026 17:20:17 +0800 Subject: [PATCH 09/15] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E4=BC=98?= =?UTF-8?q?=E5=85=88=E7=BA=A7=E6=8E=92=E5=BA=8F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_Cataclysm/src/MY_CataclysmMain.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/MY_Cataclysm/src/MY_CataclysmMain.lua b/MY_Cataclysm/src/MY_CataclysmMain.lua index c80403204..5dbc66e40 100644 --- a/MY_Cataclysm/src/MY_CataclysmMain.lua +++ b/MY_Cataclysm/src/MY_CataclysmMain.lua @@ -51,6 +51,7 @@ local function InsertBuffListCache(aBuffList, szVia, nViaPriority) if (not tab.nLevel or tab.nLevel == p.nLevel) and (not tab.szStackOp or tab.szStackOp == p.szStackOp) and (not tab.nStackNum or tab.nStackNum == p.nStackNum) + and (not tab.nPriority or tab.nPriority == p.nPriority) and (not tab.bOnlyMe == not p.bOnlyMe) and (not tab.bOnlyMine == not p.bOnlyMine) and (not tab.bCaution == not p.bCaution) From b9b7cad70e20623db6116fcf05f8545b47ad684a Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Sun, 19 Jul 2026 00:30:31 +0800 Subject: [PATCH 10/15] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=9B=A2?= =?UTF-8?q?=E9=98=9F=E7=9B=91=E6=8E=A7=E5=A4=9A=E6=AE=B5=E5=80=92=E8=AE=A1?= =?UTF-8?q?=E6=97=B6=E6=9D=A1=E8=A7=A3=E6=9E=90=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 38 +++++++- MY_TeamMon/src/MY_TeamMon_SpellTimer.lua | 105 +++++++++++++++++++++-- 2 files changed, 137 insertions(+), 6 deletions(-) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index 08f40a10f..d032ac7bf 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -405,10 +405,12 @@ local function ParseCountdown(szCountdown) local nTime = tonumber(aParams[1]) local szContent = aParams[2] local szVoice + local nIcon, nFrame local szParam, bUnknownParam, bParamRecognized for i = 3, #aParams do szParam = aParams[i] bParamRecognized = false + -- 解析语音 if not szVoice and not bParamRecognized then if szParam:sub(1, 3) == 'VO:' or szParam:sub(1, 3) == 'VC:' then @@ -416,15 +418,31 @@ local function ParseCountdown(szCountdown) bParamRecognized = true end end + -- 解析图标 + if not nIcon and not bParamRecognized then + if szParam:sub(1, 6) == 'nIcon:' then + nIcon = tonumber(szParam:sub(7)) + bParamRecognized = true + end + end + -- 解析背景色 + if not nFrame and not bParamRecognized then + if szParam:sub(1, 7) == 'nFrame:' then + nFrame = tonumber(szParam:sub(8)) + bParamRecognized = true + end + end if not bParamRecognized then bUnknownParam = true end end - if nTime and szContent and nTime and szContent ~= '' and not bUnknownParam then + if nTime and szContent and szContent ~= '' and not bUnknownParam then table.insert(aCountdown, { nTime = nTime, szContent = szContent, szVoice = szVoice, + nIcon = nIcon, + nFrame = nFrame, }) bPartError = false end @@ -464,10 +482,12 @@ local function ParseHPCountdown(szString) local szContent = aParams[2] local nTime local szVoice + local nIcon, nFrame local szParam, bUnknownParam, bParamRecognized for i = 3, #aParams do szParam = aParams[i] bParamRecognized = false + -- 解析语音 if not szVoice and not bParamRecognized then if szParam:sub(1, 3) == 'VO:' or szParam:sub(1, 3) == 'VC:' then @@ -481,6 +501,20 @@ local function ParseHPCountdown(szString) bParamRecognized = true end end + -- 解析图标 + if not nIcon and not bParamRecognized then + if szParam:sub(1, 6) == 'nIcon:' then + nIcon = tonumber(szParam:sub(7)) + bParamRecognized = true + end + end + -- 解析背景色 + if not nFrame and not bParamRecognized then + if szParam:sub(1, 7) == 'nFrame:' then + nFrame = tonumber(szParam:sub(8)) + bParamRecognized = true + end + end if not bParamRecognized then bUnknownParam = true end @@ -492,6 +526,8 @@ local function ParseHPCountdown(szString) szContent = szContent, nTime = nTime, szVoice = szVoice, + nIcon = nIcon, + nFrame = nFrame, }) bPartError = false end diff --git a/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua b/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua index ef30d76fe..d7a6c8428 100644 --- a/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua +++ b/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua @@ -112,6 +112,9 @@ local function CreateCountdown(nType, szKey, tParam, szSender, szReceiver, aBack tTime = { nTime = tParam.nTime, szContent = tParam.szContent, + nIcon = tParam.nIcon, + nFrame = tParam.nFrame, + szVoice = tParam.szVoice, } elseif X.IsString(tParam.nTime) then local aCountdown = ParseCountdown(tParam.nTime, szSender, szReceiver, aBackreferences) @@ -152,13 +155,76 @@ local function CreateCountdown(nType, szKey, tParam, szSender, szReceiver, aBack end elseif tTime.nTime == -2 then ST_TIME_EXPIRE[nType][szKey] = nTime + (tParam.nRefresh or 0) * 1000 - 3 + elseif tTime.nTime == -3 then + -- 修改计时条属性 + local ui = ST_CACHE[nType][szKey] + if ui and ui:IsValid() then + if tParam.nRefresh then + ST_TIME_EXPIRE[nType][szKey] = nTime + tParam.nRefresh * 1000 - 3 + end + local tRefs = ui.tBackreferences or {} + if tParam.nNewTime and X.IsString(tParam.nNewTime) then + local aCountdown = ParseCountdown(tParam.nNewTime, tRefs.szSender, tRefs.szReceiver, tRefs.aBackreferences) + if aCountdown then + ui.countdown = aCountdown + ui.nCreate = nTime + ui.nLeft = nTime + tTime = aCountdown[1] + tParam.nRefresh = tParam.nRefresh or aCountdown[#aCountdown].nTime - 3 + ST_TIME_EXPIRE[nType][szKey] = nTime + (tParam.nRefresh or 0) * 1000 + ui.obj:SetInfo(tTime, tTime.nIcon or tParam.nIcon) + end + + else + if tParam.nNewTime and X.IsNumber(tParam.nNewTime) then + ui.countdown = tParam.nNewTime -- 改成数字,OnFrameBreathe 走单段逻辑 + ui.nCreate = nTime + ui.nLeft = nTime + end + local szNewContent = (tTime.szContent ~= '' and tTime.szContent) + if szNewContent then + szNewContent = FilterCustomText(szNewContent, tRefs.szSender, tRefs.szReceiver, tRefs.aBackreferences) + end + ui.obj:SetInfo({ + nTime = tParam.nNewTime, + szContent = szNewContent, + nIcon = tTime.nIcon, + nFrame = tTime.nFrame, + szVoice = tTime.szVoice, + }, tParam.nIcon) + end + else + if MY_TeamMon.bPushVoiceAlarm and tTime.szVoice then + FireUIEvent('MY_TEAM_MON__VOICE_ALARM', tTime.szVoice) + end + end + elseif tTime.nTime == -4 then + -- 冻结计时条 + local ui = ST_CACHE[nType][szKey] + if ui and ui:IsValid() then + ui.bPaused = true + ui.nPauseTime = nTime + end + elseif tTime.nTime == -5 then + -- 恢复计时条 + local ui = ST_CACHE[nType][szKey] + if ui and ui:IsValid() and ui.bPaused then + local nPauseDuration = nTime - ui.nPauseTime + ui.nCreate = ui.nCreate + nPauseDuration -- 顺延创建时间 + ui.nLeft = ui.nLeft + nPauseDuration -- 顺延当前段起点 + if ST_TIME_EXPIRE[nType][szKey] then + ST_TIME_EXPIRE[nType][szKey] = ST_TIME_EXPIRE[nType][szKey] + nPauseDuration + end + ui.bPaused = false + end else local nExpire = ST_TIME_EXPIRE[nType][szKey] if nExpire and nExpire > nTime then return end + local tBackreferences = {szSender = szSender, szReceiver = szReceiver, aBackreferences = aBackreferences} ST_TIME_EXPIRE[nType][szKey] = nTime + (tParam.nRefresh or 0) * 1000 - ST:ctor(nType, szKey, tParam):SetInfo(tTime, tParam.nIcon or 13):Switch(false) + ST:ctor(nType, szKey, tParam, tBackreferences):SetInfo(tTime, tTime.nIcon or tParam.nIcon or 13):Switch(false) end end @@ -173,6 +239,7 @@ function D.OnFrameCreate() D.hItem = this:CreateItemData(ST_INI_FILE, 'Handle_Item') D.UpdateAnchor(this) D.handle = this:Lookup('', 'Handle_List') + D.handle:SetIgnoreInvisibleChild(true) -- 排版时跳过隐藏的子组件 end function D.OnEvent(szEvent) @@ -242,7 +309,7 @@ function D.OnFrameBreathe() local nNow = GetTime() for k, v in pairs(ST_CACHE) do for kk, vv in pairs(v) do - if vv:IsValid() then + if vv:IsValid() and not vv.bPaused then if type(vv.countdown) == 'number' then local nLeft = vv.countdown - ((nNow - vv.nLeft) / 1000) if nLeft >= 0 then @@ -282,7 +349,7 @@ function D.UpdateAnchor(frame) end -- 构造函数 -function ST:ctor(nType, szKey, tParam) +function ST:ctor(nType, szKey, tParam, tBackreferences) if not ST_CACHE[nType] then return end @@ -300,6 +367,7 @@ function ST:ctor(nType, szKey, tParam) oo.ui.nRefresh = tParam.nRefresh or 1 oo.ui.bTalk = tParam.bTalk oo.ui.nFrame = tParam.nFrame + oo.ui.tBackreferences = tBackreferences or oo.ui.tBackreferences else -- 没有ui的情况下 创建 oo = {} setmetatable(oo, self) @@ -312,6 +380,7 @@ function ST:ctor(nType, szKey, tParam) oo.ui.bTalk = tParam.bTalk oo.ui.nFrame = tParam.nFrame oo.ui.bHold = tParam.bHold + oo.ui.tBackreferences = tBackreferences -- 杂项 oo.ui.nAlpha = 30 -- ui @@ -349,10 +418,36 @@ function ST:SetInfo(tTime, nIcon) ) self.ui:SetUserData(math.floor(tTime.nTime)) end - if nIcon then + -- 修改倒计时条图标 + if nIcon or tTime.nIcon then local box = self.ui:Lookup('Box') box:SetObject(UI_OBJECT_NOT_NEED_KNOWN) - box:SetObjectIcon(nIcon) + box:SetObjectIcon(tTime.nIcon or nIcon) + end + -- 修改倒计时条背景色,设置背景框与显隐,-2隐藏背景、阴影、特效,-3隐藏背景、时间、阴影、特效,-4全隐藏 + local nFrame = tTime.nFrame or self.ui.nFrame + if nFrame == -2 then + self.ui:Show() + self.ui.img:Hide() + self.ui.sha:Hide() + self.ui.sfx:Hide() + elseif nFrame == -3 then + self.ui:Show() + self.ui.img:Hide() + self.ui.sha:Hide() + self.ui.sfx:Hide() + self.ui.time:Hide() + elseif nFrame == -4 then + self.ui:Hide() + else + self.ui:Show() + self.ui.img:Show() + self.ui.time:Show() + self.ui.sha:Show() + self.ui.sfx:Show() + if nFrame then + self.ui.img:SetFrame(nFrame) + end end if MY_TeamMon.bPushVoiceAlarm and tTime.szVoice then FireUIEvent('MY_TEAM_MON__VOICE_ALARM', tTime.szVoice) From 3e1f8963ff1c6b0801ecb617eb3183b236081177 Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Sun, 19 Jul 2026 01:53:57 +0800 Subject: [PATCH 11/15] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BB=84?= =?UTF-8?q?=E9=98=9F=E6=A8=A1=E5=BC=8F=E4=B8=8B=E8=BF=87=E5=9B=BE=E4=B8=8D?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E6=B0=94=E5=8A=B2=E6=8E=A8=E9=80=81=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 10 ++++++++++ MY_TeamMon/src/MY_TeamMon_BuffList.lua | 2 ++ 2 files changed, 12 insertions(+) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index d032ac7bf..94d2b3b80 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -2077,6 +2077,16 @@ function D.FireCrossMapEvent(szWhen) D.OnCallMessage(szEvent, szContent) end MAP_ID = dwMapID + + -- 组队模式下过图后系统没有推送BUFF刷新事件,这里手动补发一下,以后修复了再删除 + local me = X.GetClientPlayer() + if me then + if me.IsInParty() then + for _, tBuff in X.ipairs_c(X.GetBuffList(me)) do + D.OnBuff(me.dwID, false, tBuff.bCanCancel, tBuff.dwID, tBuff.nStackNum, tBuff.nLevel, tBuff.dwSkillSrcID) + end + end + end end end end diff --git a/MY_TeamMon/src/MY_TeamMon_BuffList.lua b/MY_TeamMon/src/MY_TeamMon_BuffList.lua index a091771fa..036042f32 100644 --- a/MY_TeamMon/src/MY_TeamMon_BuffList.lua +++ b/MY_TeamMon/src/MY_TeamMon_BuffList.lua @@ -130,6 +130,8 @@ function D.OnEvent(szEvent) D.UpdateAnchor(this) elseif szEvent == 'ON_ENTER_CUSTOM_UI_MODE' or szEvent == 'ON_LEAVE_CUSTOM_UI_MODE' then UpdateCustomModeWindow(this, _L['Buff list']) + elseif szEvent == 'LOADING_END' then + D.handle:Clear() end end function D.OnItemMouseEnter() From 5c4acc98f85012153926fe9704f2856b7e7b6180 Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Sun, 19 Jul 2026 11:43:17 +0800 Subject: [PATCH 12/15] =?UTF-8?q?fix:=20=E8=BF=87=E5=9B=BE=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E5=9B=A2=E9=98=9F=E6=88=90=E5=91=98=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index 94d2b3b80..9493fa035 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -735,6 +735,7 @@ function D.OnEvent(szEvent) elseif szEvent == 'LOADING_END' or szEvent == 'MY_TEAM_MON_CREATE_CACHE' or szEvent == 'MY_TEAM_MON_LOADING_END' then D.FireCrossMapEvent('before') D.CreateData(szEvent) + D.OnTeamEvent(szEvent) X.DelayCall('MY_TeamMon__FireCrossMapEvent__after', D.FireCrossMapEvent, 'after') elseif szEvent == 'PARTY_ADD_MEMBER' or szEvent == 'PARTY_DELETE_MEMBER' or szEvent == 'PARTY_DISBAND' then D.OnTeamEvent(szEvent) From 67e6ebaa7b635222d1a9fa99eb0393f30f0d3fba Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:30:40 +0800 Subject: [PATCH 13/15] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=87?= =?UTF-8?q?=E5=9B=BE=E5=90=8E=E5=A4=B4=E9=A1=B6=E6=9F=93=E8=89=B2=E6=AE=8B?= =?UTF-8?q?=E7=95=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_LifeBar/src/MY_LifeBar.lua | 1 + MY_LifeBar/src/MY_LifeBar_Official.lua | 10 ++++++++++ MY_LifeBar/src/MY_LifeBar_ScreenArrow.lua | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/MY_LifeBar/src/MY_LifeBar.lua b/MY_LifeBar/src/MY_LifeBar.lua index c683d3495..7366b5a47 100644 --- a/MY_LifeBar/src/MY_LifeBar.lua +++ b/MY_LifeBar/src/MY_LifeBar.lua @@ -206,6 +206,7 @@ X.RegisterEvent('PARTY_UPDATE_BASE_INFO', 'MY_LifeBar', onPartySetMark) local function onLoadingEnd() OVERWRITE_TITLE_EFFECT = {} + COUNTDOWN_CACHE = {} -- 清除缓存,防止不同地图分配相同ID,造成染色污染 end X.RegisterEvent('LOADING_END', onLoadingEnd) end diff --git a/MY_LifeBar/src/MY_LifeBar_Official.lua b/MY_LifeBar/src/MY_LifeBar_Official.lua index de0496cc2..d7ef55dcf 100644 --- a/MY_LifeBar/src/MY_LifeBar_Official.lua +++ b/MY_LifeBar/src/MY_LifeBar_Official.lua @@ -289,11 +289,21 @@ local settings = { MY_LifeBar_Official = X.CreateModule(settings) end +-------------------------------------------------------------------------------- +-- 事件注册 +-------------------------------------------------------------------------------- + X.RegisterEvent({'PLAYER_ENTER_SCENE', 'NPC_ENTER_SCENE'}, 'MY_LifeBar_Official', function() local dwID = arg0 X.DelayCall(function() ApplyCaption(dwID) end) X.DelayCall(200, function() ApplyCaption(dwID) end) X.DelayCall(500, function() ApplyCaption(dwID) end) end) +X.RegisterEvent('LOADING_END', 'MY_LifeBar_Official', function() + for dwID, _ in pairs(COUNTDOWN_CACHE) do + ResetCaption(dwID) + end + COUNTDOWN_CACHE = {} +end) --[[#DEBUG BEGIN]]X.ReportModuleLoading(MODULE_PATH, 'FINISH')--[[#DEBUG END]] diff --git a/MY_LifeBar/src/MY_LifeBar_ScreenArrow.lua b/MY_LifeBar/src/MY_LifeBar_ScreenArrow.lua index 936d010da..04194ad2d 100644 --- a/MY_LifeBar/src/MY_LifeBar_ScreenArrow.lua +++ b/MY_LifeBar/src/MY_LifeBar_ScreenArrow.lua @@ -877,7 +877,11 @@ X.BreatheCall('MY_LifeBar_ScreenArrow', D.OnBreathe) X.RegisterEvent('FIGHT_HINT', 'MY_LifeBar_ScreenArrow', D.RegisterFight) X.RegisterEvent('LOGIN_GAME', 'MY_LifeBar_ScreenArrow', D.Init) X.RegisterEvent('UI_SCALED' , 'MY_LifeBar_ScreenArrow', SetUIScale) - +X.RegisterEvent('LOADING_END', 'MY_LifeBar_ScreenArrow', function() + CACHE[TARGET.NPC] = {} + CACHE[TARGET.PLAYER] = {} + CACHE[TARGET.DOODAD] = {} +end) X.RegisterUserSettingsInit('MY_LifeBar_ScreenArrow', function() D.bReady = true end) From 407a58b728fdc4988dd9f60c926f461d3ab52aa8 Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Tue, 21 Jul 2026 20:23:15 +0800 Subject: [PATCH 14/15] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=B2?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AE=A1=E6=97=B6=E6=9D=A1bHold=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=9C=AA=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon_SpellTimer.lua | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua b/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua index d7a6c8428..c682e8a0d 100644 --- a/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua +++ b/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua @@ -281,12 +281,21 @@ local function SetSTAction(ui, nLeft, nPer) local me = X.GetClientPlayer() local obj = ui.obj if nLeft < 5 then - local nTimeLeft = nLeft * 1000 % 1000 - local nAlpha = 255 * nTimeLeft / 1000 - if math.floor(nLeft / 1) % 2 == 1 then - nAlpha = 255 - nAlpha + if ui.bHoldFrame then + if ui.nAlpha < ST_UI_ALPHA then + ui.nAlpha = math.min(ST_UI_ALPHA, ui.nAlpha + 15) + obj:SetInfo({ nTime = nLeft }):SetPercentage(nPer):SetAlpha(ui.nAlpha) + else + obj:SetInfo({ nTime = nLeft }):SetPercentage(nPer) + end + else + local nTimeLeft = nLeft * 1000 % 1000 + local nAlpha = 255 * nTimeLeft / 1000 + if math.floor(nLeft / 1) % 2 == 1 then + nAlpha = 255 - nAlpha + end + obj:SetInfo({ nTime = nLeft }):SetPercentage(nPer):Switch(true):SetAlpha(100 + nAlpha) end - obj:SetInfo({ nTime = nLeft }):SetPercentage(nPer):Switch(true):SetAlpha(100 + nAlpha) if ui.bTalk and me.IsInParty() then if not ui.szTalk or ui.szTalk ~= math.floor(nLeft) then ui.szTalk = math.floor(nLeft) @@ -367,6 +376,8 @@ function ST:ctor(nType, szKey, tParam, tBackreferences) oo.ui.nRefresh = tParam.nRefresh or 1 oo.ui.bTalk = tParam.bTalk oo.ui.nFrame = tParam.nFrame + oo.ui.bHold = tParam.bHold + oo.ui.bHoldFrame = tParam.bHoldFrame oo.ui.tBackreferences = tBackreferences or oo.ui.tBackreferences else -- 没有ui的情况下 创建 oo = {} @@ -380,6 +391,7 @@ function ST:ctor(nType, szKey, tParam, tBackreferences) oo.ui.bTalk = tParam.bTalk oo.ui.nFrame = tParam.nFrame oo.ui.bHold = tParam.bHold + oo.ui.bHoldFrame = tParam.bHoldFrame oo.ui.tBackreferences = tBackreferences -- 杂项 oo.ui.nAlpha = 30 From 91353c18f5862c203870bad037c3834894985505 Mon Sep 17 00:00:00 2001 From: LyKoiya <226704020+LyKoiya@users.noreply.github.com> Date: Wed, 22 Jul 2026 00:23:31 +0800 Subject: [PATCH 15/15] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=80=92?= =?UTF-8?q?=E8=AE=A1=E6=97=B6=E6=9D=A1=E4=BC=A0=E5=8F=82=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_TeamMon/src/MY_TeamMon.lua | 4 ++++ MY_TeamMon/src/MY_TeamMon_SpellTimer.lua | 30 ++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/MY_TeamMon/src/MY_TeamMon.lua b/MY_TeamMon/src/MY_TeamMon.lua index 9493fa035..87a09b113 100644 --- a/MY_TeamMon/src/MY_TeamMon.lua +++ b/MY_TeamMon/src/MY_TeamMon.lua @@ -1074,10 +1074,14 @@ function D.CountdownEvent(data, nClass, szSender, szReceiver, aBackreferences) nIcon = v.nIcon or data.nIcon or 340, nFrame = v.nFrame, szContent = FilterCustomText(v.szName or data.szName, szSender, szReceiver, aBackreferences), + szRawName = v.szName or data.szName, nTime = v.nTime, nRefresh = v.nRefresh, bTalk = v.bTeamChannel, bHold = v.bHold, + szVoice = v.szVoice, + nNewtime = v.nNewtime, + bHoldFrame = v.bHoldFrame, } D.FireCountdownEvent(nType, szKey, tParam, szSender, szReceiver, aBackreferences) end diff --git a/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua b/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua index c682e8a0d..ee777941c 100644 --- a/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua +++ b/MY_TeamMon/src/MY_TeamMon_SpellTimer.lua @@ -112,9 +112,11 @@ local function CreateCountdown(nType, szKey, tParam, szSender, szReceiver, aBack tTime = { nTime = tParam.nTime, szContent = tParam.szContent, + szRawName = tParam.szRawName, nIcon = tParam.nIcon, nFrame = tParam.nFrame, szVoice = tParam.szVoice, + bHoldFrame = tParam.bHoldFrame, } elseif X.IsString(tParam.nTime) then local aCountdown = ParseCountdown(tParam.nTime, szSender, szReceiver, aBackreferences) @@ -162,9 +164,9 @@ local function CreateCountdown(nType, szKey, tParam, szSender, szReceiver, aBack if tParam.nRefresh then ST_TIME_EXPIRE[nType][szKey] = nTime + tParam.nRefresh * 1000 - 3 end - local tRefs = ui.tBackreferences or {} + local tRefs = ui.tBackreferences or aBackreferences or {} if tParam.nNewTime and X.IsString(tParam.nNewTime) then - local aCountdown = ParseCountdown(tParam.nNewTime, tRefs.szSender, tRefs.szReceiver, tRefs.aBackreferences) + local aCountdown = ParseCountdown(tParam.nNewTime, tRefs.szSender or szSender, tRefs.szReceiver or szReceiver, tRefs.aBackreferences or aBackreferences) if aCountdown then ui.countdown = aCountdown ui.nCreate = nTime @@ -175,23 +177,17 @@ local function CreateCountdown(nType, szKey, tParam, szSender, szReceiver, aBack ui.obj:SetInfo(tTime, tTime.nIcon or tParam.nIcon) end - else - if tParam.nNewTime and X.IsNumber(tParam.nNewTime) then - ui.countdown = tParam.nNewTime -- 改成数字,OnFrameBreathe 走单段逻辑 - ui.nCreate = nTime - ui.nLeft = nTime - end - local szNewContent = (tTime.szContent ~= '' and tTime.szContent) + elseif tParam.nNewTime and X.IsNumber(tParam.nNewTime) and tParam.nNewTime > 0 then + ui.countdown = tParam.nNewTime -- 改成数字,OnFrameBreathe 走单段逻辑 + ui.nCreate = nTime + ui.nLeft = nTime + local szNewContent = (tParam.szRawName ~= '' and tParam.szRawName) if szNewContent then - szNewContent = FilterCustomText(szNewContent, tRefs.szSender, tRefs.szReceiver, tRefs.aBackreferences) + szNewContent = FilterCustomText(szNewContent, tRefs.szSender or szSender, tRefs.szReceiver or szReceiver, tRefs.aBackreferences or aBackreferences) end - ui.obj:SetInfo({ - nTime = tParam.nNewTime, - szContent = szNewContent, - nIcon = tTime.nIcon, - nFrame = tTime.nFrame, - szVoice = tTime.szVoice, - }, tParam.nIcon) + tTime.nTime = tParam.nNewTime + tTime.szContent = szNewContent + ui.obj:SetInfo(tTime, tParam.nIcon) end else if MY_TeamMon.bPushVoiceAlarm and tTime.szVoice then