mommytellme Posted March 29, 2014 Share Posted March 29, 2014 Cześć! mam problem z tym to oto kodem: (w połowie napisany przez mnie, reszta to shader panel z XyzzyRP) GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} } function pokazpanel() okno = guiCreateWindow(102, 119, 661, 406, "Panel ustawień", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(13, 37, 59, 53, "", false, okno) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 37, 62, 53, "gra.png", false, okno) GUIEditor.label[1] = guiCreateLabel(23, 95, 59, 20, "Gra", false, okno) GUIEditor.label[2] = guiCreateLabel(110, 41, 70, 15, "Shadery:", false, okno) przyciskshaderow = guiCreateButton(190, 37, 91, 33, "Włącz menu Shaderów", false, okno) addEventHandler("onClientRender", root, function() dxDrawLine(203, 152, 203, 513, tocolor(255, 255, 255, 255), 1, true) end ) showCursor(true) end function schowajpanel() guiSetVisible (okno, not guiGetVisible ( okno ) ) end shaderpanel = { checkbox = {}, staticimage = {}, scrollpane = {}, label = {} } shaderpanel.staticimage[1] = guiCreateStaticImage(0.69, 0.35, 0.27, 0.20, "karer_bar.png", true) shaderpanel.label[1] = guiCreateLabel(0.05, 0.03, 0.85, 0.19, "Panel shaderów", true, shaderpanel.staticimage[1]) local font_0 = guiCreateFont(":lss-gui/droid-sans.ttf", 13) guiSetFont(shaderpanel.label[1], font_0) guiLabelSetColor(shaderpanel.label[1], 0, 0, 0) guiLabelSetHorizontalAlign(shaderpanel.label[1], "center", false) guiLabelSetVerticalAlign(shaderpanel.label[1], "center") shaderpanel.staticimage[2] = guiCreateStaticImage(0.030, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[1] = guiCreateCheckBox(0.06, 0.3, 0.3, 0.1, "Bloom", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[3] = guiCreateStaticImage(0.030, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[2] = guiCreateCheckBox(0.06, 0.45, 0.3, 0.1, "Woda", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[4] = guiCreateStaticImage(0.030, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[3] = guiCreateCheckBox(0.06, 0.6, 0.3, 0.1, "Karoseria", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[5] = guiCreateStaticImage(0.330, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[4] = guiCreateCheckBox(0.36, 0.3, 0.3, 0.1, "Detale", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[6] = guiCreateStaticImage(0.330, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[5] = guiCreateCheckBox(0.36, 0.45, 0.3, 0.1, "Czarno-biały", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[7] = guiCreateStaticImage(0.330, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[6] = guiCreateCheckBox(0.36, 0.6, 0.3, 0.1, "HDR", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[8] = guiCreateStaticImage(0.630, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[7] = guiCreateCheckBox(0.66, 0.3, 0.3, 0.1, "Noc+", false, true, shaderpanel.staticimage[1]) guiSetVisible(shaderpanel.staticimage[1], false) guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) function toggleWin() local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end bindKey("F3","down",toggleWin) addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) function toggleWin2() if source == przyciskshaderow then local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end end addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) addEventHandler("onClientGUIClick", root, toggleWin2) bindKey("F4","down",pokazpanel) Problem polega na tym że jeśli kliknę F4 pierwszy raz, to fajnie wyświetla się okno panelu ustawień. Ale chciałbym, żeby kliknięcie F4 drugi raz chowało go, czyli np. wywoływało funkcję winoff (którą dopiero zrobię) ale nie wiem jak coś takiego zrobić. W tym shader panelu coś takiego jest (klawisz binda to F3) ale przeglądając jego kod nie zauważyłem tego o co mi chodzi. Pomożecie? Link to comment
WhoAmI Posted March 29, 2014 Share Posted March 29, 2014 window = ( .. ) bindKey ( "F4", "down", function ( ) guiSetVisible ( not guiGetVisible ( window ) ) showCursor ( not isCursorShowing ( ) ) end ) Link to comment
mommytellme Posted March 29, 2014 Author Share Posted March 29, 2014 Teraz działa tylko wyświetlanie i chowanie kursora, okno się w ogóle nie wyświetla. Spróbowałem dać to: window = okno bindKey ( "F4", "down", function ( ) guiSetVisible(okno,false) showCursor ( not isCursorShowing ( ) ) end ) i tak samo. Link to comment
WhoAmI Posted March 29, 2014 Share Posted March 29, 2014 GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} } okno = guiCreateWindow(102, 119, 661, 406, "Panel ustawień", false) guiSetVisible(okno, false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(13, 37, 59, 53, "", false, okno) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 37, 62, 53, "gra.png", false, okno) GUIEditor.label[1] = guiCreateLabel(23, 95, 59, 20, "Gra", false, okno) GUIEditor.label[2] = guiCreateLabel(110, 41, 70, 15, "Shadery:", false, okno) przyciskshaderow = guiCreateButton(190, 37, 91, 33, "Włącz menu Shaderów", false, okno) addEventHandler("onClientRender", root, function() dxDrawLine(203, 152, 203, 513, tocolor(255, 255, 255, 255), 1, true) end ) showCursor(true) end bindKey ( "F4", "down", function ( ) guiSetVisible ( not guiGetVisible ( okno ) ) showCursor ( not isCursorShowing ( ) ) end ) shaderpanel = { checkbox = {}, staticimage = {}, scrollpane = {}, label = {} } shaderpanel.staticimage[1] = guiCreateStaticImage(0.69, 0.35, 0.27, 0.20, "karer_bar.png", true) shaderpanel.label[1] = guiCreateLabel(0.05, 0.03, 0.85, 0.19, "Panel shaderów", true, shaderpanel.staticimage[1]) local font_0 = guiCreateFont(":lss-gui/droid-sans.ttf", 13) guiSetFont(shaderpanel.label[1], font_0) guiLabelSetColor(shaderpanel.label[1], 0, 0, 0) guiLabelSetHorizontalAlign(shaderpanel.label[1], "center", false) guiLabelSetVerticalAlign(shaderpanel.label[1], "center") shaderpanel.staticimage[2] = guiCreateStaticImage(0.030, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[1] = guiCreateCheckBox(0.06, 0.3, 0.3, 0.1, "Bloom", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[3] = guiCreateStaticImage(0.030, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[2] = guiCreateCheckBox(0.06, 0.45, 0.3, 0.1, "Woda", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[4] = guiCreateStaticImage(0.030, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[3] = guiCreateCheckBox(0.06, 0.6, 0.3, 0.1, "Karoseria", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[5] = guiCreateStaticImage(0.330, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[4] = guiCreateCheckBox(0.36, 0.3, 0.3, 0.1, "Detale", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[6] = guiCreateStaticImage(0.330, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[5] = guiCreateCheckBox(0.36, 0.45, 0.3, 0.1, "Czarno-biały", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[7] = guiCreateStaticImage(0.330, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[6] = guiCreateCheckBox(0.36, 0.6, 0.3, 0.1, "HDR", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[8] = guiCreateStaticImage(0.630, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[7] = guiCreateCheckBox(0.66, 0.3, 0.3, 0.1, "Noc+", false, true, shaderpanel.staticimage[1]) guiSetVisible(shaderpanel.staticimage[1], false) guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) function toggleWin() local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end bindKey("F3","down",toggleWin) addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) function toggleWin2() if source == przyciskshaderow then local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end end addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) addEventHandler("onClientGUIClick", root, toggleWin2) Naciśnij F4 i sprawdź, czy są jakieś błędy w debugu. Link to comment
mommytellme Posted March 29, 2014 Author Share Posted March 29, 2014 Tak, jest błąd konkretnie to ten (na czerwono) http://zapodaj.net/6d2f86d0d5502.png.html Link to comment
WhoAmI Posted March 29, 2014 Share Posted March 29, 2014 Zamień wszystko tym GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} } okno = guiCreateWindow(102, 119, 661, 406, "Panel ustawień", false) guiSetVisible(okno, false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(13, 37, 59, 53, "", false, okno) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 37, 62, 53, "gra.png", false, okno) GUIEditor.label[1] = guiCreateLabel(23, 95, 59, 20, "Gra", false, okno) GUIEditor.label[2] = guiCreateLabel(110, 41, 70, 15, "Shadery:", false, okno) przyciskshaderow = guiCreateButton(190, 37, 91, 33, "Włącz menu Shaderów", false, okno) function draw () dxDrawLine(203, 152, 203, 513, tocolor(255, 255, 255, 255), 1, true) end bindKey ( "F4", "down", function ( ) local handler = guiGetVisible ( okno ) and removeEventHandler or addEventHandler guiSetVisible ( not guiGetVisible ( okno ) ) showCursor ( not isCursorShowing ( ) ) handler ( "onClientRender", root, draw ) end ) shaderpanel = { checkbox = {}, staticimage = {}, scrollpane = {}, label = {} } shaderpanel.staticimage[1] = guiCreateStaticImage(0.69, 0.35, 0.27, 0.20, "karer_bar.png", true) shaderpanel.label[1] = guiCreateLabel(0.05, 0.03, 0.85, 0.19, "Panel shaderów", true, shaderpanel.staticimage[1]) local font_0 = guiCreateFont(":lss-gui/droid-sans.ttf", 13) guiSetFont(shaderpanel.label[1], font_0) guiLabelSetColor(shaderpanel.label[1], 0, 0, 0) guiLabelSetHorizontalAlign(shaderpanel.label[1], "center", false) guiLabelSetVerticalAlign(shaderpanel.label[1], "center") shaderpanel.staticimage[2] = guiCreateStaticImage(0.030, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[1] = guiCreateCheckBox(0.06, 0.3, 0.3, 0.1, "Bloom", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[3] = guiCreateStaticImage(0.030, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[2] = guiCreateCheckBox(0.06, 0.45, 0.3, 0.1, "Woda", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[4] = guiCreateStaticImage(0.030, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[3] = guiCreateCheckBox(0.06, 0.6, 0.3, 0.1, "Karoseria", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[5] = guiCreateStaticImage(0.330, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[4] = guiCreateCheckBox(0.36, 0.3, 0.3, 0.1, "Detale", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[6] = guiCreateStaticImage(0.330, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[5] = guiCreateCheckBox(0.36, 0.45, 0.3, 0.1, "Czarno-biały", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[7] = guiCreateStaticImage(0.330, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[6] = guiCreateCheckBox(0.36, 0.6, 0.3, 0.1, "HDR", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[8] = guiCreateStaticImage(0.630, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[7] = guiCreateCheckBox(0.66, 0.3, 0.3, 0.1, "Noc+", false, true, shaderpanel.staticimage[1]) guiSetVisible(shaderpanel.staticimage[1], false) guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) function toggleWin() local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end bindKey("F3","down",toggleWin) addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) function toggleWin2() if source == przyciskshaderow then local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end end addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) addEventHandler("onClientGUIClick", root, toggleWin2) Link to comment
mommytellme Posted March 29, 2014 Author Share Posted March 29, 2014 I kolejny błąd Tym razem linia dx jest cały czas, (mogę ją usunąć, jednak nie potrzebna) chowanie kursora działa, a gui się nie wyświetla, zdjęcie zrobione po paru kliknięciach F4: http://zapodaj.net/971942150bff5.png.html Skrypt nazywa się "Ustawienia" Link to comment
WhoAmI Posted March 29, 2014 Share Posted March 29, 2014 GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(102, 119, 661, 406, "Panel ustawień", false) guiSetVisible(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(13, 37, 59, 53, "", false, GUIEditor.window[1]) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 37, 62, 53, "gra.png", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(23, 95, 59, 20, "Gra", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(110, 41, 70, 15, "Shadery:", false, GUIEditor.window[1]) przyciskshaderow = guiCreateButton(190, 37, 91, 33, "Włącz menu Shaderów", false, GUIEditor.window[1]) function draw () dxDrawLine(203, 152, 203, 513, tocolor(255, 255, 255, 255), 1, true) end bindKey ( "F4", "down", function ( ) local handler = guiGetVisible ( GUIEditor.window[1 ) and removeEventHandler or addEventHandler guiSetVisible ( not guiGetVisible ( GUIEditor.window[1] ) ) showCursor ( not isCursorShowing ( ) ) handler ( "onClientRender", root, draw ) end ) shaderpanel = { checkbox = {}, staticimage = {}, scrollpane = {}, label = {} } shaderpanel.staticimage[1] = guiCreateStaticImage(0.69, 0.35, 0.27, 0.20, "karer_bar.png", true) shaderpanel.label[1] = guiCreateLabel(0.05, 0.03, 0.85, 0.19, "Panel shaderów", true, shaderpanel.staticimage[1]) local font_0 = guiCreateFont(":lss-gui/droid-sans.ttf", 13) guiSetFont(shaderpanel.label[1], font_0) guiLabelSetColor(shaderpanel.label[1], 0, 0, 0) guiLabelSetHorizontalAlign(shaderpanel.label[1], "center", false) guiLabelSetVerticalAlign(shaderpanel.label[1], "center") shaderpanel.staticimage[2] = guiCreateStaticImage(0.030, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[1] = guiCreateCheckBox(0.06, 0.3, 0.3, 0.1, "Bloom", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[3] = guiCreateStaticImage(0.030, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[2] = guiCreateCheckBox(0.06, 0.45, 0.3, 0.1, "Woda", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[4] = guiCreateStaticImage(0.030, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[3] = guiCreateCheckBox(0.06, 0.6, 0.3, 0.1, "Karoseria", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[5] = guiCreateStaticImage(0.330, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[4] = guiCreateCheckBox(0.36, 0.3, 0.3, 0.1, "Detale", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[6] = guiCreateStaticImage(0.330, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[5] = guiCreateCheckBox(0.36, 0.45, 0.3, 0.1, "Czarno-biały", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[7] = guiCreateStaticImage(0.330, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[6] = guiCreateCheckBox(0.36, 0.6, 0.3, 0.1, "HDR", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[8] = guiCreateStaticImage(0.630, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[7] = guiCreateCheckBox(0.66, 0.3, 0.3, 0.1, "Noc+", false, true, shaderpanel.staticimage[1]) guiSetVisible(shaderpanel.staticimage[1], false) guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) function toggleWin() local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end bindKey("F3","down",toggleWin) addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) function toggleWin2() if source == przyciskshaderow then local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end end addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) addEventHandler("onClientGUIClick", root, toggleWin2) Musi działać Link to comment
mommytellme Posted March 30, 2014 Author Share Posted March 30, 2014 Dalej nie działa xDDDD Debugscript po kliknięciu F4: http://zapodaj.net/54527e70c265e.png.html Po odpaleniu nic się nie dzieje, po kliknięciu F4 wyświetla się kursor i linia, a po ponownym kliknięciu F4 chowa się kursor, linia zostaje Link to comment
WhoAmI Posted March 30, 2014 Share Posted March 30, 2014 GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} } shaderpanel = { checkbox = {}, staticimage = {}, scrollpane = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(102, 119, 661, 406, "Panel ustawień", false) guiSetVisible(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(13, 37, 59, 53, "", false, GUIEditor.window[1]) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 37, 62, 53, "gra.png", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(23, 95, 59, 20, "Gra", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(110, 41, 70, 15, "Shadery:", false, GUIEditor.window[1]) przyciskshaderow = guiCreateButton(190, 37, 91, 33, "Włącz menu Shaderów", false, GUIEditor.window[1]) function draw () dxDrawLine(203, 152, 203, 513, tocolor(255, 255, 255, 255), 1, true) end bindKey ( "F4", "down", function ( ) local handler = guiGetVisible ( GUIEditor.window[1] ) and removeEventHandler or addEventHandler guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor ( not isCursorShowing ( ) ) handler ( "onClientRender", root, draw ) end ) shaderpanel.staticimage[1] = guiCreateStaticImage(0.69, 0.35, 0.27, 0.20, "karer_bar.png", true) guiSetVisible ( shaderpanel.staticimage[1], false) shaderpanel.label[1] = guiCreateLabel(0.05, 0.03, 0.85, 0.19, "Panel shaderów", true, shaderpanel.staticimage[1]) local font_0 = guiCreateFont(":lss-gui/droid-sans.ttf", 13) guiSetFont(shaderpanel.label[1], font_0) guiLabelSetColor(shaderpanel.label[1], 0, 0, 0) guiLabelSetHorizontalAlign(shaderpanel.label[1], "center", false) guiLabelSetVerticalAlign(shaderpanel.label[1], "center") shaderpanel.staticimage[2] = guiCreateStaticImage(0.030, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[1] = guiCreateCheckBox(0.06, 0.3, 0.3, 0.1, "Bloom", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[3] = guiCreateStaticImage(0.030, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[2] = guiCreateCheckBox(0.06, 0.45, 0.3, 0.1, "Woda", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[4] = guiCreateStaticImage(0.030, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[3] = guiCreateCheckBox(0.06, 0.6, 0.3, 0.1, "Karoseria", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[5] = guiCreateStaticImage(0.330, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[4] = guiCreateCheckBox(0.36, 0.3, 0.3, 0.1, "Detale", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[6] = guiCreateStaticImage(0.330, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[5] = guiCreateCheckBox(0.36, 0.45, 0.3, 0.1, "Czarno-biały", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[7] = guiCreateStaticImage(0.330, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[6] = guiCreateCheckBox(0.36, 0.6, 0.3, 0.1, "HDR", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[8] = guiCreateStaticImage(0.630, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[7] = guiCreateCheckBox(0.66, 0.3, 0.3, 0.1, "Noc+", false, true, shaderpanel.staticimage[1]) guiSetVisible(shaderpanel.staticimage[1], false) guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) function toggleWin() local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end bindKey("F3","down",toggleWin) addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) function toggleWin2() if source == przyciskshaderow then local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end end addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) addEventHandler("onClientGUIClick", root, toggleWin2) Sprawdzałem u siebie, działa. Link to comment
mommytellme Posted March 30, 2014 Author Share Posted March 30, 2014 Działa! Dziękuje Ci bardzo 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