MinicraftPlus / minicraft-plus-revived

Minicraft+, an extension of Notch's original minicraft project, with tons more features.
GNU General Public License v3.0
473 stars 96 forks source link

Add inventory capacity counter #686

Closed BenCheung0422 closed 3 months ago

BenCheung0422 commented 3 months ago

Self-explained by the title, this adds an inventory capacity counter, as demonstrated below:

https://github.com/MinicraftPlus/minicraft-plus-revived/assets/74168521/d497ec12-8e51-4e95-a854-e91ad1e1a369

The position of the counter is shifted upward to prevent potential collision of the counter with the title of the menu. Also, it is placed at the corners for convenience to users, instead of other places below blocking more sights. And there is a background to prevent similar colors causing confusion from the background.

Though there might be potential issues when the menus are too long, caused by long lengths, but should be able to be fixed by #543.

This can let players know when they have the inventories full. Potentially related to #685.

Litorom commented 3 months ago

Looks good but could be better aesthetically. Try making it use the menu background. Similar to how durability/arrows worked in Eye’s hotbar rewrite.

BenCheung0422 commented 3 months ago

I have changed the design of the counter, minorly using similar techniques as in #581, as demonstrated below:

https://github.com/MinicraftPlus/minicraft-plus-revived/assets/74168521/d4abeeb1-8b22-4f2b-9960-988a5da40e67

Upon the design, the color of the text changes according to the fullness of the inventory while the shape of the counter changes when the width of the text changes. The position is lock at the corners and a little overflow is preferred (when focused) as of the limited area of the inventory menu (when empty, or shortest width). The counter is expanded with the limit when focused, so they will not collide with another counter on the other menu at all.