165165
166166function DevTool .ToUIString (value , name , withoutLineBrakes )
167167 local result
168- value = DevTool .normalizeSecretValue (value )
168+ value = DevTool .secretToString (value )
169169 local valueType = type (value )
170170
171171 if valueType == " table" then
@@ -189,9 +189,9 @@ function DevTool.GetObjectInfoFromWoWAPI(helperText, value)
189189 -- try to get frame name
190190 if ok then
191191 local concat = function (str , before , after )
192- before = DevTool .normalizeSecretValue (before ) or " "
193- after = DevTool .normalizeSecretValue (after ) or " "
194- str = DevTool .normalizeSecretValue (str )
192+ before = DevTool .secretToString (before ) or " "
193+ after = DevTool .secretToString (after ) or " "
194+ str = DevTool .secretToString (str )
195195 if str then
196196 return resultStr .. " " .. before .. str .. after
197197 end
@@ -203,17 +203,43 @@ function DevTool.GetObjectInfoFromWoWAPI(helperText, value)
203203 local _ , text = DevTool .TryCallAPIFn (" GetText" , value )
204204
205205 local hasSize , left , bottom , width , height = DevTool .TryCallAPIFn (" GetBoundsRect" , value )
206+ local leftStr , bottomStr , widthStr , heightStr = " " , " " , " " , " "
206207
207208 resultStr = objectType or " "
209+
208210 if hasSize then
211+ if DevTool .isSecret (left ) then
212+ leftStr = DevTool .secretToString (left )
213+ else
214+ leftStr = tostring (DevTool .round (left ))
215+ end
216+
217+ if DevTool .isSecret (bottom ) then
218+ bottomStr = DevTool .secretToString (bottom )
219+ else
220+ bottomStr = tostring (DevTool .round (bottom ))
221+ end
222+
223+ if DevTool .isSecret (width ) then
224+ widthStr = DevTool .secretToString (width )
225+ else
226+ widthStr = tostring (DevTool .round (width ))
227+ end
228+
229+ if DevTool .isSecret (height ) then
230+ heightStr = DevTool .secretToString (height )
231+ else
232+ heightStr = tostring (DevTool .round (height ))
233+ end
234+
209235 resultStr = concat (" [" ..
210- tostring ( DevTool . round ( left )) .. " , " ..
211- tostring ( DevTool . round ( bottom )) .. " , " ..
212- tostring ( DevTool . round ( width )) .. " , " ..
213- tostring ( DevTool . round ( height )) .. " ]" )
236+ leftStr .. " , " ..
237+ bottomStr .. " , " ..
238+ widthStr .. " , " ..
239+ heightStr .. " ]" )
214240 end
215241
216- name = DevTool .normalizeSecretValue (name )
242+ name = DevTool .secretToString (name )
217243
218244 if helperText ~= name then
219245 resultStr = concat (name , DevTool .colors .gray :WrapTextInColorCode (" <" ), DevTool .colors .gray :WrapTextInColorCode (" >" ))
@@ -290,9 +316,16 @@ function DevTool.GetParentTable(info)
290316 return parent
291317end
292318
293- function DevTool .normalizeSecretValue (value )
319+ function DevTool .isSecret (value )
294320 if (issecrettable and issecrettable (value )) or (issecretvalue and issecretvalue (value )) then
321+ return true
322+ end
323+ return false
324+ end
325+
326+ function DevTool .secretToString (value )
327+ if DevTool .isSecret (value ) then
295328 return string.format (" <SECRET %s>" , type (value ))
296329 end
297- return value
330+ return tostring ( value )
298331end
0 commit comments