Caves of Qud

Caves of Qud

Not enough ratings
Vendor Action Events (library)
   
Award
Favorite
Favorited
Unfavorite
Type: Library
File Size
Posted
Updated
166.434 KB
15 Sep @ 4:55am
19 Sep @ 7:50pm
3 Change Notes ( view )

Subscribe to download
Vendor Action Events (library)

Description
Current Version is v0.0.2.

Now safe(r) to add mid-save!
Two attributes with which you can decorate an IPart are now available to ensure that the part in question is added to either the vendor [AlwaysHandlesVendor_UD_VendorActions] or an item in the trade UI [AlwaysHandlesItem_UD_VendorActions] prior to the trade window opening (vendor) or the tradeline for the item attempts to collect any vendor actions. Parts decorated with one of these attributes should ensure they do any setup that would occur during object creation in an override of "AddedAfterCreation" so that the part is primed for immediate use.

Furthermore, a new flag is avaialable which returns true or false on the basis of this mod library being present during world generation for a given save. UD_Vendor_Actions.Startup.SaveStartedWithVendorActions is a good way to check during a [CallAfterGameLoaded] whether any setup was missed during world-gen and perform it then instead.

Finally, if, for whatever reason, a vendor actions list is completely empty, the base-game's implementation will be fallen back to.

Not perfect, but substantially more robust!

Vendor Actions

This is a mod library. It contains a small collection of events that mirror InventoryActions but for actions a vendor (trader) can take on behalf of the player during a trade. Existing actions include the librarian being able to allow the player to read donated books, and tinker NPCs identifying, repairing, and recharging items, as well as simply being able to "look" at items in the trade window.

On its own, this mod simply moves the existing vendor actions offered in the TradeUI to be in reponse to the set of custom events made available by this mod. The difference is only cosmetic (certain UI options are lower-case to match their hotkey) without another mod to make use of these events with custom vendor actions.

A couple of short guides will be posted on the mod's github when I get a chance, but if you want to make use of this mod before then, feel free to hit me up for assistance, I'll do my best.

If you're at all familiar with InventoryActions then this will be familiar territory, with only a few differences/additions. I've attempted to maintain a similar nomenclature to the base game, both for ease of use, and for ease of transition if the functionality is ever "vanillarised".

Disclaimer
I'm a hobbyist at absolute best, and a hack at the best of times, so, while I'll do my best to keep this updated and working, it's entirely possible there'll be some time between game updates and this mod being updated, and some time between being reported bugs with it and their eventual fix.

There's also a BitBucket issue with a request for this functionality[bitbucket.org] to be included in the base game. In the event that's implemented, this library will be depricated and phased out in favor that.

I'm open to collaborating on this mod in the interim, so if you think this library is missing something integral or implements something poorly, let me know, and we'll see what we can work out.

This library depends on UnderDoug's Modding Toolbox.

Source
Want to see how it's made? There's a git repository[github.com]!

Licence is the "Unlicence". I don't know what that means, but I also don't care what you do with it. Easy.
Popular Discussions View All (1)
0
15 Sep @ 5:05am
PINNED: Find a Bug, Post a Bug
UnderDoug
2 Comments
UnderDoug  [author] 15 Sep @ 3:49pm 
@wizardlibrarian I did, thank you. I've repaired it now. This is what I get for doing this before bed, haha.
wizardlibrarian 15 Sep @ 8:50am 
It looks like you missed some of the closing /s for the urls in the description