diff --git a/.luacheckrc b/.luacheckrc index ce408ab..857bf23 100755 --- a/.luacheckrc +++ b/.luacheckrc @@ -48,6 +48,7 @@ read_globals = { "CreateFrame", "CreateUnsecuredObjectPool", "DEFAULT_TAB_SELECTED_COLOR_TABLE", + "ElvUI", "GameFontNormalSmall", "GameTooltip", "GeneralDockManager", diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ca6633..c1bb2d6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # CHANGELOG +## Version 110000.02 + +- Improved compatibility with ElvUI. Now the addon will stop loading if it detects that ElvUI chat is enabled, and + you'll be greeted by the addon incompatibility popup from ElvUI. Just to make things clear, it's safe to use LS: Glass + with ElvUI, you just want to disable its chat module because both addons will try to modify chat in rather extensive + ways which nowadays may result in game freezes. +- Fixed an issue where the addon would struggle to scroll through messages that are taller than the chat frame itself. +- Fixed an issue where the "Copy from" menu in the chat settings would fail to fetch the list of other chat windows. +- Updated Traditional Chinese translation. Translated by RainbowUI@Curse. + ## Version 110000.01 - Added 11.0.0 support. diff --git a/ls_Glass/core/changelog.lua b/ls_Glass/core/changelog.lua index 6655377..a3dc622 100644 --- a/ls_Glass/core/changelog.lua +++ b/ls_Glass/core/changelog.lua @@ -6,10 +6,8 @@ local _G = getfenv(0) -- Mine E.CHANGELOG = [[ -- Added 11.0.0 support. -- Rewrote the addon. Only font-related settings will be carried over. -- Added smooth scrolling through the chat history. Most fading and sliding options are gone because the new system relies on rather tight timings. -- Added proper "Social" button handling. -- Replaced the fade in on mouseover option with show on click. It's causing way too many false positives, too much headache. -- Most chat options are now tab-specific. +- Improved compatibility with ElvUI. Now the addon will stop loading if it detects that ElvUI chat is enabled, and you'll be greeted by the addon incompatibility popup from ElvUI. Just to make things clear, it's safe to use LS: Glass with ElvUI, you just want to disable its chat module because both addons will try to modify chat in rather extensive ways which nowadays may result in game freezes. +- Fixed an issue where the addon would struggle to scroll through messages that are taller than the chat frame itself. +- Fixed an issue where the "Copy from" menu in the chat settings would fail to fetch the list of other chat windows. +- Updated Traditional Chinese translation. Translated by RainbowUI@Curse. ]] diff --git a/ls_Glass/core/components/slidingmessageframe.lua b/ls_Glass/core/components/slidingmessageframe.lua index 2a2f491..8de3d6b 100644 --- a/ls_Glass/core/components/slidingmessageframe.lua +++ b/ls_Glass/core/components/slidingmessageframe.lua @@ -535,7 +535,7 @@ function object_proto:ResetState(doNotRefresh) self:SetFirstActiveMessageID(id) self:SetAtBottom(id == 0 or (id == 1 and offset == 0)) - self:SetAtTop(id == self:GetNumHistoryElements() and offset == 0) + self:SetAtTop(id == self:GetNumHistoryElements() and self:GetLastActiveMessageOffset() < self:GetMessageLineHeight()) if not doNotRefresh then self:UpdateFading() @@ -576,7 +576,7 @@ end function object_proto:SetLastActiveMessageInfo(id, offset) self.lastActiveMessageID = id - self.lastActiveMessageOffset = offset + self.lastActiveMessageOffset = m_max(offset, 0) end -- TODO: Remove @@ -794,7 +794,8 @@ function object_proto:RefreshActive(startIndex, maxPixels) end if lineIndex > 0 then - self:SetLastActiveMessageInfo(messageID, self.activeMessages[lineIndex]:GetBottom() - self:GetBottom()) + -- 2 is kinda arbitrary, I just want to make sure that only the first line of the last message is visible at the top + self:SetLastActiveMessageInfo(messageID, self.activeMessages[lineIndex]:GetTop() - self:GetBottom() - self:GetMessageLineHeight() + 2) end -- just hide the excess, releasing and removing them here is expensive, they'll be taken care of when the frame gets @@ -859,7 +860,7 @@ function object_proto:OnMouseWheel(delta) self:ResetFadingTimer() - if (delta == UP and self:IsAtBottom()) then + if delta == UP and self:IsAtBottom() then self:RefreshActive(self:GetFirstActiveMessageID()) self:UpdateFading() diff --git a/ls_Glass/core/config.lua b/ls_Glass/core/config.lua index 0c784d2..b7c6457 100644 --- a/ls_Glass/core/config.lua +++ b/ls_Glass/core/config.lua @@ -128,8 +128,6 @@ local function getChatOptionsForCopy(id) if i ~= id and i ~= 2 then if isChatFrameShown(i) then tabs[i] = GetChatWindowInfo(i) - else - break end end end @@ -170,6 +168,9 @@ local function createChatFrameConfig(id, order) values = function() return getChatOptionsForCopy(id) end, + disabled = function() + return not next(getChatOptionsForCopy(id)) + end, get = function() end, set = function(_, value) copyOptions(C.db.profile.chat[value], C.db.profile.chat[id]) diff --git a/ls_Glass/init.lua b/ls_Glass/init.lua index 0bc393e..471d2e0 100644 --- a/ls_Glass/init.lua +++ b/ls_Glass/init.lua @@ -38,6 +38,14 @@ end E:RegisterEvent("ADDON_LOADED", function(arg1) if arg1 ~= addonName then return end + -- stop loading if ElvUI with enabled chat is detected + local elvUI = ElvUI and ElvUI[1] + if elvUI and elvUI.private.chat.enable then + elvUI:AddIncompatible("Chat", addonName) + + return + end + if LS_GLASS_GLOBAL_CONFIG then if LS_GLASS_GLOBAL_CONFIG.profiles then for profile, data in next, LS_GLASS_GLOBAL_CONFIG.profiles do diff --git a/ls_Glass/locales/zhTW.lua b/ls_Glass/locales/zhTW.lua index 2ac23c5..9c7d75f 100644 --- a/ls_Glass/locales/zhTW.lua +++ b/ls_Glass/locales/zhTW.lua @@ -13,7 +13,11 @@ L["BOTTOM"] = "下方" L["CHANGELOG"] = "更新資訊" L["CHANGELOG_FULL"] = "完整內容" L["CONFIG_WARNING"] = "強烈建議在設定完成後,甚至只是打開這個設定視窗都要 |cffffd200重新載入介面 /reload|r,以避免在戰鬥中發生任何錯誤。" +L["CONFIRM_RESET"] = "是否要重置 \"%s\"?" +L["COPY_FROM"] = "複製,從" +L["DOCK"] = "標籤頁 & 按鈕" L["DOWNLOADS"] = "下載" +L["EDITBOX"] = "文字輸入框" L["FADE_OUT_DELAY"] = "淡出延遲時間" L["FADING"] = "淡出" L["FONT"] = "字體" @@ -21,9 +25,12 @@ L["MOUSEOVER_TOOLTIPS"] = "滑鼠指向顯示資訊" L["OFFSET"] = "位置偏移" L["OPEN_CONFIG"] = "開啟設定" L["OUTLINE"] = "外框" +L["POSITION"] = "位置" L["SCROLL_BUTTONS"] = "捲動按鈕" L["SHADOW"] = "陰影" +L["SHOW_ON_CLICK"] = "滑鼠點擊時顯示" L["SIZE"] = "大小" +L["SMOOTH_SCROLLING"] = "平滑捲動" L["SUPPORT"] = "支援" L["TOP"] = "上方" L["X_PADDING"] = "水平內邊界" diff --git a/ls_Glass/ls_Glass.toc b/ls_Glass/ls_Glass.toc index f46cb13..276d335 100644 --- a/ls_Glass/ls_Glass.toc +++ b/ls_Glass/ls_Glass.toc @@ -1,10 +1,11 @@ ## Interface: 110000, 110002 ## Author: lightspark -## Version: 110000.01 +## Version: 110000.02 ## Title: LS: |cffe0bc5bGlass|r ## Notes: Smooth as glass. ## IconTexture: Interface\AddOns\ls_Glass\assets\logo-64 ## SavedVariables: LS_GLASS_GLOBAL_CONFIG +## OptionalDeps: ElvUI embeds\_embeds.xml locales\_locales.xml