Thread Tools Display Modes
06/10/22, 11:47 AM   #1
Lykeion
 
Lykeion's Avatar
AddOn Author - Click to view addons
Join Date: May 2022
Posts: 17
Question The corrrect way to exit looting a container?

I am working on my autoloot plugin. I use EndLooting() to exit the loot window, which works fine on monsters or nodes. But using EndLooting() on containers (like Mirri's hidden treasure bag) leaves the container stuck in the loot window, even though the looting process is actually over. I also tried EndInteraction(INTERACTION_LOOT), but again it didn't work.

Can anyone tell me the correct way to exit a container loot window?

Last edited by Lykeion : 06/10/22 at 12:01 PM.
  Reply With Quote
06/10/22, 12:41 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
https://www.esoui.com/forums/showthr...highlight=Loot

Check this thread at the end the user told he solved it by hiding the scene again. Maybe contact him or check the addon he mentioned there hiw it was done.

Should be something like
SceneName:Hide()

Where sceneName would be something like KEYBOARD_LOOT_SCENE or similar. My posts above the last post show you some links to the code where you should find the scene name. Else check with the addon merTorchbug e. G. by using the slash command /tbsc to show the SCENE_MANAGER and then see which scene is shown as currentScene
  Reply With Quote
06/10/22, 02:38 PM   #3
Lykeion
 
Lykeion's Avatar
AddOn Author - Click to view addons
Join Date: May 2022
Posts: 17
Originally Posted by Baertram View Post
https://www.esoui.com/forums/showthr...highlight=Loot

Check this thread at the end the user told he solved it by hiding the scene again. Maybe contact him or check the addon he mentioned there hiw it was done.

Should be something like
SceneName:Hide()

Where sceneName would be something like KEYBOARD_LOOT_SCENE or similar. My posts above the last post show you some links to the code where you should find the scene name. Else check with the addon merTorchbug e. G. by using the slash command /tbsc to show the SCENE_MANAGER and then see which scene is shown as currentScene
I did some searching before posting this thread and found users have encountered the same problem as me and solved it later, which included the poster of the thread you mentioned. Sadly not Askedal nor the poster of this thread https://www.esoui.com/forums/showthr...highlight=loot provided the solution directly. I have also searched for answers in Lazy Writ, but so far no luck. And SCENE_MANAGER indicates that I have been in scene "inventory" without change, strange.

Still, I'm actively contacting these users for help. Many thanks for your information.

Last edited by Lykeion : 06/10/22 at 02:51 PM.
  Reply With Quote
06/10/22, 03:31 PM   #4
Askedal
Join Date: Aug 2017
Posts: 9
Hi,

I solved it by using something like this:
Code:
	    local n = SCENE_MANAGER:GetCurrentScene().name
	    if n == 'hudui' or n == 'interact' or n == 'hud' then
	      SCENE_MANAGER:Show('hud')
		else
	      SCENE_MANAGER:Show(n)
	    end
This closes the still open empty loot window.

I have worked on the "smarter autoloot" addon and extended it a loot, I would be happy to share it with you, maybe it already solves your autoloot needs

Best regards
Askedal
  Reply With Quote
06/10/22, 03:58 PM   #5
Lykeion
 
Lykeion's Avatar
AddOn Author - Click to view addons
Join Date: May 2022
Posts: 17
Originally Posted by Askedal View Post
Hi,

I solved it by using something like this:
Code:
	    local n = SCENE_MANAGER:GetCurrentScene().name
	    if n == 'hudui' or n == 'interact' or n == 'hud' then
	      SCENE_MANAGER:Show('hud')
		else
	      SCENE_MANAGER:Show(n)
	    end
This closes the still open empty loot window.

I have worked on the "smarter autoloot" addon and extended it a loot, I would be happy to share it with you, maybe it already solves your autoloot needs

Best regards
Askedal
Thanks a lot! I was starting to learn the concept of the scene and just found a way that could exit the container loot window correctly like below. Unfortunately, it is incompatible with the other looting process that does not start from a container in your bag, cuz they're using EndLooting(). That means my codes need a looting type pre-check.

Code:
SCENE_MANAGER:Toggle("inventory")
But your method works well in any situation without any check, you are awesome! Besides, I also have been working on Agathorn's Smarter AutoLoot's rework for a while https://www.esoui.com/downloads/info...rAutoLoot.html. It seems that SAL is such a simple addon with great ideas that even without maintenance, its legacy still benefits players so much.

Last edited by Lykeion : 06/10/22 at 06:02 PM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » The corrrect way to exit looting a container?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off