Skip to content

Commit 96bb280

Browse files
committed
feat: 战斗统计增加精简显示记录数值的选项
1 parent 0ffdb22 commit 96bb280

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

MY_Recount/lang/zhcn.jx3dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ return {
3535
['Group effect with same name' ] = '�ϲ�ͬ������Ч��',
3636
['Hide anonymous effect' ] = '����û���ֵļ�¼',
3737
['Show zero value effect' ] = '��ʾ����ֵ�ļ�¼',
38+
['Simplify value' ] = '������ʾ��ֵ��¼',
3839
['Theme' ] = '�Զ�������ѡ��',
3940
['Max history' ] = '�����ʷ��¼����',
4041

MY_Recount/lang/zhtw.jx3dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ return {
3535
['Group effect with same name' ] = '合併同名技能效果',
3636
['Hide anonymous effect' ] = '隱藏沒名字的記錄',
3737
['Show zero value effect' ] = '顯示零數值的記錄',
38+
['Simplify value' ] = '精簡顯示數值記錄',
3839
['Theme' ] = '自定界面風格選擇',
3940
['Max history' ] = '最大歷史記錄設置',
4041

MY_Recount/src/MY_Recount.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ function D.GetTargetShowName(szName, bPlayer)
9393
return szName
9494
end
9595

96+
function D.GetTargetShowValue(nValue)
97+
if MY_Recount_UI.bSimplifyValue then
98+
return X.FormatNumberDot(nValue, 1, false, true)
99+
end
100+
return nValue
101+
end
102+
96103
function D.IsImportantEffect(v)
97104
if not v then
98105
return false
@@ -259,6 +266,15 @@ function D.GetMenu()
259266
end,
260267
fnDisable = IsUIDisabled,
261268
},
269+
{
270+
szOption = _L['Simplify value'],
271+
bCheck = true,
272+
bChecked = MY_Recount_UI.bSimplifyValue,
273+
fnAction = function()
274+
MY_Recount_UI.bSimplifyValue = not MY_Recount_UI.bSimplifyValue
275+
end,
276+
fnDisable = IsUIDisabled,
277+
},
262278
}
263279

264280
if MY_CombatLogs and MY_CombatLogs.GetOptionsMenu then
@@ -604,6 +620,7 @@ local settings = {
604620
'GetHistoryMenu',
605621
'GetPublishMenu',
606622
'GetTargetShowName',
623+
'GetTargetShowValue',
607624
'IsImportantEffect',
608625
'StatContainsImportantEffect',
609626
'StatSkillContainsImportantEffect',

MY_Recount/src/MY_Recount_UI.lua

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ local O = X.CreateUserSettingsModule('MY_Recount_UI', _L['Raid'], {
136136
xSchema = X.Schema.Boolean,
137137
xDefaultValue = false,
138138
},
139+
bSimplifyValue = { -- 显示简化数值
140+
ePathType = X.PATH_TYPE.ROLE,
141+
szLabel = _L['MY_Recount'],
142+
xSchema = X.Schema.Boolean,
143+
xDefaultValue = false,
144+
},
139145
nDisplayMode = { -- 统计显示模式(显示NPC/玩家数据)(默认混合显示)
140146
ePathType = X.PATH_TYPE.ROLE,
141147
szLabel = _L['MY_Recount'],
@@ -372,15 +378,15 @@ function D.UpdateUI(frame)
372378
-- 数值显示
373379
if MY_Recount_UI.bShowEffect then
374380
if MY_Recount_UI.bShowPerSec then
375-
hItem:Lookup('Text_R'):SetText(math.floor(p.nEffectValue / p.nTimeCount) .. ' ' .. szUnit)
381+
hItem:Lookup('Text_R'):SetText(MY_Recount.GetTargetShowValue(math.floor(p.nEffectValue / p.nTimeCount)) .. ' ' .. szUnit)
376382
else
377-
hItem:Lookup('Text_R'):SetText(p.nEffectValue)
383+
hItem:Lookup('Text_R'):SetText(MY_Recount.GetTargetShowValue(p.nEffectValue))
378384
end
379385
else
380386
if MY_Recount_UI.bShowPerSec then
381-
hItem:Lookup('Text_R'):SetText(math.floor(p.nValue / p.nTimeCount) .. ' ' .. szUnit)
387+
hItem:Lookup('Text_R'):SetText(MY_Recount.GetTargetShowValue(math.floor(p.nValue / p.nTimeCount)) .. ' ' .. szUnit)
382388
else
383-
hItem:Lookup('Text_R'):SetText(p.nValue)
389+
hItem:Lookup('Text_R'):SetText(MY_Recount.GetTargetShowValue(p.nValue))
384390
end
385391
end
386392
hItem.data = p
@@ -705,6 +711,7 @@ local settings = {
705711
'bShowPerSec',
706712
'bShowEffect',
707713
'bShowZeroVal',
714+
'bSimplifyValue',
708715
'nDisplayMode',
709716
'nDrawInterval',
710717
'bShowNodataTeammate',
@@ -727,6 +734,7 @@ local settings = {
727734
'bShowPerSec',
728735
'bShowEffect',
729736
'bShowZeroVal',
737+
'bSimplifyValue',
730738
'nDisplayMode',
731739
'nDrawInterval',
732740
'bShowNodataTeammate',
@@ -743,6 +751,7 @@ local settings = {
743751
bShowPerSec = function() FireUIEvent('MY_RECOUNT_UI_CONFIG_UPDATE') end,
744752
bShowEffect = function() FireUIEvent('MY_RECOUNT_UI_CONFIG_UPDATE') end,
745753
bShowZeroVal = function() FireUIEvent('MY_RECOUNT_UI_CONFIG_UPDATE') end,
754+
bSimplifyValue = function() FireUIEvent('MY_RECOUNT_UI_CONFIG_UPDATE') end,
746755
nDisplayMode = function() FireUIEvent('MY_RECOUNT_UI_CONFIG_UPDATE') end,
747756
bShowNodataTeammate = function() FireUIEvent('MY_RECOUNT_UI_CONFIG_UPDATE') end,
748757
},

0 commit comments

Comments
 (0)