-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newui style #2
Newui style #2
Conversation
-black borders around pack and level options buttons (specifically for the level background previews) -descriptions only pop out when the level is selected so they dont take up 9000 space
Before looking at the code already I have to say I'm not a big fan of the description popping up when you click on a level, I liked it much better when it was always there. |
ui/screens/levelselect.lua
Outdated
description = label:new("", { font_size = 16, wrap = true }) | ||
elems[i].background_color = { 0, 0, 0, 0.7 } | ||
end | ||
elems[i].element.elements[2].elements[2] = update_element(description, elems[i].element.elements[2], 2, elems[i].element.elements[2].elements[2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to check for == self
, you can just set all descriptions to "" and then set the current one outside the loop (micro optimization is useless anyway and it looks cleaner that way in my opinion).
(And refer to my comment about description being shown or not)
ui/screens/levelselect.lua
Outdated
end | ||
self.background_color = { 0.5, 0.5, 0, 0.7 } | ||
root.elements[2] = update_element(root.elements[2], root, 2, root.elements[2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll probably replace this update_element function at some point as it is kind of messy, but for now this if fine ig.
level elements wont take up space upon first loading in
ui/screens/levelselect.lua
Outdated
if root.elements[2] ~= levels then | ||
levels.elements[1]:click(false) | ||
end | ||
root.elements[2] = levels | ||
levels.elements[1]:click(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to keep the check, if you always autoclick on the first level when selecting a pack clicking on the pack again will start the first level. The check there is making it not autoclick if the level column is still the same.
fixed some stuff thx to the comments
this is my pull request yay
hopefully i am doing this correctly
there are only two changes in this commit: 1. added black borders around the pack and level options buttons and 2. the descriptions pop out when selected instead of being open all the time