WritePaletteToXML() public method

public WritePaletteToXML ( XmlTextWriter writer ) : void
writer System.Xml.XmlTextWriter
return void
Exemplo n.º 1
0
        public static void ExportGUIToFile(GUI gui, string fileName, Game game)
        {
            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }
            XmlTextWriter writer = new XmlTextWriter(fileName, Encoding.Default);
            writer.WriteProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + Encoding.Default.WebName + "\"");
            writer.WriteComment("AGS Exported GUI file. DO NOT EDIT THIS FILE BY HAND, IT IS GENERATED AUTOMATICALLY BY THE AGS EDITOR.");
            writer.WriteStartElement(GUI_XML_ROOT_NODE);
            writer.WriteAttributeString(GUI_XML_VERSION_ATTRIBUTE, GUI_XML_CURRENT_VERSION);

            gui.ToXml(writer);

            writer.WriteStartElement(GUI_XML_SPRITES_NODE);
            ExportAllSpritesOnGUI(gui, writer);
            writer.WriteEndElement();

            game.WritePaletteToXML(writer);

            writer.WriteEndElement();
            writer.Close();
        }
Exemplo n.º 2
0
        public static void ExportGUIToFile(GUI gui, string fileName, Game game)
        {
            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }
            XmlTextWriter writer = new XmlTextWriter(fileName, Encoding.Default);
            writer.WriteProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + Encoding.Default.WebName + "\"");
            writer.WriteComment("Fichier AGS d'Interface Exportée. N'ÉDITEZ PAS CE FICHIER MANUELLEMENT, IL A ÉTÉ AUTOMATIQUEMENT GÉNÉRÉ PAR L'ÉDITEUR AGS.");
            writer.WriteStartElement(GUI_XML_ROOT_NODE);
            writer.WriteAttributeString(GUI_XML_VERSION_ATTRIBUTE, GUI_XML_CURRENT_VERSION);

            gui.ToXml(writer);

            writer.WriteStartElement(GUI_XML_SPRITES_NODE);
            ExportAllSpritesOnGUI(gui, writer);
            writer.WriteEndElement();

            game.WritePaletteToXML(writer);

            writer.WriteEndElement();
            writer.Close();
        }
Exemplo n.º 3
0
        public static void ExportCharacterNewFormat(Character character, string fileName, Game game)
        {
            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }
            XmlTextWriter writer = new XmlTextWriter(fileName, Encoding.Default);
            writer.WriteProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + Encoding.Default.WebName + "\"");
            writer.WriteComment("AGS Exported Character file. DO NOT EDIT THIS FILE BY HAND, IT IS GENERATED AUTOMATICALLY BY THE AGS EDITOR.");
            writer.WriteStartElement(CHARACTER_XML_ROOT_NODE);
            writer.WriteAttributeString(CHARACTER_XML_VERSION_ATTRIBUTE, CHARACTER_XML_CURRENT_VERSION);

            character.ToXml(writer);

            writer.WriteStartElement(CHARACTER_XML_VIEWS_NODE);

            Dictionary<int, object> spritesWritten = new Dictionary<int, object>();

            writer.WriteStartElement("NormalView");
            WriteNewStyleView(writer, game.FindViewByID(character.NormalView), spritesWritten);
            writer.WriteEndElement();

            if (character.SpeechView > 0)
            {
                writer.WriteStartElement("SpeechView");
                WriteNewStyleView(writer, game.FindViewByID(character.SpeechView), spritesWritten);
                writer.WriteEndElement();
            }
            if (character.IdleView > 0)
            {
                writer.WriteStartElement("IdleView");
                WriteNewStyleView(writer, game.FindViewByID(character.IdleView), spritesWritten);
                writer.WriteEndElement();
            }
            if (character.ThinkingView > 0)
            {
                writer.WriteStartElement("ThinkingView");
                WriteNewStyleView(writer, game.FindViewByID(character.ThinkingView), spritesWritten);
                writer.WriteEndElement();
            }
            if (character.BlinkingView > 0)
            {
                writer.WriteStartElement("BlinkingView");
                WriteNewStyleView(writer, game.FindViewByID(character.BlinkingView), spritesWritten);
                writer.WriteEndElement();
            }

            writer.WriteEndElement();

            game.WritePaletteToXML(writer);

            writer.WriteEndElement();
            writer.Close();
        }
Exemplo n.º 4
0
        public static void ExportCharacterNewFormat(Character character, string fileName, Game game)
        {
            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }
            XmlTextWriter writer = new XmlTextWriter(fileName, Encoding.Default);
            writer.WriteProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + Encoding.Default.WebName + "\"");
            writer.WriteComment("Fichier de Personnage AGS Exporté. N'ÉDITEZ PAS CE FICHIER MANUELLEMENT, IL EST AUTOMATIQUEMENT GÉNÉRÉ PAR L'ÉDITEUR AGS.");
            writer.WriteStartElement(CHARACTER_XML_ROOT_NODE);
            writer.WriteAttributeString(CHARACTER_XML_VERSION_ATTRIBUTE, CHARACTER_XML_CURRENT_VERSION);

            character.ToXml(writer);

            writer.WriteStartElement(CHARACTER_XML_VIEWS_NODE);

            Dictionary<int, object> spritesWritten = new Dictionary<int, object>();

            writer.WriteStartElement("NormalView");
            WriteNewStyleView(writer, game.FindViewByID(character.NormalView), spritesWritten);
            writer.WriteEndElement();

            if (character.SpeechView > 0)
            {
                writer.WriteStartElement("SpeechView");
                WriteNewStyleView(writer, game.FindViewByID(character.SpeechView), spritesWritten);
                writer.WriteEndElement();
            }
            if (character.IdleView > 0)
            {
                writer.WriteStartElement("IdleView");
                WriteNewStyleView(writer, game.FindViewByID(character.IdleView), spritesWritten);
                writer.WriteEndElement();
            }
            if (character.ThinkingView > 0)
            {
                writer.WriteStartElement("ThinkingView");
                WriteNewStyleView(writer, game.FindViewByID(character.ThinkingView), spritesWritten);
                writer.WriteEndElement();
            }
            if (character.BlinkingView > 0)
            {
                writer.WriteStartElement("BlinkingView");
                WriteNewStyleView(writer, game.FindViewByID(character.BlinkingView), spritesWritten);
                writer.WriteEndElement();
            }

            writer.WriteEndElement();

            game.WritePaletteToXML(writer);

            writer.WriteEndElement();
            writer.Close();
        }