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.
This commit is contained in:
2021-01-23 20:10:42 -05:00
parent d1849735b2
commit f79ea29f3a
3 changed files with 408 additions and 315 deletions

View File

@@ -24,8 +24,8 @@ bool RegisterFuncs(RE::BSScript::IVirtualMachine* a_vm)
a_vm->RegisterFunction("Load", "BRInteriorRefList", LoadInteriorRefList);
a_vm->RegisterFunction("LoadByShopId", "BRInteriorRefList", LoadInteriorRefListByShopId);
//a_vm->RegisterFunction("Toggle", "BRMerchandiseList", ToggleMerchandise);
//a_vm->RegisterFunction("NextPage", "BRMerchandiseList", LoadNextMerchandise);
//a_vm->RegisterFunction("PrevPage", "BRMerchandiseList", LoadPrevMerchandise);
a_vm->RegisterFunction("NextPage", "BRMerchandiseList", LoadNextMerchandise);
a_vm->RegisterFunction("PrevPage", "BRMerchandiseList", LoadPrevMerchandise);
a_vm->RegisterFunction("Load", "BRMerchandiseList", LoadMerchandiseByShopId);
//a_vm->RegisterFunction("Refresh", "BRMerchandiseList", RefreshMerchandise);
a_vm->RegisterFunction("Replace3D", "BRMerchandiseList", ReplaceMerch3D);