Files

46 lines
1.7 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 — uiHandler() (satır 657)
[← potion_rain.js](index.md) · [← Master](../../wiki.md)
Parça 2/2 · [önceki](uiHandler.md)
```javascript
var group = last.substring(0, last.length - 1);
var val = Number(last.charAt(last.length - 1));
var skey = group === "timed" ? K_TIMED : group === "mode" ? K_MODE : K_SHAPE;
st.setNumber(skey, val);
var names = { timed: ["Adet", "Sure"], mode: ["Baktigim", "Etrafim"], shape: ["Daire", "Kare"] }[group];
setLabel(ctx, group + "0", pick(val === 0, names[0]));
setLabel(ctx, group + "1", pick(val === 1, names[1]));
} else if (last.indexOf("n_") === 0) {
// Elle girilen sayi: gecerliyse sinira cekip kaydet
var nm = last.substring(2);
if (!LIMITS[nm]) return;
var raw = trim(data.getString(last)).replace(",", ".");
var v = Number(raw);
if (raw.length === 0 || !isFinite(v)) {
setLabel(ctx, "msg", "§c" + LIMITS[nm].label + ": sayi gir (" + LIMITS[nm].min + "-" + LIMITS[nm].max + ")");
return;
}
st.setNumber(K_NUM + nm, clampNum(nm, v));
} else if (last === "t_skin") {
st.setString(K_SKIN, trim(data.getString("t_skin")));
} else if (last === "t_morph") {
var m = trim(data.getString("t_morph"));
if (m.length > 0) {
var morph = null;
try { morph = mappet.createMorph(m); } catch (e) {}
if (!morph) {
setLabel(ctx, "msg", "§cMorph NBT gecersiz, kaydedilmedi.");
return;
}
}
st.setString(K_MORPH, m);
} else {
return;
}
setLabel(ctx, "msg", summaryText(readConfig(p)));
}
```