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 14, 2022
2 parents 83a0e9e + 5e2e5a6 commit 5993892
Show file tree
Hide file tree
Showing 20 changed files with 283 additions and 139 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# CHANGELOG

## Version 100000.05

- 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.

## Version 100000.04

- Added support for the pet battle log.
Expand Down
Binary file added ls_Glass/assets/scrolldown.TGA
Binary file not shown.
24 changes: 10 additions & 14 deletions ls_Glass/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added support for the pet battle log.
- Fixed an issue where custom fonts wouldn't apply on load.
- Added Korean translation. Translated by netaras@Curse.
- Added Portuguese translation. Translated by Azeveco@Curse.
- Added Traditional Chinese translation. Translated by RainbowUI@Curse.
- Updated French translation. Translated by Braincell1980@Curse.
- Updated German translation. Translated by Solence1@Curse.
### Known Issues
- There's a bug where the chat frame sometimes stops updating properly after scrolling down with
the mouse wheel. It's a tricky one to fix, I'm still investigating it. But to resume the update
process you need to scroll up until you see the "Jump to Present"/"Unread Messages" button and
then click it.
- 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.
]]
1 change: 1 addition & 0 deletions ls_Glass/core/components/_components.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
<Script file="gradientbackground.lua"/>
<Script file="messageline.lua"/>
<Script file="slidingmessageframe.lua"/>
<Script file="scrolldown.lua"/>
<Script file="tab.lua"/>
</Ui>
14 changes: 7 additions & 7 deletions ls_Glass/core/components/button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ local function handleButton(frame, ...)
normalTexture:SetPoint("BOTTOMRIGHT", -2, 2)
normalTexture:SetVertexColor(C.db.global.colors.lanzones:GetRGB())

local psuhedTexture = frame:GetPushedTexture()
psuhedTexture:SetTexture("Interface\\AddOns\\ls_Glass\\assets\\icons")
psuhedTexture:SetTexCoord(...)
psuhedTexture:ClearAllPoints()
psuhedTexture:SetPoint("TOPLEFT", 3, -3)
psuhedTexture:SetPoint("BOTTOMRIGHT", -1, 1)
psuhedTexture:SetVertexColor(C.db.global.colors.lanzones:GetRGB())
local pushedTexture = frame:GetPushedTexture()
pushedTexture:SetTexture("Interface\\AddOns\\ls_Glass\\assets\\icons")
pushedTexture:SetTexCoord(...)
pushedTexture:ClearAllPoints()
pushedTexture:SetPoint("TOPLEFT", 3, -3)
pushedTexture:SetPoint("BOTTOMRIGHT", -1, 1)
pushedTexture:SetVertexColor(C.db.global.colors.lanzones:GetRGB())

local highlightLeft = frame.HighlightLeft
highlightLeft:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, -2)
Expand Down
24 changes: 22 additions & 2 deletions ls_Glass/core/components/editbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,32 @@ function E:HandleEditBox(frame)
end

frame:ClearAllPoints()
frame:SetPoint("TOPLEFT", frame.chatFrame, "BOTTOMLEFT", 0, -2)
frame:SetPoint("TOPRIGHT", frame.chatFrame, "BOTTOMRIGHT", 0, -2)

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)
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)
end

frame:SetFontObject("LSGlassEditBoxFont")
frame.header:SetFontObject("LSGlassEditBoxFont")
frame.headerSuffix:SetFontObject("LSGlassEditBoxFont")
frame.NewcomerHint:SetFontObject("LSGlassEditBoxFont")
frame.prompt:SetFontObject("LSGlassEditBoxFont")
end

function E:UpdateEditBoxes()
for editBox in next, handledEditBoxes do
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)
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)
end
end
end
1 change: 1 addition & 0 deletions ls_Glass/core/components/messageline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ local function resetMessageLine(messageLine)
messageLine.Text:SetText("")
messageLine:ClearAllPoints()
messageLine:Hide()
messageLine:UpdateGradient()
E:StopFading(messageLine, 0)
end

Expand Down
106 changes: 106 additions & 0 deletions ls_Glass/core/components/scrolldown.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
local _, ns = ...
local E, C, D, L = ns.E, ns.C, ns.D, ns.L

-- Lua
local _G = getfenv(0)
local unpack = _G.unpack

-- Mine
local button_proto = {}

do
local ICONS = {
{0 / 128, 52 / 128, 0 / 64, 52 / 64}, -- 1, "down"
{52 / 128, 104 / 128, 0 / 64, 52 / 64}, -- 2, "new"
}

