WoWInterface SVN BearinMind

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 3 to Rev 4
    Reverse comparison

Rev 3 → Rev 4

Bear in Mind/Bear in Mind.toc
2,7 → 2,7
## Title: Bear in Mind
## Author: Seerah
## Notes: An addon to remind you of things.
## Version: 0.1
## Version: 0.1.1
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibAdvancedIconSelector-1.0
## SavedVariables: BearInMindDB
## SavedVariablesPerCharacter: BearInMindPCDB
Bear in Mind/BiM_options.lua
56,6 → 56,8
AISwindow:Show()
if reminder.data.iconID then
AISwindow.icons:SetSelectedIcon(reminder.data.iconID)
else
AISwindow:SetSearchParameter("", true)
end
end
 
168,6 → 170,7
name = "Edit a Reminder",
desc = "Select a reminder to edit.",
type = "select",
disabled = function() return #zr == 0 end,
values = function()
wipe(dropdownContents)
for i = 1, #zr do
309,6 → 312,7
name = "Edit a Reminder",
desc = "Select a reminder to edit.",
type = "select",
disabled = function() return #er == 0 end,
values = function()
wipe(dropdownContents)
for i = 1, #er do
395,7 → 399,7
},
event = {
name = "Remind on which event?",
desc = "What event should cause your reminder to display? Note: make sure you spell your event name correctly and in all caps. If you want your reminder to fire at PLAYER_LOGIN, set up a login-based reminder instead."
desc = "What event should cause your reminder to display?\n\nNote: make sure you spell your event name correctly and in all caps, complete with any underscores. Example: PLAYER_UPDATE_RESTING\n\nIf you want your reminder to fire at PLAYER_LOGIN, set up a login-based reminder instead.",
type = "input",
width = "double",
get = function() return ere and er[ere].event or "" end,
449,9 → 453,10
name = "Edit a Reminder",
desc = "Select a reminder to edit.",
type = "select",
disabled = function() return #lr == 0 end,
values = function()
wipe(dropdownContents)
for i = 1, #er do
for i = 1, #lr do
tinsert(dropdownContents, lr[i].name)
end
return dropdownContents
488,7 → 493,7
OpenIconBrowser(lr[lre])
end,
image = function()
if ere and lr[lre].data.icon then
if lre and lr[lre].data.icon then
return lr[lre].data.icon
else
return sampleData.icon --or empty image?
577,6 → 582,7
name = "Edit a Reminder",
desc = "Select a reminder to edit.",
type = "select",
disabled = function() return #dr == 0 end,
values = function()
wipe(dropdownContents)
for i = 1, #dr do
663,12 → 669,12
},
day = {
name = "Remind on which day?",
desc = "Logging in on which day should cause your reminder to display?"
desc = "Logging in on which day should cause your reminder to display?",
type = "select",
values = BiM.dayMap
values = BiM.dayMap,
get = function() return dre and dr[dre].day or nil end,
set = function(_, dayID)
dr[dre].day = BiM.dayMap[dayID]
dr[dre].day = dayID
end,
order = 6,
},
716,9 → 722,10
name = "Edit a Reminder",
desc = "Select a reminder to edit.",
type = "select",
disabled = function() return #tr == 0 end,
values = function()
wipe(dropdownContents)
for i = 1, #er do
for i = 1, #tr do
tinsert(dropdownContents, tr[i].name)
end
return dropdownContents
802,7 → 809,7
},
time = {
name = "Remind at what time?",
desc = "What time of day should cause your reminder to display? Note: Time should be in 12-hour format, followed by a space, then either AM or PM (capitals). Examples: 11:45 AM or 3:30 PM"
desc = "At what time of day should your reminder display?\n\nNote: Time should be in 12-hour format, followed by a space, then either AM or PM (capitals). Examples: 11:45 AM or 3:30 PM",
type = "input",
get = function() return tre and tr[tre].time or "" end,
set = function(_, time)
843,16 → 850,14
db[k] = v
end
end
if not db.reminders or #db.reminders == 0 then
db.reminders = {
zone = {},
db.reminders = db.reminders or
{ zone = {},
event = {},
day = {},
time = {},
login = {},
custom = {},
},
end
}
 
LibStub("AceConfig-3.0"):RegisterOptionsTable(addonName, options)
BiM.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(addonName, addonName)
Bear in Mind/BiM.lua
30,7 → 30,7
local icon = line.icon
icon:SetPoint("LEFT")
icon:SetSize(40, 40)
icon:RegisterForClicks("AnyUp")
icon:RegisterForClicks("RightButtonUp")
icon:SetScript("OnClick", function() BiM.HideReminder(line) end)
 
line.text = line:CreateFontString()
38,7 → 38,9
text:SetPoint("LEFT", icon, "RIGHT", 5, 0)
text:SetSize(225, 40)
text:SetJustifyH("LEFT")
text:SetFont(LSM:Fetch("font", db.font), db.fSize)
text:SetFont(LSM:Fetch("font", db.font), db.fSize) --, "OUTLINE")
text:SetShadowColor(0, 0, 0)
text:SetShadowOffset(1, -1)
text:SetTextColor(db.fColor.r, db.fColor.g, db.fColor.b)
 
tinsert(lines, line) --insert our new line at the end of the table
50,8 → 52,10
 
function BiM.ConfigureLine(line, data)
line.data = data
line.icon:SetNormalTexture(data.icon)
line.text:SetText(data.text)
local icon = data.icon or "Interface\\AddOns\\Bear in Mind\\BiM-icon"
local text = data.text or "Remember... something?"
line.icon:SetNormalTexture(icon)
line.text:SetText(text)
if data.sound then
PlaySoundFile(LSM:Fetch("sound", data.sound))
end
206,7 → 210,9
--listen for event reminders
local eventReminders = db.reminders.event
for i = 1, #eventReminders do
eventFrame:RegisterEvent(eventReminders[i].event)
if eventReminders[i].event then
eventFrame:RegisterEvent(eventReminders[i].event)
end
end
--check for any reminders for a certain time and start C_Timer.After
CheckForCertainTimeReminders()