#tooltip broke

36 messages · Page 1 of 1 (latest)

hidden hornet
#

what am i doing wrong i just want custom hex colors

ItemEvents.tooltip(tooltip => {
    tooltip.addAdvancedToAll((item, advanced, text) => {
        if(item.hasTag("erosia:martial")){
            text.add(0, text.get(0).copy().append(Text.darkGray(' ⚔ Martial')))
            text.remove(1)
            
        }
        if(item.hasTag("erosia:simple")){
            text.add(0, text.get(0).copy().append(Text.darkGray(' ⚔ Simple')))
            text.remove(1)
        }
        if(item.hasTag("erosia:light")){
            text.add(0, text.get(0).copy().append(Text.gray(' 🛡')).append(Text.darkGray(' Light')))
            text.remove(1)
        }
        if(item.hasTag("erosia:medium")){
            text.add(0, text.get(0).copy().append(Text.white(' 🛡')).withStyle(style => style.withColor(0x9778ff)).append(Text.darkGray(' Medium')))
            text.remove(1)
        }
        if(item.hasTag("erosia:heavy")){
            text.add(0, text.get(0).copy().append(Text.white(' 🛡')).withStyle(style => style.withColor(0x5c40b8)).append(Text.darkGray(' Heavy')))
            text.remove(1)
        }
    })
})
wispy badgerBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

pure pond
#

what did go wrong

hidden hornet
winged monolithBOT
#

Paste version of message.txt from @hidden hornet

hidden hornet
#

no errors in client log tho

#

lol

pure pond
#

hm

#

??kjswiki

winged monolithBOT
pure pond
#

withStyle takes a Style, not a UnaryOperator<Style>

hidden hornet
#

but

#

there's overloads

#

ive used this method in java before multiple times

pure pond
#

try comment the withStyle out, to check if it is that

hidden hornet
#

it is

#

this worked till i added that

pure pond
#

probably rhino weirdness

hidden hornet
#

great

pure pond
#

use .color instead

hidden hornet
#

on what

pure pond
#

the component

hidden hornet
#

oh shit

#

i didnt know thats a thing

#

does it take hex?

pure pond
#

it takes a rhino Color

#

which is basicallly any format imaginable

hidden hornet
#

lovely

hidden hornet
#

neat

pure pond
#

which i added to the wiki page,but people seem to prefer reading code anyway hoh

empty coyote
#

That's like one of the only wiki page entries I check heh

wispy badgerBOT
#

@hidden hornet Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!

wispy badgerBOT
#

@hidden hornet Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!