-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Pespiri/bsipa4-update
Beat Saber 1.8.0 and BSIPA4 update
- Loading branch information
Showing
14 changed files
with
107 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,31 @@ | ||
using CustomWalls.Settings.Utilities; | ||
using IPA.Config; | ||
using IPA.Utilities; | ||
using IPA.Config.Stores; | ||
|
||
namespace CustomWalls.Settings | ||
{ | ||
public class Configuration | ||
{ | ||
private static Ref<PluginConfig> config; | ||
private static IConfigProvider configProvider; | ||
|
||
public static string CurrentlySelectedMaterial { get; internal set; } | ||
public static bool EnableObstacleFrame { get; internal set; } | ||
|
||
public static bool UserDisabledScores { get; internal set; } | ||
|
||
internal static void Init(IConfigProvider cfgProvider) | ||
internal static void Init(Config config) | ||
{ | ||
configProvider = cfgProvider; | ||
config = cfgProvider.MakeLink<PluginConfig>((p, v) => | ||
{ | ||
if (v.Value == null || v.Value.RegenerateConfig) | ||
{ | ||
p.Store(v.Value = new PluginConfig() { RegenerateConfig = false }); | ||
} | ||
config = v; | ||
}); | ||
PluginConfig.Instance = config.Generated<PluginConfig>(); | ||
} | ||
|
||
internal static void Load() | ||
{ | ||
CurrentlySelectedMaterial = config.Value.SelectedWallMaterial; | ||
EnableObstacleFrame = config.Value.EnableObstacleFrame; | ||
CurrentlySelectedMaterial = PluginConfig.Instance.SelectedWallMaterial; | ||
EnableObstacleFrame = PluginConfig.Instance.EnableObstacleFrame; | ||
} | ||
|
||
internal static void Save() | ||
{ | ||
config.Value.SelectedWallMaterial = CurrentlySelectedMaterial; | ||
config.Value.EnableObstacleFrame = EnableObstacleFrame; | ||
|
||
configProvider.Store(config.Value); | ||
PluginConfig.Instance.SelectedWallMaterial = CurrentlySelectedMaterial; | ||
PluginConfig.Instance.EnableObstacleFrame = EnableObstacleFrame; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,29 @@ | ||
using BeatSaberMarkupLanguage.ViewControllers; | ||
using BeatSaberMarkupLanguage.Attributes; | ||
using BeatSaberMarkupLanguage.ViewControllers; | ||
using CustomWalls.Data; | ||
using CustomWalls.Utilities; | ||
using HMUI; | ||
|
||
namespace CustomWalls.Settings.UI | ||
{ | ||
internal class MaterialPreviewViewController : BSMLResourceViewController | ||
{ | ||
public override string ResourceName => "CustomWalls.Settings.UI.Views.materialPreview.bsml"; | ||
|
||
[UIComponent("error-description")] | ||
public TextPageScrollView errorDescription; | ||
|
||
public void OnMaterialWasChanged(CustomMaterial customMaterial) | ||
{ | ||
if (!string.IsNullOrWhiteSpace(customMaterial?.ErrorMessage)) | ||
{ | ||
errorDescription.gameObject.SetActive(true); | ||
errorDescription.SetText($"{customMaterial.Descriptor?.MaterialName}:\n\n{Utils.SafeUnescape(customMaterial.ErrorMessage)}"); | ||
} | ||
else | ||
{ | ||
errorDescription.gameObject.SetActive(false); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.