console.js 399 B

12345678910111213141516171819
  1. let plugin = new arm.Plugin();
  2. let h1 = new zui.Handle();
  3. let h2 = new zui.Handle();
  4. plugin.drawUI = function(ui) {
  5. if (ui.panel(h1, "Console")) {
  6. ui.indent();
  7. ui.row([8/10, 2/10]);
  8. var t = ui.textInput(h2);
  9. if (ui.button("Run")) {
  10. try { arm.Log.trace("> " + t); eval(t); }
  11. catch(e) { arm.Log.trace(e); }
  12. }
  13. for (const t of arm.Log.lastTraces) ui.text(t);
  14. ui.unindent();
  15. }
  16. }