04-06-24, 09:25 AM | #1 |
Real time update
Hi all. Currently, the data on questIDs = {70893, 71995} is updated only after an “interface reboot” or if I re-enter the game as a character. How to make the data updated immediately without having to enter “/reload”. ?
Lua Code:
|
|
04-06-24, 10:29 AM | #2 |
You could use the update function for the frame - you've used that in the past for other projects if memory serves.
I personally identify an event that would trigger for it and use that, and only fall back to the OnUpdate frame function if there are no alternatives. I notice you aren't using the QUEST_COMPLETE (https://warcraft.wiki.gg/wiki/QUEST_COMPLETE) which triggers when the player presses the complete button. There is also QUEST_TURNED_IN ( https://warcraft.wiki.gg/wiki/QUEST_TURNED_IN ) which might prove useful as well as QUEST_FINISHED (https://warcraft.wiki.gg/wiki/QUEST_FINISHED). Give those a go and see if they do what you need. If all else fails, you can do your updates via the OnUpdate routine as mentioned. Assuming you have a frame that handles all this stuff for you.
__________________
All Level 70 Characters: Demon Warlock Resto Druid Disc Priest Resto Shaman Survival Hunter Augment Evoker Frost Mage Vengence Demon Hunter Rogue ( was subtlety ) Brewmaster Monk (TR) Prot Paladin (TR) Blood Death Knight ( TR) As you can see I am missing a warrior And .. I don't have all the allied races covered. Time Runner time when it happens again |
|
04-06-24, 07:01 PM | #3 | |
The reason for that is, that's how you have it setup. I would take a look at the events for Quest Log stuff. https://warcraft.wiki.gg/wiki/Events#C_QuestLog
__________________
AddOns: Tim @ WoWInterface Battle Tag: Mysterio#11164 Current PC Setup: PCPartPicker List |
||
04-07-24, 04:32 AM | #4 |
I did this, but still the update is not in real time
Lua Code:
|
|
04-07-24, 06:51 AM | #5 |
Did you check to make sure that the event triggered when you clicked on the complete button for the quest ?
It is also possible that the IsQuestFlaggedCompleted function doesn't know about the just completed quest yet. If that is the case, the only thing you can do is use the OnUpdate function and put a timed check in there to periodically check if it is marked as complete yet. Let me check with one of my test toons and see if a simple test works as I expect it to. Okay.. I just tested with this small piece of code. Lua Code:
It worked as expected with the addon recognising that a quest had been turned in as it was turned in and marked it as completed immediately. The only slight error on my part was trying to display info.title instead of info["title"] on the screen. It might be that the quests you are looking into in particular are working differently. Try separating the event tests and see whether the QUEST_TURNED_IN functionality kicks in correctly. The saved variables show that on QUEST_ACCEPTED all of the information was available and on QUEST_TURNED_IN it knew it had been completed. In this example, the first alliance human quest was completed with the second accepted but not completed. Lua Code:
__________________
All Level 70 Characters: Demon Warlock Resto Druid Disc Priest Resto Shaman Survival Hunter Augment Evoker Frost Mage Vengence Demon Hunter Rogue ( was subtlety ) Brewmaster Monk (TR) Prot Paladin (TR) Blood Death Knight ( TR) As you can see I am missing a warrior And .. I don't have all the allied races covered. Time Runner time when it happens again Last edited by Xrystal : 04-07-24 at 07:28 AM. |
|
04-07-24, 07:42 AM | #6 |
Also, you could forego on the localization of the quest name as you could use the following :
C_QuestLog.GetTitleForQuestID(questID) https://warcraft.wiki.gg/wiki/API_C_...itleForQuestID - Includes Example Code Or a combination of : C_QuestLog.RequestLoadQuestByID(questID) and monitoring QUEST_DATA_LOAD_RESULT event for quest data access if it wasn't available before. https://warcraft.wiki.gg/wiki/API_C_...tLoadQuestByID https://warcraft.wiki.gg/wiki/QUEST_DATA_LOAD_RESULT Or like I did, use the QUEST_ACCEPTED part to access the quest info at the point it becomes available to you. It all depends on how your addon is supposed to work. I would suspect that the name of the quest would be automatically localized - similar to spell names and professions etc.
__________________
All Level 70 Characters: Demon Warlock Resto Druid Disc Priest Resto Shaman Survival Hunter Augment Evoker Frost Mage Vengence Demon Hunter Rogue ( was subtlety ) Brewmaster Monk (TR) Prot Paladin (TR) Blood Death Knight ( TR) As you can see I am missing a warrior And .. I don't have all the allied races covered. Time Runner time when it happens again |
|
04-08-24, 04:07 AM | #7 |
I tried combining my code with yours. But it still doesn't work.
Lua Code:
|
|
04-08-24, 05:12 AM | #8 |
What does it do ?
What did you expect it to do ? It doesn't work doesn't explain what is happening in your case. Looking at your code you are still only setting the information on PLAYER_LOGIN. This means it will only show the status ( outside of the printed statements from my code portions) when you first login or reload the UI. Your updating of the display code needs to be updated on completion too. Give this code a whirl. It's not perfect but hopefully it will work closer to what you wanted it to do. Lua Code:
__________________
All Level 70 Characters: Demon Warlock Resto Druid Disc Priest Resto Shaman Survival Hunter Augment Evoker Frost Mage Vengence Demon Hunter Rogue ( was subtlety ) Brewmaster Monk (TR) Prot Paladin (TR) Blood Death Knight ( TR) As you can see I am missing a warrior And .. I don't have all the allied races covered. Time Runner time when it happens again |
|
04-08-24, 06:53 AM | #9 |
Many thanks for the help. I still managed to do it using your code again + OnUpdate
Lua Code:
|
|
WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Real time update |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|