Quantcast
WoWInterface - View Single Post - ChatFrame1EditBox Resizing and Scrolling
View Single Post
02-23-21, 01:07 PM   #1
BloodLilly
A Murloc Raider
Join Date: Feb 2021
Posts: 4
ChatFrame1EditBox Resizing and Scrolling

Hello, I've searched this forum and the internet for a potential addon that would be what I'm looking for. However, I couldn't find anything after installing and uninstalling a lot of addons, nothing fit the bill. So I thought I would look around for code with the intention of making my own addon, however, I am not a coder. I have extremely little experience in coding and a lot of the code strings I see, don't explain what else you need to make the file work.

My intention is to make the 'ChatFrame1EditBox' adjustable in height. However I wish to do this with the parameter that it would be set to the number of lines that would fit in vertically.

For example, you would set the 'Height' to '4' and this would allow 4 lines of text to be written in the edit box in a Multi-line way. Then the section that states the Channel you are writing in, stays at the bottom left of the EditBox.

Beyond this, if a user were to time more than 4 lines after setting it to that height, the text would then scroll vertically, as opposed to it's default horizontally.

I have attached an image of what I'd like the final product to look like. I just have no idea where to start.

Code that I have tried is here

Main.lua
Code:
ChatFrame1EditBox:SetHeight(20)

ChatFrame1EditBoxLeft:SetSize(20, 20)
ChatFrame1EditBoxRight:SetSize(20, 20)
ChatFrame1EditBoxMid:SetHeight(20)

ChatFrame1EditBoxFocusLeft:SetSize(20, 20)
ChatFrame1EditBoxFocusRight:SetSize(20, 20)
ChatFrame1EditBoxFocusMid:SetHeight(20)

ChatFrame1EditBoxLanguage:SetSize(20, 20)
ChatExtender.toc
Code:
## Interface: 90002
## Title: Chatextender
## Author: BloodLilly
## Version: 1.0

Main.lua
Any help would be great. I have looked at tutorials, however, a lot of them don't state what it is I am looking for. So if you do provide a tutorial, can you please let me know which section I should pay attention to.

Edit:

I have recently found this piece of code, that allows the Edit Box to be longer and am currently seeing of I can make it taller instead of longer. But I'm still unsure how to.

Code:
function LargerChatInput_OnLoad(self)
    self:RegisterEvent("ADDON_LOADED")
end


function LargerChatInput_OnEvent(self, event, ...)
    if event == "ADDON_LOADED" then
        local addon = ...
        if addon == "LargerChatInput" then
            LargerChatInput_OnLoaded()
            self:UnregisterEvent("ADDON_LOADED")
        end
    end
end


function LargerChatInput_OnLoaded()
    hooksecurefunc(
        ChatFrame1EditBox,
        "Show",
        function()
            local left = ChatFrame1:GetLeft()
            local width = GetScreenWidth() - left - 5
            ChatFrame1EditBox:SetPoint("RIGHT", ChatFrame1, "LEFT", width, 0)
        end
    )
end
Attached Thumbnails
Click image for larger version

Name:	Concept.png
Views:	74
Size:	45.3 KB
ID:	9588  

Last edited by BloodLilly : 02-23-21 at 01:39 PM.
  Reply With Quote