Skip to content

Commit

Permalink
Fix for wall paint
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryConstruct committed Nov 11, 2022
1 parent 6aeb5ac commit 09f6ad8
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param(
[string] $VersionPrefix = "4.11.7",
[string] $VersionPrefix = "4.11.8",
[string] $VersionSuffix = ""
)

Expand Down
3 changes: 2 additions & 1 deletion src/TEdit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BF790973-1C76-498F-A677-4C8A71BCFCA9}"
ProjectSection(SolutionItems) = preProject
..\.editorconfig = ..\.editorconfig
..\build.ps1 = ..\build.ps1
EndProjectSection
EndProject
Global
Expand All @@ -39,8 +40,8 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9CD90452-C706-4BBF-8C2E-6C2D1052531B}
RESX_PrefixTranslations = False
SolutionGuid = {9CD90452-C706-4BBF-8C2E-6C2D1052531B}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = TEdit.vsmdi
Expand Down
24 changes: 24 additions & 0 deletions src/TEdit/Editor/TilePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public class TilePicker : ObservableObject
private int _tile = ToolDefaultData.PaintTile;
private int _wallMask = ToolDefaultData.PaintWallMask;
private int _tileMask = ToolDefaultData.PaintTileMask;

private MaskMode _wallPaintMaskMode = MaskMode.Off;
private MaskMode _tilePaintMaskMode = MaskMode.Off;
private MaskMode _liquidMaskMode = MaskMode.Off;

private bool _blueWireActive = ToolDefaultData.BlueWire;
private bool _redWireActive = ToolDefaultData.RedWire;
private bool _greenWireActive = ToolDefaultData.GreenWire;
Expand Down Expand Up @@ -264,6 +269,25 @@ public MaskMode TileMaskMode
set { Set(nameof(TileMaskMode), ref _tileMaskMode, value); }
}

public MaskMode WallPaintMaskMode
{
get { return _wallPaintMaskMode; }
set { Set(nameof(WallPaintMaskMode), ref _wallPaintMaskMode, value); }
}


public MaskMode TilePaintMaskMode
{
get { return _tilePaintMaskMode; }
set { Set(nameof(TilePaintMaskMode), ref _tilePaintMaskMode, value); }
}

public MaskMode LiquidMaskMode
{
get { return _liquidMaskMode; }
set { Set(nameof(LiquidMaskMode), ref _liquidMaskMode, value); }
}

public PaintMode PaintMode
{
get { return _paintMode; }
Expand Down
2 changes: 1 addition & 1 deletion src/TEdit/TEdit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<DefaultNamespace>TEdit</DefaultNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<VersionPrefix>4.11.7</VersionPrefix>
<VersionPrefix>4.11.8</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Platforms>AnyCPU</Platforms>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand Down
8 changes: 4 additions & 4 deletions src/TEdit/Terraria/World.FileV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public static byte[] SerializeTileData(

// downgraded illuminate coating to illuminate paint
// IF there is no other paint
if (color == 0 && version < 269 && tile.FullBrightBlock)
if (color == 0 && tile.FullBrightBlock)
{
color = 31;
}
Expand Down Expand Up @@ -342,7 +342,7 @@ public static byte[] SerializeTileData(
// save tile wall color
if (version < 269)
{
if (tile.TileColor != 0 || tile.FullBrightWall)
if (tile.WallColor != 0 || tile.FullBrightWall)
{
var color = tile.WallColor;

Expand All @@ -362,9 +362,9 @@ public static byte[] SerializeTileData(
else
{
// for versions >= 269 upgrade illuminant paint to coating
if (tile.TileColor != 0 && tile.TileColor != 31)
if (tile.WallColor != 0 && tile.WallColor != 31)
{
var color = tile.TileColor;
var color = tile.WallColor;
// set header3 bit[4] for wall color active
header3 |= 0b_0001_0000;
tileData[dataIndex++] = color;
Expand Down

0 comments on commit 09f6ad8

Please sign in to comment.