summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ear.rs11
-rw-r--r--src/components/mod.rs5
2 files changed, 15 insertions, 1 deletions
diff --git a/src/components/ear.rs b/src/components/ear.rs
index 6b723b0..6e832aa 100644
--- a/src/components/ear.rs
+++ b/src/components/ear.rs
@@ -40,6 +40,10 @@ pub enum Notification {
Options {
description: String,
options: Vec<(String, String)>
+ },
+ Describe{
+ name: String,
+ description: String
}
}
@@ -59,7 +63,8 @@ impl Notification {
},
Kill{actor: _, target: _} => "kill",
Die{actor: _, target: _} => "die",
- Options{description: _, options: _} => "options"
+ Options{description: _, options: _} => "options",
+ Describe{name: _, description: _} => "describe",
}).to_string()
}
@@ -91,6 +96,10 @@ impl Notification {
Options{description, options} => {(
format!("{}. Options: {}", description, options.iter().map(|(command, desc)| format!("'{}': {};", command, desc)).collect::<Vec<String>>().join(" ")),
json!({"description": description.clone(), "options": options.clone()})
+ )},
+ Describe{name, description} => {(
+ format!("{} - {}", name, description),
+ json!({"description": description.clone(), "name": name.clone()})
)}
};
(self.type_name(), body, payload)
diff --git a/src/components/mod.rs b/src/components/mod.rs
index d462fef..4c2ccf4 100644
--- a/src/components/mod.rs
+++ b/src/components/mod.rs
@@ -264,3 +264,8 @@ pub struct Requirements {
pub required_flags: HashSet<Flag>,
pub blocking_flags: HashSet<Flag>
}
+
+#[derive(Component, Debug, Clone)]
+pub struct Description {
+ pub description: String
+}