aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoonas <[email protected]>2020-06-22 00:30:48 +0800
committerGitHub <[email protected]>2020-06-22 00:30:48 +0800
commit25316f82b53156060361dedf7451b65fc9e956d6 (patch)
tree01415e1e2377d89211e7c6276add14d46f2c6d81 /src
parentRework to use the new flat steam api (diff)
downloadsteamworks-rs-25316f82b53156060361dedf7451b65fc9e956d6.tar.xz
steamworks-rs-25316f82b53156060361dedf7451b65fc9e956d6.zip
Add UpdateHandle description and preview
Diffstat (limited to 'src')
-rw-r--r--src/ugc.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ugc.rs b/src/ugc.rs
index 78ae003..a286d83 100644
--- a/src/ugc.rs
+++ b/src/ugc.rs
@@ -438,6 +438,25 @@ impl <Manager> UpdateHandle<Manager> {
}
#[must_use]
+ pub fn description(self, description: &str) -> Self {
+ unsafe {
+ let description = CString::new(description).unwrap();
+ assert!(sys::SteamAPI_ISteamUGC_SetItemDescription(self.ugc, self.handle, description.as_ptr()));
+ }
+ self
+ }
+
+ #[must_use]
+ pub fn preview_path(self, path: &Path) -> Self {
+ unsafe {
+ let path = path.canonicalize().unwrap();
+ let preview_path = CString::new(&*path.to_string_lossy()).unwrap();
+ assert!(sys::SteamAPI_ISteamUGC_SetItemPreview(self.ugc, self.handle, preview_path.as_ptr()));
+ }
+ self
+ }
+
+ #[must_use]
pub fn content_path(self, path: &Path) -> Self {
unsafe {
let path = path.canonicalize().unwrap();