Files

58 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.
# potion_rain.js — q() (satır 160)
[← potion_rain.js](index.md) · [← Master](../../wiki.md)
Parça 10/11 · [önceki](q-9.md) · [sonraki](q-11.md)
```javascript
if (busy !== null && busy !== undefined && now() < Number(busy)) mappet.set(G_STOP + name, 1);
}
// =====================================================================
// UI — MENU (4 sekme)
// =====================================================================
var UI_W = 340;
var UI_H = 314;
var TABS = ["Tur", "Iksir", "Alan & Sayilar", "Skin"];
// Paneli ekranin ortasina gore yerlestir (Mappet root'u tum ekrani kaplar)
function at(comp, x, y, w, h) {
return comp.rx(0.5, x - UI_W / 2).ry(0.5, y - UI_H / 2).wh(w, h).anchor(0, 0);
}
function pick(on, text) {
return (on ? "§a§l» " : "§7") + text;
}
function kindText(i, sel) {
var k = KINDS[i];
return (i === sel ? "§l» " : "") + k.col + k.name;
}
function potionText(i, sel) {
var pt = POTIONS[i];
return (i === sel ? "§l» " : "") + pt.col + pt.name;
}
function summaryText(cfg) {
var k = cfg.kind, pt = POTIONS[cfg.pot];
return "§7" + k.col + k.name + (carriesPotion(k, cfg) ? " §8+ " + pt.col + pt.name : "") +
" §8| §7" + (cfg.timed ? cfg.duration + " sn x " + cfg.rate + "/tick" : cfg.count + " adet") +
" §8| §7" + areaText(cfg) + ", " + cfg.height + " blok";
}
function numBox(ui, name, value, x, y) {
var L = LIMITS[name];
at(ui.label("§7" + L.label), x, y, 100, 12);
at(ui.textbox(String(value), 6).id("n_" + name), x, y + 12, 100, 18)
.tooltip(L.label + ": " + L.min + " - " + L.max, 1);
}
function openMenu(c, p) {
var st = p.getStates();
var cfg = readConfig(p);
var page = getIndex(st, K_PAGE, TABS.length);
var ui = mappet.createUI(c, "uiHandler").background();
```