Skip to content
Permalink
Browse files

ExplorerView now refreshes onEnable if the grid layouting has been af…

…fected by resizing, etc
  • Loading branch information...
Jackson Wood
Jackson Wood committed Jul 15, 2019
1 parent 9b06d4a commit 1ba8d60053c30447cfab0db21ae6438b29c6f013
Showing with 27 additions and 16 deletions.
  1. +27 −16 src/UI/ExplorerView.cs
@@ -114,6 +114,26 @@ public int CurrentPageCount
}

// ---------[ INITIALIZATION ]---------
private void OnEnable()
{
// NOTE(@jackson): This appears to be unnecessary?
// UpdateCurrentPageDisplay();

if(this.isActiveIndicator != null)
{
this.isActiveIndicator.isOn = true;
}

if(this.currentPageContainer != null)
{
int viewsOnCurrentPageCount = this.currentPageContainer.childCount;
if(this.itemsPerPage != viewsOnCurrentPageCount)
{
Refresh();
}
}
}

private void Start()
{
// asserts
@@ -167,18 +187,6 @@ private void Start()
this.Refresh();
}

// TODO(@jackson): Recheck page size
private void OnEnable()
{
// NOTE(@jackson): This appears to be unnecessary?
// UpdateCurrentPageDisplay();

if(this.isActiveIndicator != null)
{
this.isActiveIndicator.isOn = true;
}
}

private void OnDisable()
{
if(this.isActiveIndicator != null)
@@ -218,7 +226,7 @@ public void Refresh()
wasDisplayUpdated = true;
}
},
null);
WebRequestError.LogAsWarning);

if(!wasDisplayUpdated)
{
@@ -283,10 +291,8 @@ public void UpdatePageButtonInteractibility()

public void ChangePage(int pageDifferential)
{
// TODO(@jackson): Queue on isTransitioning?
if(this.isTransitioning)
{
Debug.LogWarning("[mod.io] Cannot change during transition");
return;
}

@@ -573,7 +579,7 @@ private void DisplayProfiles(IEnumerable<ModProfile> profileCollection, RectTran
UpdateStatisticsDisplays(statsArray);
}
},
null);
WebRequestError.LogAsWarning);
}

// fix layouting
@@ -733,6 +739,11 @@ public void OnGameProfileUpdated(GameProfile gameProfile)
if(this.m_tagCategories != gameProfile.tagCategories)
{
this.m_tagCategories = gameProfile.tagCategories;

if(this.isActiveAndEnabled)
{
this.Refresh();
}
}
}

0 comments on commit 1ba8d60

Please sign in to comment.
You can’t perform that action at this time.