Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Nov 9, 2022
2 parents 4e68b81 + 541af89 commit f4a0f0d
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## Version 100000.03

- Fixed more issues related to fasting forward. Those pesky line#340 errors.
- Added German translation. Translated by terijaki@GitHub.

## Version 100000.02

- Added horizontal and vertical padding options for messages.
Expand Down
1 change: 1 addition & 0 deletions ls_Glass/core/_core.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="core.lua"/>
<Script file="defaults.lua"/>
<Script file="modernize.lua"/>
<!-- can sort -->
<Script file="changelog.lua"/>
<Include file="components\_components.xml"/>
Expand Down
9 changes: 3 additions & 6 deletions ls_Glass/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added horizontal and vertical padding options for messages.
- Fixed an issue where messages' background gradient wouldn't resize properly.
- Fixed an issue where fast forwarding would break the message display.
- Reduced the minimal possible chat frame size to 176x64, making it smaller will break stuff.
The max is uncapped.
- Added French translation. Translated by Braincell1980@Curse.
- Fixed more issues related to fasting forward. Those pesky line#340 errors.
- Limited x/y padding to >= 1. Vertical padding set to 0 was breaking stuff.
- Added German translation. Translated by terijaki@GitHub.
]]
17 changes: 10 additions & 7 deletions ls_Glass/core/components/slidingmessageframe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ function object_proto:CaptureChatFrame(chatFrame)

self:SetPoint("TOPLEFT", chatFrame)
self:SetSize(width, height)
self:SetShown(chatFrame:IsShown())

self.ScrollChild:SetSize(width, height)

Expand All @@ -230,6 +229,8 @@ function object_proto:CaptureChatFrame(chatFrame)
for i = 1, chatFrame:GetNumMessages() do
self:AddMessage(chatFrame, chatFrame:GetMessageInfo(i))
end

self:SetShown(chatFrame:IsShown())
end

function object_proto:ReleaseChatFrame()
Expand Down Expand Up @@ -314,7 +315,7 @@ function object_proto:ReleaseMessageLine(messageLine)
end

function object_proto:GetMaxMessages()
return m_ceil(self.ChatFrame:GetHeight() / (C.db.profile.chat.font.size + C.db.profile.chat.y_padding * 2))
return m_ceil(self:GetHeight() / (C.db.profile.chat.font.size + C.db.profile.chat.y_padding * 2))
end

function object_proto:ScrollTo(index, refreshFading, tryToFadeIn)
Expand Down Expand Up @@ -389,15 +390,17 @@ function object_proto:ScrollTo(index, refreshFading, tryToFadeIn)
end

function object_proto:FastForward()
if not self:IsShown() or self.ScrollChild:GetHeight() == 0 then return end

if self:GetNumHistoryElements() > 0 then
t_wipe(self.incomingMessages)

local num = m_min(self:GetNumHistoryElements(), self:GetMaxMessages(), self:GetFirstMessageIndex())
if num == 0 then return end

self:SetVerticalScroll(0)
self:ScrollTo(num)
self:ScrollTo(num, true)

if num == 0 then return end
if num == self:GetFirstMessageIndex() then
num = num + 1
end
Expand All @@ -410,13 +413,13 @@ function object_proto:FastForward()
end
end

self:ProcessIncoming(messages, false)
self:ProcessIncoming(messages, true)
self:SetFirstMessageIndex(0)
end
end

function object_proto:Refresh(delta, refreshFading, tryToFadeIn)
if not self:IsShown() then return end
if not self:IsShown() or self.ScrollChild:GetHeight() == 0 then return end

if self:GetNumHistoryElements() == 0 then
return self:SetFirstMessageIndex(0)
Expand Down Expand Up @@ -484,7 +487,7 @@ function object_proto:AddMessage(_, ...)
end

function object_proto:OnFrame()
if not self:IsShown() or self:GetScrollingHandler() then return end
if not self:IsShown() or self.ScrollChild:GetHeight() == 0 or self:GetScrollingHandler() then return end

