Skip to content

Commit

Permalink
Merge pull request #3095 from t3du/DebugConsole
Browse files Browse the repository at this point in the history
DebugConsole: add uid and collections
  • Loading branch information
luboslenco authored Dec 9, 2024
2 parents 17d9354 + 5dfa4f8 commit 85fc709
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions armory/Sources/armory/trait/internal/DebugConsole.hx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class DebugConsole extends Trait {
static var lastTraces: Array<String> = [""];
static function consoleTrace(v: Dynamic, ?inf: haxe.PosInfos) {
lastTraces.unshift(haxe.Log.formatOutput(v, traceWithPosition ? inf : null));
if (lastTraces.length > 10) lastTraces.pop();
if (lastTraces.length > 100) lastTraces.pop();
haxeTrace(v, inf);
}

Expand Down Expand Up @@ -271,7 +271,7 @@ class DebugConsole extends Trait {

if (ui.tab(htab, "Scene")) {

if (ui.panel(Id.handle({selected: true}), "Outliner")) {
if (ui.panel(Id.handle({selected: true}), "Outliner: obj.uid_obj.name")) {
ui.indent();
ui._y -= ui.ELEMENT_OFFSET();

Expand All @@ -280,7 +280,7 @@ class DebugConsole extends Trait {

function drawObjectNameInList(object: iron.object.Object, selected: Bool) {
var _y = ui._y;
ui.text(object.name);
ui.text(object.uid+'_'+object.name);

if (object == iron.Scene.active.camera) {
var tagWidth = 100;
Expand Down Expand Up @@ -529,6 +529,24 @@ class DebugConsole extends Trait {
ui.unindent();
}

var col: Array<String> = [];

for (g in iron.Scene.active.raw.groups){
if(iron.Scene.active.getGroup(g.name).indexOf(selectedObject) != -1) col.push(g.name);
}

if (col.length > 0) {
ui.text("Collections: "+col.length);
ui.indent();

for (i => name in col) {
ui.text((i+1)+'-> '+name);
}

ui.unindent();
}


if (selectedObject.name == "Scene") {
selectedType = "(Scene)";
if (iron.Scene.active.world != null) {
Expand Down

0 comments on commit 85fc709

Please sign in to comment.