Commit Graph

27 Commits

Author SHA1 Message Date
7c77bc47be Send structured server errors to papyrus
Refactored error handling, but I still haven't tested it in-game.
2021-02-28 18:51:24 -05:00
ea3cf72c3c Fix copy and paste oopsie with log messages 2021-02-13 18:30:01 -05:00
17d428d385 Load shop keywords and gold, update shop gold
Gold is loaded into merchant chest after merchandise is loaded now. Gold is not saved to the merchandise list, but if owner takes or stores gold the change is saved to the shop separately. Gold refreshes after any transaction.
2021-02-13 17:50:19 -05:00
289ec598d4 Get & save keywords with transactions
Also, start setting vendor faction vendor items form list during shop load (hardcoded to just sell/buy armor for now until I implement shop configs).
2021-02-09 23:52:04 -05:00
c576a2b885 Add keyword strings to merchandise 2021-02-09 00:59:06 -05:00
ccaa413137 Allow selling items to the public merch chest 2021-02-06 00:28:50 -05:00
f79ea29f3a Refactor Merchandise and shelves
Shelves are now saved in a special section in the InteriorRefList and must be loaded dynamically when the shop is loaded.

Merchandise for the shop is loaded once and saved in the private merchandise chest for the shop. Optimize updating merchandise to refresh the shelves from the response of the update instead of refetching the merchandise.

A single shelf can be loaded and paged indpedent from other shelves in the cell.
2021-01-23 20:10:42 -05:00
d1849735b2 Semi-working refactor of merch for multiple shelves
Code is now capable of loading merch onto multiple store shelves during load shop.

Still need to fix refresh, loading merch after creating merch and making transactions, the shelf buttons, as well as saving the state of the shelves to the server.
2020-11-28 23:44:48 -05:00
e673ac4642 Save and load shelves from server interior_ref_lists
During CreateInteriorRefList, save shelf positions in a separate vector and ignore their buttons. In Load, recreate the shelves and their buttons from the shelf vec.

Also start storing FormIDs in a header file so I don't have to keep passing Keywords into all the functions from Papyrus.
2020-11-21 01:36:14 -05:00
0f1b017158 Calculate price from value, use ints for ids 2020-11-18 23:26:45 -05:00
a0eea948fe Add CreateTransaction function
Also made some changes to the MerchandiseList functions to support the new buy item flow.
2020-11-02 10:36:17 -05:00
5c03dace17 Finally got relative positioning of merch working 2020-10-25 20:25:58 -04:00
cf8e0d099d Update interior_ref_list and merchandise_list by shop id
Also, rename placeholder to activator. Get merchandise by shop id. Start adjusting merch positions based on shelf angle.
2020-10-25 03:19:36 -04:00
6512534219 Rename external get_interior_ref_list_by_shop_id call 2020-10-24 03:03:43 -04:00
7602efbc77 Add LoadInteriorRefListByShopId function 2020-10-20 01:20:13 -04:00
e4611ea20d Add ListShops function 2020-10-19 01:11:57 -04:00
055905bffc Refactor API calls to use FFIResult
Also create a `successReg` and `failReg` for every async function. Report error string to `failReg`.
2020-10-18 20:53:41 -04:00
c42b29af5d Add update shop & owner, get shop, better error handling 2020-10-18 02:34:34 -04:00
083c6a7f6e Update BRClient.Init to receive bool result 2020-10-17 19:22:57 -04:00
00e99bba2e Clean up dead commented code 2020-10-17 17:32:38 -04:00
404f2d9ae5 Fix crash in LoadMerch by clearing/placing refs in main thread 2020-10-16 20:19:48 -04:00
b3dd9e240d Make LoadInteriorRefList async without crash using SKSE Task interface 2020-10-16 17:43:02 -04:00
5afc919f03 Make functions with external calls async
Except for LoadInteriorRefList which seems to be causing a crash if I make it async.
2020-10-15 23:41:39 -04:00
7fb30a892d Use RegistrationMap to make LoadMerch async 2020-10-13 22:33:34 -04:00
2dc15a1884 Update related projects in README 2020-10-12 21:40:05 -04:00
7fa7d15e20 Add related projects to README 2020-10-12 21:16:59 -04:00
36abd362cd Initial commit. Integrates with client, saves refs and merch. 2020-10-12 19:50:20 -04:00