Beispiel #1
0
 private static string StrReferenceToString(int strref, TlkEntry entry)
 {
     return
         (entry.Text == null?
          strref.ToString() :
              strref + "\u2002\u2013\u2002" + entry.Text);
 }
Beispiel #2
0
        public TlkEntryView(TlkEntry entry, bool showAltStrRef)
        {
            this.entry         = entry;
            this.showAltStrRef = showAltStrRef;

            entry.PropertyChanged +=
                delegate(object sender, PropertyChangedEventArgs e)
            {
                OnPropertyChanged(e);
            };
        }
 protected void WriteTlkEntry(TlkEntry entry)
 {
 }
Beispiel #4
0
        /// <summary>
        /// Does a lookup in the tlk file, returning the entry for the specified index.
        /// </summary>
        public TlkEntry this[int index]
        {
            get
            {
                // If the index is out of range return null.
                if (index >= header.stringCount || index < 0) return null;

                // Create a TlkEntry for the entry
                TlkEntry entry = new TlkEntry();
                entry.PitchVariance = resRefs[index].pitchVariance;
                entry.SoundLength = resRefs[index].soundLength;
                entry.VolumnVariance = resRefs[index].volumeVariance;
                entry.SoundResRef = resRefs[index].soundResRef;
                entry.Text = strings[index];
                entry.Flags = (ResRefFlags) resRefs[index].flags;

                // Return the created entry.
                return entry;
            }
            set
            {
                // Make sure the index is within range.
                if (index >= header.stringCount || index < 0) throw new IndexOutOfRangeException();

                resRefs[index].pitchVariance = value.PitchVariance;
                resRefs[index].soundLength = value.SoundLength;
                resRefs[index].volumeVariance = value.VolumnVariance;
                resRefs[index].soundResRef = value.SoundResRef;
                resRefs[index].flags = (int) value.Flags;
                strings[index] = value.Text;
            }
        }