#💬 _olgierdʹs Feedback
1 messages · Page 1 of 1 (latest)
HEAT
better not, this code is total spaghetti
Why does everyone say that
i have to add things that will be dynamic
not hardcoded
like config
for icons and titles
so you can set whatever you want
cause currently its just a table in main script.
I wanna know how you did that drop down thingy
I think I can do a hacky solution by putting invisible frames inside ui list layout
Yes you can, i did that at first
Which in theory should be much more customizable
but then i decided to not use that
What made you not use it though
the fact that you have to use invisible frames for each notification
and animate it
not performant, and i dont like it
i just have 2 tables
notifications, and to_remove
when notification lifetime is gone it just plays animation and removes it
and Im updaing curr_y by iterating each notification
pretty simple
(+ 15 is just the gap, i will also make it )
and i have to keep that in curr_y and stuff cause notification y size is based on the text size cause im not scaling text to frame but frame to text cause text gets wrapped
When it’s removed it plays the animation then shifts every thing down?
like im iterating through 2 tables
both contain notifications
the second table is called to_remove
so im putting old notifications here
and then its iterating through'em
plays anim and destroyes
instance
then removes it from first table
curr_y is per notification right?
wym
self.curr_y = number
but im using singeleton in this case so its
instance.curr_y
So uh how do you know where to shift the notifs to
iterating through first table
I think I get you now
So that tables acts like a stack thingy
First item goes to the top and so on
they just stuck under eachother
if there is only 1 notif then it has nothing to stack on
so im chekcing if the table lenght == 1
so yea kind of
but you gave me idea
some time ago i made queue lib
i may be able to use it here
to make this process even coller
{
[1] = {},
[2] = {}
}
I think with this setup I can get the previous notification and stack on that
yes i do that
table.insert(instance.notifications, {instance = notification, expire_at = tick() + lifetime, is_playing = false, is_destroying = false})
What’s with the curr y then
it iterates through instance.notifications and update it
by doing curr,y = curr.y + absoulteSize.Y + GAP
I mean wouldn’t just doing AbsolutePosition + Vector2.new(0, 15) also work or something