@@ -45,7 +45,11 @@ function aManageACL ()
4545 aACLOk = guiCreateButton ( 0.55 , 0.40 , 0.19 , 0.04 , " Ok" , true , aAclForm )
4646 aACLCancel = guiCreateButton ( 0.76 , 0.40 , 0.19 , 0.04 , " Cancel" , true , aAclForm )
4747
48- aACLAddRight = guiCreateButton ( 0.55 , 0.30 , 0.40 , 0.04 , " Add Right" , true , aAclForm )
48+ aACLAddRight = guiCreateButton ( 0.55 , 0.35 , 0.40 , 0.04 , " Add Right" , true , aAclForm )
49+ aACLSetRight = guiCreateButton ( 0.55 , 0.40 , 0.40 , 0.04 , " Enable Selected Right" , true , aAclForm )
50+ aACLRemoveRight = guiCreateButton ( 0.55 , 0.45 , 0.40 , 0.04 , " Disable Selected Right" , true , aAclForm )
51+ aACLDeleteRight = guiCreateButton ( 0.55 , 0.55 , 0.40 , 0.04 , " Delete Right" , true , aAclForm )
52+
4953 aACLExit = guiCreateButton ( 0.75 , 0.90 , 0.27 , 0.04 , " Close" , true , aAclForm )
5054 aclDisplayOptions ( " " , " " )
5155
@@ -205,6 +209,15 @@ function aClientACLDoubleClick ( button )
205209 end
206210end
207211
212+ local function getSelectedRight ()
213+ local row = guiGridListGetSelectedItem ( aACLList )
214+ if ( row ~= - 1 ) then
215+ local state = guiGridListGetItemText ( aACLList , row , 2 )
216+ return state :gsub (" ^%s*(.-)%s*$" , " %1" )
217+ end
218+ return false
219+ end
220+
208221function aClientACLClick ( button )
209222 if ( source ~= aACLDropList ) then guiSetVisible ( aACLDropList , false ) end
210223 if ( button == " left" ) then
@@ -218,6 +231,15 @@ function aClientACLClick ( button )
218231 aInputBox ( " Create ACL Group" , " Enter object name:" , " " , " aclAddObject" , aAclData [" current" ] )
219232 elseif ( source == aACLAddRight ) then
220233 aInputBox ( " Create ACL" , " Enter right name:" , " " , " aclAddRight" , aAclData [" current" ] )
234+ elseif ( source == aACLSetRight ) then
235+ local right = getSelectedRight ()
236+ triggerServerEvent ( " aAdmin" , localPlayer , " acladd" , " right" , aAclData [" current" ], right )
237+ elseif ( source == aACLRemoveRight ) then
238+ local right = getSelectedRight ()
239+ triggerServerEvent ( " aAdmin" , localPlayer , " acladd" , " right" , aAclData [" current" ], right , false )
240+ elseif ( source == aACLDeleteRight ) then
241+ local right = getSelectedRight ()
242+ triggerServerEvent ( " aAdmin" , localPlayer , " aclremove" , " right" , aAclData [" current" ], right )
221243 elseif ( source == aACLDestroyGroup ) then
222244 aMessageBox ( " warning" , " Are you sure to destroy " .. aAclData [" current" ].. " group?" , " aclDestroyGroup" , aAclData [" current" ])
223245 elseif ( source == aACLDestroyACL ) then
@@ -278,6 +300,9 @@ function aclDisplayOptions ( state, name )
278300 guiSetVisible ( aACLAddACL , false )
279301 guiSetVisible ( aACLRemoveACL , false )
280302 guiSetVisible ( aACLAddRight , false )
303+ guiSetVisible ( aACLSetRight , false )
304+ guiSetVisible ( aACLRemoveRight , false )
305+ guiSetVisible ( aACLDeleteRight , false )
281306 guiSetVisible ( aACLDropCurrent , false )
282307 guiSetVisible ( aACLDropList , false )
283308 guiSetVisible ( aACLDropDown , false )
@@ -287,6 +312,9 @@ function aclDisplayOptions ( state, name )
287312 if ( state == " ACL" ) then
288313 guiSetVisible ( aACLDestroyACL , true )
289314 guiSetVisible ( aACLAddRight , true )
315+ guiSetVisible ( aACLSetRight , true )
316+ guiSetVisible ( aACLRemoveRight , true )
317+ guiSetVisible ( aACLDeleteRight , true )
290318 elseif ( state == " Group" ) then
291319 guiSetVisible ( aACLDestroyGroup , true )
292320 guiSetVisible ( aACLAddObject , true )
0 commit comments