McLib 2.0
This enormous update drastically improves the GUI system that is used in my mods, as well as adding its own configuration system, and different APIs to make it easier to develop GUI stuff. It's also allows you to slightly personalize the GUI.
- Added configuration system
- Added Dashboard GUI from Blockbuster mod
- Added
Numpad*
keybinds to open a specific panel
- Added
- Added Icon API to ease texture coordinate hell
- Added
GuiUtils.openWebLink(String)
- Added
MatrixUtils
class from Blockbuster mod - Added
Timer
class to keep mark and keep track of timed operations - Added config options:
- Primary color — sets the default color for all sorts of GUI elements, including selection and active colors
- Button borders — toggles black borders around button elements
- Checkbox instead of toggle element — toggles toggle element rendering as a checkbox
- Model grid — toggles grid rendering instead of a grass block in model renderer
- GUI scale — allows to change the GUI scale of McLib's GUIs without changing Minecraft's GUI scale
- Mouse cursor rendering — toggles mouse cursor rendering (moved from Aperture mod)
- Keystrokes rendering — toggles pressed keystrokes rendering
- Background image and background color — allows to set a custom image background or background color
- Scrollbars options — allow you to customize appearance of scrollbar
- Max. packet size — vanilla tweak option which allows to increase the limit of Minecraft's network messages
- Fixed
Interpolations.envelope
going below0
when outside of envelope's range - Fixed texture picker messing up the resource location in the root
- Improved math expression parser:
- Added more math functions:
round(x)
— roundx
to nearest integerceil(x)
— roundx
to upper integertrunc(x)
— truncatex
, floorx
whenx
is positive, and ceilx
when it's negativemax(a, b)
— return a bigger value betweena
andb
min(a, b)
— return a smaller value betweena
andb
exp(x)
— e constant to the power ofx
ln(x)
— natural logarithm ofx
sqrt(x)
— square root ofx
mod(x, d)
— get remainder ofx
divided byd
, equivalent tox % d
pow(x, p)
—x
to the power ofp
, equivalent tox^p
lerp(a, b, x)
— linearly interpolate betweena
tob
usingx
as a factor
- Added ternary operator support, for example
0 ? 1 : 5 = 5
,1 ? 4 : 2 = 4
orx >= 0 ? 5 : -5
, equals5
whenx
is positive, and-5
ifx
is negative - Added boolean comparison operators which return
1
if condition is met, or0
otherwise (these operators are also have the highest precedence):&&
—1
if both operands are non-zero||
—1
if only one operand non-zero<
—1
if left operand is less than second<=
—1
if left operand is less or equal to second operand>=
—1
if left operand is greater or equal to second operand>
—1
if left operand is greater to second operand==
—1
if left operand equals to second!=
—1
if left operand isn't equal to second
- Added
!
operator which negates an expression, i.e. if expression is non-zero, then it returns0
, otherwise if expression is0
it returns1
, for example:!(5 + 2) = 0
and!(2 - 2) = 1
- Added more math functions:
- Improved
GuiDraw.scissor
to support nested scissor test - Refactored fully the GUI system:
- Added current focused element to fix multiple selected text fields bug
- Added an ability to Tab betweeen input fields
- Added
Esc
keybind to unfocus the element when focused
- Added tooltip support to every element
- Added support for horizontal scroll in scroll element
- Added context menu API
- Added keybind support for individual GUI elements
- Added
F9
keybind to any GUI screen to view all available keybinds
- Added
- Added color picker element
- Changed track pad element:
- Added increment buttons to incremeent by one
- Changed dragging from vertical distance to horizontal distance
- Changed from
float
todouble
for better precision - Removed label option
- Changed modal elements to remove themselves from parent instead of unsetting the delegate
- Fixed labels staying the same after changing to a different language
- Improved list element:
- Added label-value lists
- Added multi-selection support (shift + click adds selects an additional element)
- Added drag-n-drop sorting support
- Added direct filtering of elements support
- Added interpolations list from Blockbuster mod
- Added support for horizontal lists
- Refactored resizers to support many new placement features, including automatic layout resizers for responsive row, column and grid placement of the elements
- Refactored inventory and slot elements
- Refactored button elements:
- Added for circulate button element to right click for previous value
- Refactored model renderer:
- Added picking code from Blockbuster
- Changed the navigation within to orbit style
- Fixed
update
method to be called correctly regardless of framerate
- Added current focused element to fix multiple selected text fields bug