Arc13

Untitled

Jul 19th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. os.loadAPI("arcui")
  2.  
  3. monX, monY = term.getSize()
  4.  
  5. arcui.drawWindow("Progress Tester")
  6. arcui.drawButton("btn_plus", 1, 3, 3, 5, colors.green, "+")
  7. arcui.drawButton("btn_moins", 5, 3, 8, 5, colors.red, "-")
  8. arcui.drawButton("btn_disable", 10, 3, monX, 5, colors.orange, "Disable progress")
  9. arcui.drawButton("btn_dis_mar", 1, 7, monX, 7, colors.orange, "Disable marquee")
  10. arcui.drawButton("btn_en_mar", 1, 9, monX, 9, colors.yellow, "Enable marquee")
  11. arcui.drawButton("btn_enable", 1, monY, monX, monY, colors.yellow, "Enable progress")
  12. arcui.drawProgress("prg_test", 1, 10, monX, monX, 30)
  13. arcui.drawProgress("prg_anim", 10, 16, 30, 20, 12)
  14. arcui.drawMarqueeProgress("mar_test", 1, 12, 18)
  15. arcui.drawMarqueeProgress("mar_test_1", 3, 14, 11)
  16.  
  17. function loop()
  18. while true do
  19. event, a1 = os.pullEvent()
  20.  
  21. if event == "button_close_clicked" then
  22. term.setBackgroundColor(colors.black)
  23. term.clear()
  24. term.setCursorPos(1, 1)
  25.  
  26. return true
  27. elseif event == "button_clicked" then
  28. if a1 == "btn_plus" then
  29. arcui.changeValue("prg_test", "value", arcui.widgets["prg_test"]["value"] + 1)
  30. elseif a1 == "btn_moins" then
  31. arcui.changeValue("prg_test", "value", arcui.widgets["prg_test"]["value"] - 1)
  32. elseif a1 == "btn_disable" then
  33. arcui.changeValue("prg_test", "enabled", "false")
  34. elseif a1 == "btn_dis_mar" then
  35. arcui.changeValue("mar_test", "enabled", "false")
  36. elseif a1 == "btn_en_mar" then
  37. arcui.changeValue("mar_test", "enabled", "true")
  38. elseif a1 == "btn_enable" then
  39. arcui.changeValue("prg_test", "enabled", "true")
  40. end
  41. end
  42. end
  43. end
  44.  
  45. parallel.waitForAll(loop, arcui.eventHandler, arcui.marqueeAnim, arcui.progressAnim)
Advertisement
Add Comment
Please, Sign In to add comment