View Single Post
04/04/22, 11:04 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
I could not believe it and tried my self and you are right.

Checked which dialog it is that is shown there, via using merTorchbug or zgoo's /tbm (/tbug mouse) or /zgoo mouse above the dialog.

It may be necessary to remove the modal overlay so you are able to use the mouse properly there.
It should be :
/script ZO_Dialog1ModalUnderlay:SetHidden(true)

This "Are you sure you want to destroy..." dialog uses the string constant 5224 which is SI_DESTROY_ALL_JUNK
and is used in the dialog as mainText



Code:
ESO_Dialogs["DESTROY_ALL_JUNK"] =
{
    title =
    {
        text = SI_PROMPT_TITLE_DESTROY_ITEMS,
    },
    mainText = 
    {
        text = SI_DESTROY_ALL_JUNK,
    },
    buttons =
    {
        [1] =
        {
            text =      SI_DESTROY_ALL_JUNK_CONFIRM,
            callback =  DestroyAllJunk,
            clickSound = SOUNDS.INVENTORY_DESTROY_JUNK,
        },
        [2] =
        {
            text =       SI_DIALOG_DECLINE,
        },
    },
}
The function seems to be used in there yes.
I've added my own prehook in an addon at event_add_on_loaded:

Code:
ZO_PreHook("DestroyAllJunk", function()
                d("DestroyAllJunk -> Aborting now")
                
                return true
            end)
And If I use the keybind to open the dialog and click on the "ok" button or use the keybind of that button it shows in my chat:
nothing and it just destroys it as you said.

So yeah, seems to be either a bug or a feature

I've asked ZOsDanBatson if he knows whats going on here.
For now you can fix this by "overwriting" the acceptCallback function of that dialog with your own func which does the checks and then calls DestroyAllJunk I'd say.
At event_player_activated do once:

Lua Code:
  1. ESO_Dialogs["DESTROY_ALL_JUNK"] =
  2. {
  3.     title =
  4.     {
  5.         text = SI_PROMPT_TITLE_DESTROY_ITEMS,
  6.     },
  7.     mainText =
  8.     {
  9.         text = SI_DESTROY_ALL_JUNK,
  10.     },
  11.     buttons =
  12.     {
  13.         [1] =
  14.         {
  15.             text =      SI_DESTROY_ALL_JUNK_CONFIRM,
  16.             callback =  function()
  17.                  if not yourAddon.doNotDestroyAllJunk then
  18.                     DestroyAllJunk()
  19.                  else
  20.                    --Do other stuff or just let the dialog close
  21.                  end
  22.             end,
  23.  
  24.             clickSound = SOUNDS.INVENTORY_DESTROY_JUNK,
  25.         },
  26.         [2] =
  27.         {
  28.             text =       SI_DIALOG_DECLINE,
  29.         },
  30.     },
  31. }

Last edited by Baertram : 04/04/22 at 11:08 AM.
  Reply With Quote