Szerző Téma: Az editbox ott marad  (Megtekintve 937 alkalommal)

Az editbox ott marad
« Dátum: 2017. január 19. - 14:48:38 »
0 Show voters
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)
« Utoljára szerkesztve: 2017. január 19. - 18:52:03 írta thegergo02 »

Az editbox ott marad
« Válasz #1 Dátum: 2017. január 22. - 17:19:26 »
0 Show voters
valaki???

Az editbox ott marad
« Válasz #2 Dátum: 2017. január 22. - 19:41:45 »
0 Show voters
destroyElement hasznos lehet számodra, ha jól gondolom. :)

Az editbox ott marad
« Válasz #3 Dátum: 2017. január 23. - 16:52:01 »
0 Show voters
Lehet gui-t destroyolni?? Köszi, megprobálom

Az editbox ott marad
« Válasz #4 Dátum: 2017. január 24. - 18:38:52 »
0 Show voters
Idézetet írta: thegergo02 date=1485186721


   
      Lehet gui-t destroyolni?? Köszi, megprobálom
   


Persze. :D

Az editbox ott marad
« Válasz #5 Dátum: 2017. január 24. - 19:23:28 »
+1 Show voters
Müködik, nagyon köszi!
 
ZÁRHATÓ!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal