/trunk/Bear in Mind
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() |
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 |
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 |
--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() |
## 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 |
AISwindow:Show() |
if reminder.data.iconID then |
AISwindow.icons:SetSelectedIcon(reminder.data.iconID) |
else |
AISwindow:SetSearchParameter("", true) |
end |
end |
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 |
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 |
}, |
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, |
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 |
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? |
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 |
}, |
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, |
}, |
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 |
}, |
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) |
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) |