LS: Toasts

LS: Toasts

807k Downloads

Toast scaling issue

Merathilis opened this issue ยท 8 comments

commented

Hello Senior,

first of all, thank you for the new skinning function for ls_Toast. But i have an issue if you set the scale to 0.9, then the right border seems to be cut off. With the default skin it looks fine, but even with the implement ElvUI skin, it get cut off:

See Screenshots
Scale 1.0 (fine)
1 0

Scale 0.9 (cut off)
0 9

btw. here is the code to my skin: https://git.tukui.org/Merathilis/ElvUI_MerathilisUI/blob/development/ElvUI_MerathilisUI/modules/skins/addons/ls_Toasts.lua

commented

Sup!

First of all, new skin engine isn't live yet, so don't release the skin! :D

It happens because of scaling, I use toast:SetScale(scale) w/o any smart maths, so it's not exactly cut off, it just happens to be on a half-pixel, and given that the texture is only 1px wide it "disappears".

If you move toasts around the screen, you'll notice that other edges will get "cut off" as well. So for perfect-pixel UIs and skins I recommend to set scale to 1.

Also, regarding texture = "Interface\\AddOns\\ElvUI_MerathilisUI\\media\\textures\\toast-border", new borders use the same type of a texture as backdrop's edgeFile. The addon creates custom backdrop-like borders.

In your case, if you want black borders you may want to do either of these:

  • Disable border colouring in options and define border as:
border = {
	texture = {1, 1, 1, 0.75},
},

This will create a white border semi-transparent border that's coloured black by default, but can be coloured via :SetVertexColor later.

  • Define border as:
border = {
	texture = {0, 0, 0, 0.75},
},

This will create a permanently black semi-transparent border, RIP :SetVertexColor๐Ÿ˜๐Ÿ”ซ

I removed all unnecessary fields from border sub-table because you use elv-no-art as your template, so they'll be copied from it anyway.

commented

What does this bit do? O_o

And another question, is this 0.15, 0.15, 0.15, .75 the colour you use in elvUI for backgrounds? My tests showed me 0.06, 0.06, 0.06, 0.8 >_>

commented

Thx for the quick respond and for your clarification. I will use the black semi-transparent border :P

Another question, when can we expect the release? And no, the color you use should be fine. I use this in my plugin. ;)

commented

Oh, and i will close this issue as it is then not an issue at all :D

commented

Prob this weekend. I want to move many methods from E to P table because there's no need for them to be public.

BTW, here's a cleaned-up version of your skin table w/ colourable borders :D

LST:RegisterSkin("MerathilisUI", {
	name = "|cffff7d0aMerathilisUI|r",
	template = "elv-no-art",
	border = {
		texture = {1, 1, 1, 0.75},
	},
	icon = {
		tex_coords = {.08, .92, .08, .92},
	},
	icon_border = {
		offset = 1,
		texture = {1, 1, 1, 0.75},
	},
	icon_highlight = {
		hidden = true,
	},
	icon_text_1 = {
		flags = "OUTLINE",
	},
	icon_text_2 = {
		flags = "OUTLINE",
	},
	dragon = {
		hidden = true,
	},
	slot = {
		tex_coords = {.08, .92, .08, .92},
		texture = "Interface\\AddOns\\ElvUI_MerathilisUI\\media\\textures\\icon-border",
	},
	bg = {
		alliance = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		archaeology = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		collection = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		default = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		dungeon = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		horde = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		legendary = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		legion = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		recipe = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		store = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		transmog = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		upgrade = {
			texture = {0.15, 0.15, 0.15, .75},
		},
		worldquest = {
			texture = {0.15, 0.15, 0.15, .75},
		},
	},
})

Basically, you need to define fields that are different from the template and defaults.

commented

cool, thx ;)

commented

@Merathilis didn't notice that you wanted perma-black borders before doing the cleanup ๐Ÿ˜:gun:

border = {
	texture = {0, 0, 0, 0.75},
},
icon_border = {
	offset = 1,
	texture = {0, 0, 0, 0.75},
},