From 5f74f29b61f84a8ec940552ea3c784abada35082 Mon Sep 17 00:00:00 2001 From: jmd Date: Tue, 23 Jul 2024 18:49:14 -0700 Subject: [PATCH] [python] fix: add missing Resources.demand_server_vault --- docs/fake/rollnw/kernel.py | 4 ++++ rollnw-py/wrapper_kernel.cpp | 1 + rollnw-stubs/kernel.pyi | 2 ++ 3 files changed, 7 insertions(+) diff --git a/docs/fake/rollnw/kernel.py b/docs/fake/rollnw/kernel.py index 1f49e2e05..36cad5022 100644 --- a/docs/fake/rollnw/kernel.py +++ b/docs/fake/rollnw/kernel.py @@ -199,6 +199,10 @@ def demand_in_order(self, resref: str, """Attempts to locate first matching resource by resource type priority. """ + def demand_server_vault(self, cdkey: str, resref: str) -> ResourceData: + """Demands a player character file. + """ + def texture(self, resref: str, types: list[ResourceType] = [ResourceType.dds, ResourceType.tga]) -> Optional[Image]: """Loads a texture from the resource manager diff --git a/rollnw-py/wrapper_kernel.cpp b/rollnw-py/wrapper_kernel.cpp index 550d49265..fb17c1406 100644 --- a/rollnw-py/wrapper_kernel.cpp +++ b/rollnw-py/wrapper_kernel.cpp @@ -143,6 +143,7 @@ void init_kernel_resources(py::module& kernel) py::keep_alive<1, 2>()) .def("demand_any", &nw::kernel::Resources::demand_any) .def("demand_in_order", &nw::kernel::Resources::demand_in_order) + .def("demand_server_vault", &nw::kernel::Resources::demand_server_vault) .def("texture", &nw::kernel::Resources::texture, py::arg("resref"), py::arg("types") = std::initializer_list{nw::ResourceType::dds, nw::ResourceType::tga}); diff --git a/rollnw-stubs/kernel.pyi b/rollnw-stubs/kernel.pyi index 88913385e..9bf546cb8 100644 --- a/rollnw-stubs/kernel.pyi +++ b/rollnw-stubs/kernel.pyi @@ -84,6 +84,8 @@ class Resources(rollnw.Container): def demand_in_order(self, resref: str, restypes: List[ResourceType]) -> ResourceData: ... + def demand_server_vault(self, cdkey: str, resref: str) -> ResourceData: ... + def texture(self, resref: str, types: List[ResourceType] = [ResourceType.dds, ResourceType.tga]) -> Optional[Image]: ...