View Single Post
11/24/23, 12:14 AM   #1
Smugger21
 
Smugger21's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2023
Posts: 4
LibQuestData Comments Closed? (SOLVED: Unaware Event Codes passed on all events)

EDIT:
Sharlikran made me aware of something I did not know.
Originally Posted by Sharlikran View Post
...
Events always have an event code not shown in the ESO documentation that most authors know is present. Which is why that's there.
...
Originally Posted by Baertram View Post
Originally Posted by Smugger21 View Post
...
Guess that would be helpful information in the documentation, but now I know this will sure help me out.
Good point, as we cannot change the API documentation Pxx.txt files I added that as bold info to the Wiki Event introduction page:
https://wiki.esoui.com/Events#Introduction
ORIGINAL POST:

I went to post in LibQuestData here: https://esoui.com/downloads/info2625....html#comments
However the comment section is closed and I found and Error in the code:
In LibQuestData_Scan.lua on Line 178,
It Accepts 2 arguments, however the calling event only returns 1 value!

Here is the code:
Lua Code:
  1. local function OnQuestCompleteDialog(eventCode, journalIndex)
  2.   --d("OnQuestCompleteDialog")
  3.   local numRewards = GetJournalQuestNumRewards(journalIndex)
  4.   if numRewards <= 0 then return end
  5.   reward = {}
  6.   for i = 1, numRewards do
  7.     local rewardType = GetJournalQuestRewardInfo(journalIndex, i)
  8.     table.insert(reward, rewardType)
  9.   end
  10. end
  11. EVENT_MANAGER:RegisterForEvent(lib.libName, EVENT_QUEST_COMPLETE_DIALOG, OnQuestCompleteDialog) -- Verified

It needs to be this:
Lua Code:
  1. local function OnQuestCompleteDialog(journalIndex)
  2.   --d("OnQuestCompleteDialog")
  3.   local numRewards = GetJournalQuestNumRewards(journalIndex)
  4.   if numRewards <= 0 then return end
  5.   reward = {}
  6.   for i = 1, numRewards do
  7.     local rewardType = GetJournalQuestRewardInfo(journalIndex, i)
  8.     table.insert(reward, rewardType)
  9.   end
  10. end
  11. EVENT_MANAGER:RegisterForEvent(lib.libName, EVENT_QUEST_COMPLETE_DIALOG, OnQuestCompleteDialog) -- Verified

This is because the ESOUIDocumentation.txt posted by sirinsidiator here: https://www.esoui.com/forums/showpos...14&postcount=1
States this as the event:
Code:
EVENT_QUEST_COMPLETE_DIALOG (*luaindex* _journalIndex_)
I posted an issue on the GitHub Page, just not sure why the comments are closed for this Addon though...

Last edited by Smugger21 : 11/27/23 at 01:12 AM.
  Reply With Quote