Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function(_ARG_0_, _ARG_1_, _ARG_2_)
- return _UPVALUE0_(_ARG_0_, _ARG_1_, _ARG_2_, false)
- end)(createElement("dxRootElement"), "x", 0);
- (function(_ARG_0_, _ARG_1_, _ARG_2_)
- return _UPVALUE0_(_ARG_0_, _ARG_1_, _ARG_2_, false)
- end)(createElement("dxRootElement"), "y", 0);
- (function(_ARG_0_, _ARG_1_, _ARG_2_)
- return _UPVALUE0_(_ARG_0_, _ARG_1_, _ARG_2_, false)
- end)(createElement("dxRootElement"), "width", guiGetScreenSize());
- (function(_ARG_0_, _ARG_1_, _ARG_2_)
- return _UPVALUE0_(_ARG_0_, _ARG_1_, _ARG_2_, false)
- end)(createElement("dxRootElement"), "height", guiGetScreenSize())
- function dxGridListSetSelectedItem(_ARG_0_)
- for _FORV_4_, _FORV_5_ in ipairs(getElementChildren(getElementParent(_ARG_0_))) do
- _UPVALUE0_(_FORV_5_, "clicked", nil)
- end
- return _UPVALUE0_(_ARG_0_, "clicked", true)
- end
- function dxGridListGetSelectedItem(_ARG_0_)
- for _FORV_4_, _FORV_5_ in ipairs(getElementChildren(_ARG_0_)) do
- if getElementData(_FORV_5_, "clicked") then
- return _FORV_5_
- end
- end
- return false
- end
- function dxGridListGetItemCount(_ARG_0_)
- if not _ARG_0_ then
- return false
- end
- for _FORV_5_, _FORV_6_ in ipairs(getElementChildren(_ARG_0_)) do
- end
- return 0 + 1
- end
- function dxGridListSetItemColorCoded(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return _UPVALUE0_(_ARG_0_, "colored", _ARG_1_)
- end
- function dxGridListRemoveRow(_ARG_0_)
- return destroyElement(_ARG_0_)
- end
- function dxGridListGetItemText(_ARG_0_)
- return getElementData(_ARG_0_, "text")
- end
- function dxGridListSetItemText(_ARG_0_, _ARG_1_)
- return _UPVALUE0_(_ARG_0_, "text", _ARG_1_)
- end
- function dxGridListClear(_ARG_0_)
- for _FORV_4_, _FORV_5_ in ipairs(getElementChlidren(_ARG_0_)) do
- destroyElement(_FORV_5_)
- end
- return true
- end
- function dxGridListGetItemText(_ARG_0_)
- if not _ARG_0_ then
- return false
- end
- return getElementData(_ARG_0_, "text")
- end
- function dxGridListSetItemText(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return _UPVALUE0_(_ARG_0_, "text", _ARG_1_)
- end
- function dxStaticImageLoadImage(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return _UPVALUE0_(_ARG_0_, "filepath", _ARG_1_)
- end
- function dxScrollBarSetScrollPosition(_ARG_0_, _ARG_1_)
- return _UPVALUE0_(_ARG_0_, "scroll", _ARG_1_ / 100)
- end
- function dxCheckBoxGetSelected(_ARG_0_)
- if not _ARG_0_ then
- return false
- end
- return (getElementData(_ARG_0_, "check"))
- end
- function dxCheckBoxSetSelected(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return (_UPVALUE0_(_ARG_0_, "check", _ARG_1_))
- end
- function dxEditSetMasked(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return _UPVALUE0_(_ARG_0_, "masked", _ARG_1_)
- end
- function dxEditSetReadOnly(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return _UPVALUE0_(_ARG_0_, "readonly", _ARG_1_)
- end
- function dxScrollBarGetScrollPosition(_ARG_0_)
- return (tonumber(getElementData(_ARG_0_, "scroll") * 100))
- end
- function dxCreateWindow(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_, _ARG_7_, _ARG_8_, _ARG_9_)
- if _ARG_0_ and _ARG_1_ and _ARG_2_ and _ARG_3_ and _ARG_4_ then
- if _ARG_5_ then
- _ARG_0_ = _ARG_0_ * _UPVALUE0_
- _ARG_1_ = _ARG_1_ * _UPVALUE1_
- _ARG_2_ = _ARG_2_ * _UPVALUE0_
- _ARG_3_ = _ARG_3_ * _UPVALUE1_
- end
- setElementParent(createElement("dxWindow"), _UPVALUE2_)
- _UPVALUE3_(createElement("dxWindow"), "x", _ARG_0_)
- _UPVALUE3_(createElement("dxWindow"), "y", _ARG_1_)
- _UPVALUE3_(createElement("dxWindow"), "width", _ARG_2_)
- _UPVALUE3_(createElement("dxWindow"), "height", _ARG_3_)
- _UPVALUE3_(createElement("dxWindow"), "movable", true)
- _UPVALUE3_(createElement("dxWindow"), "text", _ARG_4_)
- _UPVALUE3_(createElement("dxWindow"), "font", "default")
- _UPVALUE3_(createElement("dxWindow"), "title", tocolor(0, 0, 0, 255))
- _UPVALUE3_(createElement("dxWindow"), "backgroundColor", tocolor(255, 255, 255, 255))
- _UPVALUE3_(createElement("dxWindow"), "u", _ARG_6_)
- _UPVALUE3_(createElement("dxWindow"), "v", _ARG_7_)
- _UPVALUE3_(createElement("dxWindow"), "swidth", _ARG_8_)
- _UPVALUE3_(createElement("dxWindow"), "sheight", _ARG_9_)
- addEventHandlers()
- return (createElement("dxWindow"))
- else
- outputDebugString("ERROR: expected arguments are missing(dxCreateWindow)")
- end
- end
- function dxWindowSetTitleBackgroundColor(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- _UPVALUE0_(_ARG_0_, "titleBackgroundColor", tocolor(_ARG_1_, _ARG_2_, _ARG_3_, 255))
- end
- function dxWindowSetBackgroundColor(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- _UPVALUE0_(_ARG_0_, "backgroundColor", tocolor(_ARG_1_, _ARG_2_, _ARG_3_, 255))
- end
- function dxCreateGridList(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_)
- if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ then
- if _ARG_4_ then
- if _ARG_5_ then
- _ARG_0_ = _ARG_0_ * getElementData(_ARG_5_, "x")
- _ARG_1_ = _ARG_1_ * getElementData(_ARG_5_, "y")
- else
- _ARG_0_ = _ARG_0_ * _UPVALUE0_
- _ARG_1_ = _ARG_1_ * _UPVALUE1_
- end
- end
- setElementParent(createElement("dxGridList"), _ARG_5_ or _UPVALUE2_)
- _UPVALUE3_(createElement("dxGridList"), "x", _ARG_0_)
- _UPVALUE3_(createElement("dxGridList"), "y", _ARG_1_)
- _UPVALUE3_(createElement("dxGridList"), "width", _ARG_2_)
- _UPVALUE3_(createElement("dxGridList"), "height", _ARG_3_)
- _UPVALUE3_(createElement("dxGridList"), "filepath", filepath)
- _UPVALUE3_(createElement("dxGridList"), "parent", _ARG_5_)
- _UPVALUE3_(createElement("dxGridList"), "state", "normal")
- return (createElement("dxGridList"))
- else
- outputDebugString("ERROR: expected arguments are missing (dxCreateGridList)")
- end
- end
- function dxButtonSetBackgroundImage(_ARG_0_, _ARG_1_, _ARG_2_)
- if not _ARG_0_ or not _ARG_1_ or not _ARG_2_ then
- return false
- end
- if _ARG_2_ == "default" then
- _ARG_2_ = "images/button"
- if _ARG_1_ == "normal" then
- _ARG_2_ = _ARG_2_ .. ".png"
- elseif _ARG_1_ == "clicked" then
- _ARG_2_ = _ARG_2_ .. _ARG_1_ .. "clicked.png"
- elseif _ARG_1_ == "hovered" then
- _ARG_2_ = _ARG_2_ .. _ARG_1_ .. "hover.png"
- end
- end
- return _UPVALUE0_(_ARG_0_, _ARG_2_ .. "path", _ARG_2_)
- end
- function dxCreateProgressBar(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_)
- if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ then
- if _ARG_4_ then
- if _ARG_5_ then
- _ARG_0_ = _ARG_0_ * getElementData(_ARG_5_, "x")
- _ARG_1_ = _ARG_1_ * getElementData(_ARG_5_, "y")
- else
- _ARG_0_ = _ARG_0_ * _UPVALUE0_
- _ARG_1_ = _ARG_1_ * _UPVALUE1_
- end
- end
- setElementParent(createElement("dxProgressBar"), _ARG_5_ or _UPVALUE2_)
- _UPVALUE3_(createElement("dxProgressBar"), "x", _ARG_0_)
- _UPVALUE3_(createElement("dxProgressBar"), "y", _ARG_1_)
- _UPVALUE3_(createElement("dxProgressBar"), "width", _ARG_2_)
- _UPVALUE3_(createElement("dxProgressBar"), "height", _ARG_3_)
- _UPVALUE3_(createElement("dxProgressBar"), "progress", 50)
- _UPVALUE3_(createElement("dxProgressBar"), "parent", _ARG_5_)
- _UPVALUE3_(createElement("dxProgressBar"), "state", "normal")
- return (createElement("dxProgressBar"))
- else
- outputDebugString("ERROR: expected arguments are missing (dxCreateGridList)")
- end
- end
- function dxCreateScrollBar(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_)
- if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ then
- if _ARG_5_ then
- if _ARG_6_ then
- _ARG_0_ = _ARG_0_ * getElementData(_ARG_6_, "x")
- _ARG_1_ = _ARG_1_ * getElementData(_ARG_6_, "y")
- else
- _ARG_0_ = _ARG_0_ * _UPVALUE0_
- _ARG_1_ = _ARG_1_ * _UPVALUE1_
- end
- end
- setElementParent(createElement("dxScrollBar"), _ARG_6_ or _UPVALUE2_)
- _UPVALUE3_(createElement("dxScrollBar"), "x", _ARG_0_)
- _UPVALUE3_(createElement("dxScrollBar"), "y", _ARG_1_)
- _UPVALUE3_(createElement("dxScrollBar"), "scroll", 0)
- _UPVALUE3_(createElement("dxScrollBar"), "horizontal", _ARG_4_)
- _UPVALUE3_(createElement("dxScrollBar"), "width", _ARG_2_)
- _UPVALUE3_(createElement("dxScrollBar"), "height", _ARG_3_)
- _UPVALUE3_(createElement("dxScrollBar"), "filepath", filepath)
- _UPVALUE3_(createElement("dxScrollBar"), "parent", _ARG_6_)
- _UPVALUE3_(createElement("dxScrollBar"), "state", "normal")
- addEventHandler("onClientDXClick", createElement("dxScrollBar"), function()
- if getElementData(source, "horizontal") then
- 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
- _UPVALUE2_(source, "attachOffset", getCursorPosition() * _UPVALUE0_ - getElementData(source, "x") - getElementData(getElementParent(source), "x") - getElementData(source, "scroll") * getElementData(source, "width") / 2)
- end
- 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
- _UPVALUE2_(source, "attachOffset", getCursorPosition() * _UPVALUE1_ - getElementData(source, "y") - getElementData(getElementParent(source), "y") - getElementData(source, "scroll") * getElementData(source, "height") / 2)
- end
- end)
- return (createElement("dxScrollBar"))
- else
- outputDebugString("ERROR: expected arguments are missing (dxCreateButton)")
- end
- end
- function dxCreateStaticImage(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_)
- if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ and _ARG_4_ then
- if _ARG_5_ then
- if _ARG_6_ then
- _ARG_0_ = _ARG_0_ * getElementData(_ARG_6_, "x")
- _ARG_1_ = _ARG_1_ * getElementData(_ARG_6_, "y")
- else
- _ARG_0_ = _ARG_0_ * _UPVALUE0_
- _ARG_1_ = _ARG_1_ * _UPVALUE1_
- end
- end
- setElementParent(createElement("dxStaticImage"), _ARG_6_ or _UPVALUE2_)
- _UPVALUE3_(createElement("dxStaticImage"), "x", _ARG_0_)
- _UPVALUE3_(createElement("dxStaticImage"), "y", _ARG_1_)
- _UPVALUE3_(createElement("dxStaticImage"), "width", _ARG_2_)
- _UPVALUE3_(createElement("dxStaticImage"), "height", _ARG_3_)
- _UPVALUE3_(createElement("dxStaticImage"), "filepath", _ARG_4_)
- _UPVALUE3_(createElement("dxStaticImage"), "parent", _ARG_6_)
- _UPVALUE3_(createElement("dxStaticImage"), "state", "normal")
- return (createElement("dxStaticImage"))
- else
- outputDebugString("ERROR: expected arguments are missing (dxCreateButton)")
- end
- end
- function dxStaticImageSetStateImage(_ARG_0_, _ARG_1_, _ARG_2_)
- if not _ARG_0_ or not _ARG_1_ or not _ARG_2_ then
- return false
- end
- if _ARG_1_ == "normal" then
- _ARG_1_ = "file"
- end
- return _UPVALUE0_(_ARG_0_, _ARG_1_ .. "path", _ARG_2_)
- end
- function dxCreateLabel(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_, _ARG_7_, _ARG_8_)
- if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ and _ARG_4_ then
- if _ARG_5_ then
- if _ARG_6_ then
- _ARG_0_ = _ARG_0_ * getElementData(_ARG_6_, "x")
- _ARG_1_ = _ARG_1_ * getElementData(_ARG_6_, "y")
- else
- _ARG_0_ = _ARG_0_ * _UPVALUE0_
- _ARG_1_ = _ARG_1_ * _UPVALUE1_
- end
- end
- setElementParent(createElement("dxLabel"), _ARG_6_ or _UPVALUE2_)
- _UPVALUE3_(createElement("dxLabel"), "font", "default")
- _UPVALUE3_(createElement("dxLabel"), "x", _ARG_0_)
- _UPVALUE3_(createElement("dxLabel"), "y", _ARG_1_)
- _UPVALUE3_(createElement("dxLabel"), "width", _ARG_2_)
- _UPVALUE3_(createElement("dxLabel"), "height", _ARG_3_)
- _UPVALUE3_(createElement("dxLabel"), "text", _ARG_4_)
- _UPVALUE3_(createElement("dxLabel"), "parent", _ARG_6_)
- _UPVALUE3_(createElement("dxLabel"), "state", "normal")
- _UPVALUE3_(createElement("dxLabel"), "colorcoded", _ARG_7_)
- _UPVALUE3_(createElement("dxLabel"), "align", _ARG_8_ or "left")
- return (createElement("dxLabel"))
- else
- outputDebugString("ERROR: expected arguments are missing (dxCreateLabel)")
- end
- end
- function dxCreateButton(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_, _ARG_7_, _ARG_8_, _ARG_9_)
- if _ARG_0_ and _ARG_1_ and _ARG_3_ and _ARG_2_ and _ARG_4_ then
- if _ARG_5_ then
- if isElement(_ARG_6_) then
- _ARG_0_ = _ARG_0_ * getElementData(_ARG_6_, "x")
- _ARG_1_ = _ARG_1_ * getElementData(_ARG_6_, "y")
- else
- _ARG_0_ = _ARG_0_ * _UPVALUE0_
- _ARG_1_ = _ARG_1_ * _UPVALUE1_
- end
- end
- setElementParent(createElement("dxButton"), isElement(_ARG_6_) and _ARG_6_ or _UPVALUE2_)
- _UPVALUE3_(createElement("dxButton"), "x", _ARG_0_)
- _UPVALUE3_(createElement("dxButton"), "y", _ARG_1_)
- _UPVALUE3_(createElement("dxButton"), "width", _ARG_2_)
- _UPVALUE3_(createElement("dxButton"), "height", _ARG_3_)
- _UPVALUE3_(createElement("dxButton"), "text", _ARG_4_)
- _UPVALUE3_(createElement("dxButton"), "parent", _ARG_6_)
- _UPVALUE3_(createElement("dxButton"), "state", "normal")
- _UPVALUE3_(createElement("dxButton"), "color", _ARG_7_ or tocolor(255, 255, 255, 255))
- _UPVALUE3_(createElement("dxButton"), "normalpath", "images/button.png")
- _UPVALUE3_(createElement("dxButton"), "hoveredpath", "images/buttonhover.png")
- _UPVALUE3_(createElement("dxButton"), "clickedpath", "images/buttonclicked.png")
- _UPVALUE3_(createElement("dxButton"), "drawBackground", _ARG_8_ == nil and true or _ARG_8_)
- _UPVALUE3_(createElement("dxButton"), "textSize", _ARG_9_ or 1)
- return (createElement("dxButton"))
- else
- outputDebugString("ERROR: expected arguments are missing (dxCreateButton)")
- end
- end
- function dxCreateCheckBox(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_)
- if _ARG_0_ and _ARG_1_ and _ARG_2_ then
- if _ARG_4_ then
- if _ARG_5_ then
- _ARG_0_ = _ARG_0_ * getElementData(_ARG_5_, "x")
- _ARG_1_ = _ARG_1_ * getElementData(_ARG_5_, "y")
- else
- _ARG_0_ = _ARG_0_ * _UPVALUE0_
- _ARG_1_ = _ARG_1_ * _UPVALUE1_
- end
- end
- setElementParent(createElement("dxCheckBox"), _ARG_5_ or _UPVALUE2_)
- _UPVALUE3_(createElement("dxCheckBox"), "x", _ARG_0_)
- _UPVALUE3_(createElement("dxCheckBox"), "y", _ARG_1_)
- _UPVALUE3_(createElement("dxCheckBox"), "width", 20)
- _UPVALUE3_(createElement("dxCheckBox"), "height", 20)
- _UPVALUE3_(createElement("dxCheckBox"), "text", _ARG_2_)
- _UPVALUE3_(createElement("dxCheckBox"), "check", _ARG_3_)
- _UPVALUE3_(createElement("dxCheckBox"), "parent", _ARG_5_)
- _UPVALUE3_(createElement("dxCheckBox"), "state", "normal")
- _UPVALUE3_(createElement("dxCheckBox"), "font", "default")
- addEventHandler("onClientDXClick", createElement("dxCheckBox"), function()
- _UPVALUE0_(source, "check", not getElementData(source, "check"))
- end)
- return (createElement("dxCheckBox"))
- else
- outputDebugString("ERROR: expected arguments are missing (dxCreateButton)")
- end
- end
- function controls()
- keyTable = {
- "0",
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
- "8",
- "9",
- "a",
- "b",
- "c",
- "d",
- "e",
- "f",
- "g",
- "h",
- "i",
- "j",
- "k",
- "l",
- "m",
- "n",
- "o",
- "p",
- "q",
- "r",
- "s",
- "t",
- "u",
- "v",
- "w",
- "x",
- "y",
- "z",
- "backspace",
- "num_0",
- "num_1",
- "num_2",
- "num_3",
- "num_4",
- "num_5",
- "num_6",
- "num_7",
- "num_8",
- "num_9",
- "num_mul",
- "num_add",
- "num_sub",
- "num_div",
- "num_dec",
- "space",
- "[",
- "]",
- ";",
- ",",
- "-",
- ".",
- "/",
- "#",
- "\\",
- "="
- }
- for _FORV_3_, _FORV_4_ in ipairs(keyTable) do
- if getKeyState(_FORV_4_) then
- if not _UPVALUE0_[_FORV_3_] then
- _UPVALUE0_ = {}
- _UPVALUE0_[_FORV_3_] = true
- if _FORV_4_ == "num_0" then
- return "0"
- elseif _FORV_4_ == "num_1" then
- return "1"
- elseif _FORV_4_ == "num_2" then
- return "2"
- elseif _FORV_4_ == "num_3" then
- return "3"
- elseif _FORV_4_ == "num_4" then
- return "4"
- elseif _FORV_4_ == "num_5" then
- return "5"
- elseif _FORV_4_ == "num_6" then
- return "6"
- elseif _FORV_4_ == "num_7" then
- return "7"
- elseif _FORV_4_ == "num_8" then
- return "8"
- elseif _FORV_4_ == "num_9" then
- return "9"
- elseif _FORV_4_ == "num_add" then
- return "+"
- elseif _FORV_4_ == "num_sub" then
- return "-"
- elseif _FORV_4_ == "num_div" then
- return "/"
- elseif _FORV_4_ == "num_mul" then
- return "*"
- elseif _FORV_4_ == "num_dec" then
- return ","
- elseif _FORV_4_ == "space" then
- return " "
- elseif not getKeyState("lshift") and not getKeyState("rshift") then
- return _FORV_4_
- else
- return string.upper(_FORV_4_)
- end
- else
- return ""
- end
- end
- end
- _UPVALUE0_ = {}
- return ""
- end
- function dxWindowSetMovable(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return _UPVALUE0_(_ARG_0_, "movable", _ARG_1_)
- end
- function movingWindow()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxWindow")) do
- if getElementData(_FORV_4_, "movable") and elementBeingMoved == _FORV_4_ and isCursorShowing() then
- _UPVALUE2_(_FORV_4_, "x", getCursorPosition() * _UPVALUE0_ - _UPVALUE3_[1])
- _UPVALUE2_(_FORV_4_, "y", getCursorPosition() * _UPVALUE1_ - _UPVALUE3_[2])
- end
- end
- end
- function drawDXButton(_ARG_0_)
- if getElementData(_ARG_0_, "state") == "normal" then
- if getElementData(_ARG_0_, "drawBackground") then
- if getElementData(_ARG_0_, "normalpath") == "images/button.png" or getElementData(_ARG_0_, "normalpath") == "/images/button.png" then
- 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"))
- else
- 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"))
- end
- end
- elseif getElementData(_ARG_0_, "state") == "hovered" then
- if getElementData(_ARG_0_, "drawBackground") then
- if getElementData(_ARG_0_, "hoveredpath") == "images/buttonhover.png" or getElementData(_ARG_0_, "hoveredpath") == "/images/buttonhover.png" then
- 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"))
- else
- 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"))
- end
- end
- elseif getElementData(_ARG_0_, "state") == "clicked" and getElementData(_ARG_0_, "drawBackground") then
- if getElementData(_ARG_0_, "clickedpath") == "images/buttonclicked.png" or getElementData(_ARG_0_, "clickedpath") == "/images/buttonclicked.png" then
- 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"))
- else
- 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"))
- end
- end
- 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)
- end
- function drawWindows()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxWindow")) do
- 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")
- 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")
- end
- end
- function drawCheckboxes()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxCheckBox")) do
- if getElementData(_FORV_4_, "state") == "normal" then
- if getElementData(_FORV_4_, "check") then
- 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")
- else
- 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")
- end
- elseif getElementData(_FORV_4_, "check") then
- 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")
- else
- 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")
- end
- 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")
- end
- end
- function drawButtons()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxButton")) do
- if not getElementData(_FORV_4_, "isHidden") then
- drawDXButton(_FORV_4_)
- end
- end
- end
- function drawEdits()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxEdit")) do
- if getElementData(_FORV_4_, "state") == "normal" then
- 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")
- else
- 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")
- end
- if dxGetTextWidth(string.gsub(getElementData(_FORV_4_, "text"), ".", "*"), getElementData(_FORV_4_, "height") / 15) <= getElementData(_FORV_4_, "width") then
- 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)
- else
- 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)
- end
- end
- end
- function drawMemos()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxMemo")) do
- if getElementData(_FORV_4_, "state") == "normal" then
- 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")
- else
- 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")
- end
- 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)
- end
- end
- function drawStaticImages()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxStaticImage")) do
- if getElementData(_FORV_4_, "state") == "hovered" and getElementData(_FORV_4_, "hoveredpath") then
- if getElementData(_FORV_4_, "hoveredpath") == "images/closeh.png" or getElementData(_FORV_4_, "hoveredpath") == "/images/closeh.png" then
- 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")))
- else
- 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")))
- end
- elseif getElementData(_FORV_4_, "state") == "clicked" and getElementData(_FORV_4_, "clickedpath") then
- if getElementData(_FORV_4_, "clickedpath") == "images/closeh.png" or getElementData(_FORV_4_, "clickedpath") == "/images/closeh.png" then
- 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")))
- else
- 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")))
- end
- elseif getElementData(_FORV_4_, "filepath") == "images/closen.png" or getElementData(_FORV_4_, "filepath") == "/images/closen.png" then
- 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")))
- elseif getElementData(_FORV_4_, "filepath") == "images/clock.png" or getElementData(_FORV_4_, "filepath") == "/images/clock.png" then
- 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")))
- else
- 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")))
- end
- end
- end
- function drawLabels()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxLabel")) do
- if not getElementData(_FORV_4_, "isHidden") then
- if not getElementData(_FORV_4_, "colorcoded") then
- 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)
- else
- 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)
- end
- end
- end
- end
- function drawScrollbars()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxScrollBar")) do
- if not getElementData(_FORV_4_, "horizontal") then
- 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")
- 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")
- else
- 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")
- 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")
- end
- end
- end
- function drawGridlists()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxGridList")) do
- 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")
- for _FORV_11_, _FORV_12_ in ipairs(getElementChildren(_FORV_4_)) do
- if _FORV_11_ * 1.5 * 15 - 0 / 2 <= getElementData(_FORV_4_, "height") + 22.5 and 0 <= _FORV_11_ * 1.5 * 15 - 0 / 2 then
- _UPVALUE0_(_FORV_12_, "shown", true)
- if getElementData(_FORV_12_, "state") == "hovered" then
- 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))
- end
- if getElementData(_FORV_12_, "state") == "clicked" then
- 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))
- for _FORV_17_, _FORV_18_ in ipairs(getElementChildren(getElementParent(_FORV_12_))) do
- _UPVALUE0_(_FORV_18_, "clicked", nil)
- end
- _UPVALUE0_(_FORV_12_, "clicked", true)
- end
- if getElementData(_FORV_12_, "clicked") then
- 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))
- end
- if getElementData(_FORV_12_, "colored") then
- 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)
- else
- 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)
- end
- _UPVALUE0_(_FORV_12_, "width", getElementData(_FORV_4_, "width"))
- _UPVALUE0_(_FORV_12_, "height", 22.5)
- _UPVALUE0_(_FORV_12_, "x", getElementData(_FORV_4_, "x") + getElementData(getElementParent(_FORV_4_), "x"))
- _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))
- else
- _UPVALUE0_(_FORV_12_, "shown", false)
- end
- end
- for _FORV_11_, _FORV_12_ in ipairs(getElementsByType("dxProgressBar")) do
- 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")
- 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))
- end
- end
- end
- function drawingGUI()
- if #getElementsByType("dxWindow") == 0 then
- removeEventHandlers()
- return
- end
- drawWindows()
- drawCheckboxes()
- drawButtons()
- drawEdits()
- drawMemos()
- drawStaticImages()
- drawLabels()
- drawScrollbars()
- drawGridlists()
- end
- function getItemAlign(_ARG_0_)
- if _ARG_0_ == 0 then
- return "bottom"
- else
- return "top"
- end
- end
- function getItemShowingHeight(_ARG_0_)
- return math.min(getElementData(getElementParent(_ARG_0_), "height") - (getElementData(_ARG_0_, "y") - dxGetPosition(getElementParent(_ARG_0_))), 22.5)
- end
- function dxGridListAddRow(_ARG_0_, _ARG_1_)
- if _ARG_0_ and _ARG_1_ then
- setElementParent(createElement("dxGridListItem"), _ARG_0_)
- _UPVALUE0_(createElement("dxGridListItem"), "text", _ARG_1_)
- if #getElementChildren(_ARG_0_) * 15 * 1.5 >= getElementData(_ARG_0_, "height") and not getElementData(_ARG_0_, "scrollbar") then
- _UPVALUE0_(_ARG_0_, "width", getElementData(_ARG_0_, "width") - 20)
- _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_))))
- end
- return (createElement("dxGridListItem"))
- else
- outputDebugString("ERROR: expected arguments are missing (dxGridListAddRow)")
- return false
- end
- end
- function dxGetPosition(_ARG_0_, _ARG_1_)
- if not _ARG_0_ or not isElement(_ARG_0_) then
- return false
- end
- if not _ARG_1_ then
- return getElementData(_ARG_0_, "x") + getElementData(getElementParent(_ARG_0_), "x"), getElementData(_ARG_0_, "y") + getElementData(getElementParent(_ARG_0_), "y")
- else
- return getElementData(_ARG_0_, "x") / getElementData(getElementParent(_ARG_0_), "x"), getElementData(_ARG_0_, "y") / getElementData(getElementParent(_ARG_0_), "y")
- end
- end
- function dxSetPosition(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- if not _ARG_0_ then
- return false
- end
- if not _ARG_3_ then
- _UPVALUE0_(_ARG_0_, "x", _ARG_1_)
- _UPVALUE0_(_ARG_0_, "y", _ARG_2_)
- else
- _UPVALUE0_(_ARG_0_, "x", _ARG_1_ * getElementData(getElementParent(_ARG_0_), "x"))
- _UPVALUE0_(_ARG_0_, "y", _ARG_2_ * getElementData(getElementParent(_ARG_0_), "y"))
- end
- end
- function dxSetSize(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- if not _ARG_0_ then
- return false
- end
- if not _ARG_3_ then
- _UPVALUE0_(_ARG_0_, "width", _ARG_1_)
- return _UPVALUE0_(_ARG_0_, "height", _ARG_2_)
- else
- _UPVALUE0_(_ARG_0_, "height", _ARG_1_ * getElementData(getElementParent(_ARG_0_), "width"))
- return _UPVALUE0_(_ARG_0_, "width", _ARG_2_ * getElementData(getElementParent(_ARG_0_), "height"))
- end
- end
- function dxGetSize(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- if not _ARG_1_ then
- return getElementData(_ARG_0_, "width"), getElementData(_ARG_0_, "height")
- else
- return getElementData(_ARG_0_, "height") / getElementData(getElementParent(_ARG_0_), "height"), getElementData(_ARG_0_, "width") / getElementData(getElementParent(_ARG_0_), "height")
- end
- end
- function dxEditSetMaxLength(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return _UPVALUE0_(_ARG_0_, "maxlength", _ARG_1_)
- end
- function dxProgressBarSetProgress(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return _UPVALUE0_(_ARG_0_, "progress", _ARG_1_)
- end
- function dxProgressBarGetProgress(_ARG_0_)
- if not _ARG_0_ then
- return false
- end
- return getElementData(_ARG_0_, "progress")
- end
- function dxSetFont(_ARG_0_, _ARG_1_)
- return _UPVALUE0_(_ARG_0_, "font", _ARG_1_)
- end
- function dxGetFont(_ARG_0_)
- return getElementData(_ARG_0_, "font")
- end
- function processScrollbars()
- if not attachedScrollBar then
- return
- end
- if not getCursorPosition() or not getCursorPosition() then
- return
- end
- if getElementData(attachedScrollBar, "horizontal") then
- _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))))))
- else
- _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))))))
- end
- end
- function GUIstates()
- if not isCursorShowing() then
- return
- end
- for _FORV_5_, _FORV_6_ in ipairs(getElementChildren(_UPVALUE2_)) do
- for _FORV_10_, _FORV_11_ in ipairs(getElementChildren(_FORV_6_)) do
- if getElementType(_FORV_11_) == "dxGridList" then
- for _FORV_15_, _FORV_16_ in ipairs(getElementChildren(_FORV_11_)) do
- if getElementType(_FORV_16_) == "dxGridListItem" and getElementData(_FORV_16_, "shown") then
- 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
- if getKeyState("mouse1") then
- _UPVALUE3_(_FORV_16_, "state", "clicked", sync)
- else
- _UPVALUE3_(_FORV_16_, "state", "hovered", sync)
- end
- else
- _UPVALUE3_(_FORV_16_, "state", "normal", sync)
- end
- end
- end
- 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
- if getKeyState("mouse1") then
- _UPVALUE3_(_FORV_11_, "state", "clicked", sync)
- else
- if getElementData(_FORV_11_, "state") == "normal" then
- triggerEvent("onClientDXMouseEnter", _FORV_11_)
- end
- _UPVALUE3_(_FORV_11_, "state", "hovered", sync)
- end
- else
- if getElementData(_FORV_11_, "state") == "hovered" then
- triggerEvent("onClientDXMouseLeave", _FORV_11_)
- end
- _UPVALUE3_(_FORV_11_, "state", "normal", sync)
- end
- end
- end
- end
- function movingGUI(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- attachedScrollBar = nil
- for _FORV_7_, _FORV_8_ in ipairs(getElementsByType("dxEdit")) do
- _UPVALUE0_(_FORV_8_, "input", nil)
- end
- if _ARG_0_ == "left" and _ARG_1_ == "down" then
- for _FORV_7_, _FORV_8_ in ipairs(getElementChildren(_UPVALUE1_)) do
- 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
- elementBeingMoved = _FORV_8_
- _UPVALUE2_ = {
- _ARG_2_ - getElementData(_FORV_8_, "x"),
- _ARG_3_ - getElementData(_FORV_8_, "y")
- }
- end
- end
- for _FORV_7_, _FORV_8_ in ipairs(getElementsByType("dxScrollBar")) do
- 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
- triggerEvent("onClientDXClick", _FORV_8_)
- attachedScrollBar = _FORV_8_
- end
- end
- else
- elementBeingMoved = nil
- for _FORV_7_, _FORV_8_ in ipairs(getElementChildren(_UPVALUE1_)) do
- for _FORV_12_, _FORV_13_ in ipairs(getElementChildren(_FORV_8_)) do
- if _FORV_13_ and isElement(_FORV_13_) then
- 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
- triggerEvent("onClientDXClick", _FORV_13_)
- end
- end
- end
- end
- end
- end
- function dxGetText(_ARG_0_)
- if not _ARG_0_ then
- return false
- end
- return getElementData(_ARG_0_, "text")
- end
- function dxSetText(_ARG_0_, _ARG_1_)
- if not _ARG_0_ then
- return false
- end
- return _UPVALUE0_(_ARG_0_, "text", _ARG_1_)
- end
- alerts = {}
- function alert(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- table.insert(alerts, {
- _ARG_0_,
- _ARG_1_,
- _ARG_2_,
- _ARG_3_,
- getTickCount()
- })
- end
- function drawAlerts()
- if not isElement(getElementsByType("dxWindow")[1]) then
- return false
- end
- for _FORV_7_, _FORV_8_ in ipairs(alerts) do
- if getTickCount() - _FORV_8_[5] < 250 then
- elseif getTickCount() - _FORV_8_[5] > 5000 and getTickCount() - _FORV_8_[5] < 5500 then
- else
- end
- dxDrawRectangle(dxGetPosition(getElementsByType("dxWindow")[1]))
- dxDrawRectangle(dxGetPosition(getElementsByType("dxWindow")[1]))
- dxDrawLine(dxGetPosition(getElementsByType("dxWindow")[1]))
- 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)
- 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)
- end
- if alerts[1] and getTickCount() - alerts[1][5] > 5500 then
- table.remove(alerts, 1)
- end
- end
- function addEventHandlers()
- removeEventHandlers()
- addEventHandler("onClientClick", getRootElement(), movingGUI)
- addEventHandler("onClientPreRender", getRootElement(), movingWindow)
- addEventHandler("onClientRender", root, processScrollbars)
- addEventHandler("onClientRender", getRootElement(), drawingGUI, true, "low-5")
- addEventHandler("onClientRender", getRootElement(), GUIstates)
- addEventHandler("onClientRender", root, drawAlerts, false, "low-10")
- end
- function removeEventHandlers()
- removeEventHandler("onClientClick", getRootElement(), movingGUI)
- removeEventHandler("onClientPreRender", getRootElement(), movingWindow)
- removeEventHandler("onClientRender", root, processScrollbars)
- removeEventHandler("onClientRender", getRootElement(), drawingGUI)
- removeEventHandler("onClientRender", getRootElement(), GUIstates)
- removeEventHandler("onClientRender", root, drawAlerts)
- end
- addEvent("onClientDXClick", true)
- addEvent("onClientDXMouseEnter", true)
- addEvent("onClientDXMouseLeave", true)
- function getSidebarSetting(_ARG_0_)
- return Settings[_ARG_0_]
- end
- function setSidebarSetting(_ARG_0_, _ARG_1_)
- Settings[_ARG_0_] = _ARG_1_
- if isTimer(saveSettingsTimer) then
- killTimer(saveSettingsTimer)
- end
- saveSettingsTimer = setTimer(saveSettings, 2000, 1, true)
- end
- addEventHandler("onClientChatMessage", root, function(_ARG_0_)
- if string.gsub(_ARG_0_, " ", "") == "" then
- cancelEvent()
- end
- end)
- sidebar = {}
- sidebar.r = 5
- sidebar.g = 5
- sidebar.b = 5
- sidebar.a = 250
- sidebar.tr = 255
- sidebar.tg = 255
- sidebar.tb = 255
- theBoundSidebarKey = "u"
- sidebar.weekday = {
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday"
- }
- sidebar.month = {
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December"
- }
- sidebar.appbgr = {
- [0] = 0
- }
- sx, sy = guiGetScreenSize()
- white = tocolor(255, 255, 255, 255)
- sidebar.width = 160
- sidebar.app = {
- "Maps",
- "Store",
- "Music",
- "Stats",
- "9GAG",
- "Screenshots",
- "Clan Manager",
- "Settings"
- }
- sidebar.commands = {
- "maps",
- "store",
- "music",
- "stats",
- "9gag",
- "screenshots",
- "clan",
- "settings"
- }
- for _FORV_4_, _FORV_5_ in ipairs(sidebar.app) do
- sidebar.appbgr[_FORV_4_] = 0
- end
- sidebar.hover = {}
- sidebar.hover[8] = function(_ARG_0_)
- return _ARG_0_ * 10
- end
- if sy < 10 + 3 * 15 + 1 * 15 + 10 + #sidebar.app * (64 + 15) + 100 then
- sidebar.width = 120
- end
- function drawSidebar()
- if sidebar.state ~= 0 then
- showCursor(true)
- end
- checkStates()
- dxDrawRectangle(sx - sidebar.pos, 0, sidebar.pos, sy, tocolor(sidebar.r, sidebar.g, sidebar.b, sidebar.a), true)
- dxDrawLine(sx - sidebar.pos, 0, sx - sidebar.pos, sy, tocolor(100, 100, 100, 100), 1, true)
- dxDrawText(string.format("%02d:%02d", getRealTime().hour, getRealTime().minute), sx - sidebar.pos, _UPVALUE0_, sx - sidebar.pos + sidebar.width, _UPVALUE0_ + _UPVALUE1_ * 15, white, _UPVALUE1_, "default-bold", "center", "top", false, false, true)
- dxDrawText(sidebar.weekday[getRealTime().weekday + 1] .. ", " .. sidebar.month[getRealTime().month + 1] .. " " .. getRealTime().monthday, sx - sidebar.pos, _UPVALUE0_ + _UPVALUE1_ * 15, sx - sidebar.pos + sidebar.width, _UPVALUE0_ + _UPVALUE1_ * 15 + _UPVALUE2_ * 15, white, _UPVALUE2_, "default-bold", "center", "top", false, false, true)
- if getCursorPosition() and getCursorPosition() * sx and (getCursorPosition() and getCursorPosition() * sx) >= sx - sidebar.pos and 0 <= getCursorPosition() * sy and getCursorPosition() * sy < _UPVALUE3_ then
- if getKeyState("mouse1") then
- sidebar.appbgr[0] = 1.4
- else
- sidebar.appbgr[0] = math.min(1, sidebar.appbgr[0] + 0.1)
- end
- else
- sidebar.appbgr[0] = math.max(0, sidebar.appbgr[0] - 0.1)
- end
- dxDrawRectangle(sx - sidebar.pos, 0, sidebar.width, _UPVALUE3_, tocolor(255, 255, 255, sidebar.appbgr[0] * 20), true)
- if 0 < sidebar.appbgr[0] then
- dxDrawRectangle(sx - sidebar.pos - sidebar.width, 0, sidebar.width, _UPVALUE3_, tocolor(sidebar.r, sidebar.g, sidebar.b, sidebar.appbgr[0] * sidebar.a * 0.9), true)
- dxDrawText(string.format("%02d:%02d", getRealTime(getRealTime().timestamp + serverTimestampDifference).hour, getRealTime(getRealTime().timestamp + serverTimestampDifference).minute), sx - sidebar.pos - sidebar.width, _UPVALUE0_, sx - sidebar.pos, _UPVALUE3_, tocolor(255, 255, 255, sidebar.appbgr[0] * 255), _UPVALUE1_, "default-bold", "center", "top", false, false, true)
- dxDrawText("Server Time", sx - sidebar.pos - sidebar.width, _UPVALUE0_ + _UPVALUE1_ * 15, sx - sidebar.pos, _UPVALUE0_ + _UPVALUE1_ * 15 + _UPVALUE2_ * 15, tocolor(255, 255, 255, sidebar.appbgr[0] * 255), _UPVALUE2_, "default-bold", "center", "top", false, false, true)
- end
- for _FORV_9_, _FORV_10_ in ipairs(sidebar.app) do
- if getCursorPosition() and getCursorPosition() * sx and (getCursorPosition() and getCursorPosition() * sx) >= sx - sidebar.pos and getCursorPosition() * sy >= _UPVALUE3_ + (_FORV_9_ - 1) * _UPVALUE4_ and getCursorPosition() * sy < _UPVALUE3_ + _FORV_9_ * _UPVALUE4_ then
- if getKeyState("mouse1") then
- sidebar.appbgr[_FORV_9_] = 1.4
- else
- sidebar.appbgr[_FORV_9_] = math.min(1, sidebar.appbgr[_FORV_9_] + 0.1)
- _UPVALUE5_[_FORV_9_] = (_UPVALUE5_[_FORV_9_] or 0) + 0.1
- end
- else
- sidebar.appbgr[_FORV_9_] = math.max(0, sidebar.appbgr[_FORV_9_] - 0.1)
- _UPVALUE5_[_FORV_9_] = 0
- end
- dxDrawRectangle(sx - sidebar.pos, _UPVALUE3_ + (_FORV_9_ - 1) * _UPVALUE4_, sidebar.width, _UPVALUE4_, tocolor(255, 255, 255, sidebar.appbgr[_FORV_9_] * 20), true)
- dxDrawImage(sx - sidebar.pos + _UPVALUE6_, _UPVALUE3_ + (_FORV_9_ - 1) * _UPVALUE4_ + _UPVALUE7_, _UPVALUE8_, _UPVALUE8_, "images/icons/" .. sidebar.commands[_FORV_9_] .. ".png", sidebar.hover[_FORV_9_] and sidebar.hover[_FORV_9_](_UPVALUE5_[_FORV_9_]) or math.sin(_UPVALUE5_[_FORV_9_] * 1.5) * 10, 0, 0, white, true)
- dxDrawText(_FORV_10_, sx - sidebar.pos, _UPVALUE3_ + (_FORV_9_ - 1) * _UPVALUE4_ + _UPVALUE7_ + _UPVALUE8_ + 5, sx - sidebar.pos + sidebar.width, _UPVALUE3_ + _FORV_9_ * _UPVALUE4_, white, _UPVALUE2_, "default-bold", "center", "top", false, false, true)
- end
- end
- function setServerTimestampDifference(_ARG_0_)
- serverTimestampDifference = _ARG_0_
- end
- function getServerTimestampDifference()
- return serverTimestampDifference
- end
- addEvent("receiveServerTimestampDifference", true)
- addEventHandler("receiveServerTimestampDifference", localPlayer, setServerTimestampDifference)
- triggerServerEvent("getServerTimestampDifference", localPlayer, getRealTime().timestamp)
- function openSidebar()
- if not getElementData(localPlayer, "isLobbyOpened") then
- unbindKey(theBoundSidebarKey, "down")
- showCursor(true)
- addEventHandler("onClientRender", root, drawSidebar, true, "low-9")
- sidebar.pos = 0
- sidebar.state = 1
- addEventHandler("onClientClick", root, sidebarClick)
- end
- end
- function closeSidebar()
- for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("dxWindow")) do
- if getElementData(_FORV_4_, "text") ~= title then
- closeFFSWindow(_FORV_4_)
- end
- end
- sidebar.state = 0
- showCursor(false)
- removeEventHandler("onClientClick", root, sidebarClick)
- end
- function main()
- bindKey(theBoundSidebarKey, "down", openSidebar)
- end
- function checkStates()
- if sidebar.state == 1 then
- sidebar.pos = math.min(sidebar.pos + 10, sidebar.width)
- if sidebar.pos == sidebar.width then
- sidebar.state = 2
- bindKey(theBoundSidebarKey, "down", closeSidebar)
- end
- elseif sidebar.state == 0 then
- sidebar.pos = math.max(sidebar.pos - 10, 0)
- if sidebar.pos == 0 then
- bindKey(theBoundSidebarKey, "down", openSidebar)
- removeEventHandler("onClientRender", root, drawSidebar)
- end
- end
- end
- function cursorChecks()
- if isCursorShowing() then
- for _FORV_5_ = 1, 4 do
- sidebar.iconSize[_FORV_5_] = math.max(sidebar.iconSize[_FORV_5_] - 0.2, 0)
- end
- if getCursorPosition() * sx >= sx - 0.95 * sidebar.pos then
- if getCursorPosition() * sy <= sidebar.pos then
- sidebar.iconSize[1] = math.min(sidebar.iconSize[1] + 0.3, 1)
- elseif getCursorPosition() * sy <= 2 * sidebar.pos then
- sidebar.iconSize[2] = math.min(sidebar.iconSize[2] + 0.3, 1)
- elseif getCursorPosition() * sy <= 3 * sidebar.pos then
- sidebar.iconSize[3] = math.min(sidebar.iconSize[3] + 0.3, 1)
- elseif getCursorPosition() * sy >= sy - sidebar.pos then
- sidebar.iconSize[4] = math.min(sidebar.iconSize[4] + 0.3, 1)
- end
- end
- end
- end
- function apps()
- sidebar.appmenu = 0
- drawAppMenu = true
- end
- function sidebarClick(_ARG_0_, _ARG_1_)
- if _ARG_0_ ~= "left" or _ARG_1_ ~= "up" then
- return
- end
- if getCursorPosition() and getCursorPosition() * sx and (getCursorPosition() and getCursorPosition() * sx) >= sx - sidebar.pos then
- for _FORV_8_, _FORV_9_ in ipairs(sidebar.app) do
- if getCursorPosition() * sy >= _UPVALUE0_ + (_FORV_8_ - 1) * _UPVALUE1_ and getCursorPosition() * sy < _UPVALUE0_ + _FORV_8_ * _UPVALUE1_ then
- return executeCommandHandler(sidebar.commands[_FORV_8_])
- end
- end
- end
- end
- addEvent("receiveData", true)
- addEventHandler("receiveData", getLocalPlayer(), function(_ARG_0_, _ARG_1_)
- if _ARG_0_ == "News" then
- News_cache = _ARG_1_
- elseif _ARG_0_ == "Maps" then
- cacheMaps(_ARG_1_)
- elseif _ARG_0_ == "mInfo" then
- getMapInfo(_ARG_1_)
- elseif _ARG_0_ == "Music" then
- receiveMusicList(_ARG_1_)
- elseif _ARG_0_ == "Toptimes" then
- getTopHunterReachers(_ARG_1_)
- elseif _ARG_0_ == "Stats" then
- leaderBoards = _ARG_1_
- elseif _ARG_0_ == "likedMaps" then
- likedMaps = _ARG_1_
- elseif _ARG_0_ == "Cathegories" then
- mapCat = _ARG_1_
- elseif _ARG_0_ == "gagsList" then
- images = _ARG_1_
- elseif _ARG_0_ == "gag" then
- if fileExists("cache/" .. _ARG_1_[1]) then
- return
- end
- if fileCreate("cache/" .. _ARG_1_[1]) then
- for _FORV_6_, _FORV_7_ in ipairs(_ARG_1_[2]) do
- fileWrite(fileCreate("cache/" .. _ARG_1_[1]), _FORV_7_)
- end
- fileClose((fileCreate("cache/" .. _ARG_1_[1])))
- end
- elseif _ARG_0_ == "Tuning" then
- Tuning = _ARG_1_
- onTuningDataReceived()
- end
- end)
- function drawSidebarNote()
- timeDif = getTickCount() - _UPVALUE0_
- if timeDif <= 500 then
- elseif timeDif >= 500 and timeDif <= 5000 then
- elseif timeDif <= 5500 then
- else
- removeEventHandler("onClientRender", root, drawSidebarNote)
- return
- end
- dxDrawRectangle(sx / 2 - 200, sy - (5500 - timeDif) / 500 * 100, 400, 100, _UPVALUE1_[3])
- dxDrawLine(sx / 2 - 200, sy - (5500 - timeDif) / 500 * 100, sx / 2 + 200, sy - (5500 - timeDif) / 500 * 100, tocolor(255, 255, 255, 100))
- dxDrawLine(sx / 2 - 200, sy - (5500 - timeDif) / 500 * 100, sx / 2 - 200, sy, tocolor(255, 255, 255, 100))
- dxDrawLine(sx / 2 + 200, sy - (5500 - timeDif) / 500 * 100, sx / 2 + 200, sy, tocolor(255, 255, 255, 100))
- dxDrawText(_UPVALUE1_[1], sx / 2 - 195, sy - (5500 - timeDif) / 500 * 100 + 20, sx / 2 + 195, sy, tocolor(255, 255, 255, 255), 1.6, "default-bold", "center", "top", true, false)
- dxDrawText(_UPVALUE1_[2], sx / 2 - 195, sy - (5500 - timeDif) / 500 * 100 + 60, sx / 2 + 195, sy, tocolor(255, 255, 255, 255), 1.6, "default", "center", "top", true, false)
- end
- addEvent("notifyPlayer", true)
- addEventHandler("notifyPlayer", localPlayer, function(...)
- exports.ffs:addNotification(...)
- end)
- addEvent("alertPlayer", true)
- addEventHandler("alertPlayer", localPlayer, function(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- alert(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- end)
- function postData(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- triggerServerEvent("postData", localPlayer, _ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
- end
- addEvent("onClientArenaLeave", true)
- addEvent("onClientArenaJoin", true)
- function onClientArenaJoin(_ARG_0_)
- if _ARG_0_ ~= true and not Settings.serverAlreadyVisitted then
- setSidebarSetting("serverAlreadyVisitted", "yes")
- openHelp(true)
- end
- if not sidebarAlreadyStarted then
- sidebarAlreadyStarted = true
- main()
- end
- end
- addEventHandler("onClientResourceStart", resourceRoot, function()
- onClientArenaJoin(true)
- end)
- addEventHandler("onClientArenaJoin", root, onClientArenaJoin)
- bindKey("F1", "down", function()
- closeSidebar()
- end)
- addEventHandler("onClientArenaLeave", root, closeSidebar)
Advertisement
Add Comment
Please, Sign In to add comment