-- @Author: Cody Smith -- @Date: 2015-08-11 12:49:48 -- @Last Modified by: Cody Smith -- @Last Modified time: 2015-08-11 13:35:14 local LAM2 = LibStub("LibAddonMenu-2.0") function getSavedNotes(playername) --access save table and return table of getNotes end function readNotes(playername) --access guild notes and parse as table local tbl = {} local numGuildMembers = GetNumGuildMembers(GNM.gid) for i = 1, numGuildMembers do local name,note,rankIndex = GetGuildMemberInfo(GNM.gid, i) if name == playername then tbl = parseNotes(note) end end return tbl end function saveNotes(table,playername) --save any notes in our table of notes end function parseNotes(noteString) local tbl = {} for k,v in string.gmatch(noteString,"([^[]+):([^]]+)") do tbl[k] = v end return tbl end local function onMemberAdd(eventCode, guildId, DisplayName) if guildId == GNM.gid then local notes = readNotes(DisplayName) end end ---------------------LAM 2.0 SETTINGS-------------------------- local function CreateSettingsMenu() local colorYellow = "|cFFFF22" local panelData = { type = "panel", name = "Guild Note Manager", displayName = colorYellow.."Talen-Shei's Guild Note Manager", author = "Talen-Shei", version = GNM.CODE_VERSION, slashCommand = "/gnm", registerForRefresh = true, registerForDefaults = true, } local cntrlOptionsPanel = LAM2:RegisterAddonPanel("GNM_Options", panelData) optionsData = { [1] = { type = "header", name = colorYellow.."Loading", width = "full", }, [2] = { type = "description", text = "A Tool to manage guild notes and automated deletion.", }, } LAM2:RegisterOptionControls("GNM_Options", optionsData) end local function Initialize() --set up settings files and such end local function OnLoad(event,addon) if addon ~= "GuildNoteManager" then return end Initialize() CreateSettingsMenu() EVENT_MANAGER:RegisterForEvent(EVENT_GUILD_MEMBER_ADDED, onMemberAdd) end EVENT_MANAGER:RegisterForEvent("GuildNoteManager", EVENT_ADD_ON_LOADED, OnLoad)