-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
1,947 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Terraria.DataStructures; | ||
using Terraria.ModLoader; | ||
|
||
namespace MechTransfer | ||
{ | ||
internal class ButtonDelayWorld : ModWorld | ||
{ | ||
private Point16? buttonPosition = null; | ||
private int delay; | ||
|
||
private const int StartDelay = 30; | ||
|
||
public void setPoint(Point16 p) | ||
{ | ||
buttonPosition = p; | ||
delay = StartDelay; | ||
} | ||
|
||
public bool isPoint(Point16 p, int w, int h) | ||
{ | ||
if (!buttonPosition.HasValue) | ||
return false; | ||
|
||
int xOffset = p.X - buttonPosition.Value.X; | ||
int yOffset = p.Y - buttonPosition.Value.Y; | ||
|
||
return xOffset >= 0 && yOffset >= 0 && xOffset < w && yOffset < h; | ||
} | ||
|
||
public override void PostDrawTiles() | ||
{ | ||
delay--; | ||
if (delay < 1) | ||
buttonPosition = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Terraria.ModLoader; | ||
using Terraria; | ||
using Terraria.ID; | ||
|
||
namespace MechTransfer | ||
{ | ||
class ChestPlacementFix : GlobalTile | ||
{ | ||
private List<int> noChestTiles = new List<int>(); | ||
|
||
public override bool CanPlace(int i, int j, int type) | ||
{ | ||
if (TileID.Sets.BasicChest[type] || TileID.Sets.BasicChestFake[type] || TileLoader.IsDresser(type)) | ||
{ | ||
Tile bottom = Main.tile[i, j + 1]; | ||
if (bottom != null && bottom.active() && noChestTiles.Contains(bottom.type)) | ||
{ | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
public void AddNoChestTile(int type) | ||
{ | ||
noChestTiles.Add(type); | ||
} | ||
} | ||
} |
Oops, something went wrong.