Files

48 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.
# EmoteMenu.js — main() (satır 72)
[← EmoteMenu.js](index.md) · [← Master](../../wiki.md)
Parça 1/2 · [sonraki](main-2.md)
```javascript
function main(c)
{
var states = c.getSubject().getStates();
states.setString("emote_secili", "-1");
var ui = mappet.createUI(c, "handler").background();
var panel = ui.graphics().id("panel");
var click = ui.click().id("click");
var kullBtn = ui.button("KULLAN").id("kullan");
var cikis = ui.icon("close").id("kapat");
panel.rxy(0.5, 0.5).wh(420, 320).anchor(0.5);
click.rxy(0.5, 0.5).wh(420, 320).anchor(0.5);
kullBtn.rx(0.5, -40).ry(0.5, 138).wh(80, 22);
cikis.rx(0.5, 188).ry(0.5, -157).wh(20, 20).tooltip("Kapat", 1);
// ilk çizim
panel.rect(0, 0, 420, 320, 0xff0f0f17);
panel.gradient(0, 0, 420, 320, 0xff0f0f17, 0xff070710);
panel.rect(0, 0, 420, 38, 0xff1a1a2e);
panel.rect(0, 37, 420, 1, 0xff5a4aff);
panel.text("EMOTE", 210, 12, 0xffffffff, 0.5, 0.0);
panel.rect(0, 280, 420, 40, 0xff1a1a2e);
panel.rect(0, 280, 420, 1, 0xff5a4aff);
panel.text("Bir emote sec", 210, 292, 0xff9090a0, 0.5, 0.0);
var emoteRenkler = [0xff5a4aff,0xff4aff5a,0xffff4a4a,0xffff9f4a,0xff4affff,0xffff4aff,0xffffff4a,0xff4a8aff,0xffff6a4a,0xff4affaa,0xffaaaaff,0xffff4a8a];
var emoteIsimleri = ["Otur","Yat","Kalk","İşaret","???","???","???","???","???","???","???","???"];
var slotW = 90, slotH = 70, gap = 8, ox = 12, oy = 48;
for (var i = 0; i < 12; i++)
{
var col = i % 4;
var row = Math.floor(i / 4);
var x = ox + col * (slotW + gap);
var y = oy + row * (slotH + gap);
panel.rect(x, y, slotW, slotH, 0xff1a1a28);
panel.rect(x+1, y+1, slotW-2, slotH-2, 0xff141420);
panel.rect(x+30, y+8, 30, 30, emoteRenkler[i]);
```