Announcement

Collapse
No announcement yet.

Inline Styling Decorator for Rich Text Block

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [PLUGIN] Inline Styling Decorator for Rich Text Block

    Hey cool people,

    When I upgraded my project to 4.20 I realized that the experimental RichTextBlock in the engine (that I was using via this discontinued plugin) no longer functioned as it did previously.

    Developers used to be able to add <span> tags inline around sections of text changing their font, size, color, and emphasis.

    As of 4.20, the new RichTextBlock functions differently by default in that developers must statically pre-define all of their styles in a data table, then use inline tags to determine which style should apply to different sections of text. This is great for defining reusable styles which can be used across a project, but not so great when the styling needs to be generated dynamically.

    It didn't take me too long to figure out how to re-purpose the old decorator logic and make it compatible with the new RichTextBlock in 4.20, but I did notice a few others also missing the old logic and wondering what happened to it.

    So here's a free plugin that takes Epic's original decorator from before 4.20 and exposes it to be usable with the new 4.20 RichTextBlock. Simply install the plugin and add the decorator class to any RichTextBlock widgets that you wish to use it with.

    Click image for larger version  Name:	DemoText.png Views:	1 Size:	264.5 KB ID:	1536691

    This allows the RichTextBlock to process tags as it previously did, and any Projects using the old RichTextBlock that are upgrading to 4.20 can use this to re-enable the same styling behavior.

    Get it right here:
    Marketplace
    GitHub

    Enjoy!
    Last edited by Sam Bonifacio; 10-29-2018, 02:02 AM.
    [Game] Hyper Jam - Neon-soaked arena brawler
    [Plugin] Auto Settings - Game options and input binding toolkit
    [Plugin] [Free] Inline Styling Decorator - Allow inline styling on RichTextBlock

    #2
    Holy ****. You're a god. Thanks man, I really appreciate that.

    The new system frankly sucks ***, excuse my french.

    Comment


      #3
      Awesome! Thanks!!!

      Comment


        #4
        You're welcome! Not too much effort to wrap up what I already had in a plugin.

        Originally posted by Wrekk View Post
        The new system frankly sucks ***, excuse my french.
        I think there are good parts. Generally the style table seems useful to avoid repeating the same markup all over the place, and being able to add on extra decorators makes the whole thing very extensible and allows me to make this plugin, as well as opening up many other possibilities for more functionality.

        The only question I have is why the old decorator wasn't kept around as optional like how it is in this plugin, in addition to the new stuff - I know it was experimental so developers were using it at their own risk, but it can still do things that the style table cannot.
        [Game] Hyper Jam - Neon-soaked arena brawler
        [Plugin] Auto Settings - Game options and input binding toolkit
        [Plugin] [Free] Inline Styling Decorator - Allow inline styling on RichTextBlock

        Comment


          #6
          any chance you can build the ios and android plugin, so I can use this extension on mobile?

          Comment


            #7
            This is super awesome. Been away from UE for a while and after updating I found out that URichTextBlock has been changed so I got the dreaded Unable to find Slate Widget Style 'span' :P

            My question though is whether there's a license for this or not?

            Comment


              #8
              Hi,

              Is there some sample code for hooking up to the 'RichTextBlock' 4.20 code?

              Thanks.

              Comment


                #9
                texture from the table we can make a wavy line, a dotted line, and even a background for the text - system filled="(texture id from table) (color = 0 to not texture update color) (fill or left or center or rinht) (fill or up or center or down) (0=before text or 1=behind text)"
                <span color="#ffffffff" size="20" filled="texture #ffffffff fill fill 0" hower="color="#ffffffff" size="20" filled="texture #ffffffff fill fill 1"" >fill fill texture0=before text.</>
                <span color="#ffffffff" size="20" filled="texture #ffffffff fill up 0">fill up texture 0=before text.</>
                <span color="#ffffffff" size="20" filled="texture #ffffffff fill center 1">fill center texture 1 =behind text.</>
                <span color="#ffffffff" size="20" filled="texture #ffffffff fill down 1">fill down texture 1 =behind text.</>
                <span color="#ffffffff" size="80" filled="texture #ffffffff cencer fill 0">center fill texture0=before text.</>
                Last edited by Dreika; 06-01-2019, 05:00 AM.

                Comment


                  #10
                  I update plugin 4.22 add Alligned Wrap Box
                  Update Corrected file SAlignedWrapBox.h:
                  //#include "Widgets/SPanel.h"
                  //#include "Layout/Children.h"
                  #include "SlateBasics.h"
                  Attached Files
                  Last edited by Dreika; 06-06-2019, 12:19 AM.

                  Comment


                    #11
                    Originally posted by Dreika View Post
                    Hi!

                    The link you provided gets me a 404, could you update it please?

                    Comment


                      #12
                      I still can't access. Maybe it's not shared inside google drive?
                      Attached Files

                      Comment


                        #13
                        https://drive.google.com/open?id=1LG...172f73VhWnq_yA
                        Click image for larger version  Name:	eee.png Views:	1 Size:	440.8 KB ID:	1628702
                        Plugin + this content
                        Last edited by Dreika; 06-08-2019, 06:30 AM.

                        Comment


                          #14
                          Originally posted by Imperium2 View Post

                          I still can't access. Maybe it's not shared inside google drive?

                          A bunch of times re-create
                          Dreia#7828 Diskord

                          Comment


                            #15
                            Originally posted by Dreika View Post
                            Thanks, now the link works.

                            The only thing is that, when I try to open anything that was using the old plugin version crashes.

                            The log says this:

                            Code:
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe1c666a81 UE4Editor-RichTextBlockInlineDecorator.dll!FDefaultRichTextDecorator::ExplodeRunInfo() [d:\test_4.22\plugins\richtextblockinlinedecorator\source\richtextblockinlinedecorator\private\richtextblockinlinedecorator.cpp:239]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe1c66601b UE4Editor-RichTextBlockInlineDecorator.dll!FDefaultRichTextDecorator::CreateTextBlockStyle() [d:\test_4.22\plugins\richtextblockinlinedecorator\source\richtextblockinlinedecorator\private\richtextblockinlinedecorator.cpp:117]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe1c665b83 UE4Editor-RichTextBlockInlineDecorator.dll!FDefaultRichTextDecorator::Create() [d:\test_4.22\plugins\richtextblockinlinedecorator\source\richtextblockinlinedecorator\private\richtextblockinlinedecorator.cpp:101]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe3640aa4b UE4Editor-Slate.dll!FRichTextLayoutMarshaller::AppendRunsForText() [e:\ue4-22 source\unrealengine-4.22\engine\source\runtime\slate\private\framework\text\richtextlayoutmarshaller.cpp:146]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe3647ab23 UE4Editor-Slate.dll!FRichTextLayoutMarshaller::SetText() [e:\ue4-22 source\unrealengine-4.22\engine\source\runtime\slate\private\framework\text\richtextlayoutmarshaller.cpp:51]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe365c3b90 UE4Editor-Slate.dll!FSlateTextBlockLayout::UpdateTextLayout() [e:\ue4-22 source\unrealengine-4.22\engine\source\runtime\slate\private\widgets\text\slatetextblocklayout.cpp:201]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe365a9d06 UE4Editor-Slate.dll!FSlateTextBlockLayout::ComputeDesiredSize() [e:\ue4-22 source\unrealengine-4.22\engine\source\runtime\slate\private\widgets\text\slatetextblocklayout.cpp:72]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe365aa0f0 UE4Editor-Slate.dll!SRichTextBlock::ComputeDesiredSize() [e:\ue4-22 source\unrealengine-4.22\engine\source\runtime\slate\private\widgets\text\srichtextblock.cpp:79]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe3606d278 UE4Editor-SlateCore.dll!SWidget::CacheDesiredSize() [e:\ue4-22 source\unrealengine-4.22\engine\source\runtime\slatecore\private\widgets\swidget.cpp:621]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe36102f4d UE4Editor-SlateCore.dll!SWidget::SlatePrepass() [e:\ue4-22 source\unrealengine-4.22\engine\source\runtime\slatecore\private\widgets\swidget.cpp:520]
                            [2019.06.09-03.18.15:349][ 14]LogWindows: Error: [Callstack] 0x00007ffe36102efd UE4Editor-SlateCore.dll!SWidget::SlatePrepass() [e:\ue4-22 source\unrealengine-4.22\engine\source\runtime\slatecore\private\widgets\swidget.cpp:512]
                            As you can see I'm using source version of the engine. Thank you for updating the plugin, it's just my bad luck with these things.

                            Comment

                            Working...
                            X