public virtual void Write(ByteBuilder bb) { if (Args != null) { bb.AddBytes(Args); } }
public override void SetTranslate(string[] strings) { var oldStrings = GetStrings(true); if (strings.Length != oldStrings.Length) { throw new Exception("Line count mismatch"); } ByteBuilder bb = new ByteBuilder(); for (int r = 0; r < strings.Length; r++) { var tr = strings[r]; if (tr == null) { tr = oldStrings[r]; } var bytes = GameEncoding.GetBytes(tr); bb.AddBytes(bytes); bb.AddByte(0); } SaveTranslate(bb.GetArray()); }
public override void WriteText(ByteBuilder bb, object data, GameEncoding encoding) { ushort textOffset = (ushort)bb.Position; var bytes = encoding.GetBytes(Text); bb.AddBytes(bytes); bb.AddByte(0); bb.SetShortBE((int)data, textOffset); }
protected override void WriteExt(ByteBuilder bb) { bb.AddBytes(mapping); bb.AddIntBE(ts); foreach (var c in Colors) { bb.AddByte(c.Used); bb.AddByte(c.R); bb.AddByte(c.G); bb.AddByte(c.B); } }
public override byte[] GetPatch() { var strings = GetStrings(); ByteBuilder bb = new ByteBuilder(); for (int i = 0; i < strings.Length; i++) { var bytes = GameEncoding.GetBytes(strings[i]); bb.AddBytes(bytes); bb.AddByte(0); } return(bb.GetArray()); }
public override void Write(ByteBuilder bb) { Address = (ushort)bb.Position; bb.AddBytes(Bytes); bb.AddByte(0); }
protected override void WriteExt(ByteBuilder bb) { bb.AddBytes(bars); }