#Chemical Composition Tooltip

26 messages · Page 1 of 1 (latest)

north nova
#

Heya, im making my own GregTechCEU/IC2-inspired tooltips for showing the chemical composition of items/fluids.
I personally quite like it! I'm planning on making it even more dynamic and immersive (ie you click on a compound/element and it shows you its name, or you click on an ionic compound it shows the charges of the kation and anion).

Please let me know thoughts on it 😀

north nova
#

changed the colors to fit the "cassini style"

north nova
twilit storm
#

is it for pure cosmetic purpose?

north nova
brave yew
#

I like ic2

north nova
buoyant dawn
#

🔥

fossil night
#

Mod repository?

north nova
fossil night
#

sure why not

north nova
# fossil night sure why not

well to start off theres an abstract Material class with several implementations, all of them, except for ElementaryMaterial, store one or more materials inside of the - basically forming a tree structure.
custom classes for FormattedCharSequence (this interface iterates over every character) and FormattedCharSink (this interface decides what to do with every character) are made that take in an additional Material parameter [1].

there are static methods that return the MaterialCharSequence for each of the different Material classes, they iterate over the MaterialCharSequences of the inner materials in the tree and decide when or when not to parenthesise [2].
to make sure that the whole inside of the parentheses is highlighted, a custom sink accepts a constant material instead of passing the actual material used for adding the text [3].

with a mixin, i freeze the tooltip and hovered slot whenever alt is held, i also add the material tooltip to the list of tooltips and find the mouse's position on the tooltip [4]. a mixin to StringSplitter lets me find the compound the mouse is hovering [4] over and a custom ClientMaterialTooltip [5] class (and another mixin) tells the text renderer to change the style and render the glow when the text comes from the hovered material [6]. if the mouse was clicked, i store the hovered material and use it instead of the vanilla tooltip [4].

fossil night
#

Uh oh

#

It seems like this is majorly different for modern

#

I’ll have to see how the tooltips are done if I want to port it to 1.12

#

Though I don’t think they’re anything special

fossil night
#

Time to port this to 1.12 😄

fossil night
#

Just kidding, id already done it

#

@north nova Very much WIP but 😄

#

I was inspired.

north nova
fossil night
#

also its part of my gt fork so i didnt need mixin letslets