function button_proto:OnClick()
local frame = self:GetParent()
if frame then
frame:FastForward()

E:FadeOut(self, 0, 0.1, function()
self:SetState(1, true)
self:Hide()
end)
end
end

function button_proto:SetState(state, isInstant)
if state ~= self.state then
self.state = state

if isInstant then
self.NormalTexture:SetTexCoord(unpack(ICONS[state]))
self.PushedTexture:SetTexCoord(unpack(ICONS[state]))
else
E:StopFading(self.NormalTexture, 1)
E:FadeOut(self.NormalTexture, 0, 0.1, function()
self.NormalTexture:SetTexCoord(unpack(ICONS[state]))
self.PushedTexture:SetTexCoord(unpack(ICONS[state]))

E:FadeIn(self.NormalTexture, 0.1)
end)
end
end
end
end

function E:CreateScrollDownButton(parent)
local button = Mixin(CreateFrame("Button", nil, parent), button_proto)
button:SetSize(24, 24)
button:SetPoint("BOTTOMRIGHT", -4, 4)
button:SetScript("OnClick", button.OnClick)
button:SetAlpha(0)
button:Hide()

button.Backdrop = E:CreateBackdrop(button)

button:SetNormalTexture(0)
button:SetPushedTexture(0)
button:SetHighlightTexture(0)

local normalTexture = button:GetNormalTexture()
normalTexture:SetTexture("Interface\\AddOns\\ls_Glass\\assets\\scrolldown")
normalTexture:ClearAllPoints()
normalTexture:SetPoint("TOPLEFT", 3, -3)
normalTexture:SetPoint("BOTTOMRIGHT", -3, 3)
normalTexture:SetAlpha(0.8)
normalTexture:SetVertexColor(C.db.global.colors.lanzones:GetRGB())
button.NormalTexture = normalTexture

local pushedTexture = button:GetPushedTexture()
pushedTexture:SetTexture("Interface\\AddOns\\ls_Glass\\assets\\scrolldown")
pushedTexture:ClearAllPoints()
pushedTexture:SetPoint("TOPLEFT", 4, -4)
pushedTexture:SetPoint("BOTTOMRIGHT", -2, 2)
pushedTexture:SetAlpha(0.8)
pushedTexture:SetVertexColor(C.db.global.colors.lanzones:GetRGB())
button.PushedTexture = pushedTexture

local highlightLeft = button:CreateTexture(nil, "HIGHLIGHT")
highlightLeft:SetPoint("TOPLEFT", button, "TOPLEFT", 0, -2)
highlightLeft:SetTexture("Interface\\AddOns\\ls_Glass\\assets\\border-highlight")
highlightLeft:SetVertexColor(DEFAULT_TAB_SELECTED_COLOR_TABLE.r, DEFAULT_TAB_SELECTED_COLOR_TABLE.g, DEFAULT_TAB_SELECTED_COLOR_TABLE.b)
highlightLeft:SetTexCoord(0, 1, 0.5, 1)
highlightLeft:SetSize(8, 8)

local highlightRight = button:CreateTexture(nil, "HIGHLIGHT")
highlightRight:SetPoint("TOPRIGHT", button, "TOPRIGHT", 0, -2)
highlightRight:SetTexture("Interface\\AddOns\\ls_Glass\\assets\\border-highlight")
highlightRight:SetVertexColor(DEFAULT_TAB_SELECTED_COLOR_TABLE.r, DEFAULT_TAB_SELECTED_COLOR_TABLE.g, DEFAULT_TAB_SELECTED_COLOR_TABLE.b)
highlightRight:SetTexCoord(1, 0, 0.5, 1)
highlightRight:SetSize(8, 8)

local highlightMiddle = button:CreateTexture(nil, "HIGHLIGHT")
highlightMiddle:SetPoint("TOPLEFT", highlightLeft, "TOPRIGHT", 0, 0)
highlightMiddle:SetPoint("TOPRIGHT", highlightRight, "TOPLEFT", 0, 0)
highlightMiddle:SetTexture("Interface\\AddOns\\ls_Glass\\assets\\border-highlight")
highlightMiddle:SetVertexColor(DEFAULT_TAB_SELECTED_COLOR_TABLE.r, DEFAULT_TAB_SELECTED_COLOR_TABLE.g, DEFAULT_TAB_SELECTED_COLOR_TABLE.b)
highlightMiddle:SetTexCoord(0, 1, 0, 0.5)
highlightMiddle:SetSize(8, 8)

button:SetState(1)

return button
end
Loading

0 comments on commit 5993892

Please sign in to comment.