|
|
|
@ -48,7 +48,9 @@ fn main() {
|
|
|
|
.run_if(on_event::<Pointer<Click>>),
|
|
|
|
.run_if(on_event::<Pointer<Click>>),
|
|
|
|
spawn_debug_buttons.run_if(on_event::<AssetEvent<Monologue>>),
|
|
|
|
spawn_debug_buttons.run_if(on_event::<AssetEvent<Monologue>>),
|
|
|
|
handle_plant_tree.run_if(on_event::<PlantTree>),
|
|
|
|
handle_plant_tree.run_if(on_event::<PlantTree>),
|
|
|
|
assign_monologue_to_tree.run_if(on_event::<AssignMonologue>).after(handle_plant_tree),
|
|
|
|
assign_monologue_to_tree
|
|
|
|
|
|
|
|
.run_if(on_event::<AssignMonologue>)
|
|
|
|
|
|
|
|
.after(handle_plant_tree),
|
|
|
|
dialog_engine.run_if(on_event::<DialogEvent>),
|
|
|
|
dialog_engine.run_if(on_event::<DialogEvent>),
|
|
|
|
auto_scroll.run_if(any_component_added::<DialogOption>),
|
|
|
|
auto_scroll.run_if(any_component_added::<DialogOption>),
|
|
|
|
dialog_box_visibility.run_if(state_changed::<DialogState>),
|
|
|
|
dialog_box_visibility.run_if(state_changed::<DialogState>),
|
|
|
|
@ -707,12 +709,9 @@ fn handle_plant_tree(
|
|
|
|
.observe(delete_tree)
|
|
|
|
.observe(delete_tree)
|
|
|
|
.observe(drag_tree);
|
|
|
|
.observe(drag_tree);
|
|
|
|
|
|
|
|
|
|
|
|
match assignment {
|
|
|
|
if let Some(handle) = assignment {
|
|
|
|
Some(handle) => {
|
|
|
|
|
|
|
|
assignments.write(AssignMonologue(handle.clone()));
|
|
|
|
assignments.write(AssignMonologue(handle.clone()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
None => ()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -862,10 +861,7 @@ fn assign_monologue_event(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// On startup, plant a forest (add a few trees to the game)
|
|
|
|
/// On startup, plant a forest (add a few trees to the game)
|
|
|
|
fn plant_forest(
|
|
|
|
fn plant_forest(monos: Res<Assets<Monologue>>, mut e_trees: EventWriter<PlantTree>) {
|
|
|
|
monos: Res<Assets<Monologue>>,
|
|
|
|
|
|
|
|
mut e_trees: EventWriter<PlantTree>,
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
let mut i = 10;
|
|
|
|
let mut i = 10;
|
|
|
|
for id in monos.ids() {
|
|
|
|
for id in monos.ids() {
|
|
|
|
debug!("Planting tree with monologue {:?}", id);
|
|
|
|
debug!("Planting tree with monologue {:?}", id);
|
|
|
|
@ -874,7 +870,7 @@ fn plant_forest(
|
|
|
|
} else if i > 0 {
|
|
|
|
} else if i > 0 {
|
|
|
|
e_trees.write(PlantTree(None));
|
|
|
|
e_trees.write(PlantTree(None));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
i -= 1;
|
|
|
|
i -= 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|