comparison ui/GearComparisonTab.lua @ 31:44c285acfff0 v8

fixed item display bug on summary tab
author yellowfive
date Sat, 18 Oct 2014 10:33:33 -0700
parents e77e01abce98
children 4ba69d2ee252
comparison
equal deleted inserted replaced
30:55906ac875ae 31:44c285acfff0
117 117
118 return tab 118 return tab
119 end 119 end
120 120
121 function AskMrRobot.GearComparisonTab:On_SOCKET_INFO_CLOSE() 121 function AskMrRobot.GearComparisonTab:On_SOCKET_INFO_CLOSE()
122 self:Import() 122 if self.initialized then
123 self:Import()
124 end
123 end 125 end
124 126
125 function AskMrRobot.GearComparisonTab:On_SOCKET_INFO_UPDATE() 127 function AskMrRobot.GearComparisonTab:On_SOCKET_INFO_UPDATE()
126 self:Import() 128 if self.initialized then
129 self:Import()
130 end
127 end 131 end
128 132
129 function AskMrRobot.GearComparisonTab:On_PLAYER_SPECIALIZATION_CHANGED() 133 function AskMrRobot.GearComparisonTab:On_PLAYER_SPECIALIZATION_CHANGED()
130 self:Import() 134 if self.initialized then
135 self:Import()
136 end
131 end 137 end
132 138
133 function AskMrRobot.GearComparisonTab:On_BAG_UPDATE() 139 function AskMrRobot.GearComparisonTab:On_BAG_UPDATE()
134 self:Import() 140 if self.initialized then
141 self:Import()
142 end
135 end 143 end
136 144
137 function AskMrRobot.GearComparisonTab:On_ITEM_PUSH() 145 function AskMrRobot.GearComparisonTab:On_ITEM_PUSH()
138 self:Import() 146 if self.initialized then
147 self:Import()
148 end
139 end 149 end
140 150
141 function AskMrRobot.GearComparisonTab:On_DELETE_ITEM_CONFIRM() 151 function AskMrRobot.GearComparisonTab:On_DELETE_ITEM_CONFIRM()
142 self:Import() 152 if self.initialized then
153 self:Import()
154 end
143 end 155 end
144 156
145 function AskMrRobot.GearComparisonTab:OnShow() 157 function AskMrRobot.GearComparisonTab:OnShow()
146 if not self.initialized then 158 if not self.initialized then
147 self.initialized = true 159 self.initialized = true
148 160
149 -- on first show, load the last import 161 -- on first show, load the last import
150 if AmrDb.LastCharacterImport and AmrDb.LastCharacterImport ~= "" then 162 if AmrDb.LastCharacterImport and AmrDb.LastCharacterImport ~= "" then
151 self.importTab:SetImportText(AmrDb.LastCharacterImport) 163 self.importTab:SetImportText(AmrDb.LastCharacterImport)
152 self:Import() 164 self:Import()
165 self.tabButtonClick(self.tabButtons[2])
153 else 166 else
154 self:Update() 167 self:Update()
155 end 168 end
156 else 169 else
157 self:Update() 170 self:Update()
158 end 171 end
159 end 172 end
160 173
161 function AskMrRobot.GearComparisonTab:Import() 174 function AskMrRobot.GearComparisonTab:Import()
162 175
163 -- example string 176 local err = AskMrRobot.ImportCharacter(self.importTab:GetImportText(), AskMrRobot.debug)
164 -- $2;Brill (EU);Yellowfive;Twisted Legion;11;2;90;7:600,9:600;1;s1;34;2123320;68164,47782,7833;q1;99195s7u493x4647y0c22e4823;1s3u0x0y0c11e90;6s10u0x0y0c11e-481;1s1u0x383y-383c41;3047s15u12x0c1e-8;3109s5u-12x0y0z0c112e445;55s8u12x0c1e-442;5371s16u0b450x0c1e18;1691s13u-14b-1;238s11u0b0x-60c3;28s2u0b0;21s6u2b0x60y0z0c130;29s14u0b0;1s9u-2b0e-30;62s12u0b0x0c1;95s17u2b0x0c1$g\4647\76697\76631,76697,83146\20 _CriticalStrike_@g\5030\95344\\Indomitable@g\4587\76636\76570,76636,83144\20 _CriticalStrike_@e\4823\83765\122388\19 _Strength_, 11 _CriticalStrike_\72163=1,76061=1@e\4913\87585\113047\20 _Strength_, 5 _CriticalStrike_\39354=1,79254=3@e\4432\74721\104419\11 _Strength_\74249=3,74250=1,74247=1@e\4424\74713\104404\12 _CriticalStrike_\74250=1@e\4869\85559\124091\9 _Stamina_\72120=4@e\4427\74716\104408\11 _CriticalStrike_\74249=2,74250=1@e\4445\74727\104440\Colossus\74247=3@e\4415\74704\104390\18 _Strength_\74248=3
165
166 local err = AskMrRobot.ImportCharacter(self.importTab:GetImportText())
167 -- goto the summary tab 177 -- goto the summary tab
168 self.summaryTab:showImportError(err) 178 self.summaryTab:showImportError(err)
169 PanelTemplates_EnableTab(self, 2) 179 PanelTemplates_EnableTab(self, 2)
170 if err then 180 if err then
171 PanelTemplates_DisableTab(self, 3) 181 PanelTemplates_DisableTab(self, 3)