Skip to content

Commit

Permalink
[python] fix: add missing Resources.demand_server_vault
Browse files Browse the repository at this point in the history
  • Loading branch information
jd28 committed Jul 24, 2024
1 parent bebaa6d commit 5f74f29
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/fake/rollnw/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions rollnw-py/wrapper_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::type>{nw::ResourceType::dds, nw::ResourceType::tga});
Expand Down
2 changes: 2 additions & 0 deletions rollnw-stubs/kernel.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]: ...

Expand Down

0 comments on commit 5f74f29

Please sign in to comment.