@@ -205,7 +205,7 @@ local function setProfileModified_(profile, modified)
205205
206206 local uiProfileName = getUiProfileName ()
207207
208- if getProfileName_ (profile ) == uiProfileName then
208+ if getProfileName_ (profile ) == uiProfileName and modified then
209209 -- после изменения слоя UiLayer в командах юнитов могут появиться/исчезнуть конфликты
210210 -- поэтому загруженные юниты нужно загрузить заново
211211 local profilesToUnload = {}
@@ -312,6 +312,16 @@ local function getProfileModifiers(profileName)
312312 return modifiers
313313end
314314
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+
315325local function getProfileCategories_ (profile )
316326 return profile .categories
317327end
@@ -747,9 +757,7 @@ local function loadDeviceProfileFromFile(filename, deviceGenericName, folder)
747757 local status
748758
749759 status , result = pcall (f )
750-
751760 QuagglesInputCommandInjector (filename , folder , env , result )
752-
753761 if status then
754762 if nonLocalized then
755763 for i , keyCommand in ipairs (result .keyCommands or {}) do
@@ -2433,7 +2441,7 @@ end
24332441
24342442local function saveChanges ()
24352443 local devices = InputUtils .getDevices ()
2436-
2444+
24372445 for i , profile in ipairs (profiles_ ) do
24382446 if getProfileLoaded_ (profile ) and getProfileModified_ (profile ) then
24392447 local profileName = getProfileName_ (profile )
@@ -2775,6 +2783,7 @@ return {
27752783 getProfileNameByUnitName = getProfileNameByUnitName ,
27762784 getProfileUnitName = getProfileUnitName ,
27772785 getProfileModifiers = getProfileModifiers ,
2786+ getProfileModified = getProfileModified ,
27782787 getProfileCategoryNames = getProfileCategoryNames ,
27792788 getProfileKeyCommands = getProfileKeyCommands ,
27802789 getProfileKeyCommand = getProfileKeyCommand ,
0 commit comments