AriosJentu Posted January 4, 2014 Share Posted January 4, 2014 Здрасьте. У меня возникла проблема с dxGUI. ERROR: Loading script failed: name\gui.lua:227: function at line 145 has more than 60 upvalues Строка 227: englang = dxCreateButton(53, 100, 123, 21, "English", settswin, dxcol, "default-bold", "Crystal [blue]") Строка 145, 146, 147, 148 function() timemenu = dxCreateButton(mx-53, my-25, 53, 25, "12:30", false, dxcol, "default-bold", "Crystal [blue]") taskbar = dxCreateStaticImage(0, 0, 2048, 25, "task/taskbar.png") startbtn = dxCreateStaticImage(0, 0, 82, 25, "buts/start.png", 0, taskbar) Вообще ничего не понимаю. Link to comment
TheNormalnij Posted January 4, 2014 Share Posted January 4, 2014 Покажите больше кода. Особенно выше. Link to comment
AriosJentu Posted January 5, 2014 Author Share Posted January 5, 2014 Со строки 144 до 268 addEventHandler("onClientResourceStart", resourceRoot, function() timemenu = dxCreateButton(mx-53, my-25, 53, 25, "12:30", false, dxcol, "default-bold", "Crystal [blue]") taskbar = dxCreateStaticImage(0, 0, 2048, 25, "task/taskbar.png") startbtn = dxCreateStaticImage(0, 0, 82, 25, "buts/start.png", 0, taskbar) startmenu = dxCreateStaticImage(0, 25, 2048, 60, "task/topbar.png") filesbut = dxCreateStaticImage(0, 0, 60, 60, "icns/files.png", 0, startmenu) calendar = dxCreateStaticImage(64, 0, 60, 60, "icns/calend.png", 0, startmenu) monthname = dxCreateLabel(5, 3, 55, 18, "January", calendar, dxcol, "default-bold", 12) dateone = dxCreateLabel(19, 31, 21, 19, "12", calendar, dxcol, "default-bold", 12) calculatorbut = dxCreateStaticImage(128, 0, 60, 60, "icns/calc.png", 0, startmenu) picsbut = dxCreateStaticImage(320, 0, 60, 60, "icns/imgs.png", 0, startmenu) musicbut = dxCreateStaticImage(256, 0, 60, 60, "icns/music.png", 0, startmenu) infobut = dxCreateStaticImage(384, 0, 60, 60, "icns/info.png", 0, startmenu) textedbut = dxCreateStaticImage(192, 0, 60, 60, "icns/texted.png", 0, startmenu) settsbut = dxCreateStaticImage(448, 0, 60, 60, "icns/setts.png", 0, startmenu) shutdownb = dxCreateStaticImage(mx-60, 0, 60, 60, "icns/off.png", 0, startmenu) --about infowin = dxCreateWindow(407, 115, 240, 266, "About", dxcol, "default-bold", "Crystal [blue]") closeinfo = dxCreateStaticImage(10, 20, 19, 19, "buts/close.png", 0, infowin) infologo = dxCreateStaticImage(58, 20, 128, 128, "icns/alogo.png", 0, infowin) aboutinfo = dxCreateLabel(20, 158, 206, 96, " Lunix OS Blue Octopus\n Version 2.0 Preview\n For screensize: "..mx.."x"..my.."\n\nAuthor&Scripter TraniLurese\nDesigned by Mediym\nDate 31.12.2013", infowin, dxcol, "default-bold", 12) --Calculator calculatorwin = dxCreateWindow(466, 203, 183, 136, "Calculator", dxcol, "default-bold", "Crystal [blue]") closecalc = dxCreateStaticImage(10, 19, 19, 19, "buts/close.png", 0, calculatorwin) result = dxCreateEdit(29, 19, 145, 18, "Result", false, calculatorwin, dxcol, "default-bold", "Crystal [blue]") charone = dxCreateEdit(9, 47, 165, 20, "Char 1", false, calculatorwin, dxcol, "default-bold", "Crystal [blue]") plus = dxCreateButton(9, 102, 25, 23, "+", calculatorwin, dxcol, "default-bold", "Crystal [blue]") chartwo = dxCreateEdit(9, 72, 165, 20, "Char 2", false, calculatorwin, dxcol, "default-bold", "Crystal [blue]") minus = dxCreateButton(44, 102, 25, 23, "-", calculatorwin, dxcol, "default-bold", "Crystal [blue]") chxch = dxCreateButton(79, 102, 25, 23, "x", calculatorwin, dxcol, "default-bold", "Crystal [blue]") divs = dxCreateButton(114, 102, 25, 23, "÷", calculatorwin, dxcol, "default-bold", "Crystal [blue]") radic = dxCreateButton(149, 102, 25, 23, "√", calculatorwin, dxcol, "default-bold", "Crystal [blue]") --Error errorwind = dxCreateWindow(575, 249, 168, 82, "Error", dxcol, "default-bold", "Crystal [blue]") closeerror = dxCreateStaticImage(9, 20, 19, 19, "buts/close.png", 0, errorwind) errortext = dxCreateLabel(10, 41, 153, 22, "Passwords do not match", errorwind, dxcol, "default-bold", 12) --Files fileswin = dxCreateWindow(137, 69, 400, 347, "Files", dxcol, "default-bold", "Crystal [blue]") closefiles = dxCreateStaticImage(10, 20, 19, 19, "buts/close.png", 0, fileswin) filesmemo = dxCreateEdit(29, 39, 363, 299, "", false, fileswin, dxcol, "default-bold", "Crystal [blue]") dxEditSetReadOnly(filesmemo, true) calcf = dxCreateStaticImage(10, 10, 60, 60, "icns/calc.png", 0, filesmemo) imagesf = dxCreateStaticImage(10, 84, 60, 60, "icns/imgs.png", 0, filesmemo) musicf = dxCreateStaticImage(10, 159, 60, 60, "icns/music.png", 0, filesmemo) textedf = dxCreateStaticImage(10, 230, 60, 60, "icns/texted.png", 0, filesmemo) lablawinf = dxCreateLabel(80, 10, 282, 270, "Calculator\nIf you need to calculate somethink, you can use it\n\n\n\nImages\nYou can see all Lunix OS Images\n\n\n\nMusic\nPlay any music, if you have URL\n\n\n\nText Editor\nWrite some information", filesmemo, tocolor(0, 0, 0, 255), "default-bold", 12) --Login screen loginbuttn = dxCreateButton((mx/8)+(mx/2)+40, my/2+29, 103, 34, "Login", false, dxcol, "default-bold", "Crystal [blue]") regbuttn = dxCreateButton((mx/8)+(mx/2)+40, (my/4)+(my/2), 103, 34, "Register", false, dxcol, "default-bold", "Crystal [blue]") dxSetVisible(regbuttn, false) nowtime = dxCreateLabel(mx/4, my/4, 142, 51, "12:30", false, dxcol, "default-bold", 24) nowdate = dxCreateLabel((mx/4)-30, (my/4)+60, 195, 46, "21.12.2013", false, dxcol, "default-bold", 12) username = dxCreateEdit((mx/8)+(mx/2), (my/2)-30, 190, 27, "Username", false, false, dxcol, "default-bold", "Crystal [blue]") password = dxCreateEdit((mx/8)+(mx/2), my/2, 190, 27, "Password", false, false, dxcol, "default-bold", "Crystal [blue]") dxEditSetMasked(password, true) --Music Player musicwin = dxCreateWindow(485, 292, 321, 88, "Music", dxcol, "default-bold", "Crystal [blue]") closemp = dxCreateStaticImage(10, 19, 19, 19, "buts/close.png", 0, musicwin) url = dxCreateEdit(33, 19, 279, 19, "Put here URL", false, musicwin, dxcol, "default-bold", "Crystal [blue]") playurl = dxCreateButton(10, 48, 94, 29, "Play", musicwin, dxcol, "default-bold", "Crystal [blue]") pauseurl = dxCreateButton(114, 48, 94, 29, "Pause", musicwin, dxcol, "default-bold", "Crystal [blue]") stopurl = dxCreateButton(218, 48, 94, 29, "Stop", musicwin, dxcol, "default-bold", "Crystal [blue]") --Pictures imageswin = dxCreateWindow(398, 151, 465, 483, "Pictures", dxcol, "default-bold", "Crystal [blue]") closeimages = dxCreateStaticImage(10, 19, 19, 19, "buts/close.png", 0, imageswin) showedimg = dxCreateStaticImage(31, 102, 400, 350, "dsks/desktop1.png", 0, imageswin) picture[1] = dxCreateStaticImage(31, 19, 82, 74, "dsks/desktop1.png", 0, imageswin) picture[2] = dxCreateStaticImage(123, 19, 80, 74, "dsks/desktop2.png", 0, imageswin) setasdesk = dxCreateButton(9, 456, 446, 18, "Set as desktop", imageswin, dxcol, "default-bold", "Crystal [blue]") --Settings settswin = dxCreateWindow(346, 291, 396, 237, "Settings", dxcol, "default-bold", "Crystal [blue]") closesets = dxCreateStaticImage(10, 20, 19, 19, "buts/close.png", 0, settswin) tasktop = dxCreateButton(53, 49, 123, 21, "Top", settswin, dxcol, "default-bold", "Crystal [blue]") taskbot = dxCreateButton(215, 49, 123, 21, "Bottom", settswin, dxcol, "default-bold", "Crystal [blue]") englang = dxCreateButton(53, 100, 123, 21, "English", settswin, dxcol, "default-bold", "Crystal [blue]") ruslang = dxCreateButton(215, 100, 123, 21, "Russian", settswin, dxcol, "default-bold", "Crystal [blue]") infosetts = dxCreateLabel(135, 35, 119, 120, " Taskbar position\n\n\n System language\n\n\n Desktop image size", settswin, dxcol, "default-bold", 12) fullimage = dxCreateButton(53, 145, 123, 21, "2048х2048", settswin, dxcol, "default-bold", "Crystal [blue]") fullscreen = dxCreateButton(215, 145, 123, 21, mx.."x"..my, settswin, dxcol, "default-bold", "Crystal [blue]") changedesk = dxCreateButton(10, 197, 180, 25, "Change desktop image", settswin, dxcol, "default-bold", "Crystal [blue]") changetask = dxCreateButton(205, 197, 180, 25, "Change taskbar image", settswin, dxcol, "default-bold", "Crystal [blue]") --Register registerwin = dxCreateWindow(408, 156, 384, 176, "Register", dxcol, "default-bold", "Crystal [blue]") regusername = dxCreateEdit(17, 32, 174, 28, "Username", false, registerwin, dxcol, "default-bold", "Crystal [blue]") regpassword = dxCreateEdit(17, 66, 174, 28, "", false, registerwin, dxcol, "default-bold", "Crystal [blue]") dxEditSetMasked(regpassword, true) regrepeat = dxCreateEdit(17, 99, 174, 28, "", false, registerwin, dxcol, "default-bold", "Crystal [blue]") dxEditSetMasked(regrepeat, true) reglabel = dxCreateLabel(196, 36, 179, 91, "You login username\n\nPassword\n\n\nRepeat password", registerwin, dxcol, "default-bold", 12) closereg = dxCreateStaticImage(356, 23, 19, 19, "buts/close.png", 0, registerwin) regbttn = dxCreateButton(23, 138, 342, 28, "Register", registerwin, dxcol, "default-bold", "Crystal [blue]") --Desktop Sets desktopwin = dxCreateWindow(320, 270, 233, 141, "Desktop Image", dxcol, "default-bold", "Crystal [blue]") closedesktops = dxCreateStaticImage(10, 19, 19, 19, "buts/close.png", 0, desktopwin) desktopimage[1] = dxCreateStaticImage(10, 44, 100, 80, "dsks/desktop1.png", 0, desktopwin) desktopimage[2] = dxCreateStaticImage(120, 44, 100, 80, "dsks/desktop2.png", 0, desktopwin) --Taskbar Sets taskbarwin = dxCreateWindow(320, 150, 326, 116, "Taskbar Image", dxcol, "default-bold", "Crystal [blue]") closetasksets = dxCreateStaticImage(10, 20, 19, 19, "buts/close.png", 0, taskbarwin) taskbarpanel[1] = dxCreateStaticImage(10, 49, 305, 25, "task/taskbar.png", 0, taskbarwin) taskbarpanel[2] = dxCreateStaticImage(10, 79, 305, 25, "task/taskbar2.png", 0, taskbarwin) shadow = dxCreateLabel(0, 0, 44, 15, "Shadow", taskbarpanel[2], dxcol, "default-bold", 12) --Text Editor textedwin = dxCreateWindow(331, 146, 444, 362, "Lua Txt", dxcol, "default-bold", "Crystal [blue]") writeevery = dxCreateEdit(10, 45, 424, 307, "", false, textedwin, dxcol, "default-bold", "Crystal [blue]") dxEditSetReadOnly(writeevery, true) closetexted = dxCreateStaticImage(10, 22, 19, 19, "buts/close.png", 0, textedwin) --Time'n'Date timewin = dxCreateWindow(382, 177, 115, 57, "Time and date", dxcol, "default-bold", "Crystal [blue]") timehere = dxCreateLabel(34, 19, 70, 33, " 12:00\n21.12.2013", timewin, dxcol, "default-bold", 12) closetime = dxCreateStaticImage(10, 19, 19, 19, "buts/close.png", 0, timewin) end) Link to comment
TheNormalnij Posted January 5, 2014 Share Posted January 5, 2014 Используй таблицы для хранения гуи-элементов. Link to comment
AriosJentu Posted January 5, 2014 Author Share Posted January 5, 2014 Используй таблицы для хранения гуи-элементов. Не понял. Датабазу заюзать чтоле? Link to comment
TheNormalnij Posted January 5, 2014 Share Posted January 5, 2014 Читайте мануалы по Lua. Link to comment
DakiLLa Posted January 5, 2014 Share Posted January 5, 2014 Таблицы - всмысле массивы. Link to comment
AriosJentu Posted January 6, 2014 Author Share Posted January 6, 2014 Таблицы - всмысле массивы. У меня есть массивы некоторых dxGUI. Вы предлагаете сделать для всех dxGUI сделать массивы, которые деляться на названия окон? Всмысле есть окно регистрации, и все его элементы входят в один массив окна регистрации, а есть допустим окно калькулятора, и все элементы калькулятора будут записаны в другой массив. Я правильно понял? Link to comment
DakiLLa Posted January 6, 2014 Share Posted January 6, 2014 Таблицы - всмысле массивы. У меня есть массивы некоторых dxGUI. Вы предлагаете сделать для всех dxGUI сделать массивы, которые деляться на названия окон? Всмысле есть окно регистрации, и все его элементы входят в один массив окна регистрации, а есть допустим окно калькулятора, и все элементы калькулятора будут записаны в другой массив. Я правильно понял? Ну что-то вроде того. Во-первых, код в более приятный вид приведете, во-вторых, избавитесь от назойливой ошибки. Честно говоря, я не встречался с подобной ерундой и предполагаю, что проблема кроется как раз таки в количестве ваших глобальных переменных внутри тела функции (вот кстати, пример аж с 70-ю локальными переменными и той же самой ошибкой). Link to comment
AriosJentu Posted January 6, 2014 Author Share Posted January 6, 2014 Ну я так подумал, неполенился, и доверил всё replace окну Script Editor'a, и в итоге мой дебаг ругается, при запущенных ресурсах dxGUI и name, на все строки с самими созданными окнами (точнее на одну, которая присутствует в начале эвента, но поменяв местами строки, проблема не перешла на другую, а осталась на том же месте, но с другим текстом строки). ERROR: name/gui.lua:146: attempt to call global "dxCreateButton" (a nil value) При вызове GUI таже самая проблема, но со строкой с текстом "dxGetVisible". Link to comment
Other Languages Moderators Disinterpreter Posted January 6, 2014 Other Languages Moderators Share Posted January 6, 2014 Ну я так подумал, неполенился, и доверил всё replace окну Script Editor'a, и в итоге мой дебаг ругается, при запущенных ресурсах dxGUI и name, на все строки с самими созданными окнами (точнее на одну, которая присутствует в начале эвента, но поменяв местами строки, проблема не перешла на другую, а осталась на том же месте, но с другим текстом строки). ERROR: name/gui.lua:146: attempt to call global "dxCreateButton" (a nil value) При вызове GUI таже самая проблема, но со строкой с текстом "dxGetVisible". https://wiki.multitheftauto.com/wiki/Dx ... eateButton Функцию надо импортить же Link to comment
AriosJentu Posted January 7, 2014 Author Share Posted January 7, 2014 Я короче не понял как это экспортится, и поэтому написал везде перед всеми dxGUI - "exports.dxGUI:" И теперь мой дебаг при рендере пишет: INFO: dxGetVisible gets wrong parameters (dxElement) Создаю я GUI так: taskstart[1] = exports.dxGUI:dxCreateButton(mx-53, my-25, 53, 25, "12:30", false, dxcol, "default-bold", "Crystal [blue]") taskstart[2] = exports.dxGUI:dxCreateStaticImage(0, 0, 2048, 25, "task/taskbar.png") taskstart[3] = exports.dxGUI:dxCreateStaticImage(0, 0, 82, 25, "buts/start.png", 0, taskstart[2]) taskstart[4] = exports.dxGUI:dxCreateStaticImage(0, 25, 2048, 60, "task/topbar.png") taskstart[5] = exports.dxGUI:dxCreateStaticImage(0, 0, 60, 60, "icns/files.png", 0, taskstart[4]) taskstart[6] = exports.dxGUI:dxCreateStaticImage(64, 0, 60, 60, "icns/calend.png", 0, taskstart[4]) taskstart[7] = exports.dxGUI:dxCreateLabel(5, 3, 55, 18, "January", taskstart[6], dxcol, "default-bold", 12) taskstart[8] = exports.dxGUI:dxCreateLabel(19, 31, 21, 19, "12", taskstart[6], dxcol, "default-bold", 12) taskstart[9] = exports.dxGUI:dxCreateStaticImage(128, 0, 60, 60, "icns/calc.png", 0, taskstart[4]) taskstart[10] = exports.dxGUI:dxCreateStaticImage(320, 0, 60, 60, "icns/imgs.png", 0, taskstart[4]) taskstart[11] = exports.dxGUI:dxCreateStaticImage(256, 0, 60, 60, "icns/music.png", 0, taskstart[4]) taskstart[12] = exports.dxGUI:dxCreateStaticImage(384, 0, 60, 60, "icns/info.png", 0, taskstart[4]) taskstart[13] = exports.dxGUI:dxCreateStaticImage(192, 0, 60, 60, "icns/texted.png", 0, taskstart[4]) taskstart[14] = exports.dxGUI:dxCreateStaticImage(448, 0, 60, 60, "icns/setts.png", 0, taskstart[4]) taskstart[15] = exports.dxGUI:dxCreateStaticImage(mx-60, 0, 60, 60, "icns/off.png", 0, taskstart[4]) И так проверяю в рендере if exports.dxGUI:dxGetVisible(taskstart[1]) then todaytime = string.format("%02d:%02d", realtime.hour, realtime.minute) exports.dxGUI:dxSetText(taskstart[1], todaytime) end Link to comment
AriosJentu Posted January 7, 2014 Author Share Posted January 7, 2014 Ладно, с этой фигнёй разобрались, сейчас он ругается на Edit. Link to comment
AriosJentu Posted January 8, 2014 Author Share Posted January 8, 2014 Посмотрев исходник dxEdit, я понял, что Edit'ы нельзя пока пихать в мод, поэтому я решил попробовать сделать вместо dx - обычные guiEdit, но в итоге у меня появились варны, которые говорят, что gui аттачить к dx нельзя. Как бы мне выкрутиться из этой ситуации, не превращая окна в обычные gui, но чтобы Edit и Memo аттачились к dx Image Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now