|
|
|
@ -33,10 +33,12 @@ fn main() {
|
|
|
|
(
|
|
|
|
(
|
|
|
|
// Start a dialog if none are running
|
|
|
|
// Start a dialog if none are running
|
|
|
|
start_dialog
|
|
|
|
start_dialog
|
|
|
|
|
|
|
|
.run_if(in_state(DebuggingState::Off))
|
|
|
|
.run_if(in_state(DialogState::None))
|
|
|
|
.run_if(in_state(DialogState::None))
|
|
|
|
.run_if(on_event::<Pointer<Click>>),
|
|
|
|
.run_if(on_event::<Pointer<Click>>),
|
|
|
|
// Close the dialog box if it is idle (not choosing)
|
|
|
|
// Close the dialog box if it is idle (not choosing)
|
|
|
|
end_dialog
|
|
|
|
end_dialog
|
|
|
|
|
|
|
|
.run_if(in_state(DebuggingState::Off))
|
|
|
|
.run_if(in_state(DialogState::Idle))
|
|
|
|
.run_if(in_state(DialogState::Idle))
|
|
|
|
.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>>),
|
|
|
|
@ -704,10 +706,12 @@ fn hide_monologue_preview(
|
|
|
|
|
|
|
|
|
|
|
|
fn drag_tree(
|
|
|
|
fn drag_tree(
|
|
|
|
trigger: Trigger<Pointer<Drag>>,
|
|
|
|
trigger: Trigger<Pointer<Drag>>,
|
|
|
|
|
|
|
|
state: Res<State<DebuggingState>>,
|
|
|
|
mut query: Query<&mut Transform, With<Tree>>,
|
|
|
|
mut query: Query<&mut Transform, With<Tree>>,
|
|
|
|
camera: Single<(&Camera, &GlobalTransform), With<Camera>>,
|
|
|
|
camera: Single<(&Camera, &GlobalTransform), With<Camera>>,
|
|
|
|
window: Single<&Window>
|
|
|
|
window: Single<&Window>
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
if *state.get() == DebuggingState::On {
|
|
|
|
if let Ok(mut t) = query.get_mut(trigger.target()) {
|
|
|
|
if let Ok(mut t) = query.get_mut(trigger.target()) {
|
|
|
|
let world_position = window
|
|
|
|
let world_position = window
|
|
|
|
.cursor_position()
|
|
|
|
.cursor_position()
|
|
|
|
@ -721,3 +725,4 @@ fn drag_tree(
|
|
|
|
t.translation = world_position.unwrap();
|
|
|
|
t.translation = world_position.unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|