add_dialogue()
This commit is contained in:
parent
e32027e0af
commit
b08e514b12
11
src/game.rs
11
src/game.rs
|
@ -548,6 +548,17 @@ impl Game {
|
|||
new_id
|
||||
}
|
||||
|
||||
/// adds a dialogue safely and returns the new dialogue ID
|
||||
#[inline]
|
||||
pub fn add_dialogue(&mut self, mut dialogue: Dialogue) -> String {
|
||||
let new_id = try_id(self.dialogue_ids(), dialogue.id.clone());
|
||||
if new_id != dialogue.id {
|
||||
dialogue.id = new_id.clone();
|
||||
}
|
||||
self.dialogues.push(dialogue);
|
||||
new_id
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn version_line(&self) -> String {
|
||||
if self.version.is_some() {
|
||||
|
|
Loading…
Reference in New Issue