Skip to content

Commit

Permalink
feat: 焦点角色备注中的目标加入公共地图判定逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
tinymins committed Oct 9, 2021
1 parent 73bf0b0 commit 93e495d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
29 changes: 17 additions & 12 deletions MY_Focus/src/MY_Focus.PS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ function PS.OnPanelActive(wnd)
imageframe = 10,
autoenable = function() return MY_Focus.IsEnabled() end,
})

ui:Append('WndCheckBox', {
x = x, y = y, w = wr, text = _L['Auto focus tong'],
checked = MY_Focus.bFocusTong,
Expand All @@ -310,6 +309,23 @@ function PS.OnPanelActive(wnd)
})
y = y + deltaY

ui:Append('Image', {
x = x + 5, y = y - 3, w = 10, h = 8,
image = 'ui/Image/UICommon/ScienceTree.UITex',
imageframe = 10,
autoenable = function() return MY_Focus.IsEnabled() end,
})
ui:Append('WndCheckBox', {
x = x, y = y, w = wr, text = _L['Anmerkungen auto focus'],
checked = MY_Focus.bFocusAnmerkungen,
oncheck = function(bChecked)
MY_Focus.bFocusAnmerkungen = bChecked
MY_Focus.RescanNearby()
end,
autoenable = function() return MY_Focus.IsEnabled() end,
})
y = y + deltaY

ui:Append('Image', {
x = x + 5, y = y, w = 10, h = 10,
image = 'ui/Image/UICommon/ScienceTree.UITex',
Expand Down Expand Up @@ -366,17 +382,6 @@ function PS.OnPanelActive(wnd)
})
y = y + deltaY

ui:Append('WndCheckBox', {
x = x, y = y, w = wr, text = _L['Anmerkungen auto focus'],
checked = MY_Focus.bFocusAnmerkungen,
oncheck = function(bChecked)
MY_Focus.bFocusAnmerkungen = bChecked
MY_Focus.RescanNearby()
end,
autoenable = function() return MY_Focus.IsEnabled() end,
})
y = y + deltaY

ui:Append('WndCheckBox', {
x = x, y = y, w = wr, text = _L['Show focus\'s target'],
checked = MY_Focus.bShowTarget,
Expand Down
23 changes: 11 additions & 12 deletions MY_Focus/src/MY_Focus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,17 @@ function D.OnObjectEnterScene(dwType, dwID, nRetryCount)
end
else
if not O.bOnlyPublicMap or (not X.IsInBattleField() and not X.IsInDungeon() and not X.IsInArena()) then
-- 判断角色备注
if dwType == TARGET.PLAYER
and O.bFocusAnmerkungen
and MY_Anmerkungen
and MY_Anmerkungen.GetPlayerNote(dwID) then
table.insert(aVia, {
bDeletable = false,
szVia = _L['Anmerkungen'],
})
bFocus = true
end
-- 判断好友
if dwType == TARGET.PLAYER
and O.bFocusFriend
Expand Down Expand Up @@ -669,18 +680,6 @@ function D.OnObjectEnterScene(dwType, dwID, nRetryCount)
bFocus = true
end

-- 判断角色备注
if not bFocus and O.bFocusAnmerkungen
and dwType == TARGET.PLAYER
and MY_Anmerkungen
and MY_Anmerkungen.GetPlayerNote(dwID) then
table.insert(aVia, {
bDeletable = false,
szVia = _L['Anmerkungen'],
})
bFocus = true
end

-- 判断屏蔽的NPC
if bFocus and dwType == TARGET.NPC and X.IsShieldedNpc(dwTemplateID, 'FOCUS') and X.IsRestricted('MY_Focus.SHILDED_NPC') then
bFocus = false
Expand Down

0 comments on commit 93e495d

Please sign in to comment.