Advertisement
Oleshe

OpenGames (Game Maker)

Feb 16th, 2023 (edited)
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 55.18 KB | None | 0 0
  1. local GUI = require('gui')
  2. local paths = require('paths')
  3. local system = require('system')
  4. local event = require('event')
  5. local image = require('image')
  6. local fs = require('filesystem')
  7. local lc = system.getCurrentScriptLocalization()
  8. local cr1, cr2,cr3 = 0x989898, 0x505050,0x000000
  9. treemode = 'screen'
  10. game = {scripts = {},window = {abn = true,type = 'window',width=80,heigth=40,title = 'test',color = cr2,titleColor = cr2},screen = {},storage={}}
  11.  
  12. wk,win,menu = system.addWindow(GUI.filledWindow(0,0,160,50,0x989898))
  13.  
  14. local exit = win:addChild(GUI.button(160,1,1,1,0xFF0000,0xAA0000,0xFF0000,0xAA0000,'X'))
  15. exit.onTouch = function()
  16.   win:remove()
  17. end
  18. local function changePosition(where,fromposition,toposition)
  19.   if where[toposition] and where[fromposition] then
  20.     tmp = where[toposition]
  21.     tmp2 = where[fromposition]
  22.     where[toposition] = tmp2
  23.     where[fromposition] = tmp
  24.   end
  25. end
  26. local title = win:addChild(GUI.text(1,1,0x505050,'Editor 0.2'))
  27. local screen = win:addChild(GUI.container(2,3,160,50))
  28. local params = win:addChild(GUI.filledWindow(102,24,40,20,0x989898))
  29. local obj = win:addChild(GUI.filledWindow(102,2,36,20,0x989898))
  30. function hts(...)
  31.   return ("0x%06X"):format(...)
  32. end
  33. function it(...)
  34.   return params:addChild(GUI.input(...))
  35. end
  36. function bn(...)
  37.   return params:addChild(GUI.button(...))
  38. end
  39. function tt(...)
  40.   return params:addChild(GUI.text(...))
  41. end
  42. function bx(...)
  43.   return params:addChild(GUI.comboBox(...))
  44. end
  45. function del() for i = 1,#game.screen do if what == game.screen[i] then table.remove(game.screen,i) break end end draw() drawtree() drawparams(game.screen[1]) end
  46. function drawparams(whatt)
  47.   what = whatt
  48.   params:removeChildren()
  49.   if not what then return end
  50.   params:addChild(GUI.panel(1,1,40,25,cr1))
  51.   tt(1,1,0x505050,'Params')
  52.   if what.type == 'text' then
  53.     tt(1,2,cr2,lc.type..' | '..what.type)
  54.     tt(1,3,cr2,lc.name)
  55.     tt(1,4,cr2,'X')
  56.     tt(1,5,cr2,'Y')
  57.     tt(1,6,cr2,lc.text)
  58.     tt(1,7,cr2,lc.color)
  59.     tt(1,8,cr2,lc.visible)
  60.     tt(1,9,cr2,lc.delete)
  61.     tt(1,10,cr2,lc.up)
  62.     tt(1,11,cr2,lc.down)
  63.     local tmp = bn(15,10,6,1,cr1,cr2,cr1,cr2,lc.up)
  64.     tmp.onTouch = function()
  65.       for i = 1,#game.screen do
  66.         if game.screen[i] == what then
  67.           changePosition(game.screen,i,i-1)
  68.           draw()
  69.           drawtree()
  70.           break
  71.         end
  72.       end
  73.     end
  74.     local tmp = bn(15,11,6,1,cr1,cr2,cr1,cr2,lc.down)
  75.     tmp.onTouch  = function()
  76.       for i = 1,#game.screen do
  77.         if game.screen[i] == what then
  78.           changePosition(game.screen,i,i+1)
  79.           draw()
  80.           drawtree()
  81.           break
  82.         end
  83.       end
  84.     end
  85.     local tmp = bn(15,9,6,1,cr1,cr2,cr1,cr2,lc.delete)
  86.     tmp.onTouch = del
  87.     local tmp = bx(15, 8, 20, 1, cr1, cr2, cr1, cr2)
  88.     if what.visible == true then
  89.       tmp:addItem(lc.truee).onTouch = function()
  90.         what.visible = true
  91.         draw()
  92.       end
  93.       tmp:addItem(lc.falsee).onTouch = function()
  94.         what.visible = false
  95.         draw()
  96.       end
  97.     else
  98.       tmp:addItem(lc.falsee).onTouch = function()
  99.         what.visible = false
  100.         draw()
  101.       end
  102.      tmp:addItem(lc.truee).onTouch = function()
  103.         what.visible = true
  104.         draw()
  105.       end
  106.     end
  107.     local xx = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  108.     xx.onInputFinished = function()
  109.       what.x = xx.text
  110.       draw()
  111.     end
  112.     local yy = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  113.     yy.onInputFinished = function()
  114.       what.y = yy.text
  115.       draw()
  116.     end
  117.     local Text = it(15, 6, 20, 1, cr1, cr2, cr3, cr1, cr2, what.text, "T")
  118.     Text.onInputFinished = function()
  119.        what.text = Text.text
  120.        draw()
  121.     end
  122.     local color = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.color), "C")
  123.     color.onInputFinished = function()
  124.       what.color = tonumber(color.text)
  125.       draw()
  126.     end
  127.     local name = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  128.     name.onInputFinished = function()
  129.       what.name = name.text
  130.       drawtree()
  131.     end
  132.   elseif what.type == 'button' then
  133.     tt(1,2,cr2,lc.type..': '..what.type)
  134.     tt(1,3,cr2,lc.name)
  135.     tt(1,4,cr2,'X')
  136.     tt(1,5,cr2,'Y')
  137.     tt(1,6,cr2,lc.heigth)
  138.     tt(1,7,cr2,lc.widht)
  139.     tt(1,8,cr2,lc.text)
  140.     tt(1,9,cr2,lc.colorbg)
  141.     tt(1,10,cr2,lc.colorgbp)
  142.     tt(1,11,cr2,lc.colorfg)
  143.     tt(1,12,cr2,lc.colorfgp)
  144.     tt(1,13,cr2,lc.onTouch)
  145.     tt(1,14,cr2,lc.visible)
  146.     tt(1,15,cr2,lc.delete)
  147.     tt(1,16,cr2,lc.up)
  148.     tt(1,17,cr2,lc.down)
  149.     local tmp = bn(15,16,6,1,cr1,cr2,cr1,cr2,lc.up)
  150.     tmp.onTouch = function()
  151.       for i = 1,#game.screen do
  152.         if game.screen[i] == what then
  153.           changePosition(game.screen,i,i-1)
  154.           draw()
  155.           drawtree()
  156.           break
  157.         end
  158.       end
  159.     end
  160.     local tmp = bn(15,17,6,1,cr1,cr2,cr1,cr2,lc.down)
  161.     tmp.onTouch  = function()
  162.       for i = 1,#game.screen do
  163.         if game.screen[i] == what then
  164.           changePosition(game.screen,i,i+1)
  165.           draw()
  166.           drawtree()
  167.           break
  168.         end
  169.       end
  170.     end
  171.     local tmp = bn(15,15,6,1,cr1,cr2,cr1,cr2,lc.delete)
  172.     tmp.onTouch = del
  173.     local tmp = bx(15, 14, 5, 1, cr1, cr2, cr1, cr2)
  174.     if what.visible == true then
  175.       tmp:addItem(lc.truee).onTouch = function()
  176.         what.visible = true
  177.         draw()
  178.       end
  179.       tmp:addItem(lc.falsee).onTouch = function()
  180.         what.visible = false
  181.         draw()
  182.       end
  183.     else
  184.       tmp:addItem(lc.falsee).onTouch = function()
  185.         what.visible = false
  186.         draw()
  187.       end
  188.      tmp:addItem(lc.truee).onTouch = function()
  189.         what.visible = true
  190.         draw()
  191.       end
  192.     end
  193.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  194.     tmp.onInputFinished = function()
  195.       what.x =tmp.text
  196.       draw()
  197.     end
  198.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  199.     tmp.onInputFinished = function()
  200.       what.y = tmp.text
  201.       draw()
  202.     end
  203.     local tmp = it(15, 8, 20, 1, cr1, cr2, cr3, cr1, cr2, what.text, "T")
  204.     tmp.onInputFinished = function()
  205.        what.text = tmp.text
  206.        draw()
  207.     end
  208.     local tmp = it(15, 9, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorbg), "BG")
  209.     tmp.onInputFinished = function()
  210.       what.colorbg = tonumber(tmp.text)
  211.       draw()
  212.     end
  213.     local tmp = it(15, 10, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorbgp), "BGP")
  214.     tmp.onInputFinished = function()
  215.       what.colorbgp = tonumber(tmp.text)
  216.       draw()
  217.     end
  218.     local tmp = it(15, 12, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorfgp), "FGP")
  219.     tmp.onInputFinished = function()
  220.       what.colorfgp = tonumber(tmp.text)
  221.       draw()
  222.     end
  223.     local tmp = it(15, 11, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorfg), "FG")
  224.     tmp.onInputFinished = function()
  225.       what.colorfg = tonumber(tmp.text)
  226.       draw()
  227.     end
  228.     local tmp = it(15, 6, 20,1,cr1, cr2, cr3, cr1, cr2, what.height, "H")
  229.     tmp.onInputFinished = function()
  230.       what.height = tonumber(tmp.text)
  231.       draw()
  232.     end
  233.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2, what.width, "W")
  234.     tmp.onInputFinished = function()
  235.       what.width = tonumber(tmp.text)
  236.       draw()
  237.     end
  238.     local tmp = it(15, 13, 20,1, cr1, cr2, cr3, cr1, cr2, string.gsub(what.onTouch,'.lua',''), "oT")
  239.     tmp.onInputFinished = function()
  240.       what.onTouch = tmp.text .. '.lua'
  241.     end
  242.     local tmp = it(15, 3, 20,1,cr1, cr2, cr3, cr1, cr2, what.name, "N")
  243.     tmp.onInputFinished = function()
  244.       what.name = tmp.text
  245.       drawtree()
  246.     end
  247.   elseif what.type == 'script' then
  248.     tt(1,2,cr2,lc.type..': '..what.type)
  249.     tt(1,3,cr2,lc.name)
  250.     tt(1,4,cr2,lc.path)
  251.     tt(1,5,cr2,lc.autoload)
  252.     tt(1,6,cr2,lc.delete)
  253.     tt(1,7,cr2,lc.up)
  254.     tt(1,8,cr2,lc.down)
  255.     local tmp = bn(15,7,6,1,cr1,cr2,cr1,cr2,lc.up)
  256.     tmp.onTouch = function()
  257.       for i = 1,#game.screen do
  258.         if game.screen[i] == what then
  259.           changePosition(game.scripts,i,i-1)
  260.           draw()
  261.           drawtree()
  262.           break
  263.         end
  264.       end
  265.     end
  266.     local tmp = bn(15,8,6,1,cr1,cr2,cr1,cr2,lc.down)
  267.     tmp.onTouch  = function()
  268.       for i = 1,#game.screen do
  269.         if game.screen[i] == what then
  270.           changePosition(game.scripts,i,i+1)
  271.           draw()
  272.           drawtree()
  273.           break
  274.         end
  275.       end
  276.     end
  277.     local tmp = bn(15,6,6,1,cr1,cr2,cr1,cr2,lc.delete)
  278.     tmp.onTouch = function() for i = 1,#game.script do if what == game.script[i] then table.remove(game.script,i) break end end draw() drawtree() drawparams(game.script[1]) end
  279.     local tmp = bx(15, 5, 5, 1, cr1, cr2, cr1, cr2)
  280.     if what.autoload == true then
  281.       tmp:addItem(lc.truee).onTouch = function()
  282.         what.autoload = true
  283.        draw()
  284.      end
  285.      tmp:addItem(lc.falsee).onTouch = function()
  286.         what.autoload = false
  287.         draw()
  288.       end
  289.     else
  290.       tmp:addItem(lc.falsee).onTouch = function()
  291.         what.autoload = false
  292.         draw()
  293.       end
  294.       tmp:addItem(lc.truee).onTouch = function()
  295.         what.autoload = true
  296.         draw()
  297.       end
  298.     end
  299.     local tmp  = bn(15,4,#what.path,1,cr1,cr2,cr1,cr2,what.path)
  300.     tmp.onTouch = function()
  301.       system.execute(paths.system.applicationMineCodeIDE, what.path)
  302.     end
  303.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  304.     tmp.onInputFinished = function()
  305.       what.name = tmp.text
  306.       drawtree()
  307.     end
  308.   elseif what.type == 'image' then
  309.     tt(1,2,cr2,lc.type..': '..what.type)
  310.     tt(1,3,cr2,lc.name)
  311.     tt(1,4,cr2,'X')
  312.     tt(1,5,cr2,'Y')
  313.     tt(1,6,cr2,lc.path)
  314.     tt(1,7,cr2,lc.image)
  315.     tt(1,8,cr2,lc.visible)
  316.     tt(1,9,cr2,lc.delete)
  317.     tt(1,10,cr2,lc.up)
  318.     tt(1,11,cr2,lc.down)
  319.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2, what.image, "I")
  320.     tmp.onInputFinished = function()
  321.       what.image = tmp.text
  322.       draw()
  323.     end
  324.     local tmp = bn(15,10,6,1,cr1,cr2,cr1,cr2,lc.up)
  325.     tmp.onTouch = function()
  326.       for i = 1,#game.screen do
  327.         if game.screen[i] == what then
  328.           changePosition(game.screen,i,i-1)
  329.           draw()
  330.           drawtree()
  331.           break
  332.         end
  333.       end
  334.     end
  335.     local tmp = bn(15,11,6,1,cr1,cr2,cr1,cr2,lc.down)
  336.     tmp.onTouch  = function()
  337.       for i = 1,#game.screen do
  338.         if game.screen[i] == what then
  339.           changePosition(game.screen,i,i+1)
  340.           draw()
  341.           drawtree()
  342.           break
  343.         end
  344.       end
  345.     end
  346.     local tmp = bn(15,9,6,1,cr1,cr2,cr1,cr2,lc.delete)
  347.     tmp.onTouch = del
  348.     local tmp = bx(15, 8, 5, 1, cr1, cr2, cr1, cr2)
  349.     if what.visible == true then
  350.       tmp:addItem(lc.truee).onTouch = function()
  351.         what.visible = true
  352.         draw()
  353.       end
  354.       tmp:addItem(lc.falsee).onTouch = function()
  355.         what.visible = false
  356.         draw()
  357.       end
  358.     else
  359.       tmp:addItem(lc.falsee).onTouch = function()
  360.         what.visible = false
  361.         draw()
  362.       end
  363.      tmp:addItem(lc.truee).onTouch = function()
  364.         what.visible = true
  365.         draw()
  366.       end
  367.     end
  368.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  369.     tmp.onInputFinished = function()
  370.       what.name = tmp.text
  371.       drawtree()
  372.     end
  373.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  374.     tmp.onInputFinished = function()
  375.       what.x =tonumber(tmp.text)
  376.       draw()
  377.     end
  378.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  379.     tmp.onInputFinished = function()
  380.       what.y = tonumber(tmp.text)
  381.       draw()
  382.     end
  383.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2, what.path, "P")
  384.     tmp.onInputFinished = function()
  385.       what.path = tmp.text
  386.       draw()
  387.     end
  388.   elseif what.type == 'imageStorage' then
  389.     tt(1,2,cr2,lc.type..': '..what.type)
  390.     tt(1,3,cr2,lc.name)
  391.     tt(1,4,cr2,lc.path)
  392.     tt(1,5,cr2,lc.delete)
  393.     tt(1,6,cr2,lc.up)
  394.     tt(1,7,cr2,lc.down)
  395.     local tmp = bn(15,6,6,1,cr1,cr2,cr1,cr2,lc.up)
  396.     tmp.onTouch = function()
  397.       for i = 1,#game.screen do
  398.         if game.screen[i] == what then
  399.           changePosition(game.storage,i,i-1)
  400.           draw()
  401.           drawtree()
  402.           break
  403.         end
  404.       end
  405.     end
  406.     local tmp = bn(15,7,6,1,cr1,cr2,cr1,cr2,lc.down)
  407.     tmp.onTouch  = function()
  408.       for i = 1,#game.screen do
  409.         if game.screen[i] == what then
  410.           changePosition(game.storage,i,i+1)
  411.           draw()
  412.           drawtree()
  413.           break
  414.         end
  415.       end
  416.     end
  417.     local tmp = bn(15,5,6,1,cr1,cr2,cr1,cr2,lc.delete)
  418.     tmp.onTouch = function() for i = 1,#game.storage do if what == game.storage[i] then table.remove(game.storage,i) break end end draw() drawtree() drawparams(game.storage[1]) end
  419.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  420.     tmp.onInputFinished = function()
  421.       what.name = tmp.text
  422.       drawtree()
  423.     end
  424.     local tmp = params:addChild(GUI.filesystemChooser(15, 4, 10, 1,cr1, cr2, cr1, cr2, nil, lc.open, lc.close, string.gsub(what.path,'.pic',''), "/"))
  425.     tmp:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_FILE)
  426.     tmp.onSubmit = function(path)
  427.       if fs.extension(path) ~= '.pic' then GUI.alert(lc.WaYP..' :discordSkull:') return end
  428.       what.path = path
  429.       draw()
  430.     end
  431.   elseif what.type == 'input' then
  432.     tt(1,2,cr2,lc.type..': | '..what.type)
  433.     tt(1,3,cr2,lc.name)
  434.     tt(1,4,cr2,'X')
  435.     tt(1,5,cr2,'Y')
  436.     tt(1,6,cr2,lc.heigth)
  437.     tt(1,7,cr2,lc.width)
  438.     tt(1,8,cr2,lc.text)
  439.     tt(1,9,cr2,lc.ph)
  440.     tt(1,10,cr2,lc.colorbg)
  441.     tt(1,11,cr2,lc.colorbgp)
  442.     tt(1,12,cr2,lc.colorfg)
  443.     tt(1,13,cr2,lc.colorfgp)
  444.     tt(1,14,cr2,lc.colorph)
  445.     tt(1,15,cr2,lc.path)
  446.     tt(1,16,cr2,lc.delete)
  447.     tt(1,17,cr2,lc.visible)
  448.     tt(1,18,cr2,lc.up)
  449.     tt(1,19,cr2,lc.down)
  450.     local tmp = bn(15,18,6,1,cr1,cr2,cr1,cr2,lc.up)
  451.     tmp.onTouch = function()
  452.       for i = 1,#game.screen do
  453.         if game.screen[i] == what then
  454.           changePosition(game.screen,i,i-1)
  455.           draw()
  456.           drawtree()
  457.           break
  458.         end
  459.       end
  460.     end
  461.     local tmp = bn(15,19,6,1,cr1,cr2,cr1,cr2,lc.down)
  462.     tmp.onTouch  = function()
  463.       for i = 1,#game.screen do
  464.         if game.screen[i] == what then
  465.           changePosition(game.screen,i,i+1)
  466.           draw()
  467.           drawtree()
  468.           break
  469.         end
  470.       end
  471.     end
  472.     local tmp = bn(15,16,6,1,cr1,cr2,cr1,cr2,lc.delete)
  473.     tmp.onTouch = del
  474.     local tmp = bx(15, 17, 5, 1, cr1, cr2, cr1, cr2)
  475.     if what.visible == true then
  476.       tmp:addItem(lc.truee).onTouch = function()
  477.         what.visible = true
  478.         draw()
  479.       end
  480.       tmp:addItem(lc.falsee).onTouch = function()
  481.         what.visible = false
  482.         draw()
  483.       end
  484.     else
  485.       tmp:addItem(lc.falsee).onTouch = function()
  486.         what.visible = false
  487.         draw()
  488.       end
  489.      tmp:addItem(lc.truee).onTouch = function()
  490.         what.visible = true
  491.         draw()
  492.       end
  493.     end
  494.     local tmp = it(15, 14, 20, 1, cr1, cr2, cr3, cr1, cr2, hts(what.colorph), "PH")
  495.     tmp.onInputFinished = function()
  496.       what.colorph =tonumber(tmp.text)
  497.       draw()
  498.     end
  499.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  500.     tmp.onInputFinished = function()
  501.       what.x =tmp.text
  502.       draw()
  503.     end
  504.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  505.     tmp.onInputFinished = function()
  506.       what.y = tmp.text
  507.       draw()
  508.     end
  509.     local tmp = it(15, 8, 20, 1, cr1, cr2, cr3, cr1, cr2, what.text, "T")
  510.     tmp.onInputFinished = function()
  511.        what.text = tmp.text
  512.        draw()
  513.     end
  514.     local tmp = it(15, 9, 20, 1, cr1, cr2, cr3, cr1, cr2, what.textph, "T")
  515.     tmp.onInputFinished = function()
  516.        what.textph = tmp.text
  517.        draw()
  518.     end
  519.     local tmp = it(15, 10, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorbg), "BG")
  520.     tmp.onInputFinished = function()
  521.       what.colorbg = tonumber(tmp.text)
  522.       draw()
  523.     end
  524.     local tmp = it(15, 11, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorbgp), "BGP")
  525.     tmp.onInputFinished = function()
  526.       what.colorbgp = tonumber(tmp.text)
  527.       draw()
  528.     end
  529.     local tmp = it(15, 13, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorfgp), "FGP")
  530.     tmp.onInputFinished = function()
  531.       what.colorfgp = tonumber(tmp.text)
  532.       draw()
  533.     end
  534.     local tmp = it(15, 12, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorfg), "FG")
  535.     tmp.onInputFinished = function()
  536.       what.colorfg = tonumber(tmp.text)
  537.       draw()
  538.     end
  539.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2, what.height, "H")
  540.     tmp.onInputFinished = function()
  541.       what.height = tonumber(tmp.text)
  542.       draw()
  543.     end
  544.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2, what.width, "W")
  545.     tmp.onInputFinished = function()
  546.       what.width = tonumber(tmp.text)
  547.       draw()
  548.     end
  549.     local tmp = it(15, 15, 20,1, cr1, cr2, cr3, cr1, cr2, string.gsub(what.onInputEnded,'.lua',''), "oT")
  550.     tmp.onInputFinished = function()
  551.       what.onInputEnded = tmp.text .. '.lua'
  552.     end
  553.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  554.     tmp.onInputFinished = function()
  555.       what.name = tmp.text
  556.       drawtree()
  557.     end
  558.   elseif what.type == 'switch' then
  559.     tt(1,2,cr2,lc.type..': '..what.type)
  560.     tt(1,3,cr2,lc.name)
  561.     tt(1,4,cr2,'X')
  562.     tt(1,5,cr2,'Y')
  563.     tt(1,6,cr2,lc.width)
  564.     tt(1,7,cr2,lc.colorp)
  565.     tt(1,8,cr2,lc.colors)
  566.     tt(1,9,cr2,lc.colorpp)
  567.     tt(1,10,cr2,lc.path)
  568.     tt(1,11,cr2,lc.state)
  569.     tt(1,12,cr2,lc.visible)
  570.     tt(1,13,cr2,lc.delete)
  571.     tt(1,14,cr2,lc.up)
  572.     tt(1,15,cr2,lc.down)
  573.     local tmp = bn(15,14,6,1,cr1,cr2,cr1,cr2,lc.up)
  574.     tmp.onTouch = function()
  575.       for i = 1,#game.screen do
  576.         if game.screen[i] == what then
  577.           changePosition(game.screen,i,i-1)
  578.           draw()
  579.           drawtree()
  580.           break
  581.         end
  582.       end
  583.     end
  584.     local tmp = bn(15,15,6,1,cr1,cr2,cr1,cr2,lc.down)
  585.     tmp.onTouch  = function()
  586.       for i = 1,#game.screen do
  587.         if game.screen[i] == what then
  588.           changePosition(game.screen,i,i+1)
  589.           draw()
  590.           drawtree()
  591.           break
  592.         end
  593.       end
  594.     end
  595.     local tmp = it(15, 3, 5,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  596.     tmp.onInputFinished = function()
  597.       what.name = tmp.text
  598.       drawtree()
  599.     end
  600.     local tmp = bn(15,13,6,1,cr1,cr2,cr1,cr2,'Delete')
  601.     tmp.onTouch = del
  602.     local tmp = bx(15, 12, 20, 1,cr1, cr2, cr1, cr2)
  603.     if what.visible == true then
  604.       tmp:addItem(lc.truee).onTouch = function()
  605.         what.visible = true
  606.         draw()
  607.       end
  608.       tmp:addItem(lc.falsee).onTouch = function()
  609.         what.visible = false
  610.         draw()
  611.       end
  612.     else
  613.       tmp:addItem(lc.falsee).onTouch = function()
  614.         what.visible = false
  615.         draw()
  616.       end
  617.      tmp:addItem(lc.truee).onTouch = function()
  618.         what.visible = true
  619.         draw()
  620.       end
  621.     end
  622.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2, string.gsub(what.onStateChanged,'.lua',''), "oSC")
  623.     tmp.onInputFinished = function()
  624.       what.onStateChanged = tmp.text .. '.lua'
  625.       draw()
  626.     end
  627.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorp), "P")
  628.     tmp.onInputFinished = function()
  629.       what.colorp = tonumber(tmp.text)
  630.       draw()
  631.     end
  632.     local tmp = it(15, 8, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colors), "S")
  633.     tmp.onInputFinished = function()
  634.       what.colorbs = tonumber(tmp.text)
  635.       draw()
  636.     end
  637.     local tmp = it(15, 9, 20,1, cr1, cr2, cr3, cr1, cr2, hts(what.colorpp), "PP")
  638.     tmp.onInputFinished = function()
  639.       what.colorpp = tonumber(tmp.text)
  640.       draw()
  641.     end
  642.     local tmp = bx(15, 11, 20, 1,cr1, cr2, cr1,cr2)
  643.     if what.state == true then
  644.       tmp:addItem(lc.truee).onTouch = function()
  645.         what.state = true
  646.         draw()
  647.       end
  648.       tmp:addItem(lc.falsee).onTouch = function()
  649.         what.state = false
  650.         draw()
  651.       end
  652.     else
  653.       tmp:addItem(lc.falsee).onTouch = function()
  654.         what.state = false
  655.         draw()
  656.       end
  657.      tmp:addItem(lc.truee).onTouch = function()
  658.         what.state = true
  659.         draw()
  660.       end
  661.     end
  662.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  663.     tmp.onInputFinished = function()
  664.       what.x =tmp.text
  665.       draw()
  666.     end
  667.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2, what.width, "W")
  668.     tmp.onInputFinished = function()
  669.       what.width = tonumber(tmp.text)
  670.       draw()
  671.     end
  672.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  673.     tmp.onInputFinished = function()
  674.       what.y = tmp.text
  675.       draw()
  676.     end
  677.   elseif what.type == 'window' then
  678.     tt(1,2,cr2,lc.type..': '..what.type)
  679.     tt(1,3,cr2,lc.name)
  680.     tt(1,3,cr2,lc.width)
  681.     tt(1,4,cr2,lc.heigth)
  682.     tt(1,5,cr2,lc.title)
  683.     tt(1,6,cr2,lc.titleColor)
  684.     tt(1,7,cr2,lc.color)
  685.     tt(1,8,cr2,lc.actionbuttons)
  686.     tt(1,9,cr2,lc.iconi)
  687.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  688.     tmp.onInputFinished = function()
  689.       what.name = tmp.text
  690.       drawtree()
  691.     end
  692.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.width, "W")
  693.     tmp.onInputFinished = function()
  694.       what.width = tonumber(tmp.text)
  695.       draw()
  696.           drawtree()
  697.     end
  698.     local tmp = it(15, 4, 20,1, cr1, cr2, cr3, cr1, cr2, what.heigth, "H")
  699.     tmp.onInputFinished = function()
  700.       what.heigth = tonumber(tmp.text)
  701.       draw()
  702.           drawtree()
  703.     end
  704.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.color), "C")
  705.     tmp.onInputFinished = function()
  706.       what.color = tonumber(tmp.text)
  707.       draw()
  708.     end
  709.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.titleColor), "CT")
  710.     tmp.onInputFinished = function()
  711.       what.titleColor = tonumber(tmp.text)
  712.       draw()
  713.     end
  714.     local tmp = it(15, 5, 20,1, cr1, cr2, cr3, cr1, cr2,  what.title, "T")
  715.     tmp.onInputFinished = function()
  716.       what.title = tmp.text
  717.       draw()
  718.     end
  719.     local tmp = bx(15, 8, 5, 1,cr1, cr2, cr1, cr2)
  720.     if what.abn == true then
  721.       tmp:addItem(lc.truee).onTouch = function()
  722.         what.abn = true
  723.         draw()
  724.       end
  725.       tmp:addItem(lc.falsee).onTouch = function()
  726.         what.abn = false
  727.         draw()
  728.       end
  729.     else
  730.       tmp:addItem(lc.falsee).onTouch = function()
  731.         what.abn = false
  732.         draw()
  733.       end
  734.      tmp:addItem(lc.truee).onTouch = function()
  735.         what.abn = true
  736.         draw()
  737.       end
  738.     end
  739.   elseif what.type == 'colorSelector' then
  740.     tt(1,2,cr2,lc.type..': '..what.type)
  741.     tt(1,3,cr2,lc.name)
  742.     tt(1,4,cr2,'X')
  743.     tt(1,5,cr2,'Y')
  744.     tt(1,6,cr2,lc.width)
  745.     tt(1,7,cr2,lc.heigth)
  746.     tt(1,8,cr2,lc.color)
  747.     tt(1,9,cr2,lc.text)
  748.     tt(1,10,cr2,lc.path)
  749.     tt(1,11,cr2,lc.visible)
  750.     tt(1,12,cr2,lc.delete)
  751.     tt(1,13,cr2,lc.up)
  752.     tt(1,14,cr2,lc.down)
  753.     local tmp = bn(15,13,6,1,cr1,cr2,cr1,cr2,lc.up)
  754.     tmp.onTouch = function()
  755.       for i = 1,#game.screen do
  756.         if game.screen[i] == what then
  757.           changePosition(game.screen,i,i-1)
  758.           draw()
  759.           drawtree()
  760.           break
  761.         end
  762.       end
  763.     end
  764.     local tmp = bn(15,14,6,1,cr1,cr2,cr1,cr2,lc.down)
  765.     tmp.onTouch  = function()
  766.       for i = 1,#game.screen do
  767.         if game.screen[i] == what then
  768.           changePosition(game.screen,i,i+1)
  769.           draw()
  770.           drawtree()
  771.           break
  772.         end
  773.       end
  774.     end
  775.     local tmp = it(15, 9, 20,1, cr1, cr2, cr3, cr1, cr2, what.path, "P")
  776.     tmp.onInputFinished = function()
  777.       what.path = tmp.text
  778.       draw()
  779.     end
  780.     local tmp = it(15, 9, 20,1, cr1, cr2, cr3, cr1, cr2, what.text, "T")
  781.     tmp.onInputFinished = function()
  782.       what.text = tmp.text
  783.       draw()
  784.     end
  785.     local tmp = it(15, 8, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.color), "C")
  786.     tmp.onInputFinished = function()
  787.       what.color = tonumber(tmp.text)
  788.       draw()
  789.     end
  790.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2, what.width, "W")
  791.     tmp.onInputFinished = function()
  792.       what.width = tonumber(tmp.text)
  793.       draw()
  794.     end
  795.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2, what.height, "H")
  796.     tmp.onInputFinished = function()
  797.       what.height = tonumber(tmp.text)
  798.       draw()
  799.     end
  800.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  801.     tmp.onInputFinished = function()
  802.       what.name = tmp.text
  803.       drawtree()
  804.     end
  805.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  806.     tmp.onInputFinished = function()
  807.       what.x =tmp.text
  808.       draw()
  809.     end
  810.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  811.     tmp.onInputFinished = function()
  812.       what.y = tmp.text
  813.       draw()
  814.     end
  815.     local tmp = bn(15,12,6,1,cr1,cr2,cr1,cr2,'Delete')
  816.     tmp.onTouch = del
  817.     local tmp = bx(15,11, 5, 1,cr1, cr2, cr1, cr2)
  818.     if what.visible == true then
  819.       tmp:addItem(lc.truee).onTouch = function()
  820.         what.visible = true
  821.         draw()
  822.       end
  823.       tmp:addItem(lc.falsee).onTouch = function()
  824.         what.visible = false
  825.         draw()
  826.       end
  827.     else
  828.       tmp:addItem(lc.falsee).onTouch = function()
  829.         what.visible = false
  830.         draw()
  831.       end
  832.      tmp:addItem(lc.truee).onTouch = function()
  833.         what.visible = true
  834.         draw()
  835.       end
  836.     end
  837.   elseif what.type == 'progressBar' then
  838.     tt(1,2,cr2,lc.type..': '..what.type)
  839.     tt(1,3,cr2,lc.name)
  840.     tt(1,4,cr2,'X')
  841.     tt(1,5,cr2,'Y')
  842.     tt(1,6,cr2,lc.width)
  843.     tt(1,7,cr2,lc.colorp)
  844.     tt(1,8,cr2,lc.colors)
  845.     tt(1,9,cr2,lc.colorv)
  846.     tt(1,10,cr2,lc.value)
  847.     tt(1,11,cr2,lc.visible)
  848.     tt(1,12,cr2,lc.delete)
  849.     tt(1,13,cr2,lc.up)
  850.     tt(1,14,cr2,lc.down)
  851.     local tmp = bn(15,13,6,1,cr1,cr2,cr1,cr2,lc.up)
  852.     tmp.onTouch = function()
  853.       for i = 1,#game.screen do
  854.         if game.screen[i] == what then
  855.           changePosition(game.screen,i,i-1)
  856.           draw()
  857.           drawtree()
  858.           break
  859.         end
  860.       end
  861.     end
  862.     local tmp = bn(15,14,6,1,cr1,cr2,cr1,cr2,lc.down)
  863.     tmp.onTouch  = function()
  864.       for i = 1,#game.screen do
  865.         if game.screen[i] == what then
  866.           changePosition(game.screen,i,i+1)
  867.           draw()
  868.           drawtree()
  869.           break
  870.         end
  871.       end
  872.     end
  873.     local tmp = it(15, 10, 20,1, cr1, cr2, cr3, cr1, cr2, what.value, "V")
  874.     tmp.onInputFinished = function()
  875.       what.value = tonumber(tmp.text)
  876.       draw()
  877.     end
  878.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorp), "P")
  879.     tmp.onInputFinished = function()
  880.       what.colorp = tonumber(tmp.text)
  881.       draw()
  882.     end
  883.     local tmp = it(15, 8, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colors), "S")
  884.     tmp.onInputFinished = function()
  885.       what.colors = tonumber(tmp.text)
  886.       draw()
  887.     end
  888.     local tmp = it(15, 9, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorv), "V")
  889.     tmp.onInputFinished = function()
  890.       what.colorv = tonumber(tmp.text)
  891.       draw()
  892.     end
  893.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2, what.width, "W")
  894.     tmp.onInputFinished = function()
  895.       what.width = tonumber(tmp.text)
  896.       draw()
  897.     end
  898.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  899.     tmp.onInputFinished = function()
  900.       what.x =tmp.text
  901.       draw()
  902.     end
  903.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  904.     tmp.onInputFinished = function()
  905.       what.y = tmp.text
  906.       draw()
  907.     end
  908.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  909.     tmp.onInputFinished = function()
  910.       what.name = tmp.text
  911.       drawtree()
  912.     end
  913.     local tmp = bn(15,12,6,1,cr1,cr2,cr1,cr2,'Delete')
  914.     tmp.onTouch = del
  915.     local tmp = bx(15, 11, 5, 1,cr1, cr2, cr1, cr2)
  916.     if what.visible == true then
  917.       tmp:addItem(lc.truee).onTouch = function()
  918.         what.visible = true
  919.         draw()
  920.       end
  921.       tmp:addItem(lc.falsee).onTouch = function()
  922.         what.visible = false
  923.         draw()
  924.       end
  925.     else
  926.       tmp:addItem(lc.falsee).onTouch = function()
  927.         what.visible = false
  928.         draw()
  929.       end
  930.      tmp:addItem(lc.truee).onTouch = function()
  931.         what.visible = true
  932.         draw()
  933.       end
  934.     end
  935.   elseif what.type == 'comboBox' then
  936.     tt(1,2,cr2,lc.type..': '..what.type)
  937.     tt(1,3,cr2,lc.name)
  938.     tt(1,4,cr2,'X')
  939.     tt(1,5,cr2,'Y')
  940.     tt(1,6,cr2,lc.width)
  941.     tt(1,7,cr2,lc.elh)
  942.     tt(1,8,cr2,lc.colorbg)
  943.     tt(1,9,cr2,lc.colort)
  944.     tt(1,10,cr2,lc.colorabg)
  945.     tt(1,11,cr2,lc.colorat)
  946.     tt(1,12,cr2,lc.items)
  947.     tt(1,13,cr2,lc.visible)
  948.     tt(1,14,cr2,lc.delete)
  949.     tt(1,15,cr2,lc.up)
  950.     tt(1,16,cr2,lc.down)
  951.     local tmp = bn(15,15,6,1,cr1,cr2,cr1,cr2,lc.up)
  952.     tmp.onTouch = function()
  953.       for i = 1,#game.screen do
  954.         if game.screen[i] == what then
  955.           changePosition(game.screen,i,i-1)
  956.           draw()
  957.           drawtree()
  958.           break
  959.         end
  960.       end
  961.     end
  962.     local tmp = bn(15,16,6,1,cr1,cr2,cr1,cr2,lc.down)
  963.     tmp.onTouch  = function()
  964.       for i = 1,#game.screen do
  965.         if game.screen[i] == what then
  966.           changePosition(game.screen,i,i+1)
  967.           draw()
  968.           drawtree()
  969.           break
  970.         end
  971.       end
  972.     end
  973.     local tmp = bn(15,12, 4,1, cr1, cr2, cr1, cr2,  lc.show)
  974.     tmp.onTouch = function()
  975.       choosed = what.items[1]
  976.       local choose = win:addChild(GUI.filledWindow(1,1,45,12,cr1))
  977.       local function update()
  978.       local tmp1 = choose:addChild(GUI.comboBox(2,2,20,3,cr2,cr1,cr2,cr1))
  979.       local tmp = choose:addChild(GUI.input(1,6, 20,1, cr1, cr2, cr3, cr1, cr2,  choosed.name, "N"))
  980.       tmp.onInputFinished = function()
  981.         choosed.name = tmp.text
  982.         draw()
  983.       end
  984.       local tmp = choose:addChild(GUI.comboBox(1, 10, 5, 1,cr1, cr2, cr1, cr2))
  985.      if choosed.active == false then
  986.         tmp:addItem(lc.truee).onTouch = function()
  987.           choosed.active = false
  988.           draw()
  989.         end
  990.         tmp:addItem(lc.falsee).onTouch = function()
  991.           choosed.active = true
  992.           draw()
  993.         end
  994.       else
  995.         tmp:addItem(lc.falsee).onTouch = function()
  996.           choosed.active =true
  997.           draw()
  998.         end
  999.        tmp:addItem(lc.truee).onTouch = function()
  1000.           choosed.active = false
  1001.           draw()
  1002.         end
  1003.       end
  1004.       local tmp = choose:addChild(GUI.button(30,8,#lc.close,1,cr1,cr2,cr1,cr2,lc.close))
  1005.       tmp.onTouch = function()
  1006.        choose:remove()
  1007.        draw()
  1008.       end
  1009.       local tmp = choose:addChild(GUI.input(1,8, 20, 1,cr1, cr2, cr3, cr1, cr2,  choosed.path, "P"))
  1010.       tmp.onInputFinished = function()
  1011.         choosed.path = tonumber(tmp.text)
  1012.       end
  1013.         tmp1:addItem(choosed.name).onTouch = function()
  1014.          update()
  1015.         end
  1016.       for i = 1,#what.items do
  1017.         if what.items[i] ~= choosed then
  1018.         tmp1:addItem(what.items[i].name).onTouch = function()
  1019.          choosed = what.items[i]
  1020.          update()
  1021.         end
  1022.         end
  1023.       end
  1024.       local tmp = choose:addChild(GUI.button(30,2,#lc.add,1,cr1,cr2,cr1,cr2,lc.add))
  1025.       tmp.onTouch = function()
  1026.         table.insert(what.items,{name='Item',path='',active=false})
  1027.         choosed = what.items[#what.items]
  1028.         update()
  1029.       end
  1030.       local tmp = choose:addChild(GUI.button(30,4,#lc.remove,1,cr1,cr2,cr1,cr2,lc.remove))
  1031.       tmp.onTouch = function()
  1032.         for i = 1,#what.items do
  1033.         if what.items[i] == choosed then
  1034.           table.remove(what.items,i)
  1035.         end end
  1036.         choosed = what.items[#what.items]
  1037.         update()
  1038.       end
  1039.     end  update() end
  1040.     local tmp = it(15, 8, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorbg), "BG")
  1041.     tmp.onInputFinished = function()
  1042.       what.colorbg = tonumber(tmp.text)
  1043.       draw()
  1044.     end
  1045.     local tmp = it(15, 9, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colort), "T")
  1046.     tmp.onInputFinished = function()
  1047.       what.colort = tonumber(tmp.text)
  1048.       draw()
  1049.     end
  1050.     local tmp = it(15, 10, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorabg), "ABG")
  1051.     tmp.onInputFinished = function()
  1052.       what.colorabg = tonumber(tmp.text)
  1053.       draw()
  1054.     end
  1055.     local tmp = it(15, 11, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorat), "AT")
  1056.     tmp.onInputFinished = function()
  1057.       what.colorat = tonumber(tmp.text)
  1058.       draw()
  1059.     end
  1060.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2, what.elh, "ELH")
  1061.     tmp.onInputFinished = function()
  1062.       what.elh = tonumber(tmp.text)
  1063.       draw()
  1064.     end
  1065.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2, what.width, "W")
  1066.     tmp.onInputFinished = function()
  1067.       what.width = tonumber(tmp.text)
  1068.       draw()
  1069.     end
  1070.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  1071.     tmp.onInputFinished = function()
  1072.       what.x =tmp.text
  1073.       draw()
  1074.     end
  1075.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  1076.     tmp.onInputFinished = function()
  1077.       what.y = tmp.text
  1078.       draw()
  1079.     end
  1080.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  1081.     tmp.onInputFinished = function()
  1082.       what.name = tmp.text
  1083.       drawtree()
  1084.     end
  1085.     local tmp = bn(15,14,6,1,cr1,cr2,cr1,cr2,'Delete')
  1086.     tmp.onTouch = del
  1087.     local tmp = bx(10, 13, 5, 1,cr1, cr2, cr1, cr2)
  1088.     if what.visible == true then
  1089.       tmp:addItem(lc.truee).onTouch = function()
  1090.         what.visible = true
  1091.         draw()
  1092.       end
  1093.       tmp:addItem(lc.falsee).onTouch = function()
  1094.         what.visible = false
  1095.         draw()
  1096.       end
  1097.     else
  1098.       tmp:addItem(lc.falsee).onTouch = function()
  1099.         what.visible = false
  1100.         draw()
  1101.       end
  1102.      tmp:addItem(lc.truee).onTouch = function()
  1103.         what.visible = true
  1104.         draw()
  1105.       end
  1106.     end
  1107.   elseif what.type == 'slider' then
  1108.     tt(1,2,cr2,lc.type..': '..what.type)
  1109.     tt(1,3,cr2,lc.name)
  1110.     tt(1,4,cr2,'X')
  1111.     tt(1,5,cr2,'Y')
  1112.     tt(1,6,cr2,lc.width)
  1113.     tt(1,7,cr2,lc.colorp)
  1114.     tt(1,8,cr2,lc.colorpp)
  1115.     tt(1,9,cr2,lc.colorv)
  1116.     tt(1,10,cr2,lc.minv)
  1117.     tt(1,11,cr2,lc.maxv)
  1118.     tt(1,12,cr2,lc.value)
  1119.     tt(1,13,cr2,lc.path)
  1120.     tt(1,14,cr2,lc.visble)
  1121.     tt(1,15,cr2,lc.delete)
  1122.     tt(1,16,cr2,lc.up)
  1123.     tt(1,17,cr2,lc.down)
  1124.     local tmp = bn(15,16,6,1,cr1,cr2,cr1,cr2,lc.up)
  1125.     tmp.onTouch = function()
  1126.       for i = 1,#game.screen do
  1127.         if game.screen[i] == what then
  1128.           changePosition(game.screen,i,i-1)
  1129.           draw()
  1130.           drawtree()
  1131.           break
  1132.         end
  1133.       end
  1134.     end
  1135.     local tmp = bn(15,17,6,1,cr1,cr2,cr1,cr2,lc.down)
  1136.     tmp.onTouch  = function()
  1137.       for i = 1,#game.screen do
  1138.         if game.screen[i] == what then
  1139.           changePosition(game.screen,i,i+1)
  1140.           draw()
  1141.           drawtree()
  1142.           break
  1143.         end
  1144.       end
  1145.     end
  1146.     local tmp = it(15, 13, 20,1, cr1, cr2, cr3, cr1, cr2, what.path, "P")
  1147.     tmp.onInputFinished = function()
  1148.       what.path = tmp.text
  1149.       draw()
  1150.     end
  1151.     local tmp = it(15, 10, 20,1, cr1, cr2, cr3, cr1, cr2, what.minv, "MINV")
  1152.     tmp.onInputFinished = function()
  1153.       what.minv = tonumber(tmp.text)
  1154.       draw()
  1155.     end
  1156.     local tmp = it(15, 11, 20,1, cr1, cr2, cr3, cr1, cr2, what.maxv, "MAXV")
  1157.     tmp.onInputFinished = function()
  1158.       what.maxv = tonumber(tmp.text)
  1159.       draw()
  1160.     end
  1161.     local tmp = it(15, 12, 20,1, cr1, cr2, cr3, cr1, cr2, what.value, "V")
  1162.     tmp.onInputFinished = function()
  1163.       what.value = tonumber(tmp.text)
  1164.       draw()
  1165.     end
  1166.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorp), "P")
  1167.     tmp.onInputFinished = function()
  1168.       what.colorp = tonumber(tmp.text)
  1169.       draw()
  1170.     end
  1171.     local tmp = it(15, 8, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorpp), "PP")
  1172.     tmp.onInputFinished = function()
  1173.       what.colorpp = tonumber(tmp.text)
  1174.       draw()
  1175.     end
  1176.     local tmp = it(15, 9, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorv), "V")
  1177.     tmp.onInputFinished = function()
  1178.       what.colorv = tonumber(tmp.text)
  1179.       draw()
  1180.     end
  1181.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2, what.width, "W")
  1182.     tmp.onInputFinished = function()
  1183.       what.width = tonumber(tmp.text)
  1184.       draw()
  1185.     end
  1186.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  1187.     tmp.onInputFinished = function()
  1188.       what.x =tmp.text
  1189.       draw()
  1190.     end
  1191.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  1192.     tmp.onInputFinished = function()
  1193.       what.y = tmp.text
  1194.       draw()
  1195.     end
  1196.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  1197.     tmp.onInputFinished = function()
  1198.       what.name = tmp.text
  1199.       drawtree()
  1200.     end
  1201.     local tmp = bn(15,15,6,1,cr1,cr2,cr1,cr2,'Delete')
  1202.     tmp.onTouch = del
  1203.     local tmp = bx(10, 14, 5, 1,cr1, cr2, cr1, cr2)
  1204.     if what.visible == true then
  1205.       tmp:addItem(lc.truee).onTouch = function()
  1206.         what.visible = true
  1207.         draw()
  1208.       end
  1209.       tmp:addItem(lc.falsee).onTouch = function()
  1210.         what.visible = false
  1211.         draw()
  1212.       end
  1213.     else
  1214.       tmp:addItem(lc.falsee).onTouch = function()
  1215.         what.visible = false
  1216.         draw()
  1217.       end
  1218.      tmp:addItem(lc.truee).onTouch = function()
  1219.         what.visible = true
  1220.         draw()
  1221.       end
  1222.     end
  1223.   elseif what.type == 'progressIndicator' then
  1224.     tt(1,2,cr2,lc.type..': '..what.type)
  1225.     tt(1,3,cr2,lc.name)
  1226.     tt(1,4,cr2,'X')
  1227.     tt(1,5,cr2,'Y')
  1228.     tt(1,6,cr2,lc.colorpa)
  1229.     tt(1,7,cr2,lc.colorp)
  1230.     tt(1,8,cr2,lc.colors)
  1231.     tt(1,9,cr2,lc.visible)
  1232.     tt(1,10,cr2,lc.delete)
  1233.     tt(1,11,cr2,lc.up)
  1234.     tt(1,12,cr2,lc.down)
  1235.     local tmp = bn(15,11,6,1,cr1,cr2,cr1,cr2,lc.up)
  1236.     tmp.onTouch = function()
  1237.       for i = 1,#game.screen do
  1238.         if game.screen[i] == what then
  1239.           changePosition(game.screen,i,i-1)
  1240.           draw()
  1241.           drawtree()
  1242.           break
  1243.         end
  1244.       end
  1245.     end
  1246.     local tmp = bn(15,12,6,1,cr1,cr2,cr1,cr2,lc.down)
  1247.     tmp.onTouch  = function()
  1248.       for i = 1,#game.screen do
  1249.         if game.screen[i] == what then
  1250.           changePosition(game.screen,i,i+1)
  1251.           draw()
  1252.           drawtree()
  1253.           break
  1254.         end
  1255.       end
  1256.     end
  1257.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorpa), "PA")
  1258.     tmp.onInputFinished = function()
  1259.       what.colorpa = tonumber(tmp.text)
  1260.       draw()
  1261.     end
  1262.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colorp), "P")
  1263.     tmp.onInputFinished = function()
  1264.       what.colorp = tonumber(tmp.text)
  1265.       draw()
  1266.     end
  1267.     local tmp = it(12, 8, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.colors), "S")
  1268.     tmp.onInputFinished = function()
  1269.       what.colors = tonumber(tmp.text)
  1270.       draw()
  1271.     end
  1272.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  1273.     tmp.onInputFinished = function()
  1274.       what.x = tonumber(tmp.text)
  1275.       draw()
  1276.     end
  1277.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  1278.     tmp.onInputFinished = function()
  1279.       what.y = tonumber(tmp.text)
  1280.       draw()
  1281.     end
  1282.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  1283.     tmp.onInputFinished = function()
  1284.       what.name = tmp.text
  1285.       drawtree()
  1286.     end
  1287.     local tmp = bn(15,10,6,1,cr1,cr2,cr1,cr2,'Delete')
  1288.     tmp.onTouch = del
  1289.     local tmp = bx(15, 9, 5, 1,cr1, cr2, cr1, cr2)
  1290.     if what.visible == true then
  1291.       tmp:addItem(lc.truee).onTouch = function()
  1292.         what.visible = true
  1293.         draw()
  1294.       end
  1295.       tmp:addItem(lc.falsee).onTouch = function()
  1296.         what.visible = false
  1297.         draw()
  1298.       end
  1299.     else
  1300.       tmp:addItem(lc.falsee).onTouch = function()
  1301.         what.visible = false
  1302.         draw()
  1303.       end
  1304.      tmp:addItem(lc.truee).onTouch = function()
  1305.         what.visible = true
  1306.         draw()
  1307.       end
  1308.     end
  1309.   elseif what.type == 'panel' then
  1310.     tt(1,2,cr2,lc.type..': '..what.type)
  1311.     tt(1,3,cr2,lc.name)
  1312.     tt(1,4,cr2,'X')
  1313.     tt(1,5,cr2,'Y')
  1314.     tt(1,6,cr2,lc.width)
  1315.     tt(1,7,cr2,lc.heigth)
  1316.     tt(1,8,cr2,lc.color)
  1317.     tt(1,9,cr2,lc.visible)
  1318.     tt(1,10,cr2,lc.delete)
  1319.     tt(1,11,cr2,lc.up)
  1320.     tt(1,12,cr2,lc.down)
  1321.     local tmp = it(12, 8, 20,1, cr1, cr2, cr3, cr1, cr2,  hts(what.color), "S")
  1322.     tmp.onInputFinished = function()
  1323.       what.color = tonumber(tmp.text)
  1324.       draw()
  1325.     end
  1326.     local tmp = it(15, 6, 20,1, cr1, cr2, cr3, cr1, cr2, what.width, "W")
  1327.     tmp.onInputFinished = function()
  1328.       what.width = tonumber(tmp.text)
  1329.       draw()
  1330.     end
  1331.     local tmp = it(15, 7, 20,1, cr1, cr2, cr3, cr1, cr2, what.heigth, "H")
  1332.     tmp.onInputFinished = function()
  1333.       what.heigth = tonumber(tmp.text)
  1334.       draw()
  1335.     end
  1336.     local tmp = bn(15,11,6,1,cr1,cr2,cr1,cr2,lc.up)
  1337.     tmp.onTouch = function()
  1338.       for i = 1,#game.screen do
  1339.         if game.screen[i] == what then
  1340.           changePosition(game.screen,i,i-1)
  1341.           draw()
  1342.           drawtree()
  1343.           break
  1344.         end
  1345.       end
  1346.     end
  1347.     local tmp = bn(15,12,6,1,cr1,cr2,cr1,cr2,lc.down)
  1348.     tmp.onTouch  = function()
  1349.       for i = 1,#game.screen do
  1350.         if game.screen[i] == what then
  1351.           changePosition(game.screen,i,i+1)
  1352.           draw()
  1353.           drawtree()
  1354.           break
  1355.         end
  1356.       end
  1357.     end
  1358.     local tmp = it(15, 3, 20,1, cr1, cr2, cr3, cr1, cr2, what.name, "N")
  1359.     tmp.onInputFinished = function()
  1360.       what.name = tmp.text
  1361.       drawtree()
  1362.     end
  1363.     local tmp = it(15, 4, 5, 1, cr1, cr2, cr3, cr1, cr2, what.x, "X")
  1364.     tmp.onInputFinished = function()
  1365.       what.x = tonumber(tmp.text)
  1366.       draw()
  1367.     end
  1368.     local tmp = it(15, 5, 5, 1, cr1, cr2, cr3, cr1, cr2, what.y, "Y")
  1369.     tmp.onInputFinished = function()
  1370.       what.y = tonumber(tmp.text)
  1371.       draw()
  1372.     end
  1373.     local tmp = bn(15,10,6,1,cr1,cr2,cr1,cr2,'Delete')
  1374.     tmp.onTouch = del
  1375.     local tmp = bx(15, 9, 5, 1,cr1, cr2, cr1, cr2)
  1376.     if what.visible == true then
  1377.       tmp:addItem(lc.truee).onTouch = function()
  1378.         what.visible = true
  1379.         draw()
  1380.       end
  1381.       tmp:addItem(lc.falsee).onTouch = function()
  1382.         what.visible = false
  1383.         draw()
  1384.       end
  1385.     else
  1386.       tmp:addItem(lc.falsee).onTouch = function()
  1387.         what.visible = false
  1388.         draw()
  1389.       end
  1390.      tmp:addItem(lc.truee).onTouch = function()
  1391.         what.visible = true
  1392.         draw()
  1393.       end
  1394.     end
  1395.   else
  1396.     tt(1,1,cr2,lc.WYC)
  1397.   end
  1398. end
  1399. function objectmenu()
  1400.   choose = win:addChild(GUI.filledWindow(1,2,50,20,cr1))
  1401.   if treemode == 'screen' then
  1402.   local tmp = choose:addChild(GUI.button(6,14,#lc.panel,1,cr1,cr2,cr1,cr2,lc.panel))
  1403.   tmp.onTouch = function()
  1404.     choose:remove()
  1405.     new(game.screen,{visible = true,type = 'panel',x=1,y=1,color=cr1,width = 10,heigth=  10,name = 'Panel'})
  1406.   end
  1407.   local tmp = choose:addChild(GUI.button(6,4,#lc.text,1,cr1,cr2,cr1,cr2,lc.text))
  1408.   tmp.onTouch = function()
  1409.     choose:remove()
  1410.     new(game.screen,{visible = true,type = 'text',x=1,y=1,color=cr2,text='Text',name = 'Text'})
  1411.   end
  1412.   local tmp = choose:addChild(GUI.button(15,10,#lc.progressBar,1,cr1,cr2,cr1,cr2,lc.progressBar))
  1413.   tmp.onTouch = function()
  1414.     choose:remove()
  1415.     new(game.screen,{visible = true,width=20,colorp = cr1,colors=cr2,colorv=cr2,type = 'progressBar',x=1,y=1,color=cr1,value=50,name = 'ProgressBar'})
  1416.   end
  1417.   local tmp = choose:addChild(GUI.button(15,8,#lc.comboBox,1,cr1,cr2,cr1,cr2,lc.comboBox))
  1418.   tmp.onTouch = function()
  1419.     choose:remove()
  1420.     new(game.screen,{visible = true,type = 'comboBox',width=20,x=1,y=1,elh=3,items={{name='item',active = false,type='itemComboBox',path=''}},colorbg=cr1,colort=cr2,colorabg=cr2,colorat=cr2,name = 'ComboBox'})
  1421.   end
  1422.   local tmp = choose:addChild(GUI.button(15,6,#lc.slider,1,cr1,cr2,cr1,cr2,lc.slider))
  1423.   tmp.onTouch = function()
  1424.     choose:remove()
  1425.     new(game.screen,{visible = true,type = 'slider',x=1,y=1,width=20,colorp=cr1,colors=cr2,colorpp=cr1,colorv=cr2,minv=1,maxv=100,value=50,text='Text',name = 'Slider'})
  1426.   end
  1427.   local tmp = choose:addChild(GUI.button(15,4,#lc.progressIndicator,1,cr1,cr2,cr1,cr2,lc.progressIndicator))
  1428.   tmp.onTouch = function()
  1429.     choose:remove()
  1430.     new(game.screen,{visible = true,type = 'progressIndicator',x=1,y=1,active=false,rollStage=1,colorp=cr1,colors=cr2,colorpa=cr3,name = 'pI'})
  1431.   end
  1432.   local tmp = choose:addChild(GUI.button(15,2,#lc.collorSelector,1,cr1,cr2,cr1,cr2,lc.collorSelector))
  1433.   tmp.onTouch = function()
  1434.     choose:remove()
  1435.     new(game.screen,{visible = true,path='',type = 'colorSelector',color=0xFF00FF,x=1,y=1,width=20,height=3,text='Color',name = 'ColorSelector'})
  1436.   end
  1437.   local tmp = choose:addChild(GUI.button(6,10,#lc.input,1,cr1,cr2,cr1,cr2,lc.input))
  1438.   tmp.onTouch = function()
  1439.     choose:remove()
  1440.     new(game.screen,{visible = true,onInputEnded = '',width=20,height=3,colorbg = 0x989898,colorfg = 0x505050,colorfgp = 0x50505050,colorbgp = 0x989898,colorph=0x2D2D2D,type = 'input',x=1,y=1,name = 'Input',text = 'Input',textph = 'Text'})
  1441.   end
  1442.   local tmp = choose:addChild(GUI.button(6,12,#lc.switch,1,cr1,cr2,cr1,cr2,lc.switch))
  1443.   tmp.onTouch = function()
  1444.     choose:remove()
  1445.     new(game.screen,{visible = true,state=false,type = 'switch',x=1,y=1,width=8,colorp=0x505050,colors=0x505050,colorpp=0x989898,name = 'Switch'})
  1446.   end
  1447.   local tmp = choose:addChild(GUI.button(6,8,#lc.image,1,cr1,cr2,cr1,cr2,lc.image))
  1448.   tmp.onTouch = function()
  1449.     choose:remove()
  1450.     new(game.screen,{visible = true, type = 'image',x=1,y=1,image='imageStorage',name = 'image',path = 'Script'})
  1451.   end
  1452.   local tmp = choose:addChild(GUI.button(6,6,#lc.button,1,cr1,cr2,cr1,cr2,lc.button))
  1453.   tmp.onTouch = function()
  1454.     choose:remove()
  1455.     new(game.screen,{visible = true,onTouch = '', height = 5,width = 20, type = 'button',x=1,y=1,name = 'button',colorbg= cr1,colorfg = cr2,colorbgp = cr1,colorfgp=cr2,text='Button'})
  1456.   end
  1457.   elseif treemode == 'script' then
  1458.     local tmp = choose:addChild(GUI.button(6,3,#lc.scripts,1,cr1,cr2,cr1,cr2,lc.scripts))
  1459.     tmp.onTouch = function()
  1460.     choose:remove()
  1461.     fs.write('/Temporary/'..tostring(#game.scripts+1)..'.lua',lc.DFtS)
  1462.     new(game.scripts,{autoload = false,path = '/Temporary/'..tostring(#game.scripts+1)..'.lua',name = 'script',type = 'script'})
  1463.   end
  1464.   elseif treemode == 'storage' then
  1465.     local tmp = choose:addChild(GUI.button(6,3,#lc.imageStorage,1,cr1,cr2,cr1,cr2,lc.imageStorage))
  1466.     tmp.onTouch = function()
  1467.     choose:remove()
  1468.     new(game.storage,{path = '/MineOS/Icons/Script.pic',name = 'imageStorage',type = 'imageStorage'})
  1469.     end
  1470.   end
  1471. end
  1472.  
  1473. function new(where,what)
  1474.   table.insert(where,what)
  1475.   for i = 1,#where do
  1476.     if where[i].name == what.name and where[i].type == what.type and where[i].x == what.x and where[i].y == what.y then
  1477.       drawparams(where[i])
  1478.     end
  1479.   end
  1480.   drawtree()
  1481.   draw()
  1482. end
  1483.  
  1484. function drawtree()
  1485.   obj:removeChildren()
  1486.   obj:addChild(GUI.panel(1,1,36,20,0x989898))
  1487.   local screenmode = obj:addChild(GUI.button(1,1,#lc.screen,1,cr1,cr2,cr1,cr2,lc.screen))
  1488.   screenmode.onTouch = function()
  1489.     treemode = 'screen'
  1490.     drawparams(game.screen[1])
  1491.     drawtree()
  1492.   end
  1493.   local storagemode = obj:addChild(GUI.button(19,1,#lc.storage,1,cr1,cr2,cr1,cr2,lc.storage))
  1494.   storagemode.onTouch = function()
  1495.     treemode = 'storage'
  1496.     drawparams(game.storage[1])
  1497.     drawtree()
  1498.   end
  1499.   local scriptmode = obj:addChild(GUI.button(8,1,#lc.scripts,1,cr1,cr2,cr1,cr2,lc.scripts))
  1500.   scriptmode.onTouch = function()
  1501.     treemode = 'script'
  1502.     drawparams(game.scripts[1])
  1503.     drawtree()
  1504.   end
  1505.   if treemode == 'screen' then
  1506.     local tmp = obj:addChild(GUI.button(1,2,#lc.screen,1,cr1,cr2,cr1,cr2,lc.screen))
  1507.     tmp.onTouch = function()
  1508.        drawparams(game.window)
  1509.     end
  1510.     local addScreen = obj:addChild(GUI.button(#lc.screen,2,1,1,cr1,cr2,cr1,cr2,'+'))
  1511.     addScreen.onTouch = function()
  1512.       objectmenu()
  1513.     end
  1514.     y = 3
  1515.     for i = 1,#game.screen do
  1516.       tmp = obj:addChild(GUI.button(2,y,#game.screen[i].type,1,cr1,cr2,cr1,cr2, game.screen[i].name))
  1517.       tmp.onTouch = function()
  1518.         drawparams(game.screen[i])
  1519.       end
  1520.       y = y + 1
  1521.     end
  1522.   elseif treemode == 'script' then
  1523.    obj:addChild(GUI.text(1,2,0x505050,lc.scripts))
  1524.    local addScreen = obj:addChild(GUI.button(#lc.scripts,2,1,1,cr1,cr2,cr1,cr2,'+'))
  1525.     addScreen.onTouch = function()
  1526.       objectmenu()
  1527.     end
  1528.     y = 3
  1529.     for i = 1,#game.scripts do
  1530.       tmp = obj:addChild(GUI.button(2,y,#game.scripts[i].type,1,cr1,cr2,cr1,cr2, game.scripts[i].name))
  1531.       tmp.onTouch = function()
  1532.         drawparams(game.scripts[i])
  1533.       end
  1534.       y = y + 1
  1535.     end
  1536.   elseif treemode == 'storage' then
  1537.    obj:addChild(GUI.text(1,2,0x505050,lc.storage))
  1538.    local addScreen = obj:addChild(GUI.button(#lc.storage,2,1,1,cr1,cr2,cr1,cr2,'+'))
  1539.     addScreen.onTouch = function()
  1540.       objectmenu()
  1541.     end
  1542.     y = 3
  1543.     for i = 1,#game.storage do
  1544.       tmp = obj:addChild(GUI.button(2,y,#game.storage[i].type,1,cr1,cr2,cr1,cr2, game.storage[i].name))
  1545.       tmp.onTouch = function()
  1546.         drawparams(game.storage[i])
  1547.       end
  1548.       y = y + 1
  1549.     end
  1550.   end
  1551. end
  1552.  
  1553. function draw()
  1554.   screen:removeChildren()
  1555.   gamee = game.screen
  1556.   screen:addChild(GUI.panel(1,1,game.window.width,game.window.heigth,game.window.color))
  1557.   screen:addChild(GUI.text(math.floor(game.window.width/2),1,game.window.titleColor,game.window.title))
  1558.   if game.window.abn == true then
  1559.     screen:addChild(GUI.actionButtons(1,1,false))
  1560.   end
  1561.   for i = 1,#gamee do
  1562.     if gamee[i].visible == true then
  1563.       if gamee[i].type == 'text' then
  1564.         screen:addChild(GUI.text(gamee[i].x,gamee[i].y,gamee[i].color,gamee[i].text))
  1565.       end
  1566.       if gamee[i].type == 'panel' then
  1567.         screen:addChild(GUI.panel(gamee[i].x,gamee[i].y,gamee[i].width,gamee[1].heigth,gamee[i].color))
  1568.       end
  1569.       if gamee[i].type == 'button' then
  1570.         screen:addChild(GUI.button(gamee[i].x,gamee[i].y,gamee[i].width,gamee[i].height,gamee[i].colorbg,gamee[i].colorfg,gamee[i].colorbgp,gamee[i].colorfgp,gamee[i].text))
  1571.       end
  1572.       if gamee[i].type == 'slider' then
  1573.         screen:addChild(GUI.slider(gamee[i].x,gamee[i].y,gamee[i].width,gamee[i].colorp,gamee[i].colors,gamee[i].colorpp,gamee[i].colorv,gamee[i].minv,gamee[i].maxv,gamee[i].value))
  1574.       end
  1575.       if gamee[i].type == 'progressIndicator' then
  1576.         screen:addChild(GUI.progressIndicator(gamee[i].x,gamee[i].y,gamee[i].colorpa,gamee[i].colorp,gamee[i].colors))
  1577.       end
  1578.       if gamee[i].type == 'progressBar' then
  1579.         screen:addChild(GUI.progressBar(gamee[i].x,gamee[i].y,gamee[i].width,gamee[i].colorp,gamee[i].colors,gamee[i].colorv,gamee[i].value))
  1580.       end
  1581.       if gamee[i].type == 'comboBox' then
  1582.         local tmp = screen:addChild(GUI.comboBox(gamee[i].x,gamee[i].y,gamee[i].width,gamee[i].elh,gamee[i].colorbg,gamee[i].colort,gamee[i].colorabg,gamee[i].colorat))
  1583.         for e = 1,#gamee[i].items do
  1584.           tmp:addItem(gamee[i].items[e].name,gamee[i].items[e].active)
  1585.         end
  1586.       end
  1587.       if gamee[i].type == 'colorSelector' then
  1588.         screen:addChild(GUI.colorSelector(gamee[i].x,gamee[i].y,gamee[i].width,gamee[i].height,gamee[i].color,gamee[i].text))
  1589.       end
  1590.       if gamee[i].type == 'input' then
  1591.        screen:addChild(GUI.input(gamee[i].x,gamee[i].y,gamee[i].width,gamee[i].height,gamee[i].colorbg,gamee[i].colorfg,gamee[i].colorph,gamee[i].colorfg,gamee[i].colorfgp,gamee[i].text,gamee[i].textph))
  1592.       end
  1593.       if gamee[i].type == 'switch' then
  1594.         screen:addChild(GUI.switch(gamee[i].x,gamee[i].y,gamee[i].width,gamee[i].colorp,gamee[i].colors,gamee[i].colorpp,gamee[i].state))
  1595.       end
  1596.       if gamee[i].type == 'image' then
  1597.         idk = nil
  1598.         for e = 1,#game.storage do
  1599.           if game.storage[e].type == 'imageStorage' and game.storage[e].name == gamee[i].image then
  1600.             idk = game.storage[e].path
  1601.           end
  1602.         end
  1603.         if idk == nil then idk = '/MineOS/Icons/Script.pic' end
  1604.         screen:addChild(GUI.image(gamee[i].x,gamee[i].y,image.load(idk)))
  1605.       end
  1606.     end
  1607.   end
  1608. end
  1609.  
  1610. local tmp = win:addChild(GUI.filesystemChooser(14, 1, 10, 1, cr1, cr2, cr1, cr2, nil, lc.save, lc.close, lc.name, "/"))
  1611. tmp:setMode(GUI.IO_MODE_SAVE, GUI.IO_MODE_FILE)
  1612. tmp.onSubmit = function(path)
  1613.   if fs.exists(path) then GUI.alert(lc.YNEF) return end
  1614.   if not fs.exists(path..'.proj') then fs.makeDirectory(path..'.proj') end
  1615.   fs.writeTable(path..'.proj/Game.dat',game)
  1616.   for i = 1,#game.storage do
  1617.     fs.copy(game.storage[i].path,path..'.proj/'..game.storage[i].name..'.pic')
  1618.   end
  1619.   for i = 1,#game.scripts do
  1620.     fs.copy(game.scripts[i].path,path..'.proj/'..game.scripts[i].name..'.lua')
  1621.   end
  1622.   draw()
  1623.   drawtree()
  1624. end
  1625. local tmp = win:addChild(GUI.filesystemChooser(28, 1, 10, 1, cr1, cr2, cr1, cr2, nil, lc.open, lc.close, lc.name, "/"))
  1626. tmp:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_DIRECTORY)
  1627. tmp.onSubmit = function(path)
  1628.   if not fs.exists(path..'/Game.dat') then GUI.alert(lc.UFP) end
  1629.   game = fs.readTable(path..'/Game.dat')
  1630.   idk = fs.list(path)
  1631.   for i = 1,#idk do
  1632.     if fs.extension(idk[i]) == '.pic' then
  1633.       for e = 1, #game.storage do
  1634.         if game.storage[e].name == string.gsub(idk[i],'.pic','') then
  1635.           game.storage[e].path = path..idk[i]
  1636.         end
  1637.       end
  1638.     end
  1639.     if fs.extension(idk[i]) == '.lua' then
  1640.       for e = 1, #game.scripts do
  1641.         if game.scripts[e].name == string.gsub(idk[i],'.lua','') then
  1642.           game.scripts[e].path = path..idk[i]
  1643.         end
  1644.       end
  1645.     end
  1646.   end
  1647.   draw()
  1648.   drawtree()
  1649. end
  1650. local filesystemChooser = win:addChild(GUI.filesystemChooser(50, 1, 10, 1, cr1, cr2, cr1, cr2, nil, lc.export, lc.close, lc.name, "/"))
  1651. filesystemChooser:setMode(GUI.IO_MODE_SAVE, GUI.IO_MODE_FILE)
  1652. filesystemChooser.onSubmit = function(path)
  1653.   if fs.exists(path) then GUI.alert(lc.EF) return end
  1654.   fs.makeDirectory(path..'.app')
  1655.   local towrite = ''
  1656.   towrite = towrite .. 'image = require("Image")\nfs = require("filesystem")\nevent = require("event")\nGUI = require("GUI")\n system = require("System")\nrequire("opengames")\nscriptpath = string.gsub(system.getCurrentScript(),"/Main.lua","")\ngame = fs.readTable(scriptpath.."/Game.dat")\nwk,win,menu = system.addWindow(GUI.filledWindow(1,1,game.window.width,game.window.heigth,0x989898))\n'
  1657.   fs.makeDirectory(path..'.app/Scripts')
  1658.   fs.makeDirectory(path..'.app/Assests')
  1659.   for i = 1,#game.storage do
  1660.     fs.copy(game.storage[i].path,path..'.app/Assests/'..game.storage[i].name..'.pic')
  1661.   end
  1662.   for i = 1,#game.scripts do
  1663.     fs.copy(game.scripts[i].path,path..'.app/Scripts/'..game.scripts[i].name..'.lua')
  1664.   end
  1665.   for i = 1, #game.storage do
  1666.     game.storage[i].path = path..'.app/Assests/'..game.storage[i].name..'.pic'
  1667.   end
  1668.   for i = 1, #game.scripts do
  1669.     game.scripts[i].path = path..'.app/Scripts/'..game.scripts[i].name..'.lua'
  1670.   end
  1671.   fs.writeTable(path..'.app/Game.dat',game)
  1672.   towrite = towrite .. 'draw()\n for i = 1,#game.scripts do\n if game.scripts[i].autoload == true then\n system.execute(game.scripts[i].path)\n end\n end\n'
  1673.   fs.write(path..'.app/Main.lua',towrite)
  1674.   idk = nil
  1675.   for e = 1,#game.storage do
  1676.     if game.storage[e].type == 'imageStorage' and game.storage[e].name == 'Icon' then
  1677.       idk = game.storage[e].path
  1678.     end
  1679.   end
  1680.   if idk == nil then idk = '/MineOS/Icons/Script.pic' end
  1681.   fs.copy(idk,path..'.app/Icon.pic')
  1682. end
  1683.  
  1684. draw()
  1685. drawtree()
  1686. drawparams(game.screen[1])
  1687.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement