diff options
| author | Matthew Collins <[email protected]> | 2020-06-21 19:58:59 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-21 19:58:59 +0100 |
| commit | 1d0e635b7407b032346f5b3fbecd9d2760debe63 (patch) | |
| tree | 01415e1e2377d89211e7c6276add14d46f2c6d81 | |
| parent | Rework to use the new flat steam api (diff) | |
| parent | Add UpdateHandle description and preview (diff) | |
| download | steamworks-rs-1d0e635b7407b032346f5b3fbecd9d2760debe63.tar.xz steamworks-rs-1d0e635b7407b032346f5b3fbecd9d2760debe63.zip | |
Merge pull request #23 from wyozi/patch-1
Add UpdateHandle description and preview
| -rw-r--r-- | src/ugc.rs | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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(); |