Browse Source

Bumped version

Added support for custom link colors
pull/13/head
Anairkoen Schno 5 years ago
parent
commit
6dbd72662c
3 changed files with 19 additions and 6 deletions
  1. +3
    -1
      BSIPA-ModList/README.md
  2. +15
    -4
      BSIPA-ModList/UI/ViewControllers/MarkdownView.cs
  3. +1
    -1
      BSIPA-ModList/manifest.json

+ 3
- 1
BSIPA-ModList/README.md View File

@ -2,4 +2,6 @@
============== ==============
Mod List is just an in-game viewer for the mods you have installed. It also lets you have more control over the updating already present in BSIPA. Mod List is just an in-game viewer for the mods you have installed. It also lets you have more control over the updating already present in BSIPA.
Find all builds in [AppVeyor](https://ci.appveyor.com/project/nike4613/beatsaber-ipa-reloaded-9smsb/build/artifacts).
Find all builds in [AppVeyor][appv_link].
[appv_link]: https://ci.appveyor.com/project/nike4613/beatsaber-ipa-reloaded-9smsb/build/artifacts "{color: #00FF00}"

+ 15
- 4
BSIPA-ModList/UI/ViewControllers/MarkdownView.cs View File

@ -13,6 +13,8 @@ using UnityEngine.EventSystems;
using System.Diagnostics; using System.Diagnostics;
using System.Collections; using System.Collections;
using System.IO; using System.IO;
using System.Text;
using System.Text.RegularExpressions;
namespace BSIPA_ModList.UI.ViewControllers namespace BSIPA_ModList.UI.ViewControllers
{ {
@ -283,8 +285,10 @@ namespace BSIPA_ModList.UI.ViewControllers
None = 0, Bold = 1, Italic = 2, Underline = 4, Strikethrough = 8, None = 0, Bold = 1, Italic = 2, Underline = 4, Strikethrough = 8,
} }
private const string LinkDefaultColor = "#0061ff";
private const string LinkHoverColor = "#009dff";
private const string LinkDefaultColor = "#59B0F4";
// private const string LinkHoverColor = "#009dff";
private static readonly Regex linkRefTitleColorRegex = new Regex(@"\{\s*color:\s*#?([a-fA-F0-9]{6})\s*\}", RegexOptions.Compiled | RegexOptions.Singleline);
const float PSize = 3.5f; const float PSize = 3.5f;
const float BlockCodeSize = PSize - .5f; const float BlockCodeSize = PSize - .5f;
@ -597,7 +601,6 @@ namespace BSIPA_ModList.UI.ViewControllers
break; break;
case BlockTag.ReferenceDefinition: // i have no idea what the state looks like here case BlockTag.ReferenceDefinition: // i have no idea what the state looks like here
//block.DebugPrintTo(Logger.md.Info, 5);
break; break;
} }
} }
@ -690,8 +693,16 @@ namespace BSIPA_ModList.UI.ViewControllers
case InlineTag.Link: case InlineTag.Link:
EnsureText(); EnsureText();
Flag(CurrentTextFlags.Underline); Flag(CurrentTextFlags.Underline);
var color = LinkDefaultColor;
var targetUrl = ResolveUri(inl.TargetUrl);
var m = linkRefTitleColorRegex.Match(inl.LiteralContent);
if (m.Success)
color = "#" + m.Groups[1].Value;
if (node.IsOpening) if (node.IsOpening)
currentText.text += $"<color={LinkDefaultColor}><link=\"{ResolveUri(inl.TargetUrl)}\">";
currentText.text += $"<color={color}><link=\"{targetUrl}\">";
else if (node.IsClosing) else if (node.IsClosing)
currentText.text += "</link></color>"; currentText.text += "</link></color>";
break; break;


+ 1
- 1
BSIPA-ModList/manifest.json View File

@ -11,7 +11,7 @@
"gameVersion": "1.0.1", "gameVersion": "1.0.1",
"id": "BSIPA Mod List", "id": "BSIPA Mod List",
"name": "BSIPA Mod List", "name": "BSIPA Mod List",
"version": "1.2.3",
"version": "1.2.4",
"icon": "BSIPA_ModList.Icons.self.png", "icon": "BSIPA_ModList.Icons.self.png",
"dependsOn": { "dependsOn": {
"BSIPA": "^3.12.19", "BSIPA": "^3.12.19",


Loading…
Cancel
Save