diff --git a/modsettings/CustomUIAssets.json b/modsettings/CustomUIAssets.json index 5ca63e31..9c0e8dd9 100644 --- a/modsettings/CustomUIAssets.json +++ b/modsettings/CustomUIAssets.json @@ -105,14 +105,9 @@ "URL": "https://steamusercontent-a.akamaihd.net/ugc/2450610458480705628/FE3FD9F32E8704BEB7DD6327225D9D8244115A48/" }, { - "Name": "arrow-down", + "Name": "blurse", "Type": 0, - "URL": "https://steamusercontent-a.akamaihd.net/ugc/2448359292156394304/63B2D48BB94DD4CD4F897D8528E049D521298B02/" - }, - { - "Name": "caret", - "Type": 0, - "URL": "https://steamusercontent-a.akamaihd.net/ugc/2448359292156394421/CFAF0262FEDE662D399A5D786E7450B49B952C99/" + "URL": "https://steamusercontent-a.akamaihd.net/ugc/2448359292169458161/DDF4F777B738E2BDD9AF7B3B98AF200DB12485C0/" }, { "Name": "Exit", diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index c0e778b9..ef9e0b83 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -1176,25 +1176,25 @@ function onClick_spawnPlaceholder(player) changeWindowVisibilityForColor(player.color, "downloadWindow", false) end --- toggles the visibility of the bless / curse manager UI -function showHideBlurse(player) - local visibility = changeWindowVisibilityForColor(player.color, "blessCurseManager") - changeWindowVisibilityForColor(player.color, "hideBlurse", visibility) - blurseVisibility[player.color] = visibility -end - -- toggles the visibility of the respective UI ---@param player tts__Player Player that triggered this ---@param windowId string Name of the UI to toggle function onClick_toggleUi(player, windowId) + -- let the Navigation Overlay handle the toggling of its visibility modes if windowId == "Navigation Overlay" then navigationOverlayApi.cycleVisibility(player.color) return end -- hide the playAreaGallery / downloadWindow if visible - if windowId == "downloadWindow" or windowId == "playAreaGallery" then - changeWindowVisibilityForColor(player.color, windowId, false) + if windowId == "downloadWindow" then + changeWindowVisibilityForColor(player.color, "playAreaGallery", false) + elseif windowId == "playAreaGallery" then + changeWindowVisibilityForColor(player.color, "downloadWindow", false) + elseif windowId == "blessCurseManager" then + -- store the state of the Bless/Curse Manager UI to restore it onLoad() + blurseVisibility[player.color] = changeWindowVisibilityForColor(player.color, "blessCurseManager") + return end changeWindowVisibilityForColor(player.color, windowId) @@ -1900,16 +1900,13 @@ function applyHidingToCard(card, handColor) end end +-- loads the visibility of the Bless/Curse Manager XML from the internal variable function updateBlurseVisibility() - function coroBlurse() - for playerColor, state in pairs(blurseVisibility) do - changeWindowVisibilityForColor(playerColor, "blessCurseManager", state) - changeWindowVisibilityForColor(playerColor, "hideBlurse", state) - coroutine.yield() - end - return 1 + local count = 1 + for playerColor, state in pairs(blurseVisibility) do + Wait.frames(function() changeWindowVisibilityForColor(playerColor, "blessCurseManager", state) end, count) + count = count + 3 end - startLuaCoroutine(Global, "coroBlurse") end --------------------------------------------------------- diff --git a/xml/Global/BlessCurseManager.xml b/xml/Global/BlessCurseManager.xml index 947e8f02..5cbe6b59 100644 --- a/xml/Global/BlessCurseManager.xml +++ b/xml/Global/BlessCurseManager.xml @@ -10,30 +10,8 @@ offsetXY="0 69" outlineSize="2 2" outline="#303030"/> -