if #self.incomingMessages > 0 then
self:ProcessIncoming({t_removemulti(self.incomingMessages, 1, #self.incomingMessages)}, false)
Expand Down
28 changes: 28 additions & 0 deletions ls_Glass/core/modernize.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local _, ns = ...
local E, C, D, L = ns.E, ns.C, ns.D, ns.L

-- Lua
local _G = getfenv(0)
local m_max = _G.math.max

-- Mine
function E:Modernize(data, name, key)
if not data.version then return end

if key == "profile" then
--> 100000.03
if data.version < 10000003 then
if data.chat then
if data.chat.x_padding then
data.chat.x_padding = m_max(1, data.chat.x_padding)
end

if data.chat.y_padding then
data.chat.y_padding = m_max(1, data.chat.y_padding)
end
end

data.version = 10000003
end
end
end
12 changes: 10 additions & 2 deletions ls_Glass/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ function E:OnInitialize()
self.VER.string = GetAddOnMetadata(addonName, "Version")
self.VER.number = tonumber(self.VER.string:gsub("%D", ""), nil)

if LS_GLASS_GLOBAL_CONFIG then
if LS_GLASS_GLOBAL_CONFIG.profiles then
for profile, data in next, LS_GLASS_GLOBAL_CONFIG.profiles do
self:Modernize(data, profile, "profile")
end
end
end

C.db = LibStub("AceDB-3.0"):New("LS_GLASS_GLOBAL_CONFIG", D, true)
C.db:RegisterCallback("OnProfileChanged", updateCallback)
C.db:RegisterCallback("OnProfileCopied", updateCallback)
Expand Down Expand Up @@ -110,7 +118,7 @@ function E:OnInitialize()
order = 2,
type = "range",
name = L["X_PADDING"],
min = 0, max = 20, step = 1,
min = 1, max = 20, step = 1,
set = function(_, value)
if C.db.profile.chat.x_padding ~= value then
C.db.profile.chat.x_padding = value
Expand All @@ -123,7 +131,7 @@ function E:OnInitialize()
order = 3,
type = "range",
name = L["Y_PADDING"],
min = 0, max = 10, step = 1,
min = 1, max = 10, step = 1,
set = function(_, value)
if C.db.profile.chat.y_padding ~= value then
C.db.profile.chat.y_padding = value
Expand Down
26 changes: 25 additions & 1 deletion ls_Glass/locales/deDE.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Contributors:
-- Contributors: terijaki@GitHub

local _, ns = ...
local L = ns.L
Expand All @@ -7,3 +7,27 @@ local L = ns.L
local _G = getfenv(0)

if GetLocale() ~= "deDE" then return end

L["BACKGROUND_ALPHA"] = "Hintergrundtransparenz"
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["FADE_IN_DURATION"] = "Einblendezeit"
L["FADE_OUT_DELAY"] = "Ausblendeverzögerung"
L["FADE_OUT_DURATION"] = "Ausblendezeit"
L["FADING"] = "Ausblenden"
L["FONT"] = "Schriftart"
L["FONT_EDITBOX"] = "Schriftart des Eingabefeld"
L["JUMP_TO_PRESENT"] = "zur aktuellen Position springen"
L["MESSAGES"] = "Nachrichten"
L["MOUSEOVER_TOOLTIPS"] = "Mauszeiger-Tooltip"
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["UNREAD_MESSAGES"] = "|TInterface\\CHATFRAME\\UI-ChatWhisperIcon:0:|t ungelesene Nachrichten"
2 changes: 1 addition & 1 deletion ls_Glass/ls_Glass.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 100000
## Author: lightspark
## Version: 100000.02
## Version: 100000.03

## Title: LS: |cffe0bc5bGlass|r
## Notes: Smooth as glass.
Expand Down

0 comments on commit f4a0f0d

Please sign in to comment.