Skip to content

Commit

Permalink
Keep progress panel offscreen during loading; prevent progress panel …
Browse files Browse the repository at this point in the history
…opening during loading
  • Loading branch information
DMagic1 committed Aug 1, 2018
1 parent d56f3d0 commit 9822651
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions Source/ContractsWindow.Unity/Unity/CW_Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private IEnumerator GenerateContracts(IList<IContractSection> contracts)

int count = contracts.Count;

ProgressPanel.transform.SetParent(windowInterface.ContractStorageContainer, false);
ProgressPanel.transform.SetParent(windowInterface.ContractStorageContainer, true);

MissionSection.gameObject.SetActive(true);

Expand All @@ -213,7 +213,7 @@ private IEnumerator GenerateContracts(IList<IContractSection> contracts)
windowInterface.RefreshContracts();

if (ProgressPanel != null)
yield return StartCoroutine(ProgressPanel.GeneratePanel(windowInterface.GetProgressPanel, false));
yield return StartCoroutine(ProgressPanel.GeneratePanel(windowInterface.GetProgressPanel));

ProgressPanel.transform.SetParent(ContentTransform, false);
}
Expand Down Expand Up @@ -309,46 +309,49 @@ private void prepareTopBar()
loaded = true;
}

public void ToggleMainWindow(bool showProgress)
{
if (windowInterface == null)
return;
public void ToggleMainWindow(bool showProgress)
{
if (windowInterface == null)
return;

if (showProgress)
{
if (!ProgressPanel.Loaded)
return;

if (showProgress)
{
if (MissionSection != null)
MissionSection.gameObject.SetActive(false);

if (ProgressPanel != null)
ProgressPanel.gameObject.SetActive(true);

RefreshProgress();

if (MissionTitle != null)
MissionTitle.OnTextUpdate.Invoke(windowInterface.ProgressTitle);
if (MissionTitle != null)
MissionTitle.OnTextUpdate.Invoke(windowInterface.ProgressTitle);

if (MainPanelTooltip != null)
MainPanelTooltip.TooltipIndex = 0;
}
else
if (MainPanelTooltip != null)
MainPanelTooltip.TooltipIndex = 0;
}
else
{
if (ProgressPanel != null)
if (ProgressPanel != null && ProgressPanel.Loaded)
ProgressPanel.gameObject.SetActive(false);

if (MissionSection != null)
MissionSection.gameObject.SetActive(true);

if (MissionTitle != null && MissionSection != null)
MissionTitle.OnTextUpdate.Invoke(MissionSection.MasterMission ? windowInterface.AllMissionTitle : MissionSection.MissionTitle + ":");
MissionTitle.OnTextUpdate.Invoke(MissionSection.MasterMission ? windowInterface.AllMissionTitle : MissionSection.MissionTitle + ":");

if (MainPanelTooltip != null)
MainPanelTooltip.TooltipIndex = 1;
}
if (MainPanelTooltip != null)
MainPanelTooltip.TooltipIndex = 1;
}

showingContracts = !showProgress;
showingContracts = !showProgress;

ProcessTooltips();
}
ProcessTooltips();
}

public void ToggleTooltips(bool isOn)
{
Expand Down

0 comments on commit 9822651

Please sign in to comment.