Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
ls- committed Dec 23, 2022
2 parents 3dbcf91 + 189e2c6 commit b429283
Showing 14 changed files with 116 additions and 73 deletions.
28 changes: 8 additions & 20 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
std = "none"
max_line_length = false
max_comment_line_length = 80
max_comment_line_length = 120
self = false

exclude_files = {
@@ -9,7 +9,7 @@ exclude_files = {
}

ignore = {
"111/LS.*", -- Setting an undefined global variable starting with SLASH_
"111/LS.*", -- Setting an undefined global variable starting with LS
"111/SLASH_.*", -- Setting an undefined global variable starting with SLASH_
"112/LS.*", -- Mutating an undefined global variable starting with LS
"113/LS.*", -- Accessing an undefined global variable starting with LS
@@ -29,42 +29,30 @@ globals = {
}

read_globals = {
-- AddOns
"LibStub",

-- FrameXML
"BattlePetTooltip",
"BattlePetToolTip_ShowLink",
"CHAT_FRAME_MIN_WIDTH",
"CHAT_FRAME_NORMAL_MIN_HEIGHT",
"ChatFrame1",
"ChatFrame1EditBox",
"ChatFrame2",
"ChatFrameChannelButton",
"ChatFrameMenuButton",
"Clamp",
"ColorMixin",
"CreateFont",
"CreateFrame",
"CreateObjectPool",
"DEFAULT_TAB_SELECTED_COLOR_TABLE",
"GameTooltip",
"GeneralDockManager",
"GetAddOnMetadata",
"GetLocale",
"HideUIPanel",
"InCombatLockdown",
"LibStub",
"LinkUtil",
"Mixin",
"NORMAL_FONT_COLOR",
"NUM_CHAT_WINDOWS",
"Settings",
"SettingsPanel",
"SlashCmdList",
"UIParent",

-- Namespace

-- API
"CreateFont",
"CreateFrame",
"GetAddOnMetadata",
"GetCVar",
"GetLocale",
"InCombatLockdown",
}
28 changes: 28 additions & 0 deletions .luacheckrc_build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$luacheckrc = ".\.luacheckrc"

$out = ""
foreach ($line in Get-Content $luacheckrc) {
if ($line -match "read_globals") { break }

$out += $line + "`n"
}

Set-Content $luacheckrc -Value $out.TrimEnd()

$out = @()
luacheck . | ForEach-Object {
if ($_ -match "accessing undefined variable '(.+?)'") {
if ($out -notcontains $matches[1]) {
$out += $matches[1]
}
}
}

Add-Content $luacheckrc ""
Add-Content $luacheckrc ("read_globals = {")

foreach ($arg in $out | Sort-Object) {
Add-Content $luacheckrc ("`t`"" + $arg + "`",")
}

Add-Content $luacheckrc ("}")
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# CHANGELOG

## Version 100002.01

- Added 10.0.2 support.
- Increased the max fade out delay to 120s.
- Changed the initial anchor of the edit box. It now can be positioned inside the chat frame.
- Fixed an issue where profession links would open a profession window on mouse over. Thanks
truckcarr11@GitHub.
- Updated French translation. Translated by Braincell1980@Curse.
- Updated German translation. Translated by OHerendirO@Curse.
- Updated Korean translation. Translated by netaras@Curse.
- Updated Traditional Chinese translation. Translated by RainbowUI@Curse.

## Version 100000.05

- Added options to change the edit box's position and offset.
19 changes: 9 additions & 10 deletions ls_Glass/core/changelog.lua
Original file line number Diff line number Diff line change
@@ -6,14 +6,13 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added options to change the edit box's position and offset.
- Improved compatibility with other addons that re-format chat messages. IME, the most compatible
one is BasicChatMods by funkehdude, it has features my addon currently lacks, like button hiding.
That said, you definitely should disable overlapping features in other addons.
- Replaced "Jump to Present" and "Unread Messages" with icons because those text strings were
obnoxiously long in some locales.
- Fixed an issue where the chat frame would sometimes stop updating after scrolling down with the
mouse wheel.
- Added Spanish translation. Translated by cacahuete_uchi@Curse.
- Updated Korean translation. Translated by netaras@Curse and unrealcrom96@Curse.
- Added 10.0.2 support.
- Increased the max fade out delay to 120s.
- Changed the initial anchor of the edit box. It now can be positioned inside the chat frame.
- Fixed an issue where profession links would open a profession window on mouse over. Thanks
truckcarr11@GitHub.
- Updated French translation. Translated by Braincell1980@Curse.
- Updated German translation. Translated by OHerendirO@Curse.
- Updated Korean translation. Translated by netaras@Curse.
- Updated Traditional Chinese translation. Translated by RainbowUI@Curse.
]]
16 changes: 8 additions & 8 deletions ls_Glass/core/components/editbox.lua
Original file line number Diff line number Diff line change
@@ -32,11 +32,11 @@ function E:HandleEditBox(frame)
frame:ClearAllPoints()

if C.db.profile.dock.edit.position == "top" then
frame:SetPoint("BOTTOMLEFT", frame.chatFrame, "TOPLEFT", 0, C.db.profile.dock.edit.offset)
frame:SetPoint("BOTTOMRIGHT", frame.chatFrame, "TOPRIGHT", 0, C.db.profile.dock.edit.offset)
frame:SetPoint("TOPLEFT", frame.chatFrame, "TOPLEFT", 0, C.db.profile.dock.edit.offset)
frame:SetPoint("TOPRIGHT", frame.chatFrame, "TOPRIGHT", 0, C.db.profile.dock.edit.offset)
else
frame:SetPoint("TOPLEFT", frame.chatFrame, "BOTTOMLEFT", 0, -C.db.profile.dock.edit.offset)
frame:SetPoint("TOPRIGHT", frame.chatFrame, "BOTTOMRIGHT", 0, -C.db.profile.dock.edit.offset)
frame:SetPoint("BOTTOMLEFT", frame.chatFrame, "BOTTOMLEFT", 0, -C.db.profile.dock.edit.offset)
frame:SetPoint("BOTTOMRIGHT", frame.chatFrame, "BOTTOMRIGHT", 0, -C.db.profile.dock.edit.offset)
end

frame:SetFontObject("LSGlassEditBoxFont")
@@ -51,11 +51,11 @@ function E:UpdateEditBoxes()
editBox:ClearAllPoints()

if C.db.profile.dock.edit.position == "top" then
editBox:SetPoint("BOTTOMLEFT", editBox.chatFrame, "TOPLEFT", 0, C.db.profile.dock.edit.offset)
editBox:SetPoint("BOTTOMRIGHT", editBox.chatFrame, "TOPRIGHT", 0, C.db.profile.dock.edit.offset)
editBox:SetPoint("TOPLEFT", editBox.chatFrame, "TOPLEFT", 0, C.db.profile.dock.edit.offset)
editBox:SetPoint("TOPRIGHT", editBox.chatFrame, "TOPRIGHT", 0, C.db.profile.dock.edit.offset)
else
editBox:SetPoint("TOPLEFT", editBox.chatFrame, "BOTTOMLEFT", 0, -C.db.profile.dock.edit.offset)
editBox:SetPoint("TOPRIGHT", editBox.chatFrame, "BOTTOMRIGHT", 0, -C.db.profile.dock.edit.offset)
editBox:SetPoint("BOTTOMLEFT", editBox.chatFrame, "BOTTOMLEFT", 0, -C.db.profile.dock.edit.offset)
editBox:SetPoint("BOTTOMRIGHT", editBox.chatFrame, "BOTTOMRIGHT", 0, -C.db.profile.dock.edit.offset)
end
end
end
2 changes: 1 addition & 1 deletion ls_Glass/core/defaults.lua
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ D.profile = {
alpha = 0.8,
edit = {
position = "bottom", -- "top"
offset = 2,
offset = 32,
},
font = {
size = 12,
10 changes: 10 additions & 0 deletions ls_Glass/core/modernize.lua
Original file line number Diff line number Diff line change
@@ -24,5 +24,15 @@ function E:Modernize(data, name, key)

data.version = 10000003
end

if data.version < 10000201 then
if data.dock then
if data.dock.edit then
data.dock.edit.offset = nil
end
end

data.version = 10000201
end
end
end
32 changes: 11 additions & 21 deletions ls_Glass/embeds/CallbackHandler-1.0/CallbackHandler-1.0.lua
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
--[[ $Id: CallbackHandler-1.0.lua 22 2018-07-21 14:17:22Z nevcairiel $ ]]
local MAJOR, MINOR = "CallbackHandler-1.0", 7
--[[ $Id: CallbackHandler-1.0.lua 26 2022-12-12 15:09:39Z nevcairiel $ ]]
local MAJOR, MINOR = "CallbackHandler-1.0", 8
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)

if not CallbackHandler then return end -- No upgrade needed

local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}

-- Lua APIs
local tconcat = table.concat
local assert, error, loadstring = assert, error, loadstring
local setmetatable, rawset, rawget = setmetatable, rawset, rawget
local securecallfunction, error = securecallfunction, error
local setmetatable, rawget = setmetatable, rawget
local next, select, pairs, type, tostring = next, select, pairs, type, tostring

-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: geterrorhandler

local xpcall = xpcall

local function errorhandler(err)
return geterrorhandler()(err)
end

local function Dispatch(handlers, ...)
local index, method = next(handlers)
if not method then return end
repeat
xpcall(method, errorhandler, ...)
securecallfunction(method, ...)
index, method = next(handlers, index)
until not method
end
@@ -39,7 +29,7 @@ end
-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback"
-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API.

function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName)
function CallbackHandler.New(_self, target, RegisterName, UnregisterName, UnregisterAllName)

RegisterName = RegisterName or "RegisterCallback"
UnregisterName = UnregisterName or "UnregisterCallback"
@@ -67,13 +57,13 @@ function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAll

if registry.insertQueue and oldrecurse==0 then
-- Something in one of our callbacks wanted to register more callbacks; they got queued
for eventname,callbacks in pairs(registry.insertQueue) do
local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten.
for self,func in pairs(callbacks) do
events[eventname][self] = func
for event,callbacks in pairs(registry.insertQueue) do
local first = not rawget(events, event) or not next(events[event]) -- test for empty before. not test for one member after. that one member may have been overwritten.
for object,func in pairs(callbacks) do
events[event][object] = func
-- fire OnUsed callback?
if first and registry.OnUsed then
registry.OnUsed(registry, target, eventname)
registry.OnUsed(registry, target, event)
first = nil
end
end
6 changes: 3 additions & 3 deletions ls_Glass/init.lua
Original file line number Diff line number Diff line change
@@ -236,7 +236,7 @@ function E:OnInitialize()
disabled = function()
return C.db.profile.chat.fade.persistent
end,
min = 0, max = 20, step = 1,
min = 0, max = 120, step = 1,
},
out_duration = {
order = 12,
@@ -301,7 +301,7 @@ function E:OnInitialize()
order = 3,
type = "range",
name = L["OFFSET"],
min = 2, max = 32, step = 1,
min = 0, max = 64, step = 1,
get = function()
return C.db.profile.dock.edit.offset
end,
@@ -560,7 +560,7 @@ function E:OnEnable()
if linkType == "battlepet" then
GameTooltip:SetOwner(chatFrame, "ANCHOR_CURSOR_RIGHT", 4, 2)
BattlePetToolTip_ShowLink(text)
else
elseif linkType ~= "trade" then
GameTooltip:SetOwner(chatFrame, "ANCHOR_CURSOR_RIGHT", 4, 2)

local isOK = pcall(GameTooltip.SetHyperlink, GameTooltip, link)
6 changes: 5 additions & 1 deletion ls_Glass/locales/deDE.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Contributors: terijaki@GitHub, Solence1@Curse
-- Contributors: OHerendirO@Curse, terijaki@GitHub, Solence1@Cursem

local _, ns = ...
local L = ns.L
@@ -9,11 +9,13 @@ local _G = getfenv(0)
if GetLocale() ~= "deDE" then return end

L["BACKGROUND_ALPHA"] = "Hintergrundtransparenz"
L["BOTTOM"] = "Unterseite"
L["CHANGELOG"] = "Änderungsprotokoll"
L["CHANGELOG_FULL"] = "vollständiges Änderungsprotokoll"
L["CONFIG_WARNING"] = "Ich empfehle dringend, die Benutzeroberfläche nach dem Einrichten des Addons oder dem Öffnen dieses Fensters mithilfe von |cffffd200/reload|r neu zu laden, um Fehler die während des Kampfes auftreten können zu vermeiden."
L["DOCK_AND_EDITBOX"] = "Registerkarten und Eingabefeld"
L["DOWNLOADS"] = "Downloads"
L["EDITBOX_POSITION"] = "Position des Eingabefelds"
L["FADE_IN_DURATION"] = "Einblendezeit"
L["FADE_OUT_DELAY"] = "Ausblendeverzögerung"
L["FADE_OUT_DURATION"] = "Ausblendezeit"
@@ -22,12 +24,14 @@ L["FONT"] = "Schriftart"
L["FONT_EDITBOX"] = "Schriftart des Eingabefeld"
L["MESSAGES"] = "Nachrichten"
L["MOUSEOVER_TOOLTIPS"] = "Mauszeiger-Tooltip"
L["OFFSET"] = "Versatz"
L["OPEN_CONFIG"] = "Konfigurationen öffnen"
L["OUTLINE"] = "Umriss"
L["PERSISTENT"] = "Dauerhaft anzeigen"
L["SHADOW"] = "Schatten"
L["SIZE"] = "Größe"
L["SLIDE_IN_DURATION"] = "Einschubzeit"
L["SUPPORT"] = "Support"
L["TOP"] = "Oberseite"
L["X_PADDING"] = "Horizontaler Abstand"
L["Y_PADDING"] = "Vertikaler Abstand"
18 changes: 11 additions & 7 deletions ls_Glass/locales/frFR.lua
Original file line number Diff line number Diff line change
@@ -9,25 +9,29 @@ local _G = getfenv(0)
if GetLocale() ~= "frFR" then return end

L["BACKGROUND_ALPHA"] = "Opacité du fond"
L["BOTTOM"] = "Bas"
L["CHANGELOG"] = "Liste des changements "
L["CHANGELOG_FULL"] = "Tout"
L["CONFIG_WARNING"] = "Je recommande fortement de |cffffd200/reload|r l'interface utilisateur une fois que vous avez terminé de configurer l'addon ou même d'ouvrir ce panneau pour éviter toute erreur pendant un combat."
L["DOCK_AND_EDITBOX"] = "Onglets et Zone d'édition"
L["DOCK_AND_EDITBOX"] = "Onglets et boîte de saisie"
L["DOWNLOADS"] = "Téléchargements"
L["FADE_IN_DURATION"] = "Durée du Fondu entrant"
L["FADE_OUT_DELAY"] = "Délais du Fondu sortant"
L["FADE_OUT_DURATION"] = "Durée du Fondu sortant"
L["EDITBOX_POSITION"] = "Position de la boîte de saisie"
L["FADE_IN_DURATION"] = "Durée du fondu entrant"
L["FADE_OUT_DELAY"] = "Délais du fondu sortant"
L["FADE_OUT_DURATION"] = "Durée du fondu sortant"
L["FADING"] = "Fondu"
L["FONT"] = "Police"
L["FONT_EDITBOX"] = "Police de la Zone d'édition"
L["FONT_EDITBOX"] = "Police de la boîte de saisie"
L["MESSAGES"] = "Messages"
L["MOUSEOVER_TOOLTIPS"] = "Infobulle au survol de la souris"
L["OFFSET"] = "Décalage"
L["OPEN_CONFIG"] = "Ouvrir la configuration"
L["OUTLINE"] = "Contour"
L["PERSISTENT"] = "Persistant"
L["SHADOW"] = "Ombre"
L["SIZE"] = "Taille"
L["SLIDE_IN_DURATION"] = "Durée d'apparition"
L["SUPPORT"] = "Assistance"
L["X_PADDING"] = "Marge Horizontale"
L["Y_PADDING"] = "Marge Verticale"
L["TOP"] = "Haut"
L["X_PADDING"] = "Marge horizontale"
L["Y_PADDING"] = "Marge verticale"
4 changes: 4 additions & 0 deletions ls_Glass/locales/koKR.lua
Original file line number Diff line number Diff line change
@@ -9,11 +9,13 @@ local _G = getfenv(0)
if GetLocale() ~= "koKR" then return end

L["BACKGROUND_ALPHA"] = "배경 불투명도"
L["BOTTOM"] = "아래"
L["CHANGELOG"] = "변경사항"
L["CHANGELOG_FULL"] = "전체"
L["CONFIG_WARNING"] = "전투 중 오류를 피하기 위해 애드온 설정을 완료하거나 이 패널을 연 후 UI를 |cffffd200/reload|r하는 것이 좋습니다."
L["DOCK_AND_EDITBOX"] = "탭 및 입력줄"
L["DOWNLOADS"] = "내려받기"
L["EDITBOX_POSITION"] = "입력줄 위치"
L["FADE_IN_DURATION"] = "서서히 나타남 지속 시간"
L["FADE_OUT_DELAY"] = "서서히 사라짐 지연"
L["FADE_OUT_DURATION"] = "서서히 사라짐 지속 시간"
@@ -22,12 +24,14 @@ L["FONT"] = "글꼴"
L["FONT_EDITBOX"] = "입력줄 글꼴"
L["MESSAGES"] = "메시지"
L["MOUSEOVER_TOOLTIPS"] = "마우스오버 툴팁"
L["OFFSET"] = "위치"
L["OPEN_CONFIG"] = "구성 열기"
L["OUTLINE"] = "외곽선"
L["PERSISTENT"] = "나타남 지속"
L["SHADOW"] = "그림자"
L["SIZE"] = "크기"
L["SLIDE_IN_DURATION"] = "안으로 슬라이드 지속 시간"
L["SUPPORT"] = "지원"
L["TOP"] = ""
L["X_PADDING"] = "들여쓰기"
L["Y_PADDING"] = "줄간격"
Loading

0 comments on commit b429283

Please sign in to comment.