Skip to content

Commit

Permalink
Some minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Pespiri committed Jan 28, 2020
1 parent 5d94e43 commit 5c7f934
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CustomWalls/Settings/UI/MaterialListViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace CustomWalls.Settings.UI
{
internal class MaterialListView : BSMLResourceViewController
internal class MaterialListViewController : BSMLResourceViewController
{
public override string ResourceName => "CustomWalls.Settings.UI.Views.materialList.bsml";

Expand Down
17 changes: 11 additions & 6 deletions CustomWalls/Settings/UI/MaterialsFlowCoordinator.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
using BeatSaberMarkupLanguage;
using HMUI;
using IPA.Utilities;
using System;

namespace CustomWalls.Settings.UI
{
internal class MaterialsFlowCoordinator : FlowCoordinator
{
private MaterialListView materialsListView;
private MaterialListViewController materialsListView;
private MaterialPreviewViewController materialsPreviewView;
private MaterialDetailsViewController materialsDescriptionView;

public void Awake()
{
if (materialsListView == null)
if (!materialsPreviewView)
{
materialsListView = BeatSaberUI.CreateViewController<MaterialListView>();
materialsPreviewView = BeatSaberUI.CreateViewController<MaterialPreviewViewController>();
}

if (!materialsDescriptionView)
{
materialsDescriptionView = BeatSaberUI.CreateViewController<MaterialDetailsViewController>();
}

if (!materialsListView)
{
materialsListView = BeatSaberUI.CreateViewController<MaterialListViewController>();
materialsListView.customMaterialChanged += materialsDescriptionView.OnMaterialWasChanged;
}
}
Expand All @@ -43,8 +49,7 @@ protected override void DidActivate(bool firstActivation, ActivationType activat
protected override void BackButtonWasPressed(ViewController topViewController)
{
// Dismiss ourselves
MainFlowCoordinator mainFlow = BeatSaberUI.MainFlowCoordinator;
mainFlow.InvokePrivateMethod("DismissFlowCoordinator", this, null, false);
BeatSaberUI.MainFlowCoordinator.DismissFlowCoordinator(this, null, false);
}
}
}

0 comments on commit 5c7f934

Please sign in to comment.