Exemple #1
0
        private static void ParseMarkup(MyGuiControlMultilineText label, string markup)
        {
            var s = m_markupRegex.Match(markup);

            if (s.Value.Contains('|'))
            {
                var sub = s.Value.Substring(5);
                var split = sub.Split('|');
                var match = m_digitsRegex.Matches(split[1]);
                int width, height;
                if (int.TryParse(match[0].Value, out width) && int.TryParse(match[1].Value, out height))
                {
                    label.AppendImage(split[0], MyGuiManager.GetNormalizedSizeFromScreenSize(new VRageMath.Vector2(width, height)), Vector4.One);
                }
            }
            else
            {
                label.AppendLink(s.Value.Substring(0, s.Value.IndexOf(' ')), s.Value.Substring(s.Value.IndexOf(' ') + 1));
            }
        }