From a2565c3069877a5ff7ca582c027468c535f37d69 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Tue, 11 Jun 2019 14:45:54 -0500 Subject: [PATCH] Fixed some access permissions Fixed doc generation --- BSIPA-ModList/Plugin.cs | 11 ++++++++++- .../UI/ViewControllers/MarkdownView.cs | 19 +++++++++++++++++-- IPA.Injector/Backups/BackupManager.cs | 2 +- IPA.Injector/Backups/BackupUnit.cs | 2 +- IPA.Injector/Injector.cs | 7 +++++-- appveyor.yml | 3 ++- docs/docfx.json | 4 +++- 7 files changed, 39 insertions(+), 9 deletions(-) diff --git a/BSIPA-ModList/Plugin.cs b/BSIPA-ModList/Plugin.cs index 105cf324..b0a2c217 100644 --- a/BSIPA-ModList/Plugin.cs +++ b/BSIPA-ModList/Plugin.cs @@ -17,8 +17,17 @@ namespace BSIPA_ModList internal static IPALogger md => log.GetChildLogger("MarkDown"); } - public class Plugin : IBeatSaberPlugin + /// + /// The main plugin type for the in-game mod list mod. + /// + internal class Plugin : IBeatSaberPlugin { + /// + /// Initializes the plugin with certain parameters. Is only called once. + /// + /// This is called by the plugin loader in BSIPA, and thus must be . + /// + /// a logger to initialize the plugin with public void Init(IPALogger logger) { Logger.log = logger; diff --git a/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs b/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs index ef989f6e..c4fc338b 100644 --- a/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs +++ b/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs @@ -18,6 +18,9 @@ using System.Text.RegularExpressions; namespace BSIPA_ModList.UI.ViewControllers { + /// + /// A UI component that renders Markdown in-game. + /// [RequireComponent(typeof(RectTransform))] public class MarkdownView : MonoBehaviour { @@ -42,6 +45,10 @@ namespace BSIPA_ModList.UI.ViewControllers } } + /// + /// A convenience property to access the on the this is on. + /// + /// the associated with this component public RectTransform rectTransform => GetComponent(); private ScrollView scrView; @@ -49,6 +56,10 @@ namespace BSIPA_ModList.UI.ViewControllers private RectTransform viewport; private CommonMarkSettings settings; + + /// + /// Creates a new . Should never be called correctly. Instead, use . + /// public MarkdownView() { settings = CommonMarkSettings.Default.Clone(); @@ -57,6 +68,10 @@ namespace BSIPA_ModList.UI.ViewControllers settings.UriResolver = ResolveUri; } + /// + /// This function will be called whenever attempting to resolve an image URI, to ensure that the image exists in the embedded assembly. + /// + /// a delegate for the function to call public Func HasEmbeddedImage; private string ResolveUri(string arg) @@ -156,7 +171,7 @@ namespace BSIPA_ModList.UI.ViewControllers Logger.md.Debug("Font loaded"); } - protected void Awake() + internal void Awake() { if (Consolas == null) Logger.md.Error($"Loading of Consolas font failed"); @@ -265,7 +280,7 @@ namespace BSIPA_ModList.UI.ViewControllers private byte tbreakSettings = 0; #endif #endif - public void Update() + internal void Update() { #if DEBUG && UI_CONFIGURE_MARKDOWN_THEMATIC_BREAK if (Input.GetKeyDown(KeyCode.K)) diff --git a/IPA.Injector/Backups/BackupManager.cs b/IPA.Injector/Backups/BackupManager.cs index d2a47df9..1a344efb 100644 --- a/IPA.Injector/Backups/BackupManager.cs +++ b/IPA.Injector/Backups/BackupManager.cs @@ -3,7 +3,7 @@ using System.Linq; namespace IPA.Injector.Backups { - public static class BackupManager + internal static class BackupManager { public static BackupUnit FindLatestBackup(string dir) { diff --git a/IPA.Injector/Backups/BackupUnit.cs b/IPA.Injector/Backups/BackupUnit.cs index fc99ebde..e3e9ee6d 100644 --- a/IPA.Injector/Backups/BackupUnit.cs +++ b/IPA.Injector/Backups/BackupUnit.cs @@ -7,7 +7,7 @@ namespace IPA.Injector.Backups /// /// A unit for backup. WIP. /// - public class BackupUnit + internal class BackupUnit { public string Name { get; private set; } diff --git a/IPA.Injector/Injector.cs b/IPA.Injector/Injector.cs index 8a8bb50b..a0ce06d6 100644 --- a/IPA.Injector/Injector.cs +++ b/IPA.Injector/Injector.cs @@ -15,14 +15,17 @@ using MethodAttributes = Mono.Cecil.MethodAttributes; namespace IPA.Injector { + /// + /// The entry point type for BSIPA's Doorstop injector. + /// // ReSharper disable once UnusedMember.Global - public static class Injector + internal static class Injector { private static Task pluginAsyncLoadTask; private static Task permissionFixTask; // ReSharper disable once UnusedParameter.Global - public static void Main(string[] args) + internal static void Main(string[] args) { // entry point for doorstop // At this point, literally nothing but mscorlib is loaded, // and since this class doesn't have any static fields that diff --git a/appveyor.yml b/appveyor.yml index 0782b21f..78ee87ac 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -49,7 +49,8 @@ after_deploy: if(-Not $env:APPVEYOR_PULL_REQUEST_TITLE -And $env:APPVEYOR_REPO_BRANCH -eq 'master') { cd docs - & docfx docfx.json + & docfx metadata + & docfx build if ($lastexitcode -ne 0){ throw [System.Exception] "docfx build failed with exit code $lastexitcode." } diff --git a/docs/docfx.json b/docs/docfx.json index ec82d8bf..472c600d 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -9,7 +9,9 @@ ], "exclude": [ "**/IPA.csproj", - "**/IPA.Tests.csproj" + "**/IPA.Tests.csproj", + "BuildTools/**.csproj", + "Doorstop/**.csproj" ] } ],