Sziasztok! Van egy funkcióm ami megváltoztatná, hogy melyik editBox(ok) maradjanak, és melyikek nem. A bejelentkezésnél jó, de a regisztrációnál ottmarad a bejelentkezéses.
panelState = 1
volteegy = 0
volteketto = 0
function reg()
ui = guiCreateEdit(0.46, 0.41, 0.17, 0.02, \"\", true)
showCursor(true)
pi = guiCreateEdit(0.42, 0.53, 0.21, 0.02, \"\", true)
if panelState == 2 then
if volteketto == 0 then
regu = guiCreateEdit(0.46, 0.34, 0.17, 0.02, \"\", true)
email = guiCreateEdit(0.41, 0.38, 0.21, 0.02, \"\", true)
regp = guiCreateEdit(0.41, 0.42, 0.21, 0.02, \"\", true)
regpa = guiCreateEdit(0.44, 0.46, 0.19, 0.02, \"\", true)
end
guiSetVisible ( regu, true )
guiSetVisible ( email, true )
guiSetVisible ( regp, true )
guiSetVisible ( regpa, true )
guiEditSetReadOnly ( regu, false )
guiEditSetReadOnly ( email, false )
guiEditSetReadOnly ( regp, false )
guiEditSetReadOnly ( regpa, false )
if volteegy == 1 then
guiSetVisible ( ui, false )
guiSetVisible ( pi, false )
guiEditSetReadOnly ( ui, true )
guiEditSetReadOnly ( pi, true )
end
volteketto = 1
elseif panelState == 1 then
if volteegy == 0 then
ui = guiCreateEdit(0.46, 0.41, 0.17, 0.02, \"\", true)
pi = guiCreateEdit(0.42, 0.53, 0.21, 0.02, \"\", true)
end
if volteketto == 1 then
guiSetVisible ( regu, false )
guiSetVisible ( email, false )
guiSetVisible ( regp, false )
guiSetVisible ( regpa, false )
guiEditSetReadOnly ( regu, true )
guiEditSetReadOnly ( email, true )
guiEditSetReadOnly ( regp, true )
guiEditSetReadOnly ( regpa, true )
end
guiSetVisible ( ui, true )
guiSetVisible ( pi, true )
guiEditSetReadOnly ( ui, false )
guiEditSetReadOnly ( pi, false )
volteegy = 1
end
end
addEventHandler(\"onClientResourceStart\",getRootElement(),reg)
addEvent(\"reg\",true)
addEventHandler(\"reg\",getRootElement(),reg)
local screenW, screenH = guiGetScreenSize()
addEventHandler(\"onClientRender\", root,
function()
if panelState == 1 then
uig = guiGetText(ui)
pig = guiGetText(pi)
dxDrawRectangle(screenW * 0.3823, screenH * 0.2713, screenW * 0.2417, screenH * 0.4944, tocolor(1, 0, 0, 230), false)
dxDrawText(\"TopMTA - LoginPanel\", screenW * 0.3812, screenH * 0.2713, screenW * 0.6240, screenH * 0.3074, tocolor(255, 255, 255, 255), 1.00, \"bankgothic\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"FelhasználóNév:\", screenW * 0.3823, screenH * 0.4037, screenW * 0.4557, screenH * 0.4352, tocolor(255, 255, 255, 255), 0.50, \"bankgothic\", \"left\", \"center\", false, false, false, false, false)
dxDrawText(\"Jelszó:\", screenW * 0.3823, screenH * 0.5287, screenW * 0.4557, screenH * 0.5602, tocolor(255, 255, 255, 255), 0.50, \"bankgothic\", \"left\", \"center\", false, false, false, false, false)
dxDrawRectangle(screenW * 0.3859, screenH * 0.7019, screenW * 0.1052, screenH * 0.0491, tocolor(8, 8, 8, 230), false)
dxDrawRectangle(screenW * 0.5156, screenH * 0.7019, screenW * 0.1052, screenH * 0.0491, tocolor(8, 8, 8, 230), false)
dxDrawText(\"Bejelentkezés\", 739, 759, 943, 811, tocolor(255, 255, 255, 255), 0.50, \"bankgothic\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"Regisztráció\", 988, 758, 1192, 810, tocolor(255, 255, 255, 255), 0.50, \"bankgothic\", \"center\", \"center\", false, false, false, false, false)
elseif panelState == 2 then
dxDrawRectangle(screenW * 0.3823, screenH * 0.2713, screenW * 0.2417, screenH * 0.4944, tocolor(1, 0, 0, 230), false)
dxDrawText(\"TopMTA - LoginPanel\", screenW * 0.3812, screenH * 0.2713, (screenW * 0.3812) + 466, ( screenH * 0.2713) + 39, tocolor(255, 255, 255, 255), 1.00, \"bankgothic\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"FelhasználóNév:\", screenW * 0.3823, screenH * 0.3352, screenW * 0.4557, screenH * 0.3667, tocolor(255, 255, 255, 255), 0.50, \"bankgothic\", \"left\", \"center\", false, false, false, false, false)
dxDrawText(\"Jelszó:\", screenW * 0.3823, screenH * 0.4167, screenW * 0.4557, screenH * 0.4481, tocolor(255, 255, 255, 255), 0.50, \"bankgothic\", \"left\", \"center\", false, false, false, false, false)
dxDrawRectangle(screenW * 0.4505, screenH * 0.7074, screenW * 0.1052, screenH * 0.0491, tocolor(8, 8, 8, 230), false)
dxDrawText(\"Regisztráció\", screenW * 0.4495, screenH * 0.7074, screenW * 0.5557, screenH * 0.7556, tocolor(255, 255, 255, 255), 0.50, \"bankgothic\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"E-Mail:\", screenW * 0.3823, screenH * 0.3759, screenW * 0.4557, screenH * 0.4074, tocolor(255, 255, 255, 255), 0.50, \"bankgothic\", \"left\", \"center\", false, false, false, false, false)
dxDrawText(\"Jelszó újra:\", screenW * 0.3823, screenH * 0.4574, screenW * 0.4557, screenH * 0.4889, tocolor(255, 255, 255, 255), 0.50, \"bankgothic\", \"left\", \"center\", false, false, false, false, false)
dxDrawRectangle(screenW * 0.3823, screenH * 0.7157, screenW * 0.0260, screenH * 0.0491, tocolor(8, 8, 8, 255), false)
dxDrawLine(screenW * 0.3833, screenH * 0.7583, screenW * 0.4057, screenH * 0.7185, tocolor(255, 255, 255, 255), 1, false)
dxDrawLine(screenW * 0.3839, screenH * 0.7194, screenW * 0.4047, screenH * 0.7565, tocolor(255, 255, 255, 255), 1, false)
else
--semmi
end
end
)
function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
return true
else
return false
end
end
function elore (gomb, statusz, absX, absY)
if statusz == \"down\" and gomb == \"left\" then
if dobozbaVan(screenW * 0.3859, screenH * 0.7019, screenW * 0.1052, screenH * 0.0491, absX, absY) then
if panelState == 1 then
outputChatBox(\"bejelentkezes\")
--who = localPlayer
--triggerServerEvent ( \"check\", resourceRoot, uig,pig,who )
end
elseif dobozbaVan(screenW * 0.5156, screenH * 0.7019, screenW * 0.1052, screenH * 0.0491, absX, absY) then
if panelState == 1 then
outputChatBox(\"at dob regisztracio\")
panelState = 2
reg()
end
elseif dobozbaVan(screenW * 0.3823, screenH * 0.7157, screenW * 0.0260, screenH * 0.0491, absX, absY) then
panelState = 1
reg()
end
end
end
addEventHandler(\"onClientClick\",getRootElement(),elore)