Riftui

Riftui (https://www.riftui.com/forums/index.php)
-   Help/Support (https://www.riftui.com/forums/forumdisplay.php?f=3)
-   -   Rift addon using wordwrap (https://www.riftui.com/forums/showthread.php?t=211)

Melampus 01-26-12 02:32 PM

Rift addon using wordwrap
 
I am a bit confused. I am using an addon that reads from a datafile, and displays that information onto the screen. I am attempting to insert that data into columns.
Rift addons cut the text after the column length is reached by default.
Is there a way to use the wordwrap command to spice the text and display it below the original text with out doing this manually for each piece of information? Or even using the wordwrap command to tell me where the text needs to be spliced?


ie

read x from file

x is too large for display in column y by 10 characters

->use wordwrap to display the additional 10 characters on line 2 of column y

all I have found is that I can use a string read command and manually read each character of the datafile - then compute that into the columns

jca 01-27-12 08:55 PM

The Text:SetWordwrap() function is what you're looking for I think.

algritz 01-27-12 09:11 PM

out of curiosity, what add-on are you using ?

Melampus 01-30-12 08:03 PM

Wordwrap usage
 
It's for Guild Crafting Helper.

I add that segment, however it does not seem to work for me. The text still truncates on the single line... Here is the code I have so far

Code:


--- This segment reads from the fields from a datafile
--- If you notice ... I added a second 'null' line to make sure I could see any new text on the next line

if t[i].mType == (value1) and t[i].slot == (value2) then
                        pid = pid.."\n".."\n"..t[i].id
                        pmaker = pmaker.."\n".."\n"..t[i].maker
                        pname = pname.."\n".."\n"..t[i].name
                        pskill = pskill.."\n".."\n"..t[i].skill
                        pslot = pslot.."\n".."\n"..(string.sub(t[i].slot, 5))
                        pstatname = pstatname.."\n".."\n"..t[i].statname
                        pmType = pmType.."\n".."\n"..t[i].mType
                        i = i + 1
                        end

                                end
        --        return
       
        window.item1:SetText(pname)
        wordwrap = window.item1:GetWordwrap()
        window.item1:SetWordwrap(wordwrap)
        window.item2:SetText(pskill)
        wordwrap = window.item2:GetWordwrap()
        window.item2:SetWordwrap(wordwrap)
        window.item3:SetText(pslot)
        wordwrap = window.item3:GetWordwrap()
        window.item3:SetWordwrap(wordwrap)

        -------- Get the wordwrap status and use it for multiple makers       

        window.item4:SetText(pstatname)
        wordwrap = window.item4:GetWordwrap()
        window.item4:SetWordwrap(wordwrap)
        ------- Is there another way to use this? I tried to use it window.item4:SetWordwrap(pstatname)...that crated an error

            window.item5:SetText(pmaker)
        wordwrap = window.item5:GetWordwrap()
        window.item5:SetWordwrap(wordwrap)


I have a feeling that I am just not calling it to set the flag correctly.

Myrroddin 01-31-12 04:19 PM

:GetWordwrap returns the values of true or false. SetWordwrap(true) to enable, or SetWordwrap(false) to disable.
Code:

window.item1:SetText(pname)
window.item1:SetWordwrap(true)
window.item2:SetText(pskill)
window.item2:SetWordwrap(true)



All times are GMT -6. The time now is 02:16 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2022 MMOUI