From 756bd2cc9ad3289670c05a46d1acc35a542d332d Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Tue, 7 May 2019 16:37:32 -0500 Subject: [PATCH] Some description text now shows up, additional elements hidden below screen for some reason --- BSIPA-ModList/UI/ViewControllers/MarkdownView.cs | 10 ++++++++-- .../UI/ViewControllers/ModInfoViewController.cs | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs b/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs index af1b23a6..e8c10b35 100644 --- a/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs +++ b/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs @@ -70,12 +70,16 @@ namespace BSIPA_ModList.UI.ViewControllers { content = new GameObject("Content Wrapper").AddComponent(); content.SetParent(transform); + content.localPosition = Vector2.zero; + content.anchorMin = Vector2.zero; + content.anchorMax = Vector2.one; var contentLayout = content.gameObject.AddComponent(); var contentFitter = content.gameObject.AddComponent(); contentFitter.horizontalFit = ContentSizeFitter.FitMode.PreferredSize; contentFitter.verticalFit = ContentSizeFitter.FitMode.Unconstrained; contentLayout.preferredWidth = 100f; // to be adjusted content.sizeDelta = new Vector2(100f,100f); + content.gameObject.AddComponent(); /*view = GetComponent(); view.content = content; @@ -102,7 +106,7 @@ namespace BSIPA_ModList.UI.ViewControllers { var block = node.Block; - void BlockNode(string name, float spacing, bool isVertical) + void BlockNode(string name, float spacing, bool isVertical, bool isDoc = false) { var type = isVertical ? typeof(VerticalLayoutGroup) : typeof(HorizontalLayoutGroup); if (node.IsOpening) @@ -113,6 +117,8 @@ namespace BSIPA_ModList.UI.ViewControllers var go = new GameObject(name, typeof(RectTransform), type); var vlayout = go.GetComponent(); vlayout.SetParent(layout.Peek()); + //if (isDoc) + vlayout.anchoredPosition = Vector2.zero; go.AddComponent().Tag = block.Tag; layout.Push(vlayout); @@ -141,7 +147,7 @@ namespace BSIPA_ModList.UI.ViewControllers switch (block.Tag) { case BlockTag.Document: - BlockNode("DocumentRoot", 10f, true); + BlockNode("DocumentRoot", .2f, true, true); break; case BlockTag.SetextHeading: BlockNode("Heading1", .1f, false); diff --git a/BSIPA-ModList/UI/ViewControllers/ModInfoViewController.cs b/BSIPA-ModList/UI/ViewControllers/ModInfoViewController.cs index 1ba01716..96bd0b69 100644 --- a/BSIPA-ModList/UI/ViewControllers/ModInfoViewController.cs +++ b/BSIPA-ModList/UI/ViewControllers/ModInfoViewController.cs @@ -191,14 +191,16 @@ namespace BSIPA_ModList.UI descText.overflowMode = TextOverflowModes.ScrollRect;*/ var mdv = new GameObject("MarkDown Desc").AddComponent(); - mdv.rectTransform.anchoredPosition = new Vector2(-4.5f, 12f); mdv.rectTransform.SetParent(rectTransform); + mdv.rectTransform.anchorMin = new Vector2(.22f, 0f); + mdv.rectTransform.anchorMax = new Vector2(1f, .25f); + mdv.rectTransform.anchoredPosition = Vector2.zero; mdv.Markdown = controller.Description; icon = new GameObject("Mod Info View Icon", typeof(RectTransform)).AddComponent(); icon.gameObject.SetActive(false); icon.rectTransform.SetParent(rectTransform, false); - icon.rectTransform.anchorMin = new Vector2(0.5f, 0.44f); + icon.rectTransform.anchorMin = new Vector2(0.5f, 0.44f); icon.rectTransform.anchorMax = new Vector2(0.5f, 0.5f); icon.rectTransform.sizeDelta = new Vector2(60f, 10f); icon.rectTransform.anchoredPosition = new Vector2(-27.8f, 27.3f);