Loading
Docs / Components / Menu Buttons
v1.0.0 JAVA MOD LIBRARY

Menu Buttons

Full-width stacked list buttons used inside popups, dropdowns, and option sheets.

ui.menuButton(...) draws a 28px tall #636365 (OreTone.MENU_FACE) row wrapped in a 1px #999999 (OreTone.MENU_STROKE) border that smoothly darkens toward #373A39 (OreTone.POPUP_BODY) on hover. Inside ui.dropdown(...), items step vertically by 24px (itemH = 28, step = 24) or overlap by 1px when stacked tightly so shared outlines do not double up.

Interactive Preview

Selected: Try selecting this

Method Signatures (OreUi)

public void menuButton(int x, int y, int w, String label, String[] icon,
                       String key, String tip, Runnable action)

public void menuButton(int x, int y, int w, String label, String[] icon,
                       boolean textShadow, int textShadowColor, Boolean iconShadowOverride,
                       String key, String tip, Runnable action)

Parameters

ParameterTypeDescription
x, yintTop-left GUI pixel coordinates (row height is 28px).
wintRow width in GUI pixels.
labelStringRow label (x + 21 with icon, x + 5 without icon).
iconString[]Optional leading 8×8 icon (OreIcon.*.small) placed at x + 7.
keyStringUnique hover animation key ("menu:" + key).
tipStringOptional hover tooltip.
actionRunnableClick / Enter / Space callback.

Example

String[] labels = { "Edit World", "Duplicate", "Export" };
String[][] icons = { OreIcon.PENCIL.small, OreIcon.BUNDLE.small, OreIcon.EXPORT.small };

for (int i = 0; i < labels.length; i++) {
	int idx = i;
	ui.menuButton(x, y + i * 27, 180, labels[i], icons[i],
		"menuOpt:" + i, null, () -> handleOption(idx));
}