diff --git a/CustomWalls/Settings/UI/MaterialListViewController.cs b/CustomWalls/Settings/UI/MaterialListViewController.cs index bb27310..2d3335e 100644 --- a/CustomWalls/Settings/UI/MaterialListViewController.cs +++ b/CustomWalls/Settings/UI/MaterialListViewController.cs @@ -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"; diff --git a/CustomWalls/Settings/UI/MaterialsFlowCoordinator.cs b/CustomWalls/Settings/UI/MaterialsFlowCoordinator.cs index 0ba2334..d3b1228 100644 --- a/CustomWalls/Settings/UI/MaterialsFlowCoordinator.cs +++ b/CustomWalls/Settings/UI/MaterialsFlowCoordinator.cs @@ -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(); materialsPreviewView = BeatSaberUI.CreateViewController(); + } + + if (!materialsDescriptionView) + { materialsDescriptionView = BeatSaberUI.CreateViewController(); + } + if (!materialsListView) + { + materialsListView = BeatSaberUI.CreateViewController(); materialsListView.customMaterialChanged += materialsDescriptionView.OnMaterialWasChanged; } } @@ -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); } } }