Mercurial > wow > askmrrobot
comparison ui/ShoppingListTab.lua @ 11:ece9167c0d1c v1.2.14.0
Localization support, combat log features (wipe command, aura/pet tracking, and realm detection).
author | yellowfive |
---|---|
date | Thu, 10 Jul 2014 12:24:59 -0700 |
parents | ec731d2fe6ba |
children | e77e01abce98 |
comparison
equal
deleted
inserted
replaced
10:ef8b45e96b08 | 11:ece9167c0d1c |
---|---|
1 local _, AskMrRobot = ... | 1 local _, AskMrRobot = ... |
2 local L = AskMrRobot.L; | |
2 | 3 |
3 -- initialize the ShoppingListTab class | 4 -- initialize the ShoppingListTab class |
4 AskMrRobot.ShoppingListTab = AskMrRobot.inheritsFrom(AskMrRobot.Frame) | 5 AskMrRobot.ShoppingListTab = AskMrRobot.inheritsFrom(AskMrRobot.Frame) |
5 | 6 |
6 StaticPopupDialogs["SHOPPING_TAB_PLEASE_OPEN"] = { | 7 StaticPopupDialogs["SHOPPING_TAB_PLEASE_OPEN"] = { |
7 text = "You need to open the mail window for this to work", | 8 text = L.AMR_SHOPPINGLISTTAB_OPEN_MAIL, |
8 button1 = "Ok", | 9 button1 = L.AMR_SHOPPINGLISTTAB_BUTTON_OK, |
9 timeout = 0, | 10 timeout = 0, |
10 whileDead = true, | 11 whileDead = true, |
11 hideOnEscape = true, | 12 hideOnEscape = true, |
12 preferredIndex = 3, -- avoid some UI taint, see http://www.wowace.com/announcements/how-to-avoid-some-ui-taint/ | 13 preferredIndex = 3, -- avoid some UI taint, see http://www.wowace.com/announcements/how-to-avoid-some-ui-taint/ |
13 } | 14 } |
30 tab:OnEvent(...) | 31 tab:OnEvent(...) |
31 end) | 32 end) |
32 | 33 |
33 tab.shoppingListHeader = AskMrRobot.FontString:new(tab, nil, "ARTWORK", "GameFontNormalLarge") | 34 tab.shoppingListHeader = AskMrRobot.FontString:new(tab, nil, "ARTWORK", "GameFontNormalLarge") |
34 tab.shoppingListHeader:SetPoint("TOPLEFT", 0, -5) | 35 tab.shoppingListHeader:SetPoint("TOPLEFT", 0, -5) |
35 tab.shoppingListHeader:SetText("Shopping List") | 36 tab.shoppingListHeader:SetText(L.AMR_SHOPPINGLISTTAB_TITLE) |
36 | 37 |
37 tab.shoppingPanel = AskMrRobot.Frame:new(nil, tab) | 38 tab.shoppingPanel = AskMrRobot.Frame:new(nil, tab) |
38 tab.shoppingPanel:SetPoint("TOPLEFT", tab.shoppingListHeader, "BOTTOMLEFT", 0, -10) | 39 tab.shoppingPanel:SetPoint("TOPLEFT", tab.shoppingListHeader, "BOTTOMLEFT", 0, -10) |
39 tab.shoppingPanel:SetPoint("BOTTOMRIGHT", tab, "BOTTOMRIGHT", -20, 17) | 40 tab.shoppingPanel:SetPoint("BOTTOMRIGHT", tab, "BOTTOMRIGHT", -20, 17) |
40 | 41 |
41 | 42 |
42 tab.sendButton = CreateFrame("Button", "AmrSendButton", tab.shoppingPanel, "UIPanelButtonTemplate") | 43 tab.sendButton = CreateFrame("Button", "AmrSendButton", tab.shoppingPanel, "UIPanelButtonTemplate") |
43 tab.sendButton:SetText("send it!") | 44 tab.sendButton:SetText(L.AMR_SHOPPINGLISTTAB_BUTTON_SEND) |
44 tab.sendButton:SetPoint("BOTTOMLEFT", 0, 0) | 45 tab.sendButton:SetPoint("BOTTOMLEFT", 0, 0) |
45 tab.sendButton:SetHeight(25) | 46 tab.sendButton:SetHeight(25) |
46 tab.sendButton:SetNormalFontObject("GameFontNormalLarge") | 47 tab.sendButton:SetNormalFontObject("GameFontNormalLarge") |
47 tab.sendButton:SetHighlightFontObject("GameFontHighlightLarge") | 48 tab.sendButton:SetHighlightFontObject("GameFontHighlightLarge") |
48 tab.sendButton:SetWidth(150) | 49 tab.sendButton:SetWidth(150) |
54 tab.enchantMaterialsCheckbox:SetChecked(AmrSendSettings.SendEnchantMaterials) | 55 tab.enchantMaterialsCheckbox:SetChecked(AmrSendSettings.SendEnchantMaterials) |
55 tab.enchantMaterialsCheckbox:SetScript("OnClick", function () AmrSendSettings.SendEnchantMaterials = tab.enchantMaterialsCheckbox:GetChecked() end) | 56 tab.enchantMaterialsCheckbox:SetScript("OnClick", function () AmrSendSettings.SendEnchantMaterials = tab.enchantMaterialsCheckbox:GetChecked() end) |
56 tab.enchantMaterialsCheckbox:SetPoint("TOPLEFT", tab.sendButton, "TOPLEFT", 0, 25) | 57 tab.enchantMaterialsCheckbox:SetPoint("TOPLEFT", tab.sendButton, "TOPLEFT", 0, 25) |
57 local text3 = getglobal(tab.enchantMaterialsCheckbox:GetName() .. 'Text') | 58 local text3 = getglobal(tab.enchantMaterialsCheckbox:GetName() .. 'Text') |
58 text3:SetFontObject("GameFontHighlightLarge") | 59 text3:SetFontObject("GameFontHighlightLarge") |
59 text3:SetText("Enchant Materials") | 60 text3:SetText(L.AMR_SHOPPINGLISTTAB_ENCHANT_MATERIALS) |
60 text3:SetWidth(150) | 61 text3:SetWidth(150) |
61 text3:SetPoint("TOPLEFT", tab.enchantMaterialsCheckbox, "TOPRIGHT", 2, -4) | 62 text3:SetPoint("TOPLEFT", tab.enchantMaterialsCheckbox, "TOPRIGHT", 2, -4) |
62 | 63 |
63 | 64 |
64 tab.enchantsCheckbox = CreateFrame("CheckButton", "AmrEnchantsCheckbox", tab.shoppingPanel, "ChatConfigCheckButtonTemplate"); | 65 tab.enchantsCheckbox = CreateFrame("CheckButton", "AmrEnchantsCheckbox", tab.shoppingPanel, "ChatConfigCheckButtonTemplate"); |
65 tab.enchantsCheckbox:SetChecked(AmrSendSettings.SendEnchants) | 66 tab.enchantsCheckbox:SetChecked(AmrSendSettings.SendEnchants) |
66 tab.enchantsCheckbox:SetScript("OnClick", function () AmrSendSettings.SendEnchants = tab.enchantsCheckbox:GetChecked() end) | 67 tab.enchantsCheckbox:SetScript("OnClick", function () AmrSendSettings.SendEnchants = tab.enchantsCheckbox:GetChecked() end) |
67 tab.enchantsCheckbox:SetPoint("TOPLEFT", tab.sendButton, "TOPLEFT", 0, 50) | 68 tab.enchantsCheckbox:SetPoint("TOPLEFT", tab.sendButton, "TOPLEFT", 0, 50) |
68 local text2 = getglobal(tab.enchantsCheckbox:GetName() .. 'Text') | 69 local text2 = getglobal(tab.enchantsCheckbox:GetName() .. 'Text') |
69 text2:SetFontObject("GameFontHighlightLarge") | 70 text2:SetFontObject("GameFontHighlightLarge") |
70 text2:SetText("Enchants") | 71 text2:SetText(L.AMR_SHOPPINGLISTTAB_ENCHANTS) |
71 text2:SetWidth(150) | 72 text2:SetWidth(150) |
72 text2:SetPoint("TOPLEFT", tab.enchantsCheckbox, "TOPRIGHT", 2, -4) | 73 text2:SetPoint("TOPLEFT", tab.enchantsCheckbox, "TOPRIGHT", 2, -4) |
73 | 74 |
74 | 75 |
75 | 76 |
77 tab.gemsCheckbox:SetPoint("TOPLEFT", tab.sendButton, "TOPLEFT", 0, 75) | 78 tab.gemsCheckbox:SetPoint("TOPLEFT", tab.sendButton, "TOPLEFT", 0, 75) |
78 tab.gemsCheckbox:SetChecked(AmrSendSettings.SendGems) | 79 tab.gemsCheckbox:SetChecked(AmrSendSettings.SendGems) |
79 tab.gemsCheckbox:SetScript("OnClick", function () AmrSendSettings.SendGems = tab.gemsCheckbox:GetChecked() end) | 80 tab.gemsCheckbox:SetScript("OnClick", function () AmrSendSettings.SendGems = tab.gemsCheckbox:GetChecked() end) |
80 local text = getglobal(tab.gemsCheckbox:GetName() .. 'Text') | 81 local text = getglobal(tab.gemsCheckbox:GetName() .. 'Text') |
81 text:SetFontObject("GameFontHighlightLarge") | 82 text:SetFontObject("GameFontHighlightLarge") |
82 text:SetText("Gems") | 83 text:SetText(L.AMR_SHOPPINGLISTTAB_GEMS) |
83 text:SetWidth(150) | 84 text:SetWidth(150) |
84 text:SetPoint("TOPLEFT", tab.gemsCheckbox, "TOPRIGHT", 2, -4) | 85 text:SetPoint("TOPLEFT", tab.gemsCheckbox, "TOPRIGHT", 2, -4) |
85 | 86 |
86 | 87 |
87 tab.sendMessage4 = AskMrRobot.FontString:new(tab.shoppingPanel, nil, "ARTWORK", "GameFontHighlightLarge") | 88 tab.sendMessage4 = AskMrRobot.FontString:new(tab.shoppingPanel, nil, "ARTWORK", "GameFontHighlightLarge") |
88 tab.sendMessage4:SetText("Include:") | 89 tab.sendMessage4:SetText(L.AMR_SHOPPINGLISTTAB_INCLUDE) |
89 tab.sendMessage4:SetPoint("TOPLEFT", tab.gemsCheckbox, "TOPLEFT", 0, 20) | 90 tab.sendMessage4:SetPoint("TOPLEFT", tab.gemsCheckbox, "TOPLEFT", 0, 20) |
90 | 91 |
91 | 92 |
92 tab.sendMessage3 = AskMrRobot.FontString:new(tab.shoppingPanel, nil, "ARTWORK", "GameFontHighlightLarge") | 93 tab.sendMessage3 = AskMrRobot.FontString:new(tab.shoppingPanel, nil, "ARTWORK", "GameFontHighlightLarge") |
93 tab.sendMessage3:SetText("Send list to") | 94 tab.sendMessage3:SetText(L.AMR_SHOPPINGLISTTAB_SEND_LIST_TO) |
94 tab.sendMessage3:SetPoint("TOPLEFT", tab.sendMessage4, "TOPLEFT", 0, 25) | 95 tab.sendMessage3:SetPoint("TOPLEFT", tab.sendMessage4, "TOPLEFT", 0, 25) |
95 | 96 |
96 | 97 |
97 tab.sendMessage2 = AskMrRobot.FontString:new(tab.shoppingPanel, nil, "ARTWORK", "GameFontNormal") | 98 tab.sendMessage2 = AskMrRobot.FontString:new(tab.shoppingPanel, nil, "ARTWORK", "GameFontNormal") |
98 tab.sendMessage2:SetTextColor(.5,.5,.5) | 99 tab.sendMessage2:SetTextColor(.5,.5,.5) |
99 tab.sendMessage2:SetText("Whisper to a friend or send to a channel, like /raid or /guild.") | 100 tab.sendMessage2:SetText(L.AMR_SHOPPINGLISTTAB_WHISPER_CHANNEL) |
100 tab.sendMessage2:SetPoint("TOPLEFT", tab.sendMessage3, "TOPLEFT", 0, 25) | 101 tab.sendMessage2:SetPoint("TOPLEFT", tab.sendMessage3, "TOPLEFT", 0, 25) |
101 | 102 |
102 | 103 |
103 tab.sendMessage1 = AskMrRobot.FontString:new(tab.shoppingPanel, nil, "ARTWORK", "GameFontNormalLarge") | 104 tab.sendMessage1 = AskMrRobot.FontString:new(tab.shoppingPanel, nil, "ARTWORK", "GameFontNormalLarge") |
104 tab.sendMessage1:SetTextColor(0,1,0) | 105 tab.sendMessage1:SetTextColor(0,1,0) |
105 tab.sendMessage1:SetText("Send to a Jewelcraft or Enchanter friend :)") | 106 tab.sendMessage1:SetText(L.AMR_SHOPPINGLISTTAB_SEND_JEWELCRAFT_ENCHANTER) |
106 tab.sendMessage1:SetPoint("TOPLEFT", tab.sendMessage2, "TOPLEFT", 0, 25) | 107 tab.sendMessage1:SetPoint("TOPLEFT", tab.sendMessage2, "TOPLEFT", 0, 25) |
107 | 108 |
108 | 109 |
109 tab.scrollFrame = CreateFrame("ScrollFrame", "AmrScrollFrame", tab.shoppingPanel, "UIPanelScrollFrameTemplate") | 110 tab.scrollFrame = CreateFrame("ScrollFrame", "AmrScrollFrame", tab.shoppingPanel, "UIPanelScrollFrameTemplate") |
110 tab.scrollFrame:SetPoint("TOPLEFT", 0, 0) | 111 tab.scrollFrame:SetPoint("TOPLEFT", 0, 0) |
121 tab.scrollFrame:SetScript("OnMouseWheel", function(arg1, arg2) | 122 tab.scrollFrame:SetScript("OnMouseWheel", function(arg1, arg2) |
122 ScrollFrameTemplate_OnMouseWheel(arg1, arg2, arg1.ScrollBar) | 123 ScrollFrameTemplate_OnMouseWheel(arg1, arg2, arg1.ScrollBar) |
123 end) | 124 end) |
124 | 125 |
125 tab.gemsHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") | 126 tab.gemsHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") |
126 tab.gemsHeader:SetText("Gems") | 127 tab.gemsHeader:SetText(L.AMR_SHOPPINGLISTTAB_GEMS) |
127 tab.gemsHeader:SetPoint("TOPLEFT", tab.scrollParent, "TOPLEFT", 0, 0) | 128 tab.gemsHeader:SetPoint("TOPLEFT", tab.scrollParent, "TOPLEFT", 0, 0) |
128 | 129 |
129 tab.gemsQuantityHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") | 130 tab.gemsQuantityHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") |
130 tab.gemsQuantityHeader:SetText("Total") | 131 tab.gemsQuantityHeader:SetText(L.AMR_SHOPPINGLISTTAB_TOTAL) |
131 tab.gemsQuantityHeader:SetPoint("TOPLEFT", tab.scrollParent, "TOPLEFT", 370, 0) | 132 tab.gemsQuantityHeader:SetPoint("TOPLEFT", tab.scrollParent, "TOPLEFT", 370, 0) |
132 | 133 |
133 tab.enchantsHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") | 134 tab.enchantsHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") |
134 tab.enchantsHeader:SetText("Enchants") | 135 tab.enchantsHeader:SetText(L.AMR_SHOPPINGLISTTAB_ENCHANTS) |
135 | 136 |
136 tab.enchantsQuantityHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") | 137 tab.enchantsQuantityHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") |
137 tab.enchantsQuantityHeader:SetText("Total") | 138 tab.enchantsQuantityHeader:SetText(L.AMR_SHOPPINGLISTTAB_TOTAL) |
138 tab.enchantsQuantityHeader:SetPoint("TOPLEFT", tab.enchantsHeader, "TOPLEFT", 370, 0) | 139 tab.enchantsQuantityHeader:SetPoint("TOPLEFT", tab.enchantsHeader, "TOPLEFT", 370, 0) |
139 | 140 |
140 tab.enchantMaterialsHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") | 141 tab.enchantMaterialsHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") |
141 tab.enchantMaterialsHeader:SetText("Enchant Materials") | 142 tab.enchantMaterialsHeader:SetText(L.AMR_SHOPPINGLISTTAB_ENCHANT_MATERIALS) |
142 | 143 |
143 tab.enchantMaterialsQuantityHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") | 144 tab.enchantMaterialsQuantityHeader = AskMrRobot.FontString:new(tab.scrollParent, nil, "ARTWORK", "GameFontNormalLarge") |
144 tab.enchantMaterialsQuantityHeader:SetText("Total") | 145 tab.enchantMaterialsQuantityHeader:SetText(L.AMR_SHOPPINGLISTTAB_TOTAL) |
145 tab.enchantMaterialsQuantityHeader:SetPoint("TOPLEFT", tab.enchantMaterialsHeader, "TOPLEFT", 370, 0) | 146 tab.enchantMaterialsQuantityHeader:SetPoint("TOPLEFT", tab.enchantMaterialsHeader, "TOPLEFT", 370, 0) |
146 | 147 |
147 tab.stamp = AskMrRobot.RobotStamp:new(nil, tab) | 148 tab.stamp = AskMrRobot.RobotStamp:new(nil, tab) |
148 tab.stamp:Hide() | 149 tab.stamp:Hide() |
149 tab.stamp.bigText:SetText("YOUR SHOPPING IS ALL DONE!") | 150 tab.stamp.bigText:SetText(L.AMR_SHOPPINGLISTTAB_DONE) |
150 tab.stamp.smallText:SetText("Unless you want to buy me a birthday present! I like titanium bolts and robot dogs... Or was it titanium dogs and robot bolts...") | 151 tab.stamp.smallText:SetText(L.AMR_SHOPPINGLISTTAB_A_ROBOTS_WISHLIST) |
151 tab.stamp:SetPoint("TOPLEFT", tab.shoppingListHeader, "BOTTOMLEFT", 2, -15) | 152 tab.stamp:SetPoint("TOPLEFT", tab.shoppingListHeader, "BOTTOMLEFT", 2, -15) |
152 tab.stamp:SetPoint("RIGHT", tab, "RIGHT", -30, 0) | 153 tab.stamp:SetPoint("RIGHT", tab, "RIGHT", -30, 0) |
153 tab.stamp:SetHeight(92) | 154 tab.stamp:SetHeight(92) |
154 | 155 |
155 tab.gemIcons = {} | 156 tab.gemIcons = {} |
184 return info | 185 return info |
185 end | 186 end |
186 | 187 |
187 -- Create and bind the initialization function to the dropdown menu | 188 -- Create and bind the initialization function to the dropdown menu |
188 UIDropDownMenu_Initialize(tab.dropDown, function(self, level, menuList) | 189 UIDropDownMenu_Initialize(tab.dropDown, function(self, level, menuList) |
189 UIDropDownMenu_AddButton(AddButton(self, "a friend")) | 190 UIDropDownMenu_AddButton(AddButton(self, L.AMR_SHOPPINGLISTTAB_DROPDOWN_FRIEND)) |
190 UIDropDownMenu_AddButton(AddButton(self, "party")) | 191 UIDropDownMenu_AddButton(AddButton(self, L.AMR_SHOPPINGLISTTAB_DROPDOWN_PARTY)) |
191 UIDropDownMenu_AddButton(AddButton(self, "raid")) | 192 UIDropDownMenu_AddButton(AddButton(self, L.AMR_SHOPPINGLISTTAB_DROPDOWN_RAID)) |
192 UIDropDownMenu_AddButton(AddButton(self, "guild")) | 193 UIDropDownMenu_AddButton(AddButton(self, L.AMR_SHOPPINGLISTTAB_DROPDOWN_GUILD)) |
193 UIDropDownMenu_AddButton(AddButton(self, "channel")) | 194 UIDropDownMenu_AddButton(AddButton(self, L.AMR_SHOPPINGLISTTAB_DROPDOWN_CHANNEL)) |
194 UIDropDownMenu_AddButton(AddButton(self, "mail")) | 195 UIDropDownMenu_AddButton(AddButton(self, L.AMR_SHOPPINGLISTTAB_DROPDOWN_MAIL)) |
195 end) | 196 end) |
196 | 197 |
197 function tab.dropDown:SetValue(newValue) | 198 function tab.dropDown:SetValue(newValue) |
198 AmrSendSettings.SendToType = newValue | 199 AmrSendSettings.SendToType = newValue |
199 -- Update the text; if we merely wanted it to display newValue, we would not need to do this | 200 -- Update the text; if we merely wanted it to display newValue, we would not need to do this |
776 if not self.mailOpen then | 777 if not self.mailOpen then |
777 StaticPopup_Show("SHOPPING_TAB_PLEASE_OPEN") | 778 StaticPopup_Show("SHOPPING_TAB_PLEASE_OPEN") |
778 return | 779 return |
779 end | 780 end |
780 | 781 |
781 local message = "Mr. Robot says I need the following to optimize my gear:\n" | 782 local message = L.AMR_SHOPPINGLISTTAB_MAIL_ROBOT_MESSAGE |
782 | 783 |
783 local gemList, enchantList, enchantMaterials = self:CalculateItems() | 784 local gemList, enchantList, enchantMaterials = self:CalculateItems() |
784 | 785 |
785 if AmrSendSettings.SendGems then | 786 if AmrSendSettings.SendGems then |
786 for k,v in pairs(gemList) do | 787 for k,v in pairs(gemList) do |
822 end | 823 end |
823 | 824 |
824 MailFrameTab_OnClick(nil, 2) | 825 MailFrameTab_OnClick(nil, 2) |
825 if AmrSendSettings.SendGems then | 826 if AmrSendSettings.SendGems then |
826 if AmrSendSettings.SendEnchants then | 827 if AmrSendSettings.SendEnchants then |
827 SendMailSubjectEditBox:SetText('Request for gems and enchants') | 828 SendMailSubjectEditBox:SetText(L.AMR_SHOPPINGLISTTAB_MAIL_SUBJECT_GE) |
828 else | 829 else |
829 SendMailSubjectEditBox:SetText('Request for gems') | 830 SendMailSubjectEditBox:SetText(L.AMR_SHOPPINGLISTTAB_MAIL_SUBJECT_G) |
830 end | 831 end |
831 else | 832 else |
832 SendMailSubjectEditBox:SetText('Request for enchants') | 833 SendMailSubjectEditBox:SetText(L.AMR_SHOPPINGLISTTAB_MAIL_SUBJECT_E) |
833 end | 834 end |
834 SendMailNameEditBox:SetText(AmrSendSettings.SendTo) | 835 SendMailNameEditBox:SetText(AmrSendSettings.SendTo) |
835 SendMailBodyEditBox:SetText(message) | 836 SendMailBodyEditBox:SetText(message) |
836 end | 837 end |
837 | 838 |
838 function AskMrRobot.ShoppingListTab:Send() | 839 function AskMrRobot.ShoppingListTab:Send() |
839 local chatType = nil | 840 local chatType = nil |
840 if AmrSendSettings.SendToType == "party" then | 841 if AmrSendSettings.SendToType == L.AMR_SHOPPINGLISTTAB_DROPDOWN_PARTY then |
841 chatType = "PARTY" | 842 chatType = "PARTY" |
842 elseif AmrSendSettings.SendToType == "guild" then | 843 elseif AmrSendSettings.SendToType == L.AMR_SHOPPINGLISTTAB_DROPDOWN_GUILD then |
843 chatType = "GUILD" | 844 chatType = "GUILD" |
844 elseif AmrSendSettings.SendToType == "raid" then | 845 elseif AmrSendSettings.SendToType == L.AMR_SHOPPINGLISTTAB_DROPDOWN_RAID then |
845 chatType = "RAID" | 846 chatType = "RAID" |
846 elseif AmrSendSettings.SendToType == "channel" then | 847 elseif AmrSendSettings.SendToType == L.AMR_SHOPPINGLISTTAB_DROPDOWN_CHANNEL then |
847 chatType = "CHANNEL" | 848 chatType = "CHANNEL" |
848 elseif AmrSendSettings.SendToType == "mail" then | 849 elseif AmrSendSettings.SendToType == L.AMR_SHOPPINGLISTTAB_DROPDOWN_MAIL then |
849 self:sendMail() | 850 self:sendMail() |
850 return | 851 return |
851 else | 852 else |
852 chatType = "WHISPER" | 853 chatType = "WHISPER" |
853 end | 854 end |
854 | 855 |
855 local message = "Mr. Robot says I need" | 856 local message = L.AMR_SHOPPINGLISTTAB_CHAT_ROBOT_MESSAGE |
856 local count = 0 | 857 local count = 0 |
857 | 858 |
858 | 859 |
859 local gemList, enchantList, enchantMaterials = self:CalculateItems() | 860 local gemList, enchantList, enchantMaterials = self:CalculateItems() |
860 | 861 |
894 message = message .. " " .. entry.needed .. "x " .. link | 895 message = message .. " " .. entry.needed .. "x " .. link |
895 count = count + 1 | 896 count = count + 1 |
896 if count == 2 then | 897 if count == 2 then |
897 tinsert(self.messageQueue, {message = message, chatType = chatType, chatChannel = AmrSendSettings.SendTo}) | 898 tinsert(self.messageQueue, {message = message, chatType = chatType, chatChannel = AmrSendSettings.SendTo}) |
898 count = 0 | 899 count = 0 |
899 message = "Mr. Robot says I need" | 900 message = L.AMR_SHOPPINGLISTTAB_CHAT_ROBOT_MESSAGE |
900 end | 901 end |
901 end | 902 end |
902 end | 903 end |
903 | 904 |
904 if count > 0 then | 905 if count > 0 then |