lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #1  
Unread 03-07-2021, 08:11 PM
Ivandar Ivandar is offline
The Wary
 
Join Date: Mar 2021
Posts: 2
Markup, GetText() and GetTextLength()

So ... I've found I can use <rgb> commands if I set a label or text box to having markup.

Two questions.

(A) are there any other <> commands that markup activates?

(B) GetText() and GetTextLength() strip the <> commands out ... This makes GetTextLength() inaccurate (because I've found the <> commands contribute to the 'real' length of the label) and make it impossible to get, modify, and re-set the label's text (you lose the <> commands when you do).

I've made a workaround, which is to simply keep a separate copy of the text, but that's space inefficient.

Has Turbine provided a way to get the 'markedup' text and textlength?
Reply With Quote
  #2  
Unread 03-07-2021, 10:50 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 338
From the original release notes for Update 8 (when SetMarkupEnable was added):
Quote:
Added IsMarkupEnabled, SetMarkupEnabled to the Label class. This will allow for a limited set of HTML style tags to be used for formatting text. Tags include<b>, <i>, <u>, <p>, and a custom <rgb=#XXXXXX> tag. Make sure you close them </>.
Unfortunately, only the underline and paragraph tags actually seem to do anything (and the paragraph only adds a linefeed before the text not after it so it's not really a paragraph tag). Bold and italic don't work due to the way fonts are rendered in LotRO (to make bold text, you have to assign a bold font to the entire control and then everything is bold so the tag is irrelevant and there are no italic fonts). I can only guess that Turbine at one time intended to replace their existing font mechanism with actual true type fonts but that would have required significant changes to the UI and must have been scrapped.

Last edited by Garan : 03-07-2021 at 11:11 PM.
Reply With Quote
  #3  
Unread 03-08-2021, 05:10 AM
Thurallor's Avatar
Thurallor Thurallor is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: May 2013
Posts: 202
I think you can use these other undocumented tags, too.

I wouldn't worry too much about memory inefficiency, when your average user has several GB of RAM to spare.
Reply With Quote
  #4  
Unread 03-08-2021, 06:34 AM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 338
Quote:
Originally Posted by Thurallor
I think you can use these other undocumented tags, too.

I wouldn't worry too much about memory inefficiency, when your average user has several GB of RAM to spare.
Those are always enabled (not enabled by SetMarkupEnabled). The item examination tags will allow the user to get a popup tooltip when they click the text but not on hover. The character tag (<Select:IID> tag) provides a popup menu on right click. I haven't tried the map note, npc query or quest ref tags either - no idea how you would figure out IDs for them since the lorebook is long gone.

The ExamineItemInstance tag requires encoded data which is a royal pain to encode properly and is of little use
The Examine tag however, uses regular game item IDs and is very useful. The first id is a unique identifier for a stack that is actually in inventory (and will show the correct quantity in the tooltip when clicked), the second is a generic identifier for a generic single representation of the item.
ex:
<Examine:IIDDID:0x030A0007F6CAFC3A:0x70033CA6>Poti ons</Examine> is for a stack of universal morale potions in Garan's inventory; will only work on Landroval because unique ids are server specific
<Examine:IIDDID:0:0x70033CA6>some item</Examine> is for a generic universal morale potion, will work on any server because generic ids are, well, generic.
<Select:IID:0x020A000000041D3A>Garan<\Select> is a character select tag for.... Garan (on Landroval)
Lunarwater experimented quite a bit with these tags and Lotro Compendium (not to be confused with Plugin Compendium) uses some of them

Last edited by Garan : 03-08-2021 at 10:03 AM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 05:52 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui