add option to not ignore new members

Leandro Silva [02-02-20 - 14:28]
add option to not ignore new members
Filename
LeoGuildManager.lua
LeoGuildManager.txt
LeoGuildManagerInit.lua
LeoGuildManagerUI.lua
Settings.lua
diff --git a/LeoGuildManager.lua b/LeoGuildManager.lua
index f29edf9..1487fb6 100644
--- a/LeoGuildManager.lua
+++ b/LeoGuildManager.lua
@@ -140,7 +140,9 @@ function LeoGuildManager.GetCycleName(id)
 end

 function LeoGuildManager.GetNewRangeName(value)
-    if value == 7 then
+    if value == 0 then
+        return "None"
+    elseif value == 7 then
         return "1 week"
     elseif value == 14 then
         return "2 weeks"
@@ -872,6 +874,17 @@ function LeoGuildManager:DeleteOldData()
     end
 end

+function LeoGuildManager.onReadMail(eventCode, mailId)
+    local senderDisplayName, senderCharacterName, subject, icon, unread, fromSystem, fromCustomerService,
+    returned, numAttachments, attachedMoney, codAmount, expiresInDays, secsSinceReceived = GetMailItemInfo(mailId)
+
+    --if fromSystem or not numAttachments or numAttachments <= 0 or fromCustomerService then return end
+    local sender = GetMailSender(mailId)
+    local message = ZO_MailInboxMessageBody:GetText()
+    LeoGuildManager.log(sender)
+    LeoGuildManager.log(message)
+end
+
 function LeoGuildManager:OnUpdate()
     LeoGuildManager.AutoKick()
 end
@@ -909,6 +922,10 @@ local function OnPlayerDeactivated()
     LeoGuildManager:DeleteOldData()
 end

+local function onReadMail()
+    LeoGuildManager.onReadMail()
+end
+
 function LeoGuildManager.OnAddOnLoaded(event, addonName)
     if addonName == LeoGuildManager.name then
         EVENT_MANAGER:UnregisterForEvent(LeoGuildManager.Name, EVENT_ADD_ON_LOADED)
@@ -926,6 +943,7 @@ function LeoGuildManager.OnAddOnLoaded(event, addonName)
         CHAMPION_PERKS_SCENE:RegisterCallback('StateChange', onChampionPerksSceneStateChange)
         EVENT_MANAGER:RegisterForEvent(LeoGuildManager.name, EVENT_PLAYER_COMBAT_STATE, onCombatState)
         EVENT_MANAGER:RegisterForEvent(LeoGuildManager.name, EVENT_GUILD_HISTORY_RESPONSE_RECEIVED, onGuildHistoryResponseReceived)
+        -- EVENT_MANAGER:RegisterForEvent(LeoGuildManager.name, EVENT_MAIL_READABLE, onReadMail)
         LeoGuildManager.log("started.")
     end
 end
diff --git a/LeoGuildManager.txt b/LeoGuildManager.txt
index 5d23bdb..acd855e 100644
--- a/LeoGuildManager.txt
+++ b/LeoGuildManager.txt
@@ -1,7 +1,7 @@
 ## Title: Leo's Guild Manager
 ## APIVersion: 100029 100030
-## Version: 1.2.4
-## AddOnVersion: 1204
+## Version: 1.2.5
+## AddOnVersion: 1205
 ## Author: |c39B027@LeandroSilva|r
 ## SavedVariables: LeoGuildManagerGlobalData LeoGuildManagerScanData
 ## DependsOn: LibStub LibFeedback LibAddonMenu-2.0
diff --git a/LeoGuildManagerInit.lua b/LeoGuildManagerInit.lua
index a662d5d..493f7fb 100644
--- a/LeoGuildManagerInit.lua
+++ b/LeoGuildManagerInit.lua
@@ -4,7 +4,7 @@ LeoGuildManagerUI = LeoGuildManagerUI or {}

 LeoGuildManager.name = "LeoGuildManager"
 LeoGuildManager.displayName = "Leo's Guild Manager"
-LeoGuildManager.version = "1.2.4"
+LeoGuildManager.version = "1.2.5"
 LeoGuildManager.chatPrefix = "|c39B027" .. LeoGuildManager.name .. "|r: "

 LeoGuildManager.TAB_PURGE = "Purge"
diff --git a/LeoGuildManagerUI.lua b/LeoGuildManagerUI.lua
index 699025b..0dc8441 100644
--- a/LeoGuildManagerUI.lua
+++ b/LeoGuildManagerUI.lua
@@ -811,3 +811,11 @@ function LeoGuildManagerUI.TooltipDeposits(control, visible)
 end

 ZO_CreateStringId('SI_BINDING_NAME_LEOGM_TOGGLE_WINDOW', "Show/Hide Main Window")
+
+local keystripDef = {
+    name = function() return "Register as Raffle" end,
+    keybind = "AR_CRAFT",
+    callback = function() PressCraft() end,
+    alignment = KEYBIND_STRIP_ALIGN_LEFT,
+    visible = function() return IsShowingRefinement() end,
+}
diff --git a/Settings.lua b/Settings.lua
index 546647f..001390d 100644
--- a/Settings.lua
+++ b/Settings.lua
@@ -155,6 +155,7 @@ function LeoGuildManagerSettings:CreatePanel()
                                 name = "Ignore new members",
                                 tooltip = "Recently added members need some time to start, right? :)",
                                 choices = {
+                                    "None",
                                     "1 week",
                                     "2 weeks",
                                     "3 weeks",
@@ -165,7 +166,8 @@ function LeoGuildManagerSettings:CreatePanel()
                                     return LeoGuildManager.GetNewRangeName(value)
                                 end,
                                 setFunc = function(value)
-                                    if value == "1 week" then value = 7
+                                    if value == "None" then value = 0
+                                    elseif value == "1 week" then value = 7
                                     elseif value == "2 weeks" then value = 14
                                     elseif value == "3 weeks" then value = 21
                                     else value = 30 end