ToolTip.uc 166

AlexandreC

Путник
Участник
Сообщения
52
Розыгрыши
0
Репутация
2
Реакции
1
Баллы
65
Хроники
  1. Prelude
  2. Helios
  3. Fafurion
Исходники
Присутствуют
Сборка
Tooltip code
Подскажите, пожалуйста, как можно добавить в тултип дополнительную строку с иконкой, чтобы заголовок «Augmentation Effects» отображался вместе с иконкой слева на одной линии, как показано на скриншоте.
Буду очень признателен за помощь.



Код:
function AddTooltipRefinery(ItemInfo item)
{
    local string strDesc1, strDesc2, strDesc3;
    local int ColorR, ColorG, ColorB, Quality;

    if (item.RefineryOp1 != 0 || item.RefineryOp2 != 0)
    {
        AddTooltipItemBlank(2);

        // [Refinery]
        // AddSectionTitleBoader();
        AddTooltipItemOption(1490, "", true, false, false);
        SetTooltipItemColor(255, 255, 255, 0);
        AddTooltipItemBlank(2);

        // Choose initial color by option quality depending on slot type
        if (item.SlotBitType == 8192)
        {
            Quality = class'UIDATA_REFINERYOPTION'.static.GetQuality(item.RefineryOp1);
            GetRefineryColor(Quality, ColorR, ColorG, ColorB);
        }
        else
        {
            Quality = class'UIDATA_REFINERYOPTION'.static.GetQuality(item.RefineryOp2);
            GetRefineryColor(Quality, ColorR, ColorG, ColorB);
        }

        if (item.RefineryOp1 != 0)
        {
            strDesc1 = "";
            strDesc2 = "";
            strDesc3 = "";

            if (class'UIDATA_REFINERYOPTION'.static.GetOptionDescription(item.RefineryOp1, strDesc1, strDesc2, strDesc3))
            {
                if (Len(strDesc1) > 0)
                {
                    AddTooltipColorText(strDesc1, getColor(ColorR, ColorG, ColorB, 255), true, false, false);
                }
                if (Len(strDesc2) > 0)
                {
                    AddTooltipColorText(strDesc2, getColor(ColorR, ColorG, ColorB, 255), true, false, false);
                }
                if (Len(strDesc3) > 0)
                {
                    AddTooltipColorText(strDesc3, getColor(ColorR, ColorG, ColorB, 255), true, false, false);
                }
            }
        }

        // If needed, switch color to match the second option
        if (item.SlotBitType == 8192)
        {
            Quality = class'UIDATA_REFINERYOPTION'.static.GetQuality(item.RefineryOp2);
            GetRefineryColor(Quality, ColorR, ColorG, ColorB);
        }

        if (item.RefineryOp2 != 0)
        {
            strDesc1 = "";
            strDesc2 = "";
            strDesc3 = "";

            if (class'UIDATA_REFINERYOPTION'.static.GetOptionDescription(item.RefineryOp2, strDesc1, strDesc2, strDesc3))
            {
                if (Len(strDesc1) > 0)
                {
                    AddTooltipColorText(strDesc1, getColor(ColorR, ColorG, ColorB, 255), true, false, false);
                }
                if (Len(strDesc2) > 0)
                {
                    AddTooltipColorText(strDesc2, getColor(ColorR, ColorG, ColorB, 255), true, false, false);
                }
                if (Len(strDesc3) > 0)
                {
                    AddTooltipColorText(strDesc3, getColor(ColorR, ColorG, ColorB, 255), true, false, false);
                }
            }
        }

        // Extra line for non-Classic servers (and non-8192 slot)
        if (!getInstanceUIData().getIsClassicServer() && item.SlotBitType != 8192)
        {
            AddTooltipItemOption(1491, "", true, false, false);
            SetTooltipItemColor(ColorR, ColorG, ColorB, 0);
        }

        AddTooltipItemBlank(2);
    }
}
 

Вложения

  • bgaug.webp
    bgaug.webp
    19,2 КБ · Просмотры: 33
Код:
AddTitleIconWithHeadLine("L2UI_NewTex.Tooltip.TooltipICON_Refinery_small", "Augmentation Effects");



function AddTitleIconWithHeadLine(string Icontex, string titleStr, optional bool bDoNotAddBlank)
{
    AddTooltipItemBlank(4);
    addTooltipTextureSplitLineType("L2UI_NewTex.Tooltip.TooltipLine_DetailTitleBG", 1, 25, 0, 0, 0, 0);
    if( Icontex != "" )
    {
        addTooltipTexture(Icontex, 18, 18, 0, 0, False, False, 1, 2);
    }
    AddTooltipColorText(titleStr, getInstanceL2Util().Gold, False, True, False, "", 4, 4);
    if( bDoNotAddBlank == False )
    {
        AddTooltipItemBlank(4);
    }
}
function addTooltipTextureSplitLineType(string Texture, int Width, int Height, int uWidth, int uHeight, optional int OffsetX, optional int OffsetY)
{
    StartItem();
    m_Info.eType = DIT_SPLITLINE;
    m_Info.t_bDrawOneLine = True;
    m_Info.bLineBreak = False;
    m_Info.u_nTextureWidth = Width;
    m_Info.u_nTextureHeight = Height;
    m_Info.nOffSetX = OffsetX;
    m_Info.nOffSetY = OffsetY;
    m_Info.u_nTextureUWidth = uWidth;
    m_Info.u_nTextureUHeight = uHeight;
    m_Info.u_strTexture = Texture;
    EndItem();
}



So just replace this:
AddTooltipItemOption(1490, "", true, false, false);
with this:
AddTitleIconWithHeadLine("L2UI_NewTex.Tooltip.TooltipICON_Refinery_small", "Augmentation Effects");
 

Похожие темы

  • Вопрос Вопрос
Ответы
6
Просмотры
587
Hedgehog
Ответы
10
Просмотры
Ответы
9
Просмотры
Hedgehog
Ответы
18
Просмотры
Hedgehog
Назад
Сверху