diff options
| author | Joonas <[email protected]> | 2020-06-22 00:30:48 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-22 00:30:48 +0800 |
| commit | 25316f82b53156060361dedf7451b65fc9e956d6 (patch) | |
| tree | 01415e1e2377d89211e7c6276add14d46f2c6d81 /src | |
| parent | Rework to use the new flat steam api (diff) | |
| download | steamworks-rs-25316f82b53156060361dedf7451b65fc9e956d6.tar.xz steamworks-rs-25316f82b53156060361dedf7451b65fc9e956d6.zip | |
Add UpdateHandle description and preview
Diffstat (limited to 'src')
| -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(); |