- 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:
Parnic
2009-04-04 18:34:33 +00:00
parent a6222135db
commit 56fc146f56
2 changed files with 37 additions and 8 deletions

View File

@ -522,7 +522,7 @@ IceHUD.options =
desc = 'Creates a new customized bar', desc = 'Creates a new customized bar',
func = function() func = function()
IceHUD.IceCore:AddNewDynamicModule(IceCustomBar:new()) 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, end,
order = 94.5 order = 94.5
}, },
@ -588,8 +588,8 @@ IceHUD.slashMenu =
StaticPopupDialogs["ICEHUD_RESET"] = StaticPopupDialogs["ICEHUD_RESET"] =
{ {
text = "Are you sure you want to reset IceHUD settings?", text = "Are you sure you want to reset IceHUD settings?",
button1 = "Okay", button1 = OKAY,
button2 = "Cancel", button2 = CANCEL,
timeout = 0, timeout = 0,
whileDead = 1, whileDead = 1,
hideOnEscape = 1, hideOnEscape = 1,
@ -598,6 +598,28 @@ StaticPopupDialogs["ICEHUD_RESET"] =
end 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() function IceHUD:OnInitialize()
self:SetDebugging(false) self:SetDebugging(false)

View File

@ -28,6 +28,8 @@ function IceCustomBar.prototype:Enable(core)
self:SetBottomText2("") self:SetBottomText2("")
self.unit = self.moduleSettings.myUnit self.unit = self.moduleSettings.myUnit
self:Update(self.unit)
end end
function IceCustomBar.prototype:TargetChanged() function IceCustomBar.prototype:TargetChanged()
@ -53,7 +55,7 @@ function IceCustomBar.prototype:GetDefaultSettings()
settings["upperText"]="" settings["upperText"]=""
settings["usesDogTagStrings"] = false settings["usesDogTagStrings"] = false
settings["lockLowerFontAlpha"] = false settings["lockLowerFontAlpha"] = false
settings["lowerTextString"] = "" settings["lowerText"] = ""
settings["lowerTextVisible"] = false settings["lowerTextVisible"] = false
settings["isCustomBar"] = true settings["isCustomBar"] = true
settings["buffToTrack"] = "" settings["buffToTrack"] = ""
@ -78,10 +80,12 @@ function IceCustomBar.prototype:GetOptions()
opts["deleteme"] = { opts["deleteme"] = {
type = 'execute', type = 'execute',
name = 'Delete me', name = 'Delete me',
desc = 'Deletes me', desc = 'Deletes this custom module and all associated settings. Cannot be undone!',
func = function() func = function()
-- need to add a confirmation box here local dialog = StaticPopup_Show("ICEHUD_DELETE_CUSTOM_MODULE")
IceHUD.IceCore:DeleteDynamicModule(self) if dialog then
dialog.data = self
end
end, end,
order = 20.1 order = 20.1
} }
@ -138,6 +142,9 @@ function IceCustomBar.prototype:GetOptions()
return self.moduleSettings.buffToTrack return self.moduleSettings.buffToTrack
end, end,
set = function(v) set = function(v)
if self.moduleSettings.buffToTrack == self.moduleSettings.upperText then
self.moduleSettings.upperText = v
end
self.moduleSettings.buffToTrack = v self.moduleSettings.buffToTrack = v
self:Redraw() self:Redraw()
end, end,
@ -155,7 +162,7 @@ function IceCustomBar.prototype:GetOptions()
self.moduleSettings.barColor.r = r self.moduleSettings.barColor.r = r
self.moduleSettings.barColor.g = g self.moduleSettings.barColor.g = g
self.moduleSettings.barColor.b = b self.moduleSettings.barColor.b = b
self.barFrame:SetStatusBarColor(self.moduleSettings.barColor) self.barFrame:SetStatusBarColor(self:GetBarColor())
end, end,
order = 43, order = 43,
} }