Files

40 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Lal2.js — openMenu() (satır 77)
[← Lal2.js](index.md) · [← Master](../../wiki.md)
Parça 1/2 · [sonraki](openMenu-2.md)
```javascript
function openMenu(c, p) {
var ui = mappet.createUI(c, "handler").background();
var root = ui.getCurrent();
root.rxy(0.5, 0.5).wh(390, 190).anchor(0.5, 0.5);
var active = String(mappet.get(STATE_KEY)) === "1";
var phase = String(mappet.get(PHASE_KEY) || "idle");
var lastBlock = p.getStates().getString("kapla_last_block");
var lastMeta = p.getStates().getString("kapla_last_meta");
if (!lastBlock) lastBlock = "minecraft:stone";
if (!lastMeta) lastMeta = "0";
ui.graphics().rect(0, 0, 390, 190, 0xE0090A10).rxy(0, 0).wh(390, 190).anchor(0, 0);
ui.graphics().rect(0, 0, 390, 30, 0xEE11131F).rxy(0, 0).wh(390, 30).anchor(0, 0);
ui.graphics().rect(0, 0, 390, 1, 0xFF48D7FF).rxy(0, 0).wh(390, 1).y(30).anchor(0, 0);
ui.label("\u00a7b\u00a7lKapla \u00a78- \u00a77block dalgasi")
.x(12).y(9).wh(330, 12).anchor(0, 0).labelAnchor(0, 0.5);
ui.icon("close").id("close").x(362).y(6).wh(18, 18).anchor(0, 0);
ui.label("\u00a77Block id").x(14).y(46).wh(80, 12).anchor(0, 0);
ui.textbox(lastBlock, 160).id("block").x(14).y(60).wh(250, 20).anchor(0, 0)
.tooltip("Ornek: minecraft:stone veya biomesoplenty:mud", 1);
ui.label("\u00a77Meta").x(276).y(46).wh(70, 12).anchor(0, 0);
ui.textbox(lastMeta, 8).id("meta").x(276).y(60).wh(60, 20).anchor(0, 0)
.tooltip("Genelde 0. Wool gibi bloklarda renk/metalar icin kullanilir.", 1);
ui.button("\u00a7aYay").id("spread").x(14).y(96).wh(88, 24).anchor(0, 0);
ui.button("\u00a7eGeri Cek").id("pull").x(112).y(96).wh(94, 24).anchor(0, 0);
ui.button("\u00a7cReset").id("reset").x(216).y(96).wh(70, 24).anchor(0, 0);
```