thenuke321

Untitled

May 31st, 2015
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 50.01 KB | None | 0 0
  1. (function(_ARG_0_, _ARG_1_, _ARG_2_)
  2.   return _UPVALUE0_(_ARG_0_, _ARG_1_, _ARG_2_, false)
  3. end)(createElement("dxRootElement"), "x", 0);
  4. (function(_ARG_0_, _ARG_1_, _ARG_2_)
  5.   return _UPVALUE0_(_ARG_0_, _ARG_1_, _ARG_2_, false)
  6. end)(createElement("dxRootElement"), "y", 0);
  7. (function(_ARG_0_, _ARG_1_, _ARG_2_)
  8.   return _UPVALUE0_(_ARG_0_, _ARG_1_, _ARG_2_, false)
  9. end)(createElement("dxRootElement"), "width", guiGetScreenSize());
  10. (function(_ARG_0_, _ARG_1_, _ARG_2_)
  11.   return _UPVALUE0_(_ARG_0_, _ARG_1_, _ARG_2_, false)
  12. end)(createElement("dxRootElement"), "height", guiGetScreenSize())
  13. function dxGridListSetSelectedItem(_ARG_0_)
  14.   for _FORV_4_, _FORV_5_ in ipairs(getElementChildren(getElementParent(_ARG_0_))) do
  15.     _UPVALUE0_(_FORV_5_, "clicked", nil)
  16.   end
  17.   return _UPVALUE0_(_ARG_0_, "clicked", true)
  18. end
  19. function dxGridListGetSelectedItem(_ARG_0_)
  20.   for _FORV_4_, _FORV_5_ in ipairs(getElementChildren(_ARG_0_)) do
  21.     if getElementData(_FORV_5_, "clicked") then
  22.       return _FORV_5_
  23.     end
  24.   end
  25.   return false
  26. end
  27. function dxGridListGetItemCount(_ARG_0_)
  28.   if not _ARG_0_ then
  29.     return false
  30.   end
  31.   for _FORV_5_, _FORV_6_ in ipairs(getElementChildren(_ARG_0_)) do
  32.   end
  33.   return 0 + 1
  34. end
  35. function dxGridListSetItemColorCoded(_ARG_0_, _ARG_1_)
  36.   if not _ARG_0_ then
  37.     return false
  38.   end
  39.   return _UPVALUE0_(_ARG_0_, "colored", _ARG_1_)
  40. end
  41. function dxGridListRemoveRow(_ARG_0_)
  42.   return destroyElement(_ARG_0_)
  43. end
  44. function dxGridListGetItemText(_ARG_0_)
  45.   return getElementData(_ARG_0_, "text")
  46. end
  47. function dxGridListSetItemText(_ARG_0_, _ARG_1_)
  48.   return _UPVALUE0_(_ARG_0_, "text", _ARG_1_)
  49. end
  50. function dxGridListClear(_ARG_0_)
  51.   for _FORV_4_, _FORV_5_ in ipairs(getElementChlidren(_ARG_0_)) do
  52.     destroyElement(_FORV_5_)
  53.   end
  54.   return true
  55. end
  56. function dxGridListGetItemText(_ARG_0_)
  57.   if not _ARG_0_ then
  58.     return false
  59.   end
  60.   return getElementData(_ARG_0_, "text")
  61. end
  62. function dxGridListSetItemText(_ARG_0_, _ARG_1_)
  63.   if not _ARG_0_ then
  64.     return false
  65.   end
  66.   return _UPVALUE0_(_ARG_0_, "text", _ARG_1_)
  67. end
  68. function dxStaticImageLoadImage(_ARG_0_, _ARG_1_)
  69.   if not _ARG_0_ then
  70.     return false
  71.   end
  72.   return _UPVALUE0_(_ARG_0_, "filepath", _ARG_1_)
  73. end
  74. function dxScrollBarSetScrollPosition(_ARG_0_, _ARG_1_)
  75.   return _UPVALUE0_(_ARG_0_, "scroll", _ARG_1_ / 100)
  76. end
  77. function dxCheckBoxGetSelected(_ARG_0_)
  78.   if not _ARG_0_ then
  79.     return false
  80.   end
  81.   return (getElementData(_ARG_0_, "check"))
  82. end
  83. function dxCheckBoxSetSelected(_ARG_0_, _ARG_1_)
  84.   if not _ARG_0_ then
  85.     return false
  86.   end
  87.   return (_UPVALUE0_(_ARG_0_, "check", _ARG_1_))
  88. end
  89. function dxEditSetMasked(_ARG_0_, _ARG_1_)
  90.   if not _ARG_0_ then
  91.     return false
  92.   end
  93.   return _UPVALUE0_(_ARG_0_, "masked", _ARG_1_)
  94. end
  95. function dxEditSetReadOnly(_ARG_0_, _ARG_1_)
  96.   if not _ARG_0_ then
  97.     return false
  98.   end
  99.   return _UPVALUE0_(_ARG_0_, "readonly", _ARG_1_)
  100. end
  101. function dxScrollBarGetScrollPosition(_ARG_0_)
  102.   return (tonumber(getElementData(_ARG_0_, "scroll") * 100))
  103. end
  104. function dxCreateWindow(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_, _ARG_7_, _ARG_8_, _ARG_9_)
  105.   if _ARG_0_ and _ARG_1_ and _ARG_2_ and _ARG_3_ and _ARG_4_ then
  106.     if _ARG_5_ then
  107.       _ARG_0_ = _ARG_0_ * _UPVALUE0_
  108.       _ARG_1_ = _ARG_1_ * _UPVALUE1_
  109.       _ARG_2_ = _ARG_2_ * _UPVALUE0_
  110.       _ARG_3_ = _ARG_3_ * _UPVALUE1_
  111.     end
  112.     setElementParent(createElement("dxWindow"), _UPVALUE2_)
  113.     _UPVALUE3_(createElement("dxWindow"), "x", _ARG_0_)
  114.     _UPVALUE3_(createElement("dxWindow"), "y", _ARG_1_)
  115.     _UPVALUE3_(createElement("dxWindow"), "width", _ARG_2_)
  116.     _UPVALUE3_(createElement("dxWindow"), "height", _ARG_3_)
  117.     _UPVALUE3_(createElement("dxWindow"), "movable", true)
  118.     _UPVALUE3_(createElement("dxWindow"), "text", _ARG_4_)
  119.     _UPVALUE3_(createElement("dxWindow"), "font", "default")
  120.     _UPVALUE3_(createElement("dxWindow"), "title", tocolor(0, 0, 0, 255))
  121.     _UPVALUE3_(createElement("dxWindow"), "backgroundColor", tocolor(255, 255, 255, 255))
  122.     _UPVALUE3_(createElement("dxWindow"), "u", _ARG_6_)
  123.     _UPVALUE3_(createElement("dxWindow"), "v", _ARG_7_)
  124.     _UPVALUE3_(createElement("dxWindow"), "swidth", _ARG_8_)
  125.     _UPVALUE3_(createElement("dxWindow"), "sheight", _ARG_9_)
  126.     addEventHandlers()
  127.     return (createElement("dxWindow"))
  128.   else
  129.     outputDebugString("ERROR: expected arguments are missing(dxCreateWindow)")
  130.   end
  131. end
  132. function dxWindowSetTitleBackgroundColor(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
  133.   _UPVALUE0_(_ARG_0_, "titleBackgroundColor", tocolor(_ARG_1_, _ARG_2_, _ARG_3_, 255))
  134. end
  135. function dxWindowSetBackgroundColor(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
  136.   _UPVALUE0_(_ARG_0_, "backgroundColor", tocolor(_ARG_1_, _ARG_2_, _ARG_3_, 255))
  137. end
  138. function dxCreateGridList(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_)
  139.   if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ then
  140.     if _ARG_4_ then
  141.       if _ARG_5_ then
  142.         _ARG_0_ = _ARG_0_ * getElementData(_ARG_5_, "x")
  143.         _ARG_1_ = _ARG_1_ * getElementData(_ARG_5_, "y")
  144.       else
  145.         _ARG_0_ = _ARG_0_ * _UPVALUE0_
  146.         _ARG_1_ = _ARG_1_ * _UPVALUE1_
  147.       end
  148.     end
  149.     setElementParent(createElement("dxGridList"), _ARG_5_ or _UPVALUE2_)
  150.     _UPVALUE3_(createElement("dxGridList"), "x", _ARG_0_)
  151.     _UPVALUE3_(createElement("dxGridList"), "y", _ARG_1_)
  152.     _UPVALUE3_(createElement("dxGridList"), "width", _ARG_2_)
  153.     _UPVALUE3_(createElement("dxGridList"), "height", _ARG_3_)
  154.     _UPVALUE3_(createElement("dxGridList"), "filepath", filepath)
  155.     _UPVALUE3_(createElement("dxGridList"), "parent", _ARG_5_)
  156.     _UPVALUE3_(createElement("dxGridList"), "state", "normal")
  157.     return (createElement("dxGridList"))
  158.   else
  159.     outputDebugString("ERROR: expected arguments are missing (dxCreateGridList)")
  160.   end
  161. end
  162. function dxButtonSetBackgroundImage(_ARG_0_, _ARG_1_, _ARG_2_)
  163.   if not _ARG_0_ or not _ARG_1_ or not _ARG_2_ then
  164.     return false
  165.   end
  166.   if _ARG_2_ == "default" then
  167.     _ARG_2_ = "images/button"
  168.     if _ARG_1_ == "normal" then
  169.       _ARG_2_ = _ARG_2_ .. ".png"
  170.     elseif _ARG_1_ == "clicked" then
  171.       _ARG_2_ = _ARG_2_ .. _ARG_1_ .. "clicked.png"
  172.     elseif _ARG_1_ == "hovered" then
  173.       _ARG_2_ = _ARG_2_ .. _ARG_1_ .. "hover.png"
  174.     end
  175.   end
  176.   return _UPVALUE0_(_ARG_0_, _ARG_2_ .. "path", _ARG_2_)
  177. end
  178. function dxCreateProgressBar(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_)
  179.   if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ then
  180.     if _ARG_4_ then
  181.       if _ARG_5_ then
  182.         _ARG_0_ = _ARG_0_ * getElementData(_ARG_5_, "x")
  183.         _ARG_1_ = _ARG_1_ * getElementData(_ARG_5_, "y")
  184.       else
  185.         _ARG_0_ = _ARG_0_ * _UPVALUE0_
  186.         _ARG_1_ = _ARG_1_ * _UPVALUE1_
  187.       end
  188.     end
  189.     setElementParent(createElement("dxProgressBar"), _ARG_5_ or _UPVALUE2_)
  190.     _UPVALUE3_(createElement("dxProgressBar"), "x", _ARG_0_)
  191.     _UPVALUE3_(createElement("dxProgressBar"), "y", _ARG_1_)
  192.     _UPVALUE3_(createElement("dxProgressBar"), "width", _ARG_2_)
  193.     _UPVALUE3_(createElement("dxProgressBar"), "height", _ARG_3_)
  194.     _UPVALUE3_(createElement("dxProgressBar"), "progress", 50)
  195.     _UPVALUE3_(createElement("dxProgressBar"), "parent", _ARG_5_)
  196.     _UPVALUE3_(createElement("dxProgressBar"), "state", "normal")
  197.     return (createElement("dxProgressBar"))
  198.   else
  199.     outputDebugString("ERROR: expected arguments are missing (dxCreateGridList)")
  200.   end
  201. end
  202. function dxCreateScrollBar(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_)
  203.   if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ then
  204.     if _ARG_5_ then
  205.       if _ARG_6_ then
  206.         _ARG_0_ = _ARG_0_ * getElementData(_ARG_6_, "x")
  207.         _ARG_1_ = _ARG_1_ * getElementData(_ARG_6_, "y")
  208.       else
  209.         _ARG_0_ = _ARG_0_ * _UPVALUE0_
  210.         _ARG_1_ = _ARG_1_ * _UPVALUE1_
  211.       end
  212.     end
  213.     setElementParent(createElement("dxScrollBar"), _ARG_6_ or _UPVALUE2_)
  214.     _UPVALUE3_(createElement("dxScrollBar"), "x", _ARG_0_)
  215.     _UPVALUE3_(createElement("dxScrollBar"), "y", _ARG_1_)
  216.     _UPVALUE3_(createElement("dxScrollBar"), "scroll", 0)
  217.     _UPVALUE3_(createElement("dxScrollBar"), "horizontal", _ARG_4_)
  218.     _UPVALUE3_(createElement("dxScrollBar"), "width", _ARG_2_)
  219.     _UPVALUE3_(createElement("dxScrollBar"), "height", _ARG_3_)
  220.     _UPVALUE3_(createElement("dxScrollBar"), "filepath", filepath)
  221.     _UPVALUE3_(createElement("dxScrollBar"), "parent", _ARG_6_)
  222.     _UPVALUE3_(createElement("dxScrollBar"), "state", "normal")
  223.     addEventHandler("onClientDXClick", createElement("dxScrollBar"), function()
  224.       if getElementData(source, "horizontal") then
  225.         if 0 <= getCursorPosition() * _UPVALUE0_ - getElementData(source, "x") - getElementData(getElementParent(source), "x") - getElementData(source, "scroll") * getElementData(source, "width") / 2 and getCursorPosition() * _UPVALUE0_ - getElementData(source, "x") - getElementData(getElementParent(source), "x") - getElementData(source, "scroll") * getElementData(source, "width") / 2 <= getElementData(source, "width") / 2 then
  226.           _UPVALUE2_(source, "attachOffset", getCursorPosition() * _UPVALUE0_ - getElementData(source, "x") - getElementData(getElementParent(source), "x") - getElementData(source, "scroll") * getElementData(source, "width") / 2)
  227.         end
  228.       elseif 0 <= getCursorPosition() * _UPVALUE1_ - getElementData(source, "y") - getElementData(getElementParent(source), "y") - getElementData(source, "scroll") * getElementData(source, "height") / 2 and getCursorPosition() * _UPVALUE1_ - getElementData(source, "y") - getElementData(getElementParent(source), "y") - getElementData(source, "scroll") * getElementData(source, "height") / 2 <= getElementData(source, "height") / 2 then
  229.         _UPVALUE2_(source, "attachOffset", getCursorPosition() * _UPVALUE1_ - getElementData(source, "y") - getElementData(getElementParent(source), "y") - getElementData(source, "scroll") * getElementData(source, "height") / 2)
  230.       end
  231.     end)
  232.     return (createElement("dxScrollBar"))
  233.   else
  234.     outputDebugString("ERROR: expected arguments are missing (dxCreateButton)")
  235.   end
  236. end
  237. function dxCreateStaticImage(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_)
  238.   if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ and _ARG_4_ then
  239.     if _ARG_5_ then
  240.       if _ARG_6_ then
  241.         _ARG_0_ = _ARG_0_ * getElementData(_ARG_6_, "x")
  242.         _ARG_1_ = _ARG_1_ * getElementData(_ARG_6_, "y")
  243.       else
  244.         _ARG_0_ = _ARG_0_ * _UPVALUE0_
  245.         _ARG_1_ = _ARG_1_ * _UPVALUE1_
  246.       end
  247.     end
  248.     setElementParent(createElement("dxStaticImage"), _ARG_6_ or _UPVALUE2_)
  249.     _UPVALUE3_(createElement("dxStaticImage"), "x", _ARG_0_)
  250.     _UPVALUE3_(createElement("dxStaticImage"), "y", _ARG_1_)
  251.     _UPVALUE3_(createElement("dxStaticImage"), "width", _ARG_2_)
  252.     _UPVALUE3_(createElement("dxStaticImage"), "height", _ARG_3_)
  253.     _UPVALUE3_(createElement("dxStaticImage"), "filepath", _ARG_4_)
  254.     _UPVALUE3_(createElement("dxStaticImage"), "parent", _ARG_6_)
  255.     _UPVALUE3_(createElement("dxStaticImage"), "state", "normal")
  256.     return (createElement("dxStaticImage"))
  257.   else
  258.     outputDebugString("ERROR: expected arguments are missing (dxCreateButton)")
  259.   end
  260. end
  261. function dxStaticImageSetStateImage(_ARG_0_, _ARG_1_, _ARG_2_)
  262.   if not _ARG_0_ or not _ARG_1_ or not _ARG_2_ then
  263.     return false
  264.   end
  265.   if _ARG_1_ == "normal" then
  266.     _ARG_1_ = "file"
  267.   end
  268.   return _UPVALUE0_(_ARG_0_, _ARG_1_ .. "path", _ARG_2_)
  269. end
  270. function dxCreateLabel(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_, _ARG_7_, _ARG_8_)
  271.   if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ and _ARG_4_ then
  272.     if _ARG_5_ then
  273.       if _ARG_6_ then
  274.         _ARG_0_ = _ARG_0_ * getElementData(_ARG_6_, "x")
  275.         _ARG_1_ = _ARG_1_ * getElementData(_ARG_6_, "y")
  276.       else
  277.         _ARG_0_ = _ARG_0_ * _UPVALUE0_
  278.         _ARG_1_ = _ARG_1_ * _UPVALUE1_
  279.       end
  280.     end
  281.     setElementParent(createElement("dxLabel"), _ARG_6_ or _UPVALUE2_)
  282.     _UPVALUE3_(createElement("dxLabel"), "font", "default")
  283.     _UPVALUE3_(createElement("dxLabel"), "x", _ARG_0_)
  284.     _UPVALUE3_(createElement("dxLabel"), "y", _ARG_1_)
  285.     _UPVALUE3_(createElement("dxLabel"), "width", _ARG_2_)
  286.     _UPVALUE3_(createElement("dxLabel"), "height", _ARG_3_)
  287.     _UPVALUE3_(createElement("dxLabel"), "text", _ARG_4_)
  288.     _UPVALUE3_(createElement("dxLabel"), "parent", _ARG_6_)
  289.     _UPVALUE3_(createElement("dxLabel"), "state", "normal")
  290.     _UPVALUE3_(createElement("dxLabel"), "colorcoded", _ARG_7_)
  291.     _UPVALUE3_(createElement("dxLabel"), "align", _ARG_8_ or "left")
  292.     return (createElement("dxLabel"))
  293.   else
  294.     outputDebugString("ERROR: expected arguments are missing (dxCreateLabel)")
  295.   end
  296. end
  297. function dxCreateButton(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_, _ARG_7_, _ARG_8_, _ARG_9_)
  298.   if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ and _ARG_4_ then
  299.     if _ARG_5_ then
  300.       if isElement(_ARG_6_) then
  301.         _ARG_0_ = _ARG_0_ * getElementData(_ARG_6_, "x")
  302.         _ARG_1_ = _ARG_1_ * getElementData(_ARG_6_, "y")
  303.       else
  304.         _ARG_0_ = _ARG_0_ * _UPVALUE0_
  305.         _ARG_1_ = _ARG_1_ * _UPVALUE1_
  306.       end
  307.     end
  308.     setElementParent(createElement("dxButton"), isElement(_ARG_6_) and _ARG_6_ or _UPVALUE2_)
  309.     _UPVALUE3_(createElement("dxButton"), "x", _ARG_0_)
  310.     _UPVALUE3_(createElement("dxButton"), "y", _ARG_1_)
  311.     _UPVALUE3_(createElement("dxButton"), "width", _ARG_2_)
  312.     _UPVALUE3_(createElement("dxButton"), "height", _ARG_3_)
  313.     _UPVALUE3_(createElement("dxButton"), "text", _ARG_4_)
  314.     _UPVALUE3_(createElement("dxButton"), "parent", _ARG_6_)
  315.     _UPVALUE3_(createElement("dxButton"), "state", "normal")
  316.     _UPVALUE3_(createElement("dxButton"), "color", _ARG_7_ or tocolor(255, 255, 255, 255))
  317.     _UPVALUE3_(createElement("dxButton"), "normalpath", "images/button.png")
  318.     _UPVALUE3_(createElement("dxButton"), "hoveredpath", "images/buttonhover.png")
  319.     _UPVALUE3_(createElement("dxButton"), "clickedpath", "images/buttonclicked.png")
  320.     _UPVALUE3_(createElement("dxButton"), "drawBackground", _ARG_8_ == nil and true or _ARG_8_)
  321.     _UPVALUE3_(createElement("dxButton"), "textSize", _ARG_9_ or 1)
  322.     return (createElement("dxButton"))
  323.   else
  324.     outputDebugString("ERROR: expected arguments are missing (dxCreateButton)")
  325.   end
  326. end
  327. function dxCreateCheckBox(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_)
  328.   if _ARG_0_ and _ARG_1_ and _ARG_2_ then
  329.     if _ARG_4_ then
  330.       if _ARG_5_ then
  331.         _ARG_0_ = _ARG_0_ * getElementData(_ARG_5_, "x")
  332.         _ARG_1_ = _ARG_1_ * getElementData(_ARG_5_, "y")
  333.       else
  334.         _ARG_0_ = _ARG_0_ * _UPVALUE0_
  335.         _ARG_1_ = _ARG_1_ * _UPVALUE1_
  336.       end
  337.     end
  338.     setElementParent(createElement("dxCheckBox"), _ARG_5_ or _UPVALUE2_)
  339.     _UPVALUE3_(createElement("dxCheckBox"), "x", _ARG_0_)
  340.     _UPVALUE3_(createElement("dxCheckBox"), "y", _ARG_1_)
  341.     _UPVALUE3_(createElement("dxCheckBox"), "width", 20)
  342.     _UPVALUE3_(createElement("dxCheckBox"), "height", 20)
  343.     _UPVALUE3_(createElement("dxCheckBox"), "text", _ARG_2_)
  344.     _UPVALUE3_(createElement("dxCheckBox"), "check", _ARG_3_)
  345.     _UPVALUE3_(createElement("dxCheckBox"), "parent", _ARG_5_)
  346.     _UPVALUE3_(createElement("dxCheckBox"), "state", "normal")
  347.     _UPVALUE3_(createElement("dxCheckBox"), "font", "default")
  348.     addEventHandler("onClientDXClick", createElement("dxCheckBox"), function()
  349.       _UPVALUE0_(source, "check", not getElementData(source, "check"))
  350.     end)
  351.     return (createElement("dxCheckBox"))
  352.   else
  353.     outputDebugString("ERROR: expected arguments are missing (dxCreateButton)")
  354.   end
  355. end
  356. function controls()
  357.   keyTable = {
  358.     "0",
  359.     "1",
  360.     "2",
  361.     "3",
  362.     "4",
  363.     "5",
  364.     "6",
  365.     "7",
  366.     "8",
  367.     "9",
  368.     "a",
  369.     "b",
  370.     "c",
  371.     "d",
  372.     "e",
  373.     "f",
  374.     "g",
  375.     "h",
  376.     "i",
  377.     "j",
  378.     "k",
  379.     "l",
  380.     "m",
  381.     "n",
  382.     "o",
  383.     "p",
  384.     "q",
  385.     "r",
  386.     "s",
  387.     "t",
  388.     "u",
  389.     "v",
  390.     "w",
  391.     "x",
  392.     "y",
  393.     "z",
  394.     "backspace",
  395.     "num_0",
  396.     "num_1",
  397.     "num_2",
  398.     "num_3",
  399.     "num_4",
  400.     "num_5",
  401.     "num_6",
  402.     "num_7",
  403.     "num_8",
  404.     "num_9",
  405.     "num_mul",
  406.     "num_add",
  407.     "num_sub",
  408.     "num_div",
  409.     "num_dec",
  410.     "space",
  411.     "[",
  412.     "]",
  413.     ";",
  414.     ",",
  415.     "-",
  416.     ".",
  417.     "/",
  418.     "#",
  419.     "\\",
  420.     "="
  421.   }
  422.   for _FORV_3_, _FORV_4_ in ipairs(keyTable) do
  423.     if getKeyState(_FORV_4_) then
  424.       if not _UPVALUE0_[_FORV_3_] then
  425.         _UPVALUE0_ = {}
  426.         _UPVALUE0_[_FORV_3_] = true
  427.         if _FORV_4_ == "num_0" then
  428.           return "0"
  429.         elseif _FORV_4_ == "num_1" then
  430.           return "1"
  431.         elseif _FORV_4_ == "num_2" then
  432.           return "2"
  433.         elseif _FORV_4_ == "num_3" then
  434.           return "3"
  435.         elseif _FORV_4_ == "num_4" then
  436.           return "4"
  437.         elseif _FORV_4_ == "num_5" then
  438.           return "5"
  439.         elseif _FORV_4_ == "num_6" then
  440.           return "6"
  441.         elseif _FORV_4_ == "num_7" then
  442.           return "7"
  443.         elseif _FORV_4_ == "num_8" then
  444.           return "8"
  445.         elseif _FORV_4_ == "num_9" then
  446.           return "9"
  447.         elseif _FORV_4_ == "num_add" then
  448.           return "+"
  449.         elseif _FORV_4_ == "num_sub" then
  450.           return "-"
  451.         elseif _FORV_4_ == "num_div" then
  452.           return "/"
  453.         elseif _FORV_4_ == "num_mul" then
  454.           return "*"
  455.         elseif _FORV_4_ == "num_dec" then
  456.           return ","
  457.         elseif _FORV_4_ == "space" then
  458.           return " "
  459.         elseif not getKeyState("lshift") and not getKeyState("rshift") then
  460.           return _FORV_4_
  461.         else
  462.           return string.upper(_FORV_4_)
  463.         end
  464.       else
  465.         return ""
  466.       end
  467.     end
  468.   end
  469.   _UPVALUE0_ = {}
  470.   return ""
  471. end
  472. function dxWindowSetMovable(_ARG_0_, _ARG_1_)
  473.   if not _ARG_0_ then
  474.     return false
  475.   end
  476.   return _UPVALUE0_(_ARG_0_, "movable", _ARG_1_)
  477. end
  478. function movingWindow()
  479.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxWindow")) do
  480.     if getElementData(_FORV_4_, "movable") and elementBeingMoved == _FORV_4_ and isCursorShowing() then
  481.       _UPVALUE2_(_FORV_4_, "x", getCursorPosition() * _UPVALUE0_ - _UPVALUE3_[1])
  482.       _UPVALUE2_(_FORV_4_, "y", getCursorPosition() * _UPVALUE1_ - _UPVALUE3_[2])
  483.     end
  484.   end
  485. end
  486. function drawDXButton(_ARG_0_)
  487.   if getElementData(_ARG_0_, "state") == "normal" then
  488.     if getElementData(_ARG_0_, "drawBackground") then
  489.       if getElementData(_ARG_0_, "normalpath") == "images/button.png" or getElementData(_ARG_0_, "normalpath") == "/images/button.png" then
  490.         dxDrawImageSection(getElementData(_ARG_0_, "x") + (getElementData(getElementParent(_ARG_0_), "x") or 0), getElementData(_ARG_0_, "y") + (getElementData(getElementParent(_ARG_0_), "y") or 0), getElementData(_ARG_0_, "width"), getElementData(_ARG_0_, "height"), 0, 0, 400, 140, getElementData(_ARG_0_, "normalpath"), 0, 0, 0, getElementData(_ARG_0_, "color"))
  491.       else
  492.         dxDrawImage(getElementData(_ARG_0_, "x") + (getElementData(getElementParent(_ARG_0_), "x") or 0), getElementData(_ARG_0_, "y") + (getElementData(getElementParent(_ARG_0_), "y") or 0), getElementData(_ARG_0_, "width"), getElementData(_ARG_0_, "height"), getElementData(_ARG_0_, "normalpath"), 0, 0, 0, getElementData(_ARG_0_, "color"))
  493.       end
  494.     end
  495.   elseif getElementData(_ARG_0_, "state") == "hovered" then
  496.     if getElementData(_ARG_0_, "drawBackground") then
  497.       if getElementData(_ARG_0_, "hoveredpath") == "images/buttonhover.png" or getElementData(_ARG_0_, "hoveredpath") == "/images/buttonhover.png" then
  498.         dxDrawImageSection(getElementData(_ARG_0_, "x") + (getElementData(getElementParent(_ARG_0_), "x") or 0), getElementData(_ARG_0_, "y") + (getElementData(getElementParent(_ARG_0_), "y") or 0), getElementData(_ARG_0_, "width"), getElementData(_ARG_0_, "height"), 0, 0, 400, 140, getElementData(_ARG_0_, "hoveredpath"), 0, 0, 0, getElementData(_ARG_0_, "color"))
  499.       else
  500.         dxDrawImage(getElementData(_ARG_0_, "x") + (getElementData(getElementParent(_ARG_0_), "x") or 0), getElementData(_ARG_0_, "y") + (getElementData(getElementParent(_ARG_0_), "y") or 0), getElementData(_ARG_0_, "width"), getElementData(_ARG_0_, "height"), getElementData(_ARG_0_, "hoveredpath"), 0, 0, 0, getElementData(_ARG_0_, "color"))
  501.       end
  502.     end
  503.   elseif getElementData(_ARG_0_, "state") == "clicked" and getElementData(_ARG_0_, "drawBackground") then
  504.     if getElementData(_ARG_0_, "clickedpath") == "images/buttonclicked.png" or getElementData(_ARG_0_, "clickedpath") == "/images/buttonclicked.png" then
  505.       dxDrawImageSection(getElementData(_ARG_0_, "x") + (getElementData(getElementParent(_ARG_0_), "x") or 0), getElementData(_ARG_0_, "y") + (getElementData(getElementParent(_ARG_0_), "y") or 0), getElementData(_ARG_0_, "width"), getElementData(_ARG_0_, "height"), 0, 0, 400, 140, getElementData(_ARG_0_, "clickedpath"), 0, 0, 0, getElementData(_ARG_0_, "color"))
  506.     else
  507.       dxDrawImage(getElementData(_ARG_0_, "x") + (getElementData(getElementParent(_ARG_0_), "x") or 0), getElementData(_ARG_0_, "y") + (getElementData(getElementParent(_ARG_0_), "y") or 0), getElementData(_ARG_0_, "width"), getElementData(_ARG_0_, "height"), getElementData(_ARG_0_, "clickedpath"), 0, 0, 0, getElementData(_ARG_0_, "color"))
  508.     end
  509.   end
  510.   dxDrawText(getElementData(_ARG_0_, "text"), getElementData(_ARG_0_, "x") + (getElementData(getElementParent(_ARG_0_), "x") or 0), getElementData(_ARG_0_, "y") + (getElementData(getElementParent(_ARG_0_), "y") or 0), getElementData(_ARG_0_, "x") + (getElementData(getElementParent(_ARG_0_), "x") or 0) + getElementData(_ARG_0_, "width"), getElementData(_ARG_0_, "y") + (getElementData(getElementParent(_ARG_0_), "y") or 0) + getElementData(_ARG_0_, "height"), tocolor(255, 255, 255, 255), getElementData(_ARG_0_, "textSize"), "default-bold", "center", "center", true, false, false, true)
  511. end
  512. function drawWindows()
  513.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxWindow")) do
  514.     dxDrawImageSection(getElementData(_FORV_4_, "x"), getElementData(_FORV_4_, "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), getElementData(_FORV_4_, "u") or 0, getElementData(_FORV_4_, "v") or 0, getElementData(_FORV_4_, "swidth") or 640, getElementData(_FORV_4_, "sheight") or 480, "images/window.png")
  515.     dxDrawText(getElementData(_FORV_4_, "text"), getElementData(_FORV_4_, "x"), getElementData(_FORV_4_, "y"), getElementData(_FORV_4_, "x") + getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "y") + 40, tocolor(255, 255, 255, 255), 1.5, "default-bold", "center", "center")
  516.   end
  517. end
  518. function drawCheckboxes()
  519.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxCheckBox")) do
  520.     if getElementData(_FORV_4_, "state") == "normal" then
  521.       if getElementData(_FORV_4_, "check") then
  522.         dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), 20, 20, 0, 0, 20, 20, "images/checkboxcheck.png")
  523.       else
  524.         dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), 20, 20, 0, 0, 20, 20, "images/checkbox.png")
  525.       end
  526.     elseif getElementData(_FORV_4_, "check") then
  527.       dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), 20, 20, 0, 0, 20, 20, "images/checkboxcheck_hover.png")
  528.     else
  529.       dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), 20, 20, 0, 0, 20, 20, "images/checkbox_hover.png")
  530.     end
  531.     dxDrawText(getElementData(_FORV_4_, "text"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 25, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), 0, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + 20, tocolor(255, 255, 255, 255), 1.5 * (15 / dxGetFontHeight(1, getElementData(_FORV_4_, "font"))), getElementData(_FORV_4_, "font"), "left", "center")
  532.   end
  533. end
  534. function drawButtons()
  535.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxButton")) do
  536.     if not getElementData(_FORV_4_, "isHidden") then
  537.       drawDXButton(_FORV_4_)
  538.     end
  539.   end
  540. end
  541. function drawEdits()
  542.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxEdit")) do
  543.     if getElementData(_FORV_4_, "state") == "normal" then
  544.       dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), 0, 0, 300, 50, "images/edit.png")
  545.     else
  546.       dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), 0, 0, 300, 50, "images/edit_hover.png")
  547.     end
  548.     if dxGetTextWidth(string.gsub(getElementData(_FORV_4_, "text"), ".", "*"), getElementData(_FORV_4_, "height") / 15) <= getElementData(_FORV_4_, "width") then
  549.       dxDrawText(string.gsub(getElementData(_FORV_4_, "text"), ".", "*"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 5, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + getElementData(_FORV_4_, "height"), tocolor(0, 0, 0, 255), getElementData(_FORV_4_, "height") / dxGetFontHeight(1, getElementData(_FORV_4_, "font")), getElementData(_FORV_4_, "font"), "left", "center", true)
  550.     else
  551.       dxDrawText(string.gsub(getElementData(_FORV_4_, "text"), ".", "*"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 5, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + getElementData(_FORV_4_, "height"), tocolor(0, 0, 0, 255), getElementData(_FORV_4_, "height") / dxGetFontHeight(1, getElementData(_FORV_4_, "font")), getElementData(_FORV_4_, "font"), "right", "center", true)
  552.     end
  553.   end
  554. end
  555. function drawMemos()
  556.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxMemo")) do
  557.     if getElementData(_FORV_4_, "state") == "normal" then
  558.       dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), 0, 0, 1000, 1000, "images/memo.png")
  559.     else
  560.       dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), 0, 0, 1000, 1000, "images/memo_hover.png")
  561.     end
  562.     dxDrawText(getElementData(_FORV_4_, "text"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 5, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + getElementData(_FORV_4_, "height"), tocolor(0, 0, 0, 255), 1.5 * (15 / dxGetFontHeight(1, getElementData(_FORV_4_, "font"))), getElementData(_FORV_4_, "font"), "left", "top", true, true)
  563.   end
  564. end
  565. function drawStaticImages()
  566.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxStaticImage")) do
  567.     if getElementData(_FORV_4_, "state") == "hovered" and getElementData(_FORV_4_, "hoveredpath") then
  568.       if getElementData(_FORV_4_, "hoveredpath") == "images/closeh.png" or getElementData(_FORV_4_, "hoveredpath") == "/images/closeh.png" then
  569.         dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), 0, 0, 50, 30, (getElementData(_FORV_4_, "hoveredpath")))
  570.       else
  571.         dxDrawImage(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), (getElementData(_FORV_4_, "hoveredpath")))
  572.       end
  573.     elseif getElementData(_FORV_4_, "state") == "clicked" and getElementData(_FORV_4_, "clickedpath") then
  574.       if getElementData(_FORV_4_, "clickedpath") == "images/closeh.png" or getElementData(_FORV_4_, "clickedpath") == "/images/closeh.png" then
  575.         dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), 0, 0, 50, 30, (getElementData(_FORV_4_, "clickedpath")))
  576.       else
  577.         dxDrawImage(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), (getElementData(_FORV_4_, "clickedpath")))
  578.       end
  579.     elseif getElementData(_FORV_4_, "filepath") == "images/closen.png" or getElementData(_FORV_4_, "filepath") == "/images/closen.png" then
  580.       dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), 0, 0, 50, 30, (getElementData(_FORV_4_, "filepath")))
  581.     elseif getElementData(_FORV_4_, "filepath") == "images/clock.png" or getElementData(_FORV_4_, "filepath") == "/images/clock.png" then
  582.       dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), 0, 0, 130, 130, (getElementData(_FORV_4_, "filepath")))
  583.     else
  584.       dxDrawImage(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), (getElementData(_FORV_4_, "filepath")))
  585.     end
  586.   end
  587. end
  588. function drawLabels()
  589.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxLabel")) do
  590.     if not getElementData(_FORV_4_, "isHidden") then
  591.       if not getElementData(_FORV_4_, "colorcoded") then
  592.         dxDrawText(getElementData(_FORV_4_, "text"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 5, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + getElementData(_FORV_4_, "height"), tocolor(255, 255, 255, 255), getElementData(_FORV_4_, "height") / dxGetFontHeight(1, getElementData(_FORV_4_, "font")), getElementData(_FORV_4_, "font"), getElementData(_FORV_4_, "align") or "left", "top", true, false)
  593.       else
  594.         dxDrawText(getElementData(_FORV_4_, "text"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 5, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + getElementData(_FORV_4_, "height"), tocolor(255, 255, 255, 255), getElementData(_FORV_4_, "height") / dxGetFontHeight(1, getElementData(_FORV_4_, "font")), getElementData(_FORV_4_, "font"), getElementData(_FORV_4_, "align") or "left", "top", true, false, false, true)
  595.       end
  596.     end
  597.   end
  598. end
  599. function drawScrollbars()
  600.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxScrollBar")) do
  601.     if not getElementData(_FORV_4_, "horizontal") then
  602.       dxDrawImage(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 5 - 1, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height") + 2, "images/scrollbg.png")
  603.       dxDrawImage(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 5, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + getElementData(_FORV_4_, "height") / 2 * getElementData(_FORV_4_, "scroll"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height") / 2, "images/scrollhandle.png")
  604.     else
  605.       dxDrawImage(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 5, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), "images/scrollbg.png")
  606.       dxDrawImage(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 5 + getElementData(_FORV_4_, "width") / 2 * getElementData(_FORV_4_, "scroll"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width") / 2, getElementData(_FORV_4_, "height"), "images/scrollhandle.png")
  607.     end
  608.   end
  609. end
  610. function drawGridlists()
  611.   for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxGridList")) do
  612.     dxDrawImageSection(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y"), getElementData(_FORV_4_, "width"), getElementData(_FORV_4_, "height"), 0, 0, 1000, 1000, "images/grid.png")
  613.     for _FORV_11_, _FORV_12_ in ipairs(getElementChildren(_FORV_4_)) do
  614.       if _FORV_11_ * 1.5 * 15 - 0 / 2 <= getElementData(_FORV_4_, "height") + 22.5 and 0 <= _FORV_11_ * 1.5 * 15 - 0 / 2 then
  615.         _UPVALUE0_(_FORV_12_, "shown", true)
  616.         if getElementData(_FORV_12_, "state") == "hovered" then
  617.           dxDrawRectangle(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), 3 + getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + math.max((_FORV_11_ - 1) * 1.5 * 15 - 0 / 2, 0), getElementData(_FORV_4_, "width") - 3, getItemShowingHeight(_FORV_12_), tocolor(255, 255, 255, 100))
  618.         end
  619.         if getElementData(_FORV_12_, "state") == "clicked" then
  620.           dxDrawRectangle(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), 3 + getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + math.max((_FORV_11_ - 1) * 1.5 * 15 - 0 / 2, 0), getElementData(_FORV_4_, "width") - 3, getItemShowingHeight(_FORV_12_), tocolor(0, 0, 0, 100))
  621.           for _FORV_17_, _FORV_18_ in ipairs(getElementChildren(getElementParent(_FORV_12_))) do
  622.             _UPVALUE0_(_FORV_18_, "clicked", nil)
  623.           end
  624.           _UPVALUE0_(_FORV_12_, "clicked", true)
  625.         end
  626.         if getElementData(_FORV_12_, "clicked") then
  627.           dxDrawRectangle(getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"), 3 + getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + math.max((_FORV_11_ - 1) * 1.5 * 15 - 0 / 2, 0), getElementData(_FORV_4_, "width") - 3, getItemShowingHeight(_FORV_12_), tocolor(0, 0, 255, 100))
  628.         end
  629.         if getElementData(_FORV_12_, "colored") then
  630.           dxDrawText(getElementData(_FORV_12_, "text"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 3, 3 + getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + math.max((_FORV_11_ - 1) * 1.5 * 15 - 0 / 2, 0), getElementData(_FORV_4_, "width") + getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") - 3, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + math.min(getElementData(_FORV_4_, "height"), _FORV_11_ * 1.5 * 15 - 0 / 2) - 3, tocolor(255, 255, 255, 255), 1.3, "default", "left", getItemAlign(math.max((_FORV_11_ - 1) * 1.5 * 15 - 0 / 2, 0)), true, false, false, true)
  631.         else
  632.           dxDrawText(getElementData(_FORV_12_, "text"), getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") + 3, 3 + getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + math.max((_FORV_11_ - 1) * 1.5 * 15 - 0 / 2, 0), getElementData(_FORV_4_, "width") + getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x") - 3, getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + math.min(getElementData(_FORV_4_, "height"), _FORV_11_ * 1.5 * 15 - 0 / 2) - 3, tocolor(255, 255, 255, 255), 1.3, "default", "left", getItemAlign(math.max((_FORV_11_ - 1) * 1.5 * 15 - 0 / 2, 0)), true, false)
  633.         end
  634.         _UPVALUE0_(_FORV_12_, "width", getElementData(_FORV_4_, "width"))
  635.         _UPVALUE0_(_FORV_12_, "height", 22.5)
  636.         _UPVALUE0_(_FORV_12_, "x", getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"))
  637.         _UPVALUE0_(_FORV_12_, "y", 3 + getElementData(_FORV_4_, "y") + getElementData(getElementParent(_FORV_4_), "y") + math.max((_FORV_11_ - 1) * 1.5 * 15 - 0 / 2, 0))
  638.       else
  639.         _UPVALUE0_(_FORV_12_, "shown", false)
  640.       end
  641.     end
  642.     for _FORV_11_, _FORV_12_ in ipairs(getElementsByType("dxProgressBar")) do
  643.       dxDrawImageSection(getElementData(_FORV_12_, "x") + getElementData(getElementParent(_FORV_12_), "x"), getElementData(_FORV_12_, "y") + getElementData(getElementParent(_FORV_12_), "y"), getElementData(_FORV_12_, "width"), getElementData(_FORV_12_, "height"), 0, 0, 500, 3, "images/progress.png")
  644.       dxDrawRectangle(getElementData(_FORV_12_, "x") + getElementData(getElementParent(_FORV_12_), "x") + 5, getElementData(_FORV_12_, "y") + getElementData(getElementParent(_FORV_12_), "y") + 5, (getElementData(_FORV_12_, "width") - 10) * (getElementData(_FORV_12_, "progress") / 100), getElementData(_FORV_12_, "height") - 10, tocolor(0, 255, 0, 155))
  645.     end
  646.   end
  647. end
  648. function drawingGUI()
  649.   if #getElementsByType("dxWindow") == 0 then
  650.     removeEventHandlers()
  651.     return
  652.   end
  653.   drawWindows()
  654.   drawCheckboxes()
  655.   drawButtons()
  656.   drawEdits()
  657.   drawMemos()
  658.   drawStaticImages()
  659.   drawLabels()
  660.   drawScrollbars()
  661.   drawGridlists()
  662. end
  663. function getItemAlign(_ARG_0_)
  664.   if _ARG_0_ == 0 then
  665.     return "bottom"
  666.   else
  667.     return "top"
  668.   end
  669. end
  670. function getItemShowingHeight(_ARG_0_)
  671.   return math.min(getElementData(getElementParent(_ARG_0_), "height") - (getElementData(_ARG_0_, "y") - dxGetPosition(getElementParent(_ARG_0_))), 22.5)
  672. end
  673. function dxGridListAddRow(_ARG_0_, _ARG_1_)
  674.   if _ARG_0_ and _ARG_1_ then
  675.     setElementParent(createElement("dxGridListItem"), _ARG_0_)
  676.     _UPVALUE0_(createElement("dxGridListItem"), "text", _ARG_1_)
  677.     if #getElementChildren(_ARG_0_) * 15 * 1.5 >= getElementData(_ARG_0_, "height") and not getElementData(_ARG_0_, "scrollbar") then
  678.       _UPVALUE0_(_ARG_0_, "width", getElementData(_ARG_0_, "width") - 20)
  679.       _UPVALUE0_(_ARG_0_, "scrollbar", (dxCreateScrollBar(dxGetPosition(_ARG_0_) - dxGetPosition(getElementParent(_ARG_0_)) + getElementData(_ARG_0_, "width") - 5, dxGetPosition(_ARG_0_) - dxGetPosition(getElementParent(_ARG_0_)), 20, getElementData(_ARG_0_, "height"), false, false, getElementParent(_ARG_0_))))
  680.     end
  681.     return (createElement("dxGridListItem"))
  682.   else
  683.     outputDebugString("ERROR: expected arguments are missing (dxGridListAddRow)")
  684.     return false
  685.   end
  686. end
  687. function dxGetPosition(_ARG_0_, _ARG_1_)
  688.   if not _ARG_0_ or not isElement(_ARG_0_) then
  689.     return false
  690.   end
  691.   if not _ARG_1_ then
  692.     return getElementData(_ARG_0_, "x") + getElementData(getElementParent(_ARG_0_), "x"), getElementData(_ARG_0_, "y") + getElementData(getElementParent(_ARG_0_), "y")
  693.   else
  694.     return getElementData(_ARG_0_, "x") / getElementData(getElementParent(_ARG_0_), "x"), getElementData(_ARG_0_, "y") / getElementData(getElementParent(_ARG_0_), "y")
  695.   end
  696. end
  697. function dxSetPosition(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
  698.   if not _ARG_0_ then
  699.     return false
  700.   end
  701.   if not _ARG_3_ then
  702.     _UPVALUE0_(_ARG_0_, "x", _ARG_1_)
  703.     _UPVALUE0_(_ARG_0_, "y", _ARG_2_)
  704.   else
  705.     _UPVALUE0_(_ARG_0_, "x", _ARG_1_ * getElementData(getElementParent(_ARG_0_), "x"))
  706.     _UPVALUE0_(_ARG_0_, "y", _ARG_2_ * getElementData(getElementParent(_ARG_0_), "y"))
  707.   end
  708. end
  709. function dxSetSize(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
  710.   if not _ARG_0_ then
  711.     return false
  712.   end
  713.   if not _ARG_3_ then
  714.     _UPVALUE0_(_ARG_0_, "width", _ARG_1_)
  715.     return _UPVALUE0_(_ARG_0_, "height", _ARG_2_)
  716.   else
  717.     _UPVALUE0_(_ARG_0_, "height", _ARG_1_ * getElementData(getElementParent(_ARG_0_), "width"))
  718.     return _UPVALUE0_(_ARG_0_, "width", _ARG_2_ * getElementData(getElementParent(_ARG_0_), "height"))
  719.   end
  720. end
  721. function dxGetSize(_ARG_0_, _ARG_1_)
  722.   if not _ARG_0_ then
  723.     return false
  724.   end
  725.   if not _ARG_1_ then
  726.     return getElementData(_ARG_0_, "width"), getElementData(_ARG_0_, "height")
  727.   else
  728.     return getElementData(_ARG_0_, "height") / getElementData(getElementParent(_ARG_0_), "height"), getElementData(_ARG_0_, "width") / getElementData(getElementParent(_ARG_0_), "height")
  729.   end
  730. end
  731. function dxEditSetMaxLength(_ARG_0_, _ARG_1_)
  732.   if not _ARG_0_ then
  733.     return false
  734.   end
  735.   return _UPVALUE0_(_ARG_0_, "maxlength", _ARG_1_)
  736. end
  737. function dxProgressBarSetProgress(_ARG_0_, _ARG_1_)
  738.   if not _ARG_0_ then
  739.     return false
  740.   end
  741.   return _UPVALUE0_(_ARG_0_, "progress", _ARG_1_)
  742. end
  743. function dxProgressBarGetProgress(_ARG_0_)
  744.   if not _ARG_0_ then
  745.     return false
  746.   end
  747.   return getElementData(_ARG_0_, "progress")
  748. end
  749. function dxSetFont(_ARG_0_, _ARG_1_)
  750.   return _UPVALUE0_(_ARG_0_, "font", _ARG_1_)
  751. end
  752. function dxGetFont(_ARG_0_)
  753.   return getElementData(_ARG_0_, "font")
  754. end
  755. function processScrollbars()
  756.   if not attachedScrollBar then
  757.     return
  758.   end
  759.   if not getCursorPosition() or not getCursorPosition() then
  760.     return
  761.   end
  762.   if getElementData(attachedScrollBar, "horizontal") then
  763.     _UPVALUE2_(attachedScrollBar, "scroll", (math.min(1, (math.max(0, (getCursorPosition() * _UPVALUE0_ - (getElementData(getElementParent(attachedScrollBar), "x") + getElementData(attachedScrollBar, "x")) - (getElementData(attachedScrollBar, "attachOffset") or 0)) / (getElementData(attachedScrollBar, "width") / 2))))))
  764.   else
  765.     _UPVALUE2_(attachedScrollBar, "scroll", (math.min(1, (math.max(0, (getCursorPosition() * _UPVALUE1_ - (getElementData(getElementParent(attachedScrollBar), "y") + getElementData(attachedScrollBar, "y")) - (getElementData(attachedScrollBar, "attachOffset") or 0)) / (getElementData(attachedScrollBar, "height") / 2))))))
  766.   end
  767. end
  768. function GUIstates()
  769.   if not isCursorShowing() then
  770.     return
  771.   end
  772.   for _FORV_5_, _FORV_6_ in ipairs(getElementChildren(_UPVALUE2_)) do
  773.     for _FORV_10_, _FORV_11_ in ipairs(getElementChildren(_FORV_6_)) do
  774.       if getElementType(_FORV_11_) == "dxGridList" then
  775.         for _FORV_15_, _FORV_16_ in ipairs(getElementChildren(_FORV_11_)) do
  776.           if getElementType(_FORV_16_) == "dxGridListItem" and getElementData(_FORV_16_, "shown") then
  777.             if getCursorPosition() * _UPVALUE0_ >= getElementData(_FORV_16_, "x") and getCursorPosition() * _UPVALUE0_ <= getElementData(_FORV_16_, "x") + (getElementData(_FORV_16_, "width") or 0) and getCursorPosition() * _UPVALUE1_ >= getElementData(_FORV_16_, "y") and getCursorPosition() * _UPVALUE1_ <= getElementData(_FORV_16_, "y") + (getElementData(_FORV_16_, "height") or 0) then
  778.               if getKeyState("mouse1") then
  779.                 _UPVALUE3_(_FORV_16_, "state", "clicked", sync)
  780.               else
  781.                 _UPVALUE3_(_FORV_16_, "state", "hovered", sync)
  782.               end
  783.             else
  784.               _UPVALUE3_(_FORV_16_, "state", "normal", sync)
  785.             end
  786.           end
  787.         end
  788.       elseif getCursorPosition() * _UPVALUE0_ >= dxGetPosition(_FORV_11_) and getCursorPosition() * _UPVALUE0_ <= dxGetPosition(_FORV_11_) + (getElementData(_FORV_11_, "width") or 0) and getCursorPosition() * _UPVALUE1_ >= dxGetPosition(_FORV_11_) and getCursorPosition() * _UPVALUE1_ <= dxGetPosition(_FORV_11_) + (getElementData(_FORV_11_, "height") or 0) then
  789.         if getKeyState("mouse1") then
  790.           _UPVALUE3_(_FORV_11_, "state", "clicked", sync)
  791.         else
  792.           if getElementData(_FORV_11_, "state") == "normal" then
  793.             triggerEvent("onClientDXMouseEnter", _FORV_11_)
  794.           end
  795.           _UPVALUE3_(_FORV_11_, "state", "hovered", sync)
  796.         end
  797.       else
  798.         if getElementData(_FORV_11_, "state") == "hovered" then
  799.           triggerEvent("onClientDXMouseLeave", _FORV_11_)
  800.         end
  801.         _UPVALUE3_(_FORV_11_, "state", "normal", sync)
  802.       end
  803.     end
  804.   end
  805. end
  806. function movingGUI(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
  807.   attachedScrollBar = nil
  808.   for _FORV_7_, _FORV_8_ in ipairs(getElementsByType("dxEdit")) do
  809.     _UPVALUE0_(_FORV_8_, "input", nil)
  810.   end
  811.   if _ARG_0_ == "left" and _ARG_1_ == "down" then
  812.     for _FORV_7_, _FORV_8_ in ipairs(getElementChildren(_UPVALUE1_)) do
  813.       if _ARG_2_ >= getElementData(_FORV_8_, "x") and _ARG_2_ <= getElementData(_FORV_8_, "x") + (getElementData(_FORV_8_, "width") or 0) and _ARG_3_ >= getElementData(_FORV_8_, "y") and _ARG_3_ <= getElementData(_FORV_8_, "y") + 40 then
  814.         elementBeingMoved = _FORV_8_
  815.         _UPVALUE2_ = {
  816.           _ARG_2_ - getElementData(_FORV_8_, "x"),
  817.           _ARG_3_ - getElementData(_FORV_8_, "y")
  818.         }
  819.       end
  820.     end
  821.     for _FORV_7_, _FORV_8_ in ipairs(getElementsByType("dxScrollBar")) do
  822.       if _ARG_2_ >= dxGetPosition(_FORV_8_) and _ARG_2_ <= dxGetPosition(_FORV_8_) + (getElementData(_FORV_8_, "width") or 0) and _ARG_3_ >= dxGetPosition(_FORV_8_) and _ARG_3_ <= dxGetPosition(_FORV_8_) + (getElementData(_FORV_8_, "height") or 0) and getElementType(_FORV_8_) == "dxScrollBar" then
  823.         triggerEvent("onClientDXClick", _FORV_8_)
  824.         attachedScrollBar = _FORV_8_
  825.       end
  826.     end
  827.   else
  828.     elementBeingMoved = nil
  829.     for _FORV_7_, _FORV_8_ in ipairs(getElementChildren(_UPVALUE1_)) do
  830.       for _FORV_12_, _FORV_13_ in ipairs(getElementChildren(_FORV_8_)) do
  831.         if _FORV_13_ and isElement(_FORV_13_) then
  832.           if _ARG_2_ >= dxGetPosition(_FORV_13_) and _ARG_2_ <= dxGetPosition(_FORV_13_) + (getElementData(_FORV_13_, "width") or 0) and _ARG_3_ >= dxGetPosition(_FORV_13_) and _ARG_3_ <= dxGetPosition(_FORV_13_) + (getElementData(_FORV_13_, "height") or 0) and _ARG_1_ == "up" and _ARG_0_ == "left" then
  833.             triggerEvent("onClientDXClick", _FORV_13_)
  834.           end
  835.         end
  836.       end
  837.     end
  838.   end
  839. end
  840. function dxGetText(_ARG_0_)
  841.   if not _ARG_0_ then
  842.     return false
  843.   end
  844.   return getElementData(_ARG_0_, "text")
  845. end
  846. function dxSetText(_ARG_0_, _ARG_1_)
  847.   if not _ARG_0_ then
  848.     return false
  849.   end
  850.   return _UPVALUE0_(_ARG_0_, "text", _ARG_1_)
  851. end
  852. alerts = {}
  853. function alert(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
  854.   table.insert(alerts, {
  855.     _ARG_0_,
  856.     _ARG_1_,
  857.     _ARG_2_,
  858.     _ARG_3_,
  859.     getTickCount()
  860.   })
  861. end
  862. function drawAlerts()
  863.   if not isElement(getElementsByType("dxWindow")[1]) then
  864.     return false
  865.   end
  866.   for _FORV_7_, _FORV_8_ in ipairs(alerts) do
  867.     if getTickCount() - _FORV_8_[5] < 250 then
  868.     elseif getTickCount() - _FORV_8_[5] > 5000 and getTickCount() - _FORV_8_[5] < 5500 then
  869.     else
  870.     end
  871.     dxDrawRectangle(dxGetPosition(getElementsByType("dxWindow")[1]))
  872.     dxDrawRectangle(dxGetPosition(getElementsByType("dxWindow")[1]))
  873.     dxDrawLine(dxGetPosition(getElementsByType("dxWindow")[1]))
  874.     dxDrawText(_FORV_8_[1], dxGetPosition(getElementsByType("dxWindow")[1]) + 10 + 1, dxGetPosition(getElementsByType("dxWindow")[1]) + 43 + 1, dxGetPosition(getElementsByType("dxWindow")[1]) + getElementData(getElementsByType("dxWindow")[1], "width") - 10 + 1, dxGetPosition(getElementsByType("dxWindow")[1]) + 43 + 0 * 40 - 13 + 1, tocolor(0, 0, 0, 170), 1, "default-bold", "left", "bottom", true, true, true)
  875.     dxDrawText(_FORV_8_[1], dxGetPosition(getElementsByType("dxWindow")[1]) + 10, dxGetPosition(getElementsByType("dxWindow")[1]) + 43, dxGetPosition(getElementsByType("dxWindow")[1]) + getElementData(getElementsByType("dxWindow")[1], "width") - 10, dxGetPosition(getElementsByType("dxWindow")[1]) + 43 + 0 * 40 - 13, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "bottom", true, true, true)
  876.   end
  877.   if alerts[1] and getTickCount() - alerts[1][5] > 5500 then
  878.     table.remove(alerts, 1)
  879.   end
  880. end
  881. function addEventHandlers()
  882.   removeEventHandlers()
  883.   addEventHandler("onClientClick", getRootElement(), movingGUI)
  884.   addEventHandler("onClientPreRender", getRootElement(), movingWindow)
  885.   addEventHandler("onClientRender", root, processScrollbars)
  886.   addEventHandler("onClientRender", getRootElement(), drawingGUI, true, "low-5")
  887.   addEventHandler("onClientRender", getRootElement(), GUIstates)
  888.   addEventHandler("onClientRender", root, drawAlerts, false, "low-10")
  889. end
  890. function removeEventHandlers()
  891.   removeEventHandler("onClientClick", getRootElement(), movingGUI)
  892.   removeEventHandler("onClientPreRender", getRootElement(), movingWindow)
  893.   removeEventHandler("onClientRender", root, processScrollbars)
  894.   removeEventHandler("onClientRender", getRootElement(), drawingGUI)
  895.   removeEventHandler("onClientRender", getRootElement(), GUIstates)
  896.   removeEventHandler("onClientRender", root, drawAlerts)
  897. end
  898. addEvent("onClientDXClick", true)
  899. addEvent("onClientDXMouseEnter", true)
  900. addEvent("onClientDXMouseLeave", true)
Advertisement
Add Comment
Please, Sign In to add comment