some auto-refactoring
This commit is contained in:
@@ -41,8 +41,8 @@ pub(crate) enum Action {
|
||||
Log(LogLine),
|
||||
/// Add (`present = true`) or remove (`present = false`) `tag` on `target`.
|
||||
SetTag { target: ObjectId, tag: String, present: bool },
|
||||
/// Display a speech bubble above the source object for [`crate::game::SAY_DURATION`] seconds.
|
||||
Say(String),
|
||||
/// Display a speech bubble above the source object for `duration` seconds.
|
||||
Say(String, f64),
|
||||
/// Pause draining this object's queue for `secs` seconds. Never reaches the board queue.
|
||||
Delay(f64),
|
||||
/// Set the source object's foreground and/or background color.
|
||||
@@ -95,9 +95,10 @@ pub(crate) fn action_to_map(action: &Action) -> rhai::Map {
|
||||
m.insert("tag".into(), Dynamic::from(tag.clone()));
|
||||
m.insert("present".into(), Dynamic::from(*present));
|
||||
}
|
||||
Action::Say(text) => {
|
||||
m.insert("type".into(), ds("Say"));
|
||||
m.insert("msg".into(), Dynamic::from(text.clone()));
|
||||
Action::Say(text, dur) => {
|
||||
m.insert("type".into(), ds("Say"));
|
||||
m.insert("msg".into(), Dynamic::from(text.clone()));
|
||||
m.insert("duration".into(), Dynamic::from(*dur));
|
||||
}
|
||||
Action::Delay(secs) => {
|
||||
m.insert("type".into(), ds("Delay"));
|
||||
|
||||
Reference in New Issue
Block a user