warlitsh Posted June 8, 2012 Posted June 8, 2012 Salut , j'ai pris aujourd'hui une ressource pour faire sois meme son 'Help'. Tout et mis en place tout marche , je l'ouvre avec F1. Mais , lorsque je veux fermer le Help (Jappuis sur F1) et la, elle disparais mais ma souris reste sur l'écran comme si elle y etait encore..Du coup je ne peut plus bouger ni tourner la camera. Voila le .lua : window = guiCreateWindow(0.25,0.2656,0.5107,0.4635,"Help",true)text = guiCreateMemo(0.2792,0.2022,0.6692,0.736,"",true,window)lol1 = guiCreateGridList(0.0363,0.1994,0.2141,0.7331,true,window)guiGridListSetSelectionMode(lol1,2)guiMemoSetReadOnly(text, true)guiGridListAddColumn(lol1,"Page ",0.guiWindowSetMovable(window,false)guiWindowSetSizable(window,false)guiSetVisible(window,false)showCursor(false)for i = 1, 5 do guiGridListAddRow(lol1)endguiGridListSetItemText(lol1,0,1,"Rules",false,false)guiGridListSetItemText(lol1,1,1,"Commandes",false,false)guiGridListSetItemText(lol1,2,1,"Commandes2",false,false)guiGridListSetItemText(lol1,3,1,"Commandes3",false,false)guiGridListSetItemText(lol1,4,1,"Commandes4",false,false)local item,row = guiGridListGetSelectedItem ( lol1 ) local rulesF = fileOpen("rules.txt", true)local commandesF = fileOpen("commandes.txt", true)local commandes2F = fileOpen("commandes2.txt", true)local commandes3F = fileOpen("commandes3.txt", true)local commandes4F = fileOpen("commandes4.txt", true) local rules = fileRead(rulesF, 500) local commandes = fileRead(commandesF, 500) local commandes2 = fileRead(commandes2F, 500) local commandes3 = fileRead(commandes3F, 500) local commandes4 = fileRead(commandes4F, 500) addEventHandler('onClientGUIClick',root,function()local row,col = guiGridListGetSelectedItem ( lol1 ) if ( row == 0 ) and ( col == 1 ) then guiSetText(text,rules) elseif ( row == 1 ) and ( col == 1 ) then guiSetText(text,commandes) elseif ( row == 2 ) and ( col == 1 ) then guiSetText(text,commandes2) elseif ( row == 3 ) and ( col == 1 ) then guiSetText(text,commandes3) elseif ( row == 4 ) and ( col == 1 ) then guiSetText(text,commandes4) endend) bindKey('f1','down', function()guiSetVisible(window, not guiGetVisible(window))showCursor(not isCursorShowing())end) Merci de pouvoir m'aidez ^^ cordialement.
Sparrow Posted June 14, 2012 Posted June 14, 2012 window = guiCreateWindow(0.25,0.2656,0.5107,0.4635,"Help",true) text = guiCreateMemo(0.2792,0.2022,0.6692,0.736,"",true,window) lol1 = guiCreateGridList(0.0363,0.1994,0.2141,0.7331,true,window) guiGridListSetSelectionMode(lol1,2) guiMemoSetReadOnly(text, true) guiGridListAddColumn(lol1,"Page ",0.-- s8) --> guiWindowSetMovable(window,false) guiWindowSetSizable(window,false) guiSetVisible(window,false) showCursor(false) for i = 1, 5 do guiGridListAddRow(lol1) end guiGridListSetItemText(lol1,0,1,"Rules",false,false) guiGridListSetItemText(lol1,1,1,"Commandes",false,false) guiGridListSetItemText(lol1,2,1,"Commandes2",false,false) guiGridListSetItemText(lol1,3,1,"Commandes3",false,false) guiGridListSetItemText(lol1,4,1,"Commandes4",false,false) local item,row = guiGridListGetSelectedItem ( lol1 ) local rulesF = fileOpen("rules.txt", true) local commandesF = fileOpen("commandes.txt", true) local commandes2F = fileOpen("commandes2.txt", true) local commandes3F = fileOpen("commandes3.txt", true) local commandes4F = fileOpen("commandes4.txt", true) local rules = fileRead(rulesF, 500) local commandes = fileRead(commandesF, 500) local commandes2 = fileRead(commandes2F, 500) local commandes3 = fileRead(commandes3F, 500) local commandes4 = fileRead(commandes4F, 500) addEventHandler('onClientGUIClick',root, function() local row,col = guiGridListGetSelectedItem ( lol1 ) if ( row == 0 ) and ( col == 1 ) then guiSetText(text,rules) elseif ( row == 1 ) and ( col == 1 ) then guiSetText(text,commandes) elseif ( row == 2 ) and ( col == 1 ) then guiSetText(text,commandes2) elseif ( row == 3 ) and ( col == 1 ) then guiSetText(text,commandes3) elseif ( row == 4 ) and ( col == 1 ) then guiSetText(text,commandes4) end end ) function showWindow () if (guiGetVisible(window) == true) then guiSetVisible(window, false) showCursor(false) end if (guiGetVisible(window) == false) then guiSetVisible(window, true) showCursor(true) end end bindKey("F1", "down", showWindow)
InDev Posted June 28, 2012 Posted June 28, 2012 Ou plus court function showWindow () guiSetVisible( window, not guiGetVisible(window) ) showCursor( not isCursorShowing() ) end bindKey("F1", "down", showWindow)
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