Ejemplo n.º 1
0
        private static void ParseYML(string FileName)
        {
            BymlFileData data = ByamlFile.LoadN(FileName, true);

            var serializer = new SharpYaml.Serialization.Serializer();
            var text       = serializer.Serialize(data);

            Console.WriteLine(text);
        }
Ejemplo n.º 2
0
        private static async Task <IReadOnlyDictionary <int, string> > GetDocRelativeUrisAsync(HttpClient client)
        {
            string tocContent = await client.GetStringAsync(DocTableOfContentsUrl);

            var serializer = new SharpYaml.Serialization.Serializer();
            var root       = serializer.Deserialize <TocRoot>(tocContent);
            var codes      = new Dictionary <int, string>();

            foreach (var item in root.Items.SelectMany(n => n.Items ?? Array.Empty <TocNode>()))
            {
                int code = int.Parse(Path.GetFileNameWithoutExtension(item.Name)[2..]);
Ejemplo n.º 3
0
        public override void Generate()
        {
            try
            {
                using (var file = OpenProjectFile(Path))
                {
                    var        serializer = new SharpYaml.Serialization.Serializer();
                    TextObject obj        = serializer.Deserialize <TextObject>(file);

                    var configGlobal = obj.Config;

                    var font = LoadFont(SpritesPath, new FontDescription()
                    {
                        FontPath  = Font,
                        FontSize  = FontSize,
                        Color     = FontColor,
                        Padding   = new Vector2(configGlobal.Padding[0] ?? 0, configGlobal.Padding[1] ?? 0),
                        FontStyle = FontStyle
                    },
                                        new FontGlow()
                    {
                        Radius = AdditiveGlow ? 0 : GlowRadius,
                        Color  = GlowColor,
                    },
                                        new FontOutline()
                    {
                        Thickness = OutlineThickness,
                        Color     = OutlineColor,
                    },
                                        new FontShadow()
                    {
                        Thickness = ShadowThickness,
                        Color     = ShadowColor,
                    });

                    foreach (var i in obj.Texts)
                    {
                        Parse(i, configGlobal.Clone() as TextConfiguration, font, new Vector2(configGlobal.Position[0] ?? 0, configGlobal.Position[1] ?? 0), null, null);
                    }
                }
            } catch (Exception e) {
                Log($"{e.Message}\n{e.StackTrace}");
            }
        }