Prat 3.0

692 - Fixed Groupsay

Only partially tested, but should work fine.

            --- ChannelStickyOriginal.lua   2014-02-20 09:57:14.000000000 +1300
            +++ ChannelSticky.lua   2014-02-26 06:03:35.243780000 +1300
            @@ -66,8 +66,8 @@
                ["Chat channel sticky options."] = true,
                ChatType = true,
                ["Per chat type options."] = true,
            -   smartgroup_desc = "Adds a /gr command which automatically picks the correct type of chat, RAID, PARTY, or BATTLEGROUND",
            -   smartgroup_name = "Smart Groups",
            +   smartgroup_desc = "Adds a /gr command which automatically picks the correct type of chat, INSTANCE_CHAT, RAID, or PARTY",
            +   smartgroup_name = "Smart Group chat",
                ["Sticky Per Chat Frame"] = true,
                ["Sticky %s"] = true,
                ["Toggle remembering the chat type last used per chat frame."] = true,
            @@ -236,11 +236,11 @@
                    officer = true,
                    raid = true,
                    raid_warning = true,
            -       instance_chat = true,
            +       instance = true,
                    channel = true,
                    emote = true,
                    perframe = false,
            -       smartgroup = false,
            +       smartgroup = true,
                    bn_whisper = true,
                    bn_conversation=true,
                }
            @@ -259,11 +259,11 @@
             --                desc = L["Toggle remembering the chat type last used per chat frame."],
             --                type = "toggle",
             --            },
            ---         smartgroup = {
            ---             name = L["smartgroup_name"],
            ---             desc = L["smartgroup_desc"],
            ---             type = "toggle",
            ---         }
            +           smartgroup = {
            +               name = L["smartgroup_name"],
            +               desc = L["smartgroup_desc"],
            +               type = "toggle",
            +           }
                     }
                 }
             )
            @@ -288,7 +288,7 @@
                 self:Stickum("OFFICER",prof.officer)
                 self:Stickum("RAID",prof.raid)
                 self:Stickum("RAID_WARNING",prof.raid_warning)
            -    self:Stickum("INSTANCE_CHAT",prof.instance_chat)
            +    self:Stickum("INSTANCE_CHAT",prof.instance)
                 self:Stickum("CHANNEL",prof.channel)
                 self:Stickum("EMOTE",prof.emote)

            @@ -297,11 +297,11 @@

                 --self:StickyFrameChan(prof.perframe)

            ---    Prat.RegisterChatEvent(self, "Prat_OutboundChat")
            ---
            ---    if prof.smartgroup then
            ---        self:RegisterSmartGroup()
            ---    end
            +   Prat.RegisterChatEvent(self, "Prat_OutboundChat")
            +
            +   if prof.smartgroup then
            +       self:RegisterSmartGroup()
            +   end
             end

             function module:OnModuleDisable()
            @@ -322,7 +322,7 @@
                 -- unregister events
                 self:UnregisterAllEvents()

            -   --Prat.UnregisterAllChatEvents(self)
            +   Prat.UnregisterAllChatEvents(self)
             end

             --[[------------------------------------------------
            @@ -454,42 +454,40 @@



            ---function module:RegisterSmartGroup()
            ---    if not self.smart_group then
            ---     self:SecureHook("ChatEdit_SendText", function(this) if self.groupsay then this:SetAttribute("chatType", "GROUPSAY") self.groupsay=nil end end)
            ---
            ---     self.smart_group = true
            ---
            ---
            ---     SLASH_GROUPSAY1 = "/gr"
            ---     SLASH_GROUPSAY2 = "/group"
            ---     ChatTypeInfo["GROUPSAY"] = { r=0.5, g=0.9, b=0.9, sticky = 1 }
            ---     CHAT_GROUPSAY_SEND = "SmartGroup:\32 "
            ---     CHAT_GROUPSAY_GET = "SmartGroup: %1\32 "
            ---    end
            ---end
            +function module:RegisterSmartGroup()
            +   if not self.smart_group then
            +       self:SecureHook("ChatEdit_SendText", function(this) if self.groupsay then this:SetAttribute("chatType", "GROUPSAY") self.groupsay=nil end end)
            +
            +       self.smart_group = true


            ---function module:SmartGroupChatType()
            ---     local _,pvp = IsInInstance()
            ---
            ---     if pvp == "pvp" then
            ---        return "BATTLEGROUND"
            ---     elseif GetNumRaidMembers() > 0 then
            ---         return "RAID"
            ---     elseif GetNumPartyMembers() > 0 then
            ---         return "PARTY"
            ---     end
            ---
            ---    return "SAY"
            ---end
            ---
            ---function module:Prat_OutboundChat(arg, m)
            --- if m.CTYPE == "GROUPSAY" then
            ---     self.groupsay = true
            ---     m.CTYPE = self:SmartGroupChatType()
            --- end
            ---end
            +       SLASH_GROUPSAY1 = "/gr"
            +       SLASH_GROUPSAY2 = "/group"
            +       ChatTypeInfo["GROUPSAY"] = { r=0.5, g=0.9, b=0.9, sticky = 1 }
            +       CHAT_GROUPSAY_SEND = "SmartGroup:\32 "
            +       CHAT_GROUPSAY_GET = "SmartGroup: %1\32 "
            +   end
            +end
            +
            +
            +function module:SmartGroupChatType()
            +    if IsInGroup(LE_PARTY_CATEGORY_INSTANCE) then
            +       return "INSTANCE_CHAT"
            +    elseif IsInRaid() then
            +        return "RAID"
            +    elseif IsInGroup(LE_PARTY_CATEGORY_HOME) then
            +        return "PARTY"
            +    end
            +
            +   return "SAY"
            +end
            +
            +function module:Prat_OutboundChat(arg, m)
            +   if m.CTYPE == "GROUPSAY" then
            +       self.groupsay = true
            +       m.CTYPE = self:SmartGroupChatType()
            +   end
            +end

               return
             end ) -- Prat:AddModuleToLoad
            \ No newline at end of file
User When Change
ripdog Feb 25, 2014 at 17:29 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

Facts

Reported
Feb 25, 2014
Status
New - Issue has not had initial review yet.
Type
Patch - Source code patch for review
Priority
Medium - Normal priority.
Votes
0
Component
Specific Module

Reported by

Possible assignees