Skip to content
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

Merged
merged 5 commits into from
Sep 17, 2023
Merged

Newui style #2

merged 5 commits into from
Sep 17, 2023

Conversation

Theepicosity
Copy link
Collaborator

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

-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
@Theepicosity Theepicosity changed the base branch from main to newui September 4, 2023 23:28
@Bauumm
Copy link
Collaborator

Bauumm commented Sep 5, 2023

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.

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])
Copy link
Collaborator

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)

end
self.background_color = { 0.5, 0.5, 0, 0.7 }
root.elements[2] = update_element(root.elements[2], root, 2, root.elements[2])
Copy link
Collaborator

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
Comment on lines 198 to 212
if root.elements[2] ~= levels then
levels.elements[1]:click(false)
end
root.elements[2] = levels
levels.elements[1]:click(false)
Copy link
Collaborator

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.

@Theepicosity Theepicosity merged commit f4f5c8a into newui Sep 17, 2023
1 check passed
@Theepicosity Theepicosity deleted the newui-style branch September 17, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants