@@ -205,7 +205,7 @@ local function setProfileModified_(profile, modified)
205
205
206
206
local uiProfileName = getUiProfileName ()
207
207
208
- if getProfileName_ (profile ) == uiProfileName then
208
+ if getProfileName_ (profile ) == uiProfileName and modified then
209
209
-- после изменения слоя UiLayer в командах юнитов могут появиться/исчезнуть конфликты
210
210
-- поэтому загруженные юниты нужно загрузить заново
211
211
local profilesToUnload = {}
@@ -312,6 +312,16 @@ local function getProfileModifiers(profileName)
312
312
return modifiers
313
313
end
314
314
315
+ local function getProfileModified (profileName )
316
+ local profile = findProfile_ (profileName )
317
+
318
+ if profile then
319
+ return getProfileModified_ (profile )
320
+ end
321
+
322
+ return false
323
+ end
324
+
315
325
local function getProfileCategories_ (profile )
316
326
return profile .categories
317
327
end
@@ -747,9 +757,7 @@ local function loadDeviceProfileFromFile(filename, deviceGenericName, folder)
747
757
local status
748
758
749
759
status , result = pcall (f )
750
-
751
760
QuagglesInputCommandInjector (filename , folder , env , result )
752
-
753
761
if status then
754
762
if nonLocalized then
755
763
for i , keyCommand in ipairs (result .keyCommands or {}) do
@@ -2433,7 +2441,7 @@ end
2433
2441
2434
2442
local function saveChanges ()
2435
2443
local devices = InputUtils .getDevices ()
2436
-
2444
+
2437
2445
for i , profile in ipairs (profiles_ ) do
2438
2446
if getProfileLoaded_ (profile ) and getProfileModified_ (profile ) then
2439
2447
local profileName = getProfileName_ (profile )
@@ -2775,6 +2783,7 @@ return {
2775
2783
getProfileNameByUnitName = getProfileNameByUnitName ,
2776
2784
getProfileUnitName = getProfileUnitName ,
2777
2785
getProfileModifiers = getProfileModifiers ,
2786
+ getProfileModified = getProfileModified ,
2778
2787
getProfileCategoryNames = getProfileCategoryNames ,
2779
2788
getProfileKeyCommands = getProfileKeyCommands ,
2780
2789
getProfileKeyCommand = getProfileKeyCommand ,
0 commit comments