[v1.3.0+] Schrödinger's Lore (Mark 2)
Posted: Sat Mar 16, 2019 12:49 am
My original Schrödinger's Lore addon has an annoying bug: because the game's notes on which which lore you've seen is also used to decide whether to place a lore object, the lore listed in the "Show known Lore" dialog will sometimes be different from the lore you've actually seen. In retrospect, I really should have implemented that whole thing differently… 
Anyway, backpatching the proper implementation into the original addon would invove multiple moving parts and would almost certainly break badly, so I'm starting over with a new addon, cleverly named Schrödinger's Lore (Mark 2).
As you can no doubt imagine, you definitely shouldn't use both at once, and if you're going to use either, you should definitely use this one.
[If you're an addon author and your addon adds lore that would benefit from this reordering, you can get in on this too: in your ToME:load hook, check for the presence of the PartyLore:addLoreGroup() method, and if present, call it to add whatever lore groups you need (after loading your lore definitions, of course
). Check this addon's hooks/load.lua for examples. (Fortunately, this is exactly the same mechanism provided by the original Schrödinger's Lore addon, so your modifications will work the same for both addons.)]
[Technical notes:]

Anyway, backpatching the proper implementation into the original addon would invove multiple moving parts and would almost certainly break badly, so I'm starting over with a new addon, cleverly named Schrödinger's Lore (Mark 2).

[If you're an addon author and your addon adds lore that would benefit from this reordering, you can get in on this too: in your ToME:load hook, check for the presence of the PartyLore:addLoreGroup() method, and if present, call it to add whatever lore groups you need (after loading your lore definitions, of course

[Technical notes:]
Code: Select all
Hooks:
ToME:load [to add our lore groups]
Entity:loadList [to modify lore objects as needed]
Superload:
mod.class.interface.PartyLore:
addLoreGroup() [added, to add lore groups (hence the name)]
getLoreGroup() [added, for use by Party:learnLore() below]
checkLoreFilter() [added, for lore objects' :checkFilter() method]
mod.class.Party:
learnLore() [to check for lore groups and change lore to be learned as needed]
mod.dialogs.Birther:
on_register() [show an addon collision dialog if necessary]