From 0381772cfa0c0588e21d339dccba03de9ec2e3ce Mon Sep 17 00:00:00 2001 From: Barinade Date: Sun, 9 Jun 2019 03:22:52 -0500 Subject: [PATCH] Fix toasty playing over and over when clicking the same one Just make sure the cursor moved before playing --- .../BGAnimations/ScreenAssetSettings underlay.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenAssetSettings underlay.lua b/Themes/Til Death/BGAnimations/ScreenAssetSettings underlay.lua index 5446bee44e..5b1054dd13 100644 --- a/Themes/Til Death/BGAnimations/ScreenAssetSettings underlay.lua +++ b/Themes/Til Death/BGAnimations/ScreenAssetSettings underlay.lua @@ -198,7 +198,7 @@ local function moveCursor(x, y) -- move the cursor end lastClickedIndex = curIndex if curPage == nextPage then - MESSAGEMAN:Broadcast("CursorMoved",{index = curIndex}) + MESSAGEMAN:Broadcast("CursorMoved",{index = curIndex, prevIndex = oldIndex}) else curPage = nextPage MESSAGEMAN:Broadcast("PageMoved",{index = curIndex, page = curPage}) @@ -410,9 +410,10 @@ local function assetBox(i) if lastClickedIndex == i then confirmPick() end + local prev = curIndex lastClickedIndex = i curIndex = i - MESSAGEMAN:Broadcast("CursorMoved",{index = i}) + MESSAGEMAN:Broadcast("CursorMoved",{index = i, prevIndex = prev}) end end } @@ -463,7 +464,7 @@ local function assetBox(i) end, CursorMovedMessageCommand = function(self, params) - if params.index == i and curType == 1 then + if params.index == i and curType == 1 and params.prevIndex ~= i then self:play() end end