Skip to content

Commit

Permalink
Merge pull request #11 from sketchfab/feature/fix-own-models_D3D-4855
Browse files Browse the repository at this point in the history
[#D3D-4855] Fixes downloadable filter in url (own models)
  • Loading branch information
AurL committed Jun 24, 2019
2 parents 0a2522f + 1dcee49 commit 8255cbd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,12 @@ void displaySearchBox()
GUILayout.FlexibleSpace();
bool previous = _myModels;
GUIContent content = _logger.isUserBasic() ? new GUIContent("My Models", SketchfabUI.getPlanIcon("pro")) : new GUIContent("My Models");

bool previousState = GUI.enabled;
GUI.enabled = SketchfabPlugin.getLogger().isUserLogged();
_myModels = GUILayout.Toggle(_myModels, content, GUILayout.Height(18));
GUI.enabled = previousState;

if (_myModels != previous)
{
if(_myModels)
Expand Down Expand Up @@ -295,7 +300,7 @@ void displayFeatures()
if (_animated != previous)
triggerSearch();
previous = _staffpicked;
_staffpicked = GUILayout.Toggle(_staffpicked, "StaffPicked");
_staffpicked = GUILayout.Toggle(_staffpicked, "Staff Picked");
if (_staffpicked != previous)
triggerSearch();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,16 @@ private void OnGUI()

GUILayout.BeginVertical(GUILayout.Width(300));
_ui.displayTitle("LICENSE");
if(model.licenseJson != null)
if(model.licenseJson != null && model.licenseJson["fullName"] != null)
{
_ui.displayContent(model.licenseJson["fullName"]);
_ui.displaySubContent(model.licenseJson["requirements"]);
}
else if(model.vertexCount != 0)
{
_ui.displayContent("Personal");
_ui.displaySubContent("You own this model");
}
else
{
_ui.displaySubContent("Fetching license data");
Expand Down Expand Up @@ -165,7 +170,7 @@ void displayImportSettings()

if (!_window._logger.isUserLogged())
{
buttonCaption = "You need to be logged in to download and import assets";
buttonCaption = "You need to be logged in to download assets";
GUI.enabled = false;
}
else if(modelIsAvailable)
Expand Down

0 comments on commit 8255cbd

Please sign in to comment.