Skip to content

Commit d206297

Browse files
committed
Updated to support DCS 2.7.7.14727 Data.lua changes
1 parent 6812663 commit d206297

File tree

2 files changed

+14
-5
lines changed
  • DCS-Input-Command-Injector-Quaggles

2 files changed

+14
-5
lines changed

DCS-Input-Command-Injector-Quaggles/DCS-Input-Command-Injector-Quaggles/Scripts/Input/Data.lua

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
313313
end
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+
315325
local function getProfileCategories_(profile)
316326
return profile.categories
317327
end
@@ -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

24342442
local 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,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.3
1+
1.0.4

0 commit comments

Comments
 (0)