From 1a1e9933660d630a7db55c848e8ce73c4a0b6eda Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sun, 12 May 2019 00:25:25 -0500 Subject: [PATCH] Adjusted some styling --- .../UI/ViewControllers/MarkdownView.cs | 18 +++++++++++------- BSIPA-ModList/UI/ViewControllers/ModCells.cs | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs b/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs index b2f7b46a..0b5bc990 100644 --- a/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs +++ b/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs @@ -276,7 +276,7 @@ namespace BSIPA_ModList.UI.ViewControllers l.minHeight = l.preferredHeight = size; } - HorizontalOrVerticalLayoutGroup BlockNode(string name, float spacing, bool isVertical, Action apply = null, float? spacer = null, bool isDoc = false) + HorizontalOrVerticalLayoutGroup BlockNode(string name, float spacing, bool isVertical, Action apply = null, float? spacer = null, bool isDoc = false, bool matchWidth = false) { if (node.IsOpening) { @@ -296,8 +296,10 @@ namespace BSIPA_ModList.UI.ViewControllers vlayout.sizeDelta = new Vector2(rectTransform.rect.width, 0f); vlayout.anchorMin = new Vector2(0f, 1f); vlayout.anchorMax = new Vector2(1f, 1f); - //vlayout.anchoredPosition = new Vector2(0f, -30f); // no idea where this -30 comes from, but it works for my use } + if (matchWidth) + vlayout.sizeDelta = new Vector2(layout.Peek().rect.width, BreakHeight); + var tt = go.AddComponent(); tt.Tag = block.Tag; apply?.Invoke(tt); @@ -332,7 +334,7 @@ namespace BSIPA_ModList.UI.ViewControllers return null; } - void ThematicBreak() + void ThematicBreak(float spacerSize = 1f) { // TODO: Fix positioning var go = new GameObject("ThematicBreak", typeof(RectTransform), typeof(HorizontalLayoutGroup)); var vlayout = go.GetComponent(); @@ -379,7 +381,8 @@ namespace BSIPA_ModList.UI.ViewControllers rt.anchorMax = Vector2.one; rt.sizeDelta = new Vector2(layout.Peek().rect.width, BreakHeight); - Spacer(1f); + if (spacerSize != 0f) + Spacer(spacerSize); } switch (block.Tag) @@ -388,13 +391,14 @@ namespace BSIPA_ModList.UI.ViewControllers BlockNode("DocumentRoot", .5f, true, isDoc: true); break; case BlockTag.SetextHeading: - var l = BlockNode("SeHeading", .1f, false, t => t.hData = block.Heading); + var l = BlockNode("SeHeading", 0f, false, t => t.hData = block.Heading, spacer: 0f); if (l) { l.childAlignment = TextAnchor.UpperCenter; l.padding = new RectOffset(TextInset, TextInset, 0, 0); } - else ThematicBreak(); + else + ThematicBreak(1.5f); break; case BlockTag.AtxHeading: l = BlockNode("AtxHeading", .1f, false, t => t.hData = block.Heading); @@ -425,7 +429,7 @@ namespace BSIPA_ModList.UI.ViewControllers } const float PSize = 3.5f; - const float H1Size = 4.8f; + const float H1Size = 5.5f; const float HLevelDecrease = 0.5f; void EnsureText() { diff --git a/BSIPA-ModList/UI/ViewControllers/ModCells.cs b/BSIPA-ModList/UI/ViewControllers/ModCells.cs index d6d7dfb7..54741014 100644 --- a/BSIPA-ModList/UI/ViewControllers/ModCells.cs +++ b/BSIPA-ModList/UI/ViewControllers/ModCells.cs @@ -175,8 +175,8 @@ namespace BSIPA_ModList.UI.ViewControllers infoView = BeatSaberUI.CreateViewController(); infoView.Init(icon, Plugin.Name, "v" + Plugin.Version.ToString(), "Unknown Author", - "# This mod was written for IPA Reloaded. No metadata is avaliable for this mod.\n\n" + - "# Please contact the mod author and ask them to port it to BSIPA to provide more information.", updateInfo); + "This mod was written for IPA.\n===\n\n## No metadata is avaliable for this mod.\n\n" + + "Please contact the mod author and ask them to port it to BSIPA to provide more information.", updateInfo); } list.flow.SetSelected(infoView, immediate: list.flow.HasSelected);