Skip to content

Commit

Permalink
Fix swing->click duplication glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Jul 12, 2017
1 parent a66b7cf commit c542fad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 56 deletions.
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

32 changes: 18 additions & 14 deletions UIElements/UIQueryItemSlot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,33 @@ namespace RecipeBrowser.UIElements
class UIQueryItemSlot : UIItemSlot
{
public static Texture2D backgroundTextureFake = Main.inventoryBack8Texture;
internal bool real;
internal bool real = true;

public UIQueryItemSlot(Item item) : base(item)
{
}

public override void Click(UIMouseEvent evt)
{
if (real)
Player player = Main.LocalPlayer;
if (player.itemAnimation == 0 && player.itemTime == 0)
{
Item item = Main.mouseItem.Clone();
Main.mouseItem = this.item.Clone();
if (Main.mouseItem.type > 0)
if (real)
{
Main.playerInventory = true;
Item item = Main.mouseItem.Clone();
Main.mouseItem = this.item.Clone();
if (Main.mouseItem.type > 0)
{
Main.playerInventory = true;
}
this.item = item.Clone();
}
else
{
item = Main.mouseItem.Clone();
Main.mouseItem.SetDefaults(0);
real = true;
}
this.item = item.Clone();
}
else
{
item = Main.mouseItem.Clone();
Main.mouseItem.SetDefaults(0);
real = true;
}
backgroundTexture = real ? defaultBackgroundTexture : backgroundTextureFake;

Expand All @@ -45,7 +49,7 @@ internal void ReplaceWithFake(int type)
{
if (real && item.stack > 0)
{
// Main.player[Main.myPlayer].QuickSpawnItem(RecipeBrowserWindow.lookupItemSlot.item.type, RecipeBrowserWindow.lookupItemSlot.item.stack);
// Main.player[Main.myPlayer].QuickSpawnItem(RecipeBrowserWindow.lookupItemSlot.item.type, RecipeBrowserWindow.lookupItemSlot.item.stack);

Player player = Main.player[Main.myPlayer];
item.position = player.Center;
Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
author = jopojelly
version = 0.2.0.5
version = 0.2.0.6
displayName = Recipe Browser
homepage = http://forums.terraria.org/index.php?threads/cheat-sheet.41407/
buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, unused\*
Expand Down

0 comments on commit c542fad

Please sign in to comment.