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

Proposal to Change Creative Buttons Texture #4221

Open
wants to merge 7 commits into
base: 1.21.3
Choose a base branch
from

Conversation

matthewperiut
Copy link

@matthewperiut matthewperiut commented Nov 10, 2024

Screenshots of updated texture and position

image

2024-11-11_17 20 15
2024-11-11_17 20 18
2024-11-11_17 20 21
2024-11-11_17 20 25

BELOW IS OUTDATED!

tl;dr

video.mp4

Proposal to Change Creative Buttons Texture

The creative buttons texture has haunted me for years in fabric-api. Why?
They're blue. The entire interface for buttons hasn't been blue in over 6 years.
Additionally they have too much contrast, sticking out like a sore thumb in the user interface.

How do we fix it?

We have a great example of something interactable in the creative menu already, the scroll bar.
It has an inactive state and an active state:
active:
scroll_enabled
inactive:
scroll_disabled

Extrapolating the Features

Notice that the creative scroll bar is in an indented section where it can move freely.
This creates a contrast strong enough to differentiate it from the rest of the menu.
The "grip" lines horizontal on the bar also changes color depending on if you can or cannot scroll.

Using the Features

Including the indent to seperate it from the rest of the UI helps the contrast to make it visible, without making it stand out visually from the slots and the scroll bar.
Using the pallette of the scroll bar in its active and inactive state for the pallette in the buttons being active and inactive makes it more flush with the design and not stick out.

Result:

Default appearance:
default_appearance
Hovering on right:
hover_right
Hovering on left:
hover_left
Disabled left:
disabled_left
Disabled right:
disabled_right

Full screenshot view of change

2024-11-10_02 40 15

Previous appearance for reference:

2024-11-10_02 50 22

Small Feats

Reduced color pallete allows for greater compression
5,512 bytes -> 382 bytes
14x decrease in size

Jar size improvement:
1,992,580 -> 1,989,946
0.13% total jar size improvement
(small things matter LOL)
detail: compiled on arch linux with Temurin-21.0.5+11-LTS

Footnote additional details

The arrow is made white instead of the button outline because it becomes too noisy in a small area.
Minecraft 1.15 removed blue backgrounds from buttons in Minecraft, and it came out in 2019, 6 years ago.
Previous attempts, which the textures were worse rip- #2740, #2746

@Laxystem
Copy link

Laxystem commented Nov 11, 2024

I believe it makes a lot more sense to have secondary buttons there instead of primary ones.

In-game UI mostly doesn't have primary buttons (except for the p menu - but that one uses them as tabs, which means it's outdated anyway).

@matthewperiut
Copy link
Author

Another reference, back in 1.14, where hovered buttons were still blue this texture was awesome!
Screenshot 2024-11-11 at 1 45 55 PM
but nowadays it really doesn't make much sense with the colors chosen to be inside the existing gui as-is

@embeddedt
Copy link
Contributor

embeddedt commented Nov 11, 2024

I like the new look, but the right edge of the buttons doesn't align with the right edge of the scrollbar. To be fair this was also an issue with the previous implementation, but it seems more obvious now.

@matthewperiut
Copy link
Author

Does this look better?
image
Alternatively, this?
image

@embeddedt
Copy link
Contributor

I like the first revision, yes.

@matthewperiut
Copy link
Author

image
I further modified it to have the disabled button be a bit nicer

@IMB11
Copy link
Member

IMB11 commented Nov 18, 2024

I think this looks great 👍

Copy link
Member

@modmuss50 modmuss50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im happy with this, its a definite improvement. If anyone thinks they can be done better again please let it be known as I dont plan on touching this yet agian.

@modmuss50 modmuss50 added the last call If you care, make yourself heard right away! label Dec 16, 2024
@quinn-semele
Copy link

quinn-semele commented Dec 16, 2024

Only issue I can think of is that by trying to fit into the vanilla scheme here the contrast on the active buttons end up being low.

That may not be an issue due to the physical location but I believe it is something that should still be thought about.

@matthewperiut
Copy link
Author

I just found a last minute thing, surprised it wasn't seen earlier by past me, but don't merge yet!
image

@matthewperiut
Copy link
Author

Alright, I'm thinking about the solutions, and here are the options,

  1. Move the buttons back to their usual location
  2. Shorten the search bar
  3. Move the search bar

I'm not really sure what to do, but I think probably move the buttons back

@embeddedt
Copy link
Contributor

I actually think shortening the search bar would look better.

@Laxystem
Copy link

@matthewperiut there's a fourth option, replace the outline with a normal cell border on the search tab.

@IMB11
Copy link
Member

IMB11 commented Dec 19, 2024

Shortening the search bar would be perfectly acceptable in my opinion, users won't notice and it's aesthetically pleasing.

Copy link
Contributor

@Syst3ms Syst3ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorten the search bar, as per consensus. Making a review of this so it doesn't get forgotten when last call ends.

@matthewperiut
Copy link
Author

Yeah sorry guys work got busy, let me try and get this finished

@matthewperiut
Copy link
Author

image getting there guys...

@matthewperiut
Copy link
Author

Ok, now it is ready (I think)

@@ -68,11 +73,11 @@ private void updateSelection() {
}
}

@Inject(method = "init", at = @At("RETURN"))
@Inject(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;setEditableColor(I)V", shift = At.Shift.AFTER))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed to stop creating creative buttons when in survival mode, incase anyone asks the purpose

@matthewperiut
Copy link
Author

OK I'm taking my grubby hands off this code and various like OO this could be betters and handing it off to just be reviewed, do keep in mind that I tried to keep my code as minimally invasive as possible for the changes that I made. Feel free to ask questions for my decisions. This is what the search tab looks like now
image

@IMB11
Copy link
Member

IMB11 commented Dec 25, 2024

Looks great IMO 👍

@matthewperiut
Copy link
Author

Me thinking I'm done, having random thoughts of what ifs and how to fix them later... guys maybe its truly ready now.

@matthewperiut
Copy link
Author

I decided not to mess with the png size as that is how it was originally, I am truly solely trying to get the design of the button to be different and making sure the code I add isn't inefficient. But yes, in the current version widgets are usually just small images with a different image loading system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
last call If you care, make yourself heard right away!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants