private static ColorOffsets Write_Colors(Stream s, Theme b)
{
var offsets = new ColorOffsets();
using (BinaryWriter bw = new BinaryWriter(s, Encoding.ASCII, true))
{
// Top Solid
#if SKIP_COLOR_NOT_SET
if (b.Flags.TopDrawType == TopDrawType.SolidColor || b.Flags.TopDrawType == TopDrawType.SolidColorTexture)
#endif
{
offsets.TopBackground = (uint) s.Position;
var seven = b.Flags.TopDrawType == TopDrawType.SolidColorTexture;
b.Colors.TopBackground.Write(bw, seven);
}
// Cursor
#if SKIP_COLOR_NOT_SET
if (b.Flags.CursorColor)
#endif
{
offsets.Cursor = (uint) s.Position;
b.Colors.Cursor.Write(bw);
}
// 3D Folder
#if SKIP_COLOR_NOT_SET
if (b.Flags.FolderColor)
#endif
{
offsets.Folder = (uint) s.Position;
b.Colors.Folder.Write(bw);
}
// 3D File
#if SKIP_COLOR_NOT_SET
if (b.Flags.FileColor)
#endif
{
offsets.File = (uint) s.Position;
b.Colors.File.Write(bw);
}
// Arrow Button
#if SKIP_COLOR_NOT_SET
if (b.Flags.ArrowButtonColor)
#endif
{
offsets.ArrowButton = (uint) s.Position;
b.Colors.ArrowButton.Write(bw);
}
// Arrow
#if SKIP_COLOR_NOT_SET
if (b.Flags.ArrowColor)
#endif
{
offsets.Arrow = (uint) s.Position;
b.Colors.Arrow.Write(bw);
}
// Open Close Button
#if SKIP_COLOR_NOT_SET
if (b.Flags.OpenCloseColor)
#endif
{
offsets.Open = (uint) s.Position;
b.Colors.Open.Write(bw);
offsets.Close = (uint) s.Position;
b.Colors.Close.Write(bw);
}
// Game Text
#if SKIP_COLOR_NOT_SET
if (b.Flags.GameTextDrawType)
#endif
{
offsets.GameText = (uint) s.Position;
b.Colors.GameText.Write(bw);
}
// Bottom Solid
#if SKIP_COLOR_NOT_SET
if (b.Flags.BottomBackgroundInnerColor)
#endif
{
offsets.BottomSolid = (uint) s.Position;
b.Colors.BottomBackgroundInner.Write(bw);
}
// Bottom Outer
#if SKIP_COLOR_NOT_SET
if (b.Flags.BottomBackgroundOuterColor)
#endif
{
offsets.BottomOuter = (uint) s.Position;
b.Colors.BottomBackgroundOuter.Write(bw);
}
// Folder BG
#if SKIP_COLOR_NOT_SET
if (b.Flags.FolderBackgroundColor)
#endif
{
offsets.FolderBackground = (uint) s.Position;
b.Colors.FolderBackground.Write(bw);
}
// Folder Arrow
#if SKIP_COLOR_NOT_SET
if (b.Flags.FolderArrowColor)
#endif
{
offsets.FolderArrow = (uint) s.Position;
b.Colors.FolderArrow.Write(bw);
}
// Bottom Corner
#if SKIP_COLOR_NOT_SET
if (b.Flags.BottomCornerButtonColor)
#endif
{
offsets.BottomCornerButton = (uint) s.Position;
b.Colors.BottomCornerButton.Write(bw);
}
// Top Corner
#if SKIP_COLOR_NOT_SET
if (b.Flags.TopCornerButtonColor)
#endif
{
offsets.TopCornerButton = (uint) s.Position;
b.Colors.TopCornerButton.Write(bw);
}
// Demo Text
#if SKIP_COLOR_NOT_SET
if (b.Flags.DemoTextColor)
#endif
{
offsets.DemoText = (uint) s.Position;
b.Colors.DemoText.Write(bw);
}
}
return offsets;
}