mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- added information dialog when creating a new custom bar about how to use it
- added confirmation dialog when deleting a custom bar to tell the user that it cannot be undone - made the custom bar's upper text match the buff/debuff that the user wants to track (it's still editable by the user, but it defaults to the buff name) - made bar color apply properly when the module is created and when configuring without the bar active
This commit is contained in:
28
IceHUD.lua
28
IceHUD.lua
@ -522,7 +522,7 @@ IceHUD.options =
|
||||
desc = 'Creates a new customized bar',
|
||||
func = function()
|
||||
IceHUD.IceCore:AddNewDynamicModule(IceCustomBar:new())
|
||||
-- need to add a dialog box encouraging user to rename the bar first
|
||||
StaticPopup_Show("ICEHUD_CUSTOM_BAR_CREATED")
|
||||
end,
|
||||
order = 94.5
|
||||
},
|
||||
@ -588,8 +588,8 @@ IceHUD.slashMenu =
|
||||
StaticPopupDialogs["ICEHUD_RESET"] =
|
||||
{
|
||||
text = "Are you sure you want to reset IceHUD settings?",
|
||||
button1 = "Okay",
|
||||
button2 = "Cancel",
|
||||
button1 = OKAY,
|
||||
button2 = CANCEL,
|
||||
timeout = 0,
|
||||
whileDead = 1,
|
||||
hideOnEscape = 1,
|
||||
@ -598,6 +598,28 @@ StaticPopupDialogs["ICEHUD_RESET"] =
|
||||
end
|
||||
}
|
||||
|
||||
StaticPopupDialogs["ICEHUD_CUSTOM_BAR_CREATED"] =
|
||||
{
|
||||
text = "A custom bar has been created and can be configured through Module Settings => MyCustomBar. It is highly recommended that you change the bar name of this module ASAP because creating two custom bars with the same name is bad.",
|
||||
button1 = OKAY,
|
||||
timeout = 0,
|
||||
whileDead = 1,
|
||||
hideOnEscape = 0,
|
||||
}
|
||||
|
||||
StaticPopupDialogs["ICEHUD_DELETE_CUSTOM_MODULE"] =
|
||||
{
|
||||
text = "Are you sure you want to delete this module? This will remove all settings associated with this bar and cannot be un-done.",
|
||||
button1 = "Yes",
|
||||
button2 = "No",
|
||||
timeout = 0,
|
||||
whileDead = 1,
|
||||
hideOnEscape = 0,
|
||||
OnAccept = function(self)
|
||||
IceHUD.IceCore:DeleteDynamicModule(self.data)
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
function IceHUD:OnInitialize()
|
||||
self:SetDebugging(false)
|
||||
|
@ -28,6 +28,8 @@ function IceCustomBar.prototype:Enable(core)
|
||||
self:SetBottomText2("")
|
||||
|
||||
self.unit = self.moduleSettings.myUnit
|
||||
|
||||
self:Update(self.unit)
|
||||
end
|
||||
|
||||
function IceCustomBar.prototype:TargetChanged()
|
||||
@ -53,7 +55,7 @@ function IceCustomBar.prototype:GetDefaultSettings()
|
||||
settings["upperText"]=""
|
||||
settings["usesDogTagStrings"] = false
|
||||
settings["lockLowerFontAlpha"] = false
|
||||
settings["lowerTextString"] = ""
|
||||
settings["lowerText"] = ""
|
||||
settings["lowerTextVisible"] = false
|
||||
settings["isCustomBar"] = true
|
||||
settings["buffToTrack"] = ""
|
||||
@ -78,10 +80,12 @@ function IceCustomBar.prototype:GetOptions()
|
||||
opts["deleteme"] = {
|
||||
type = 'execute',
|
||||
name = 'Delete me',
|
||||
desc = 'Deletes me',
|
||||
desc = 'Deletes this custom module and all associated settings. Cannot be undone!',
|
||||
func = function()
|
||||
-- need to add a confirmation box here
|
||||
IceHUD.IceCore:DeleteDynamicModule(self)
|
||||
local dialog = StaticPopup_Show("ICEHUD_DELETE_CUSTOM_MODULE")
|
||||
if dialog then
|
||||
dialog.data = self
|
||||
end
|
||||
end,
|
||||
order = 20.1
|
||||
}
|
||||
@ -138,6 +142,9 @@ function IceCustomBar.prototype:GetOptions()
|
||||
return self.moduleSettings.buffToTrack
|
||||
end,
|
||||
set = function(v)
|
||||
if self.moduleSettings.buffToTrack == self.moduleSettings.upperText then
|
||||
self.moduleSettings.upperText = v
|
||||
end
|
||||
self.moduleSettings.buffToTrack = v
|
||||
self:Redraw()
|
||||
end,
|
||||
@ -155,7 +162,7 @@ function IceCustomBar.prototype:GetOptions()
|
||||
self.moduleSettings.barColor.r = r
|
||||
self.moduleSettings.barColor.g = g
|
||||
self.moduleSettings.barColor.b = b
|
||||
self.barFrame:SetStatusBarColor(self.moduleSettings.barColor)
|
||||
self.barFrame:SetStatusBarColor(self:GetBarColor())
|
||||
end,
|
||||
order = 43,
|
||||
}
|
||||
|
Reference in New Issue
Block a user