CapY Posted August 30, 2011 Share Posted August 30, 2011 Rows in gridlist are not selectable , when i click on one row window closes. GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Memo1 = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.207,0.1426,0.607,0.5605,"Help Manager",true) GUIEditor_Grid[1] = guiCreateGridList(14,52,121,485,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Description",0.2) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],0,1,"FAQ",false,true) GUIEditor_Memo[1] = guiCreateMemo(139,54,601,484," Here are recently asked questions by other players\n\n\nQ:What type of server is this ?\nA:It's Freeroam.\n\n\nQ: For what FG stands for ? \nA: It's stand for Friend Gang\n\n\nQ: Where i can visit your site ? \nA: Site link is Fggaming.forumcroatian.com/\n",false,GUIEditor_Window[1]) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Glue",false,truer) GUIEditor_Memo1 = guiCreateMemo(139,54,601,484,"",false,GUIEditor_Window[1]) end -- BIND THE TOUCH F9 function onresourceStart () bindKey ("F9", "down", showUserPanel) guiSetVisible (GUIEditor_Window[1], false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanel () getVisible = guiGetVisible (GUIEditor_Window[1]) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) end if (getVisible == false) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) addEventHandler( "onClientGUIClick", GUIEditor_Grid[1], showUserPanel ) end end Link to comment
CapY Posted August 30, 2011 Author Share Posted August 30, 2011 Script fixed a bit , but still when i click anywhere on the window it gets closed . Here : GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Memo1 = {} GUIEditor_Grid = {} lol = {} GUIEditor_Window[1] = guiCreateWindow(0.207,0.1426,0.607,0.5605,"Help Manager",true) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Grid[1] = guiCreateGridList(14,52,121,485,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(lol,2) guiGridListAddColumn(GUIEditor_Grid[1],"Description",0.2) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end lol = guiGridListSetItemText(GUIEditor_Grid[1],0,1,"FAQ",false,true) GUIEditor_Memo[1] = guiCreateMemo(139,54,601,484," Here are recently asked questions by other players\n\n\nQ:What type of server is this ?\nA:It's Freeroam.\n\n\nQ: For what FG stands for ? \nA: It's stand for Friend Gang\n\n\nQ: Where i can visit your site ? \nA: Site link is Fggaming.forumcroatian.com/\n",false,GUIEditor_Window[1]) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Glue",false,true) guiSetSizable(GUIEditor_Window, false) guiSetMovable(GUIEditor_Window, false) guiMemoSetReadOnly(GUIEditor_Memo[1],false) GUIEditor_Memo1 = guiCreateMemo(139,54,601,484,"Test, test",false,GUIEditor_Window[1]) end -- BIND F9 function onresourceStart () bindKey ("F9", "down", showUserPanel) guiSetVisible (GUIEditor_Window[1], false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanel () getVisible = guiGetVisible (GUIEditor_Window[1]) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) elseif (getVisible == false) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) addEventHandler( "onClientGUIClick", GUIEditor_Grid[1], showUserPanel ) end end Error on :71: @addEventHandler: 'onClientGUIClick' with this function is already handled Help anybody ? Link to comment
Castillo Posted August 31, 2011 Share Posted August 31, 2011 Well, maybe you should remove the event handler after close? GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Memo1 = {} GUIEditor_Grid = {} lol = {} GUIEditor_Window[1] = guiCreateWindow(0.207,0.1426,0.607,0.5605,"Help Manager",true) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Grid[1] = guiCreateGridList(14,52,121,485,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(lol,2) guiGridListAddColumn(GUIEditor_Grid[1],"Description",0.2) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end lol = guiGridListSetItemText(GUIEditor_Grid[1],0,1,"FAQ",false,true) GUIEditor_Memo[1] = guiCreateMemo(139,54,601,484," Here are recently asked questions by other players\n\n\nQ:What type of server is this ?\nA:It's Freeroam.\n\n\nQ: For what FG stands for ? \nA: It's stand for Friend Gang\n\n\nQ: Where i can visit your site ? \nA: Site link is Fggaming.forumcroatian.com/\n",false,GUIEditor_Window[1]) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Glue",false,true) guiSetSizable(GUIEditor_Window, false) guiSetMovable(GUIEditor_Window, false) guiMemoSetReadOnly(GUIEditor_Memo[1],false) GUIEditor_Memo1 = guiCreateMemo(139,54,601,484,"Test, test",false,GUIEditor_Window[1]) end -- BIND F9 function onresourceStart () bindKey ("F9", "down", showUserPanel) guiSetVisible (GUIEditor_Window[1], false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanel () local playerName = getPlayerName ( getLocalPlayer() ) if guiGetVisible (GUIEditor_Window[1]) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) removeEventHandler( "onClientGUIClick", GUIEditor_Grid[1], showUserPanel ) else guiSetVisible (GUIEditor_Window[1], true) showCursor (true) addEventHandler( "onClientGUIClick", GUIEditor_Grid[1], showUserPanel ) end end Link to comment
Static-X Posted August 31, 2011 Share Posted August 31, 2011 @21 & 22: 'GUIEditor_Window' is not defined, use GUIEditor_Window[1] @45: addEventHandler( "onClientGUIClick", GUIEditor_Grid[1], showUserPanel ) why are you adding that event on gridlist click? Link to comment
CapY Posted August 31, 2011 Author Share Posted August 31, 2011 GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Memo1 = {} GUIEditor_Grid = {} lol = {} GUIEditor_Window[1] = guiCreateWindow(0.207,0.1426,0.607,0.5605,"Help Manager",true) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Grid[1] = guiCreateGridList(14,52,121,485,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(lol,2) guiGridListAddColumn(GUIEditor_Window[1],"Description",0.2) for i = 1, 2 do guiGridListAddRow(GUIEditor_Window[1]) end lol = guiGridListSetItemText(GUIEditor_Grid[1],0,1,"FAQ",false,true) GUIEditor_Memo[1] = guiCreateMemo(139,54,601,484," Here are recently asked questions by other players\n\n\nQ:What type of server is this ?\nA:It's Freeroam.\n\n\nQ: For what FG stands for ? \nA: It's stand for Friend Gang\n\n\nQ: Where i can visit your site ? \nA: Site link is Fggaming.forumcroatian.com/\n",false,GUIEditor_Window[1]) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Glue",false,true) guiSetSizable(GUIEditor_Window, false) guiSetMovable(GUIEditor_Window, false) guiMemoSetReadOnly(GUIEditor_Memo[1],false) GUIEditor_Memo1[1] = guiCreateMemo(139,54,601,484,"Test, test",false,GUIEditor_Window[1]) end -- BIND F9 function onresourceStart () bindKey ("F9", "down", showUserPanel) guiSetVisible (GUIEditor_Window[1], false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanel () local playerName = getPlayerName ( getLocalPlayer() ) if guiGetVisible (GUIEditor_Window[1]) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) removeEventHandler( "onClientGUIClick", GUIEditor_Grid[1], showUserPanel ) else guiSetVisible (GUIEditor_Window[1], true) showCursor (true) addEventHandler( "onClientGUIClick", GUIEditor_Window[1], showUserPanel ) end end By the way , i got this error on 25. line ' ' expected near end Link to comment
Castillo Posted August 31, 2011 Share Posted August 31, 2011 Remove that 'end', I don't see any function or anything that should use it. Link to comment
CapY Posted August 31, 2011 Author Share Posted August 31, 2011 Lol now it starts on resource start and it's not toggleable with F9 . Link to comment
Static-X Posted August 31, 2011 Share Posted August 31, 2011 Can you post your code again? Link to comment
CapY Posted August 31, 2011 Author Share Posted August 31, 2011 Here it is : GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Memo1 = {} GUIEditor_Grid = {} lol = {} GUIEditor_Window[1] = guiCreateWindow(0.207,0.1426,0.607,0.5605,"Help Manager",true) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Grid[1] = guiCreateGridList(14,52,121,485,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(lol,2) guiGridListAddColumn(GUIEditor_Window[1],"Description",0.2) for i = 1, 2 do guiGridListAddRow(GUIEditor_Window[1]) end lol = guiGridListSetItemText(GUIEditor_Grid[1],0,1,"FAQ",false,true) GUIEditor_Memo[1] = guiCreateMemo(139,54,601,484," Here are recently asked questions by other players\n\n\nQ:What type of server is this ?\nA:It's Freeroam.\n\n\nQ: For what FG stands for ? \nA: It's stand for Friend Gang\n\n\nQ: Where i can visit your site ? \nA: Site link is Fggaming.forumcroatian.com/\n",false,GUIEditor_Window[1]) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Glue",false,true) guiSetSizable(GUIEditor_Window, false) guiSetMovable(GUIEditor_Window, false) guiMemoSetReadOnly(GUIEditor_Memo[1],false) GUIEditor_Memo1[1] = guiCreateMemo(139,54,601,484,"Test, test",false,GUIEditor_Window[1]) end -- BIND F9 function onresourceStart () bindKey ("F9", "down", showUserPanel) guiSetVisible (GUIEditor_Window[1], false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanel () local playerName = getPlayerName ( getLocalPlayer() ) if guiGetVisible (GUIEditor_Window[1]) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) removeEventHandler( "onClientGUIClick", GUIEditor_Grid[1], showUserPanel ) else guiSetVisible (GUIEditor_Window[1], true) showCursor (true) addEventHandler( "onClientGUIClick", GUIEditor_Window[1], showUserPanel ) end end Link to comment
Static-X Posted August 31, 2011 Share Posted August 31, 2011 you are adding rows in a window ? Fixed it but still dont know what you are doing with the gridlist GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Memo1 = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.207,0.1426,0.607,0.5605,"Help Manager",true) guiSetVisible(GUIEditor_Window[1],false) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Grid[1] = guiCreateGridList(14,52,121,485,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Description",0.6) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],1,1,"FAQ",false,true) GUIEditor_Memo[1] = guiCreateMemo(139,54,601,484," Here are recently asked questions by other players\n\n\nQ:What type of server is this ?\nA:It's Freeroam.\n\n\nQ: For what FG stands for ? \nA: It's stand for Friend Gang\n\n\nQ: Where i can visit your site ? \nA: Site link is Fggaming.forumcroatian.com/\n",false,GUIEditor_Window[1]) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Glue",false,true) guiWindowSetSizable(GUIEditor_Window[1], false) guiWindowSetMovable(GUIEditor_Window[1], false) guiMemoSetReadOnly(GUIEditor_Memo[1],false) --GUIEditor_Memo1[1] = guiCreateMemo(139,54,601,484,"Test, test",false,GUIEditor_Window[1]) -- BIND F9 function showUserPanel () local playerName = getPlayerName ( getLocalPlayer() ) if guiGetVisible (GUIEditor_Window[1]) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) else guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end bindKey ("F9", "down", showUserPanel) Link to comment
CapY Posted August 31, 2011 Author Share Posted August 31, 2011 Can you show one example with more rows , without same memo description ? Link to comment
Static-X Posted August 31, 2011 Share Posted August 31, 2011 Use this, not tested btw. GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Memo1 = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.207,0.1426,0.607,0.5605,"Help Manager",true) guiSetVisible(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(14,52,121,485,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Description",0.6) for i = 1,3 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],1,1,"FAQ",false,false) guiGridListSetItemText(GUIEditor_Grid[1],2,1,"Static-X",false,false) GUIEditor_Memo[1] = guiCreateMemo(139,54,601,484,"",false,GUIEditor_Window[1]) guiWindowSetSizable(GUIEditor_Window[1], false) guiWindowSetMovable(GUIEditor_Window[1], false) guiMemoSetReadOnly(GUIEditor_Memo[1],false) function setMemoText(text) guiSetText(GUIEditor_Memo[1],text) end function gridSelect() if guiGridListGetSelectedCount(GUIEditor_Grid[1]) == 0 then setMemoText("") return end local selc = guiGridListGetItemText(GUIEditor_Grid[1],guiGridListGetSelectedItem(GUIEditor_Grid[1]),1) if selc == "FAQ" then setMemoText("Here are recently asked questions by other players\n\n\nQ:What type of server is this ?\nA:It's Freeroam.\n\n\nQ: For what FG stands for ? \nA: It's stand for Friend Gang\n\n\nQ: Where i can visit your site ? \nA: Site link is Fggaming.forumcroatian.com/") elseif selc == "Static-X" then setMemoText("static-x ftw") end end function showUserPanel () local playerName = getPlayerName ( getLocalPlayer() ) if guiGetVisible (GUIEditor_Window[1]) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) removeEventHandler("onClientGUIClick",GUIEditor_Grid[1],gridSelect,false) else guiSetVisible (GUIEditor_Window[1], true) showCursor (true) addEventHandler("onClientGUIClick",GUIEditor_Grid[1],gridSelect,false) end end bindKey ("F9", "down", showUserPanel) 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