示例#1
0
        public override void Load(RSFileReader br)
        {
            byte tag = 0;

            p_words.Clear();
            Sound = null;
            while ((tag = br.ReadByte()) != 0)
            {
                switch (tag)
                {
                case 1:
                    int count = br.ReadInt32();
                    for (int i = 0; i < count; i++)
                    {
                        GOFRunningTextItem gri = new GOFRunningTextItem();
                        gri.Load(br);
                        p_words.Add(gri);
                    }
                    break;

                case 2:
                    Sound = new MNReferencedSound();
                    Sound.Load(br);
                    break;

                case 3:
                    Text = br.ReadString();
                    break;
                }
            }
        }
示例#2
0
        public MNReferencedSound FindSound(string soundName)
        {
            MNReferencedSound s = null;

            if (CurrentLanguage != null)
            {
                s = CurrentLanguage.FindSound(soundName);
            }
            if (s != null)
            {
                return(s);
            }
            if (DefaultLanguage != null)
            {
                s = DefaultLanguage.FindSound(soundName);
            }
            return(s);
        }
示例#3
0
        public bool Load(RSFileReader br, bool fullRead)
        {
            if (!br.ReadHeader(p_FileHeader))
            {
                return(false);
            }

            Clear();
            byte tag;

            while ((tag = br.ReadByte()) != 0)
            {
                switch (tag)
                {
                case 10:
                    string key   = br.ReadString();
                    string value = br.ReadString();
                    Properties.Add(key, value);
                    if (key.Equals("TotalWork"))
                    {
                        long la;
                        if (long.TryParse(value, out la))
                        {
                            WorkTime.SetTotalWorkTime(la);
                        }
                    }
                    break;

                case 100:
                    if (!fullRead)
                    {
                        return(true);
                    }
                    MNReferencedText rt = new MNReferencedText();
                    rt.Load(br);
                    Texts.Add(rt);
                    break;

                case 101:
                    if (!fullRead)
                    {
                        return(true);
                    }
                    MNReferencedImage ri = new MNReferencedImage();
                    ri.Load(br);
                    Images.Add(ri);
                    break;

                case 102:
                    if (!fullRead)
                    {
                        return(true);
                    }
                    MNReferencedSound rs = new MNReferencedSound();
                    rs.Load(br);
                    Sounds.Add(rs);
                    break;

                case 103:
                    if (!fullRead)
                    {
                        return(true);
                    }
                    MNReferencedAudioText ra = new MNReferencedAudioText();
                    ra.Load(br);
                    AudioTexts.Add(ra);
                    break;

                case 104:
                    if (!fullRead)
                    {
                        return(true);
                    }
                    MNReferencedStyle rsa = new MNReferencedStyle();
                    rsa.Load(br);
                    Styles.Add(rsa);
                    break;

                default:
                    LoadMessage = string.Format("Unknown tag {0} at position {1} in the file.", tag, br.Position);
                    return(false);
                }
            }

            Modified = false;
            return(true);
        }
示例#4
0
 public string GetFileNameFromSound(MNReferencedSound sound)
 {
     return(string.Format("sound/{0}.mp3", sound.Name));
 }
示例#5
0
 public void SetSound(MNReferencedSound s)
 {
     sound = s;
 }