From 672499f2fa2bcaa7695f46a646aec4509f1517e1 Mon Sep 17 00:00:00 2001 From: tercio Date: Wed, 1 Oct 2014 17:59:55 -0300 Subject: [PATCH] - few fixes --- boot.lua | 4 ++-- core/network.lua | 27 ++++++++++++++++++++++++--- functions/profiles.lua | 1 + functions/slash.lua | 11 +++++++++++ 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/boot.lua b/boot.lua index b198e528..a1e5ad34 100644 --- a/boot.lua +++ b/boot.lua @@ -3,8 +3,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 83 --it's 87 for release - _detalhes.userversion = "a1.28.0" + _detalhes.build_counter = 83 --it's 88 for release + _detalhes.userversion = "a1.28.1" _detalhes.realversion = 28 _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" diff --git a/core/network.lua b/core/network.lua index 17592bf4..0f5fceaa 100644 --- a/core/network.lua +++ b/core/network.lua @@ -465,6 +465,9 @@ --> entrar no canal após logar no servidor function _detalhes:EnterChatChannel() + if (not _detalhes.realm_sync) then + return + end if (_detalhes.schedule_chat_leave) then _detalhes:CancelTimer (_detalhes.schedule_chat_leave) @@ -500,6 +503,9 @@ end function _detalhes:LeaveChatChannel() + if (not _detalhes.realm_sync) then + return + end if (_detalhes.schedule_chat_enter) then _detalhes:CancelTimer (_detalhes.schedule_chat_enter) @@ -539,7 +545,10 @@ --> sair do canal quando estiver em grupo local event_handler = {Enabled = true, __enabled = true, teste = " teste"} function event_handler:ZONE_TYPE_CHANGED (zone_type) - --print (zone_type) + if (not _detalhes.realm_sync) then + return + end + if (zone_type == "none") then if (not _detalhes:InGroup()) then if (_detalhes.schedule_chat_leave) then @@ -562,7 +571,11 @@ end function event_handler:GROUP_ONENTER() - if (zone_type ~= "none") then + if (not _detalhes.realm_sync) then + return + end + + if (_detalhes.zone_type ~= "none") then if (_detalhes.schedule_chat_enter) then _detalhes:CancelTimer (_detalhes.schedule_chat_enter) end @@ -573,8 +586,12 @@ end function _detalhes:CheckChatOnLeaveGroup() + if (not _detalhes.realm_sync) then + return + end + _detalhes.schedule_group_onleave_check = nil - if (zone_type == "none") then + if (_detalhes.zone_type == "none") then if (_detalhes.schedule_chat_leave) then _detalhes:CancelTimer (_detalhes.schedule_chat_leave) end @@ -584,6 +601,10 @@ end end function event_handler:GROUP_ONLEAVE() + if (not _detalhes.realm_sync) then + return + end + if (_detalhes.schedule_group_onleave_check) then _detalhes:CancelTimer (_detalhes.schedule_group_onleave_check) _detalhes.schedule_group_onleave_check = nil diff --git a/functions/profiles.lua b/functions/profiles.lua index dc1ac588..b9910c5c 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -881,6 +881,7 @@ local default_global_data = { savedTimeCaptures = {}, lastUpdateWarning = 0, report_where = "SAY", + realm_sync = true, --> switch tables switchSaved = {slots = 4, table = { {["atributo"] = 1, ["sub_atributo"] = 1}, --damage done diff --git a/functions/slash.lua b/functions/slash.lua index deae5ca1..a1859d11 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -79,6 +79,17 @@ function SlashCmdList.DETAILS (msg, editbox) -------- debug --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + elseif (msg == "realmsync") then + + _detalhes.realm_sync = not _detalhes.realm_sync + _detalhes:Msg ("Realm Sync: ", _detalhes.realm_sync and "Enabled" or "Disabled") + + if (not _detalhes.realm_sync) then + LeaveChannelByName ("Details") + else + _detalhes:CheckChatOnLeaveGroup() + end + elseif (msg == "owner2") then local tip = CreateFrame('GameTooltip', 'GuardianOwnerTooltip', nil, 'GameTooltipTemplate')