mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
Only allow custom bars to track players in Classic
This commit is contained in:
@ -81,6 +81,10 @@ function IceCustomBar.prototype:Disable(core)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function IceCustomBar.prototype:GetUnitToTrack()
|
function IceCustomBar.prototype:GetUnitToTrack()
|
||||||
|
if IceHUD.WowClassic then
|
||||||
|
return "player"
|
||||||
|
end
|
||||||
|
|
||||||
if self.moduleSettings.myUnit == "other" then
|
if self.moduleSettings.myUnit == "other" then
|
||||||
if self.moduleSettings.customUnit ~= nil and self.moduleSettings.customUnit ~= "" then
|
if self.moduleSettings.customUnit ~= nil and self.moduleSettings.customUnit ~= "" then
|
||||||
return self.moduleSettings.customUnit
|
return self.moduleSettings.customUnit
|
||||||
@ -258,51 +262,53 @@ function IceCustomBar.prototype:GetOptions()
|
|||||||
order = 30.3,
|
order = 30.3,
|
||||||
}
|
}
|
||||||
|
|
||||||
opts["unitToTrack"] = {
|
if not IceHUD.WowClassic then
|
||||||
type = 'select',
|
opts["unitToTrack"] = {
|
||||||
values = validUnits,
|
type = 'select',
|
||||||
name = L["Unit to track"],
|
values = validUnits,
|
||||||
desc = L["Select which unit that this bar should be looking for buffs/debuffs on"],
|
name = L["Unit to track"],
|
||||||
get = function(info)
|
desc = L["Select which unit that this bar should be looking for buffs/debuffs on"],
|
||||||
return IceHUD:GetSelectValue(info, self.moduleSettings.myUnit)
|
get = function(info)
|
||||||
end,
|
return IceHUD:GetSelectValue(info, self.moduleSettings.myUnit)
|
||||||
set = function(info, v)
|
end,
|
||||||
self.moduleSettings.myUnit = info.option.values[v]
|
set = function(info, v)
|
||||||
self.unit = self:GetUnitToTrack()
|
self.moduleSettings.myUnit = info.option.values[v]
|
||||||
self:RegisterFontStrings()
|
self.unit = self:GetUnitToTrack()
|
||||||
self:ConditionalSubscribe()
|
self:RegisterFontStrings()
|
||||||
self:Redraw()
|
self:ConditionalSubscribe()
|
||||||
self:UpdateCustomBar(self.unit)
|
self:Redraw()
|
||||||
IceHUD:NotifyOptionsChange()
|
self:UpdateCustomBar(self.unit)
|
||||||
end,
|
IceHUD:NotifyOptionsChange()
|
||||||
disabled = function()
|
end,
|
||||||
return not self.moduleSettings.enabled
|
disabled = function()
|
||||||
end,
|
return not self.moduleSettings.enabled
|
||||||
order = 30.4,
|
end,
|
||||||
}
|
order = 30.4,
|
||||||
|
}
|
||||||
|
|
||||||
opts["customUnitToTrack"] = {
|
opts["customUnitToTrack"] = {
|
||||||
type = 'input',
|
type = 'input',
|
||||||
name = L["Custom unit"],
|
name = L["Custom unit"],
|
||||||
desc = L["Any valid unit id such as: party1, raid14, targettarget, etc. Not guaranteed to work with all unit ids.\n\nRemember to press ENTER after filling out this box with the name you want or it will not save."],
|
desc = L["Any valid unit id such as: party1, raid14, targettarget, etc. Not guaranteed to work with all unit ids.\n\nRemember to press ENTER after filling out this box with the name you want or it will not save."],
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.customUnit
|
return self.moduleSettings.customUnit
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.customUnit = v
|
self.moduleSettings.customUnit = v
|
||||||
self.unit = self:GetUnitToTrack()
|
self.unit = self:GetUnitToTrack()
|
||||||
self:RegisterFontStrings()
|
self:RegisterFontStrings()
|
||||||
self:ConditionalSubscribe()
|
self:ConditionalSubscribe()
|
||||||
self:Redraw()
|
self:Redraw()
|
||||||
self:UpdateCustomBar(self.unit)
|
self:UpdateCustomBar(self.unit)
|
||||||
IceHUD:NotifyOptionsChange()
|
IceHUD:NotifyOptionsChange()
|
||||||
end,
|
end,
|
||||||
hidden = function()
|
hidden = function()
|
||||||
return self.moduleSettings.myUnit ~= "other"
|
return self.moduleSettings.myUnit ~= "other"
|
||||||
end,
|
end,
|
||||||
usage = "<what custom unit to track when unitToTrack is set to 'other'>",
|
usage = "<what custom unit to track when unitToTrack is set to 'other'>",
|
||||||
order = 30.45,
|
order = 30.45,
|
||||||
}
|
}
|
||||||
|
end
|
||||||
|
|
||||||
opts["buffOrDebuff"] = {
|
opts["buffOrDebuff"] = {
|
||||||
type = 'select',
|
type = 'select',
|
||||||
|
Reference in New Issue
Block a user