Skip to content

Commit 82d5b83

Browse files
authored
admin: Fixed that double clicking on a resource without setting opened the GUI settings window (#506)
1 parent 88348e0 commit 82d5b83

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

[admin]/admin/client/gui/admin_main.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ aLastSync = 0
2020
aResources = {}
2121

2222
local serverPassword = 'None'
23+
local hasResourceSetting
2324

2425
function guiComboBoxAdjustHeight ( combobox, itemcount )
2526
if getElementType ( combobox ) ~= "gui-combobox" or type ( itemcount ) ~= "number" then error ( "Invalid arguments @ 'guiComboBoxAdjustHeight'", 2 ) end
@@ -970,7 +971,9 @@ end
970971
function aClientDoubleClick ( button )
971972
if ( source == aTab2.ResourceList ) then
972973
if ( guiGridListGetSelectedItem ( aTab2.ResourceList ) ~= -1 ) then
973-
aManageSettings ( guiGridListGetItemText ( aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1 ) )
974+
if hasResourceSetting then
975+
aManageSettings ( guiGridListGetItemText ( aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1 ) )
976+
end
974977
end
975978
elseif ( source == aTab4.BansList ) then
976979
if ( guiGridListGetSelectedItem ( aTab4.BansList ) == -1 ) then
@@ -1198,7 +1201,8 @@ function aClientClick ( button )
11981201
end
11991202

12001203
addEvent ("setVisibilityOfSettingsButton", true)
1201-
function setVisibilityOfSettingsButton (hasResourceSetting)
1204+
function setVisibilityOfSettingsButton (showResourceSetting)
1205+
hasResourceSetting = showResourceSetting
12021206
if hasResourceSetting then
12031207
guiSetVisible(aTab2.ResourceSettings, true)
12041208
else

0 commit comments

Comments
 (0)