From d8e6bf7535b021adc813833fa1d81fcfb1424783 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Fri, 9 Jun 2023 13:02:51 +0200 Subject: [PATCH] core: Show root DO's in debug view --- core/src/debug_ui/display_object.rs | 38 +++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/core/src/debug_ui/display_object.rs b/core/src/debug_ui/display_object.rs index 43f345799..696469566 100644 --- a/core/src/debug_ui/display_object.rs +++ b/core/src/debug_ui/display_object.rs @@ -268,8 +268,8 @@ impl DisplayObjectWindow { Grid::new(ui.id().with("display")) .num_columns(2) .show(ui, |ui| { + ui.label("Parent"); if let Some(other) = object.parent() { - ui.label("Parent"); open_display_object_button( ui, context, @@ -277,8 +277,42 @@ impl DisplayObjectWindow { other, &mut self.hovered_debug_rect, ); - ui.end_row(); + } else { + ui.colored_label(ui.style().visuals.error_fg_color, "Orphaned"); } + ui.end_row(); + + ui.label("AVM1 Root"); + if object.avm1_root().as_ptr() != object.as_ptr() { + open_display_object_button( + ui, + context, + messages, + object.avm1_root(), + &mut self.hovered_debug_rect, + ); + } else { + ui.label("Self"); + } + ui.end_row(); + + ui.label("AVM2 Root"); + if let Some(other) = object.avm2_root() { + if object.as_ptr() != object.as_ptr() { + open_display_object_button( + ui, + context, + messages, + other, + &mut self.hovered_debug_rect, + ); + } else { + ui.label("Self"); + } + } else { + ui.colored_label(ui.style().visuals.error_fg_color, "None"); + } + ui.end_row(); if let Some(other) = object.masker() { ui.label("Masker");