Jump to content

Emoji in TextLine


Recommended Posts

  • 2 months later...
  • 4 weeks later...
  • 4 weeks later...
  • Premium

Since my fellow arabs don't like to share fixes here is how to make it work for arabic

 

search for the function in GrpTextinstance.cpp  if (defCodePage == CP_ARABIC) 

then add the lines according to the tutorial above , make sure to add the lines 

 

 

Spoiler

                                    else if (ret == TEXT_TAG_IMAGE_START)
                                    {
                                        imageStep = 1;
                                        imageBuffer = L"";
                                    }
                                    else if (ret == TEXT_TAG_IMAGE_END)
                                    {
                                        kImage.x = x;

                                        char retBuf[1024];
                                        int retLen = Ymir_WideCharToMultiByte(GetDefaultCodePage(), 0, imageBuffer.c_str(), imageBuffer.length(), retBuf, sizeof(retBuf) - 1, NULL, NULL);
                                        retBuf[retLen] = '\0';

                                        char szPath[255];
                                        _snprintf(szPath, sizeof(szPath), "icon/%s.tga", retBuf);
                                        if (CResourceManager::Instance().IsFileExist(szPath))
                                        {
                                            CGraphicImage* pImage = (CGraphicImage*)CResourceManager::Instance().GetResourcePointer(szPath);
                                            kImage.pInstance = CGraphicImageInstance::New();
                                            kImage.pInstance->SetImagePointer(pImage);
                                            m_imageVector.push_back(kImage);
                                            memset(&kImage, 0, sizeof(SImage));
                                            for (int i = 0; i < pImage->GetWidth() / (pSpaceInfo->width - 1); ++i)
                                                x += __DrawCharacter(pFontTexture, dataCodePage, ' ', dwColor);
                                            if (pImage->GetWidth() % (pSpaceInfo->width - 1) > 1)
                                                x += __DrawCharacter(pFontTexture, dataCodePage, ' ', dwColor);
                                        }
                                        imageStep = 0;
                                        imageBuffer = L"";
                                    }

 

under every 

Spoiler

                                    else if (ret == TEXT_TAG_HYPERLINK_START)
                                    {
                                        hyperlinkStep = 1;
                                        hyperlinkBuffer = L"";
                                    }
                                    else if (ret == TEXT_TAG_HYPERLINK_END)
                                    {
                                        if (hyperlinkStep == 1)
                                        {
                                            ++hyperlinkStep;
                                            kHyperlink.ex = kHyperlink.sx = x; // ½اء¦ إط½؛ئ®°، ½أہغµا´آ ہ§ؤ،
                                        }
                                        else
                                        {
                                            kHyperlink.text = hyperlinkBuffer;
                                            m_hyperlinkVector.push_back(kHyperlink);

                                            hyperlinkStep = 0;
                                            hyperlinkBuffer = L"";
                                        }
                                    }

 

now it will be working fine https://metin2.download/picture/2VhJ58wlCePJfoXWOl8JNwH4OeH7ZsLL/.png

 

 

kind regards Dream,

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 8
  • Good 5
  • Love 3
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 3 weeks later...
  • Developer
3 hours ago, 4peppe said:

Hello, can you help me? I have this problem: https://metin2.download/picture/995084F4N6UkJ63m4151Fis1CbuT0tV5/.png

If you followed the tutorial correctly, it should work. If you have added macros, make sure the sheets arrive in Locale_inc.h

Edited by Metin2 Dev
Core X - External 2 Internal

503953077003354113.png

Link to comment
Share on other sites

9 hours ago, Mitachi said:

If you followed the tutorial correctly, it should work. If you have added macros, make sure the sheets arrive in Locale_inc.h

do I have to insert the icon folder of your pack inside an .eix / .epk archive?

43 minutes ago, 4peppe said:

do I have to insert the icon folder of your pack inside an .eix / .epk archive?

obviously it must be compacted in the icon archive, I solved;

if it can help anyone, here it is 100% working GrpTextInstance.cpp link: https://pastebin.com/Qk3LpJup

  • Love 1
Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
  • 7 months later...
  • 3 months later...
  • 3 months later...
  • 5 months later...

1121 12:40:38298 :: Traceback (most recent call last):

1121 12:40:38299 ::   File "ui.py", line 1821, in OnOverInItem

1121 12:40:38299 ::   File "ui.py", line 87, in __call__

1121 12:40:38299 ::   File "ui.py", line 78, in __call__

1121 12:40:38300 ::   File "uiInventory.py", line 975, in OverInItem

1121 12:40:38300 ::   File "uiInventory.py", line 1151, in ShowToolTip

1121 12:40:38300 ::   File "uiToolTip.py", line 554, in SetInventoryItem

1121 12:40:38301 :: NameError
1121 12:40:38301 :: : 
1121 12:40:38301 :: global name 'emojiTextLine' is not defined
1121 12:40:38301 :: 

 

How to fix it?

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.