From c542fad8224c45aaf88bc825b80bfccb2d7c041d Mon Sep 17 00:00:00 2001 From: JavidPack Date: Tue, 11 Jul 2017 19:21:33 -0600 Subject: [PATCH] Fix swing->click duplication glitch --- .travis.yml | 41 ----------------------------------- UIElements/UIQueryItemSlot.cs | 32 +++++++++++++++------------ build.txt | 2 +- 3 files changed, 19 insertions(+), 56 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b59f6fc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: generic - -notifications: - email: false - -branches: - only: - - master - -# Environment variables -env: - global: - - MODNAME: RecipeBrowser - - Deploy: no - -script: - - pwd - - ls - - git tag - - cd $TRAVIS_BUILD_DIR - - ls - - export version=`curl http://javid.ddns.net/tModLoader/tools/latestmodversionsimple.php?modname=$MODNAME` - - echo "Mod Browser version is $version" - - export gitVersion=`git describe --abbrev=0 --tags` - - echo "git version is $gitVersion" - - if [[ "$version" = "$gitVersion" ]]; then echo "Version does match, no need to push release"; Deploy=no; else echo "Version does not match, need to push release"; git config --global user.email "builds@travis-ci.com"; git config --global user.name "Travis CI"; git tag $version -a -m "TravisCI Autogenerated Release"; Deploy=yes; fi - - echo $Deploy - -before_deploy: - - wget -O $MODNAME.tmod http://javid.ddns.net/tModLoader/download.php?Down=mods/$MODNAME.tmod - - ls - -# should only deploy if the script doesn't fail, meaning we have a new .tmod file to publish -deploy: - provider: releases - api_key: $GH_REPO_TOKEN - file: "$MODNAME.tmod" - skip_cleanup: true - on: - tags: false - condition: "$Deploy = yes" \ No newline at end of file diff --git a/UIElements/UIQueryItemSlot.cs b/UIElements/UIQueryItemSlot.cs index 2228413..22ce800 100644 --- a/UIElements/UIQueryItemSlot.cs +++ b/UIElements/UIQueryItemSlot.cs @@ -12,7 +12,7 @@ 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) { @@ -20,21 +20,25 @@ 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; @@ -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; diff --git a/build.txt b/build.txt index d09c640..e8715f6 100644 --- a/build.txt +++ b/build.txt @@ -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\*