Skip to content

Commit

Permalink
Update asset explorer on background
Browse files Browse the repository at this point in the history
  • Loading branch information
tentone committed May 15, 2018
1 parent 8be3d4f commit 5b8cdfb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
30 changes: 5 additions & 25 deletions source/Editor.js
Expand Up @@ -815,7 +815,6 @@ Editor.addObject = function(obj, parent)
parent = Editor.program.scene;
}


//TODO <Check for resources here and create a history action to add resources and objects>

Editor.history.add(new ObjectAddedAction(obj, parent));
Expand Down Expand Up @@ -1067,34 +1066,19 @@ Editor.selectTool = function(tool)

Editor.updateSettings = function()
{
var tab = Editor.gui.bottomTab.getActual();
if(tab !== null)
{
tab.updateSettings();
}
Editor.gui.bottomTab.updateSettings();
};

//Update all object views
Editor.updateObjectsViewsGUI = function()
{
//Update tree view to match actual scene
Editor.gui.treeView.updateObjectsView();

//Update tabs
var tab = Editor.gui.bottomTab.getActual();
if(tab !== null)
{
tab.updateObjectsView();
}

var tab = Editor.gui.tab.getActual();
if(tab !== null)
{
tab.updateObjectsView();
}
Editor.gui.bottomTab.updateObjectsView();
Editor.gui.bottomTab.updateMetadata();

Editor.gui.tab.updateObjectsView();
Editor.gui.tab.updateMetadata();
Editor.gui.bottomTab.updateMetadata();
};


Expand All @@ -1117,11 +1101,7 @@ Editor.updateSelectionGUI = function()

//Bottom tab group
Editor.gui.bottomTab.updateMetadata();
var tab = Editor.gui.bottomTab.getActual();
if(tab !== null)
{
tab.updateSelection();
}
Editor.gui.bottomTab.updateSelection();

//Right side tab group
/*Editor.gui.bottomTab.updateMetadata();
Expand Down
27 changes: 27 additions & 0 deletions source/editor/ui/TabGroup.js
Expand Up @@ -58,6 +58,33 @@ TabGroup.prototype.updateMetadata = function()
}
};

//Update all tab object views
TabGroup.prototype.updateObjectsView = function()
{
for(var i = 0; i < this.options.length; i++)
{
this.options[i].updateObjectsView();
}
};

//Update all tab object views
TabGroup.prototype.updateSelection = function()
{
for(var i = 0; i < this.options.length; i++)
{
this.options[i].updateSelection();
}
};

//Update all tab object views
TabGroup.prototype.updateSettings = function()
{
for(var i = 0; i < this.options.length; i++)
{
this.options[i].updateSettings();
}
};

//Get actual tab
TabGroup.prototype.getActual = function()
{
Expand Down
5 changes: 0 additions & 5 deletions source/editor/ui/tab/asset/AssetExplorer.js
Expand Up @@ -93,11 +93,6 @@ AssetExplorer.prototype.updateSelection = function()

AssetExplorer.prototype.updateObjectsView = function()
{
if(!this.active)
{
return;
}

this.clear();

ResourceManager.retrieveResources(Editor.program);
Expand Down

0 comments on commit 5b8cdfb

Please sign in to comment.