Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- { UpdateTextAreaModified API } Created By: Nettoork#0000
- - updateTextArea
- id, modification, name
- - modification
- id, text, x, y, w, h, background, border, alpha, fixed
- { EXAMPLES }
- ui.addTextArea(1, '', nil, 5, 26, 100, 100, 1, 1, 1, true)
- ui.updateTextArea(1, 'test1', nil)
- ui.updateTextArea(1, 'test2')
- ui.updateTextArea(1, {background = 0xFFFFFF}, nil)
- ]]--
- do
- local names, textAreas, addTextArea, removeTextArea, updateTextArea = {id = 1, text = 2, x = 4, y = 5, w = 6, h = 7, background = 8, border = 9, alpha = 10, fixed = 11}, {}, ui.addTextArea, ui.removeTextArea, ui.updateTextArea
- ui.addTextArea = function(...)
- local info = {...}
- if not info[3] then info[3] = 'nil' end
- textAreas[info[3]..'_'..info[1]] = {...}
- addTextArea(...)
- end
- ui.updateTextArea = function(id, mod, name)
- if not name then name = 'nil' end
- if not textAreas[name..'_'..id] then return
- elseif type(mod) == 'string' then
- updateTextArea(id, mod, name)
- textAreas[name..'_'..id][2] = mod
- return
- end
- for i, v in next, mod do
- if names[i] then
- textAreas[name..'_'..id][names[i]] = v
- local m = textAreas[name..'_'..id]
- addTextArea(m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8], m[9], m[10], m[11])
- end
- end
- end
- ui.removeTextArea = function(id, name)
- if not name then name = 'nil' end
- if textAreas[name..'_'..id] then textAreas[name..'_'..id] = nil end
- removeTextArea(id, name)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement