mirror of
https://github.com/waynebian01/Shigure.git
synced 2026-09-03 07:15:24 +08:00
添加宠物状态判断.主要判断是否有宠物存在
This commit is contained in:
@@ -98,6 +98,7 @@ function Fuyutsui:OnEnable()
|
||||
self:RegisterEvent("PLAYER_ALIVE")
|
||||
self:RegisterEvent("PLAYER_UNGHOST")
|
||||
self:RegisterEvent("PLAYER_MOUNT_DISPLAY_CHANGED")
|
||||
self:RegisterEvent("UNIT_PET")
|
||||
self:RegisterEvent("PLAYER_REGEN_DISABLED")
|
||||
self:RegisterEvent("PLAYER_REGEN_ENABLED")
|
||||
self:RegisterEvent("PLAYER_STARTED_MOVING")
|
||||
|
||||
@@ -63,6 +63,12 @@ function Fuyutsui:PLAYER_MOUNT_DISPLAY_CHANGED()
|
||||
self:UpdatePlayerMounted()
|
||||
end
|
||||
|
||||
function Fuyutsui:UNIT_PET(_, unit)
|
||||
if unit == "player" then
|
||||
self:UpdatePlayerPet()
|
||||
end
|
||||
end
|
||||
|
||||
function Fuyutsui:PLAYER_REGEN_DISABLED()
|
||||
self:UpdateTargetCanAttack()
|
||||
state.combat = true
|
||||
|
||||
@@ -31,6 +31,7 @@ function Fuyutsui:GetCharacterSpecInfo()
|
||||
self:LoadPlayerBlocks(self.state.specIndex)
|
||||
self:UpdateSpellKnown()
|
||||
self:UpdatePlayerMounted()
|
||||
self:UpdatePlayerPet()
|
||||
self:UpdateGroup()
|
||||
-- 登录阶段其他插件可能稍后写入覆盖绑定;首次加载延后 5 秒,确保本插件最后绑定。
|
||||
C_Timer.After(5, function()
|
||||
@@ -257,6 +258,11 @@ function Fuyutsui:UpdatePlayerBarInfo()
|
||||
end
|
||||
end
|
||||
|
||||
function Fuyutsui:UpdatePlayerPet()
|
||||
state.hasPet = UnitExists("pet") and 1 / 255 or 0
|
||||
self:UpdateStateBlock("状态", "宠物")
|
||||
end
|
||||
|
||||
function Fuyutsui:UpdatePlayerMounted()
|
||||
state.mounted = IsMounted() or state.shapeshiftFormID == 27 or state.shapeshiftFormID == 3 or
|
||||
state.shapeshiftFormID == 29
|
||||
|
||||
@@ -116,6 +116,7 @@ local stateBlockGetters = {
|
||||
["有效性"] = function() return state.valid or 0 end,
|
||||
["战斗时间"] = function() return state.combatTime or 0 end,
|
||||
["移动"] = function() return state.moving or 0 end,
|
||||
["宠物"] = function() return state.hasPet or 0 end,
|
||||
["生命值"] = function() return state.healthPercent or 0 end,
|
||||
["一键辅助"] = function() return state.assistantSpell or 0 end,
|
||||
["插入法术"] = function() return state.insertSpell or 0 end,
|
||||
|
||||
@@ -7,6 +7,7 @@ function Fuyutsui:UpdatePlayerBlocks()
|
||||
self.state.drinkStatus = false
|
||||
self.state.mountCasting = false
|
||||
self:UpdatePlayerMounted()
|
||||
self:UpdatePlayerPet()
|
||||
self:UpdatePlayerCombat()
|
||||
self:UpdatePlayerMoving(IsPlayerMoving())
|
||||
self:UpdatePlayerCastBlocks()
|
||||
|
||||
@@ -40,7 +40,7 @@ internal static class ClassStateCatalog
|
||||
[
|
||||
(CategoryState,
|
||||
[
|
||||
"职业", "专精", "有效性", "战斗时间", "移动",
|
||||
"职业", "专精", "有效性", "战斗时间", "移动", "宠物",
|
||||
"生命值", "一键辅助", "插入法术", "队伍类型", "队伍人数",
|
||||
"首领战", "难度", "英雄天赋", "施法目标", "施法技能",
|
||||
"敌人数量", "敌人数-无仇恨", "敌人数-有仇恨",
|
||||
|
||||
Reference in New Issue
Block a user