@@ -5492,87 +5492,29 @@ if not MultiBot.InitHunterQuick then
54925492 end
54935493
54945494 function MBH :ShowPrompt (fmt , targetName , title )
5495- local P = self .PROMPT
5496- if not P then
5497- P = CreateFrame (" Frame" , " MBHunterPrompt" , UIParent )
5498- self .PROMPT = P
5499- P :SetSize (260 , 90 )
5500- P :SetPoint (" CENTER" )
5501- P :SetBackdrop ({
5502- bgFile = " Interface\\ Tooltips\\ UI-Tooltip-Background" ,
5503- edgeFile = " Interface\\ Tooltips\\ UI-Tooltip-Border" ,
5504- tile = true , tileSize = 16 , edgeSize = 16 ,
5505- insets = {left = 4 ,right = 4 ,top = 4 ,bottom = 4 }
5506- })
5507- P :SetBackdropColor (0 ,0 ,0 ,0.9 )
5508- P :SetFrameStrata (" DIALOG" )
5509- P :SetMovable (true ); P :EnableMouse (true )
5510- P :RegisterForDrag (" LeftButton" )
5511- P :SetScript (" OnDragStart" , P .StartMoving )
5512- P :SetScript (" OnDragStop" , P .StopMovingOrSizing )
5513- local btnClose = CreateFrame (" Button" , nil , P , " UIPanelCloseButton" )
5514- btnClose :SetPoint (" TOPRIGHT" , - 5 , - 5 )
5515- btnClose :SetScript (" OnClick" , function () P :Hide () end )
5516- local e = CreateFrame (" EditBox" , nil , P , " InputBoxTemplate" )
5517- e :SetAutoFocus (true ); e :SetSize (200 ,20 ); e :SetTextColor (1 ,1 ,1 )
5518- e :SetPoint (" TOP" , 0 , - 30 )
5519- e :SetScript (" OnEscapePressed" , function () P :Hide () end )
5520- P .EditBox = e
5521- local ok = CreateFrame (" Button" , nil , P , " UIPanelButtonTemplate" )
5522- ok :SetSize (60 ,20 ); ok :SetPoint (" BOTTOM" ,0 ,10 ); ok :SetText (OKAY )
5523- P .OkBtn = ok
5524- P .Title = P :CreateFontString (nil , " ARTWORK" , " GameFontNormal" )
5525- P .Title :SetPoint (" TOP" , 0 , - 10 )
5526- end
5527- P .Title :SetText (title or MultiBot .L (" info.hunterpeteditentervalue" ))
5528- P :Show ()
5529- P .EditBox :SetText (MultiBot .L (" info.hunterpetentersomething" ))
5530- P .EditBox :SetFocus ()
5531- P .OkBtn :SetScript (" OnClick" , function ()
5532- local text = P .EditBox :GetText ()
5533- if text and text ~= " " and targetName then
5495+ ShowPrompt (title or MultiBot .L (" info.hunterpeteditentervalue" ), function (text )
5496+ if text and text ~= " " and targetName then
55345497 local cmd = string.format (fmt , text )
55355498 SendChatMessage (cmd , " WHISPER" , nil , targetName )
55365499 end
5537- P :Hide ()
5538- end )
5500+ end , MultiBot .L (" info.hunterpetentersomething" ))
55395501 end
55405502
55415503 function MBH :EnsureSearchFrame ()
55425504 if self .SEARCH_FRAME then return end
5543- local f = CreateFrame (" Frame" , " MBHunterPetSearch" , UIParent )
5505+ local f = createAceQuestPopupHost (MultiBot .L (" info.hunterpetcreaturelist" ), 360 , 360 , " AceGUI-3.0 is required for MBHunterPetSearch" )
5506+ assert (f , " AceGUI-3.0 is required for MBHunterPetSearch" )
55445507 self .SEARCH_FRAME = f
55455508
5546- local title = f :CreateFontString (nil ," ARTWORK" ," GameFontNormalLarge" )
5547- title :SetPoint (" TOP" ,0 ,- 10 )
5548- title :SetText (MultiBot .L (" info.hunterpetcreaturelist" ))
5549-
5550- f :SetSize (340 ,340 )
5551- f :SetPoint (" CENTER" )
5552- f :SetBackdrop ({
5553- bgFile = " Interface\\ Tooltips\\ UI-Tooltip-Background" ,
5554- edgeFile = " Interface\\ Tooltips\\ UI-Tooltip-Border" ,
5555- tile = true , tileSize = 16 , edgeSize = 16 ,
5556- insets = {left = 4 ,right = 4 ,top = 4 ,bottom = 4 }
5557- })
5558- f :SetBackdropColor (0 ,0 ,0 ,0.9 )
5559- f :SetMovable (true ); f :EnableMouse (true )
5560- f :RegisterForDrag (" LeftButton" )
5561- f :SetScript (" OnDragStart" , f .StartMoving )
5562- f :SetScript (" OnDragStop" , f .StopMovingOrSizing )
5563- CreateFrame (" Button" , nil , f , " UIPanelCloseButton" ):SetPoint (" TOPRIGHT" ,- 5 ,- 5 )
5564-
55655509 local e = CreateFrame (" EditBox" , nil , f , " InputBoxTemplate" )
55665510 e :SetAutoFocus (true )
55675511 e :SetSize (200 ,20 )
5568- e :SetPoint (" TOP" , title , " BOTTOM " , 0 , - 8 )
5512+ e :SetPoint (" TOP" , 0 , - 14 )
55695513 f .EditBox = e
55705514
55715515 local PREVIEW_WIDTH , PREVIEW_HEIGHT = 180 , 260
5572- local BLANK_MODEL = " Interface\\ Buttons\\ WHITE8x8"
55735516 local PREVIEW_MODEL_SCALE = 0.6
55745517 local PREVIEW_FACING = - math.pi / 12
5575- local PREVIEW_X_OFFSET , PREVIEW_Y_OFFSET = 100 , 20
55765518 local CURRENT_ENTRY = nil
55775519
55785520 local function GetPreviewFrame ()
@@ -5591,23 +5533,43 @@ if not MultiBot.InitHunterQuick then
55915533 p :SetScript (" OnDragStart" , p .StartMoving )
55925534 p :SetScript (" OnDragStop" , p .StopMovingOrSizing )
55935535 CreateFrame (" Button" ,nil ,p ," UIPanelCloseButton" ):SetPoint (" TOPRIGHT" ,- 5 ,- 5 )
5536+ -- Keep a stable default anchor; do not re-anchor on every preview click.
5537+ p :ClearAllPoints ()
5538+ p :SetPoint (" LEFT" , UIParent , " CENTER" , 180 , 20 )
55945539 return p
55955540 end
55965541
5597- local function LoadCreatureToPreview (entryId )
5542+ local function HidePreviewFrame ()
5543+ if MBHunterPetPreview and MBHunterPetPreview :IsShown () then
5544+ MBHunterPetPreview :Hide ()
5545+ end
5546+ CURRENT_ENTRY = nil
5547+ end
5548+
5549+ if f .window and f .window .frame and f .window .frame .HookScript then
5550+ f .window .frame :HookScript (" OnHide" , HidePreviewFrame )
5551+ end
5552+
5553+ local function LoadCreatureToPreview (entryId , displayId )
55985554 local pv = GetPreviewFrame ()
55995555 if pv :IsShown () and CURRENT_ENTRY == entryId then pv :Hide (); CURRENT_ENTRY = nil ; return end
56005556 CURRENT_ENTRY = entryId
5601- local cx ,cy = GetCursorPosition (); local scale = UIParent :GetEffectiveScale ()
5602- pv :ClearAllPoints ()
5603- pv :SetPoint (" TOPLEFT" ,UIParent ," BOTTOMLEFT" ,
5604- cx / scale + PREVIEW_X_OFFSET , cy / scale + PREVIEW_Y_OFFSET )
5605- pv :SetUnit (" none" ); pv :ClearModel (); pv :SetModel (BLANK_MODEL ); pv :Show ()
5557+
5558+ pv :SetUnit (" none" )
5559+ pv :ClearModel ()
5560+ pv :Show ()
56065561 pv :SetScript (" OnUpdate" , function (self )
56075562 self :SetScript (" OnUpdate" ,nil )
56085563 self :SetModelScale (PREVIEW_MODEL_SCALE )
56095564 self :SetFacing (PREVIEW_FACING )
5610- self :SetCreature (entryId )
5565+
5566+ -- Prefer direct display ID to avoid cache-dependent creature preview resolution on 3.3.5 clients.
5567+ local displayNum = tonumber (displayId )
5568+ if displayNum and displayNum > 0 and type (self .SetDisplayInfo ) == " function" then
5569+ self :SetDisplayInfo (displayNum )
5570+ else
5571+ self :SetCreature (entryId )
5572+ end
56115573 end )
56125574 end
56135575
@@ -5616,7 +5578,7 @@ if not MultiBot.InitHunterQuick then
56165578 local RESULTS = {}
56175579
56185580 local sf = CreateFrame (" ScrollFrame" ," MBHunterPetScroll" ,f ," UIPanelScrollFrameTemplate" )
5619- sf :SetPoint (" TOPLEFT" ,10 ,- 60 )
5581+ sf :SetPoint (" TOPLEFT" ,10 ,- 42 )
56205582 sf :SetPoint (" BOTTOMRIGHT" ,- 30 ,10 )
56215583 local content = CreateFrame (" Frame" ,nil ,sf ) ; content :SetSize (1 ,1 )
56225584 sf :SetScrollChild (content )
@@ -5680,7 +5642,7 @@ if not MultiBot.InitHunterQuick then
56805642 end )
56815643
56825644 row .previewBtn :SetScript (" OnClick" , function ()
5683- LoadCreatureToPreview (data .id )
5645+ LoadCreatureToPreview (data .id , data . display )
56845646 end )
56855647
56865648 row :Show ()
@@ -5719,31 +5681,12 @@ if not MultiBot.InitHunterQuick then
57195681 function MBH :ShowFamilyFrame (targetName )
57205682 local ff = self .FAMILY_FRAME
57215683 if not ff then
5722- ff = CreateFrame (" Frame" , " MBHunterPetFamily" , UIParent )
5684+ ff = createAceQuestPopupHost (MultiBot .L (" info.hunterpetrandomfamily" ), 260 , 340 , " AceGUI-3.0 is required for MBHunterPetFamily" )
5685+ assert (ff , " AceGUI-3.0 is required for MBHunterPetFamily" )
57235686 self .FAMILY_FRAME = ff
5724- ff :SetSize (220 , 300 )
5725- ff :SetPoint (" CENTER" )
5726- ff :SetBackdrop ({
5727- bgFile = " Interface\\ Tooltips\\ UI-Tooltip-Background" ,
5728- edgeFile = " Interface\\ Tooltips\\ UI-Tooltip-Border" ,
5729- tile = true , tileSize = 16 , edgeSize = 16 ,
5730- insets = {left = 4 , right = 4 , top = 4 , bottom = 4 }
5731- })
5732- ff :SetBackdropColor (0 ,0 ,0 ,0.9 )
5733- ff :EnableMouse (true ); ff :SetMovable (true )
5734- ff :RegisterForDrag (" LeftButton" )
5735- ff :SetScript (" OnDragStart" , ff .StartMoving )
5736- ff :SetScript (" OnDragStop" , ff .StopMovingOrSizing )
5737-
5738- local title = ff :CreateFontString (nil , " ARTWORK" , " GameFontNormalLarge" )
5739- title :SetPoint (" TOP" , 0 , - 10 )
5740- title :SetText (MultiBot .L (" info.hunterpetrandomfamily" ))
5741-
5742- local close = CreateFrame (" Button" , nil , ff , " UIPanelCloseButton" )
5743- close :SetPoint (" TOPRIGHT" , - 5 , - 5 )
57445687
57455688 local sf = CreateFrame (" ScrollFrame" , " MBHunterFamilyScroll" , ff , " UIPanelScrollFrameTemplate" )
5746- sf :SetPoint (" TOPLEFT" , 8 , - 40 )
5689+ sf :SetPoint (" TOPLEFT" , 8 , - 10 )
57475690 sf :SetPoint (" BOTTOMRIGHT" , - 28 , 8 )
57485691 local LIST_W = 320
57495692 local content = CreateFrame (" Frame" , nil , sf )
0 commit comments