RecentChat - first messy version.

I took InputScrollFrameTemplate code from retail and put it into xml file in my addon.
Seems to work. But still messy.
This commit is contained in:
Sattva
2023-05-27 22:23:07 +03:00
parent ba8f68ff18
commit 9e40ba5961
3 changed files with 118 additions and 8 deletions
+108
View File
@@ -0,0 +1,108 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
<ScrollFrame name="InputScrollFrameTemplate" inherits="ScrollFrameTemplate" virtual="true">
<KeyValues>
<KeyValue key="maxLetters" value="0" type="number"/>
<!--
<KeyValue key="instructions" value="INSTRUCTION_TEXT" type="global"/>
<KeyValue key="hideCharCount" value="false" type="boolean"/>
-->
</KeyValues>
<Layers>
<Layer level="BACKGROUND">
<Texture parentKey="TopLeftTex" file="Interface\Common\Common-Input-Border-TL">
<Size x="8" y="8"/>
<Anchors>
<Anchor point="TOPLEFT" x="-5" y="5"/>
</Anchors>
</Texture>
<Texture parentKey="TopRightTex" file="Interface\Common\Common-Input-Border-TR">
<Size x="8" y="8"/>
<Anchors>
<Anchor point="TOPRIGHT" x="5" y="5"/>
</Anchors>
</Texture>
<Texture parentKey="TopTex" file="Interface\Common\Common-Input-Border-T">
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.TopLeftTex" relativePoint="TOPRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.TopRightTex" relativePoint="BOTTOMLEFT"/>
</Anchors>
</Texture>
<Texture parentKey="BottomLeftTex" file="Interface\Common\Common-Input-Border-BL">
<Size x="8" y="8"/>
<Anchors>
<Anchor point="BOTTOMLEFT" x="-5" y="-5"/>
</Anchors>
</Texture>
<Texture parentKey="BottomRightTex" file="Interface\Common\Common-Input-Border-BR">
<Size x="8" y="8"/>
<Anchors>
<Anchor point="BOTTOMRIGHT" x="5" y="-5"/>
</Anchors>
</Texture>
<Texture parentKey="BottomTex" file="Interface\Common\Common-Input-Border-B">
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.BottomLeftTex" relativePoint="TOPRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.BottomRightTex" relativePoint="BOTTOMLEFT"/>
</Anchors>
</Texture>
<Texture parentKey="LeftTex" file="Interface\Common\Common-Input-Border-L">
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.TopLeftTex" relativePoint="BOTTOMLEFT"/>
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.BottomLeftTex" relativePoint="TOPRIGHT"/>
</Anchors>
</Texture>
<Texture parentKey="RightTex" file="Interface\Common\Common-Input-Border-R">
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.TopRightTex" relativePoint="BOTTOMLEFT"/>
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.BottomRightTex" relativePoint="TOPRIGHT"/>
</Anchors>
</Texture>
<Texture parentKey="MiddleTex" file="Interface\Common\Common-Input-Border-M">
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.LeftTex" relativePoint="TOPRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.RightTex" relativePoint="BOTTOMLEFT"/>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString inherits="GameFontDisableLarge" parentKey="CharCount">
<Anchors>
<Anchor point="BOTTOMRIGHT" x="-6" y="0"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad function="InputScrollFrame_OnLoad"/>
<OnMouseDown function="InputScrollFrame_OnMouseDown"/>
</Scripts>
<ScrollChild>
<EditBox parentKey="EditBox" multiLine="true" countInvisibleLetters="true" autoFocus="false">
<Size x="1" y="1"/>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<Layers>
<Layer level="BORDER">
<FontString parentKey="Instructions" inherits="GameFontNormalSmall" justifyH="LEFT" justifyV="TOP">
<Anchors>
<Anchor point="TOPLEFT" x="0" y="0"/>
</Anchors>
<Color r="0.35" g="0.35" b="0.35"/>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnTabPressed function="InputScrollFrame_OnTabPressed"/>
<OnTextChanged function="InputScrollFrame_OnTextChanged"/>
<OnCursorChanged function="ScrollingEdit_OnCursorChanged"/>
<OnUpdate function="InputScrollFrame_OnUpdate"/>
<OnEscapePressed function="InputScrollFrame_OnEscapePressed"/>
</Scripts>
<FontString inherits="GameFontHighlightSmall"/>
</EditBox>
</ScrollChild>
</ScrollFrame>
</Ui>
+8 -8
View File
@@ -9754,11 +9754,11 @@ function LeaPlusLC:FriendCheck(name)
local titleBox = titleFrame.EditBox
titleBox:Hide()
titleBox:SetEnabled(false)
-- titleBox:SetEnabled(false)
-- Drag to resize
editFrame:SetResizable(true)
editFrame:SetResizeBounds(600, 170, 600, 560)
-- editFrame:SetResizeBounds(600, 170, 600, 560)
titleFrame:HookScript("OnMouseDown", function(self, btn)
if btn == "LeftButton" then
@@ -9783,7 +9783,7 @@ function LeaPlusLC:FriendCheck(name)
editBox:SetAltArrowKeyMode(false)
editBox:SetTextInsets(4, 4, 4, 4)
editBox:SetWidth(editFrame:GetWidth() - 30)
editBox:SetSecurityDisablePaste()
-- editBox:SetSecurityDisablePaste()
editBox:SetMaxLetters(0)
-- Manage focus
@@ -9864,10 +9864,10 @@ function LeaPlusLC:FriendCheck(name)
end
-- Handle colors
if r and g and b then
local colorCode = RGBToColorCode(r, g, b)
chatMessage = colorCode .. chatMessage
end
-- if r and g and b then
-- -- local colorCode = RGBToColorCode(r, g, b)
-- chatMessage = colorCode .. chatMessage
-- end
chatMessage = gsub(chatMessage, "|T.-|t", "") -- Remove textures
chatMessage = gsub(chatMessage, "|A.-|a", "") -- Remove atlases
@@ -9878,7 +9878,7 @@ function LeaPlusLC:FriendCheck(name)
end
titleFrame.m:SetText(L["Messages"] .. ": " .. totalMsgCount)
editFrame:SetVerticalScroll(0)
LibCompat.After(0.1, function() editFrame.ScrollBar.ScrollDownButton:Click() end)
-- LibCompat.After(0.1, function() editFrame.ScrollBar.ScrollDownButton:Click() end)
editFrame:Show()
editBox:ClearFocus()
end
+2
View File
@@ -16,6 +16,8 @@
## X-Curse-Project-ID: 463863
Leatrix_InputScrollFrameTemplate.xml
libs\LibStub\LibStub.lua
libs\LibCompat-1.0\lib.xml
Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua