aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Collins <[email protected]>2020-06-21 19:58:59 +0100
committerGitHub <[email protected]>2020-06-21 19:58:59 +0100
commit1d0e635b7407b032346f5b3fbecd9d2760debe63 (patch)
tree01415e1e2377d89211e7c6276add14d46f2c6d81
parentRework to use the new flat steam api (diff)
parentAdd UpdateHandle description and preview (diff)
downloadsteamworks-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.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();