diff --git a/src/commands.rs b/src/commands.rs index 79889cf..0450627 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -67,19 +67,6 @@ struct ParserState { light_brightness: f32, light_color: Option, ar_model: Option, - -// // Chat fields -// delay: f64, -// text: String, -// level: String, -// label: String, -// goto: String, -// is_choice: bool, -// stores_item: bool, -// script: String, -// script_parameter: String, -// script_parameter2: String, -// sound: Option, } impl Default for ParserState { fn default() -> Self { @@ -123,52 +110,9 @@ impl Default for ParserState { light_brightness: 0.0, light_color: None, ar_model: None, - -// delay: 0.0, -// text: "".to_string(), -// level: "chat".to_string(), -// label: "".to_string(), -// goto: "".to_string(), -// is_choice: false, -// stores_item: false, -// script: "".to_string(), -// script_parameter: "".to_string(), -// script_parameter2: "".to_string(), -// sound: Some("chat".to_string()), } } } -impl ParserState { -// fn reset_message(&mut self) { -// let default = ParserState::default(); -// self.label = default.label; -// self.delay = default.delay; -// self.goto = default.goto; -// self.level = default.level; -// self.text = default.text; -// self.is_choice = default.is_choice; -// self.script = default.script; -// self.script_parameter = default.script_parameter; -// self.script_parameter2 = default.script_parameter2; -// self.sound = default.sound; -// } -// fn as_chatbranch(&self) -> chat::ChatBranch { -// return chat::ChatBranch { -// id: self.chat.clone(), -// name: self.name.clone().unwrap_or("".to_string()), -// label: self.label.clone(), -// delay: self.delay.clone(), -// sound: if self.is_choice || self.sound.is_none() { "".to_string() } else { "chat".to_string() }, -// level: self.level.clone(), -// reply: if self.is_choice { "".to_string() } else { self.text.clone() }, -// choice: if self.is_choice { self.text.clone() } else { "".to_string() }, -// goto: self.goto.clone(), -// script: self.script.clone(), -// script_parameter: self.script_parameter.clone(), -// script_parameter2: self.script_parameter2.clone(), -// } -// } -} pub fn load_defs( mut ew_spawn: EventWriter, @@ -470,104 +414,6 @@ pub fn load_defs( ["armodel", asset_name] => { state.ar_model = Some(asset_name.to_string()); } - - // Parsing chats -// ["chat", chat_name] => { -// debug!("Registering chat: {}", chat_name); -// ew_spawn.send(SpawnEvent(state)); -// state = ParserState::default(); -// state.class = DefClass::Chat; -// state.chat = chat_name.to_string(); -// } -// ["msg", sleep, text] => { -// debug!("Registering message (sleep={}): {}", sleep, text); -// ew_spawn.send(SpawnEvent(state.clone())); -// if let Ok(sleep_float) = sleep.parse::() { -// state.delay = sleep_float; -// state.text = text.to_string(); -// state.stores_item = true; -// state.is_choice = false; -// } else { -// error!("The 'sleep' value for this message is not a float: {}", line); -// continue; -// } -// } -// ["msg", sleep, label, goto, text] => { -// debug!("Registering message (sleep={}): {}", sleep, text); -// ew_spawn.send(SpawnEvent(state.clone())); -// state.reset_message(); -// if let Ok(sleep_float) = sleep.parse::() { -// state.delay = sleep_float; -// state.text = text.to_string(); -// state.stores_item = true; -// state.is_choice = false; -// state.goto = goto.to_string(); -// state.label = label.to_string(); -// } else { -// error!("The 'sleep' value for this message is not a float: {}", line); -// continue; -// } -// } -// ["choice", sleep, text] => { -// debug!("Registering choice (sleep={}): {}", sleep, text); -// ew_spawn.send(SpawnEvent(state.clone())); -// state.reset_message(); -// if let Ok(sleep_float) = sleep.parse::() { -// state.delay = sleep_float; -// state.text = text.to_string(); -// state.stores_item = true; -// state.is_choice = true; -// } else { -// error!("The 'sleep' value for this message is not a float: {}", line); -// continue; -// } -// } -// ["choice", sleep, label, goto, text] => { -// debug!("Registering choice (sleep={}): {}", sleep, text); -// ew_spawn.send(SpawnEvent(state.clone())); -// state.reset_message(); -// if let Ok(sleep_float) = sleep.parse::() { -// state.delay = sleep_float; -// state.text = text.to_string(); -// state.stores_item = true; -// state.is_choice = true; -// state.goto = goto.to_string(); -// state.label = label.to_string(); -// } else { -// error!("The 'sleep' value for this message is not a float: {}", line); -// continue; -// } -// } -// ["goto", label] => { -// debug!("Registering goto: {}", label); -// state.goto = label.to_string(); -// } -// ["label", label] => { -// debug!("Registering label: {}", label); -// state.label = label.to_string(); -// } -// ["lvl", level] => { -// debug!("Registering level: {}", level); -// state.level = level.to_string(); -// } -// ["script", scriptname] => { -// state.script = scriptname.to_string(); -// state.script_parameter = "".to_string(); -// state.script_parameter2 = "".to_string(); -// } -// ["script", scriptname, parameter] => { -// state.script = scriptname.to_string(); -// state.script_parameter = parameter.to_string(); -// state.script_parameter2 = "".to_string(); -// } -// ["script", scriptname, parameter, parameter2] => { -// state.script = scriptname.to_string(); -// state.script_parameter = parameter.to_string(); -// state.script_parameter2 = parameter2.to_string(); -// } -// ["sound", "none"] => { -// state.sound = None; -// } _ => { error!("No match for [{}]", parts.join(",")); }