32 Print(
"SCR_SettingsManagerKeybindModule: InputBindings were not created!",
LogLevel.WARNING);
36 int GetActionBindCount(
string actionName,
string actionPreset =
string.Empty, EInputDeviceType device = EInputDeviceType.KEYBOARD)
41 return m_Binding.GetBindingsCount(actionName, device, actionPreset);
51 void DeleteActionBindByIndex(
string actionName,
int keybindIndex,
string actionPreset =
"", EInputDeviceType device = EInputDeviceType.KEYBOARD)
56 if (
m_Binding.IsDefault(actionName, device, actionPreset))
59 m_Binding.CreateUserBinding(actionName, device, actionPreset);
63 m_Binding.RemoveBinding(actionName, device, actionPreset, keybindIndex);
68 void StartCaptureForAction(
string actionName,
string actionPreset, EInputDeviceType device = EInputDeviceType.KEYBOARD,
bool append =
false)
73 m_Binding.StartCapture(actionName, device, actionPreset, append);
77 void SetFilterForActionByIndex(
string actionName,
string actionPreset,
int filterIndex,
int keybindIndex, SCR_EActionPrefixType prefixType, EInputDeviceType device = EInputDeviceType.KEYBOARD)
82 array<ref SCR_KeyBindingFilter> filters =
GetFilters(prefixType);
90 if (
m_Binding.IsDefault(actionName, device, actionPreset))
93 m_Binding.CreateUserBinding(actionName, device, actionPreset);
97 m_Binding.SetFilter(actionName, device, actionPreset, keybindIndex, filter.m_sFilterString);
111 SCR_KeyBindingBind bind = binds.Get(bindIndex);
115 m_Binding.AddBinding(actionName, preset, bind.m_sBindString, filterName);
120 array<ref SCR_KeyBindingFilter>
GetFilters(SCR_EActionPrefixType filterType)
125 array <ref SCR_KeyBindingFilter> foundFilters = {};
128 if (filterType == SCR_EActionPrefixType.AMBIGUOUS || filter.GetFilterType() == filterType)
129 foundFilters.Insert(filter);
155 bool IsActionConflicted(
string actionName, notnull out array<SCR_KeyBindingEntry> confirmedConflicts,
int bindIndex,
string preset =
string.Empty)
160 confirmedConflicts.Clear();
162 array<int> indices = {};
163 array<string> conflicts = {};
164 array<string> presets = {};
165 m_Binding.GetConflicts(actionName, indices, conflicts, presets, EInputDeviceType.KEYBOARD, preset);
167 if (conflicts.IsEmpty())
170 array<SCR_KeyBindingEntry> foundActions = {};
173 foreach (
int index,
string action : conflicts)
175 if (indices[
index] != bindIndex)
180 foreach (SCR_KeyBindingEntry entry :
category.m_KeyBindingEntries)
182 if (entry.m_sActionName ==
"separator" || entry.m_sActionName != action || entry.m_sPreset != presets[
index])
185 foundActions.Insert(entry);
190 confirmedConflicts.Copy(foundActions);
192 return !foundActions.IsEmpty();
196 void UnbindAction(
string actionName,
string preset =
"", EInputDeviceType device = EInputDeviceType.KEYBOARD)
198 m_Binding.StartCapture(actionName, device, preset,
false);
205 void AddComboToActionByIndex(
string actionName,
string preset,
int comboIndex,
int keybindIndex,
string filterName =
string.Empty,
int comboPosition = 0)
218 m_Binding.InsertCombo(actionName, preset, combo.m_sComboString, filterName, keybindIndex, comboPosition);
223 void ResetAction(
string actionName,
string preset =
"", EInputDeviceType device = EInputDeviceType.KEYBOARD)
231 case EInputDeviceType.KEYBOARD:
232 case EInputDeviceType.MOUSE:
234 if (!
m_Binding.IsDefault(actionName, EInputDeviceType.KEYBOARD, preset))
236 m_Binding.ResetDefault(actionName, EInputDeviceType.KEYBOARD, preset);
240 if (!
m_Binding.IsDefault(actionName, EInputDeviceType.MOUSE, preset))
242 m_Binding.ResetDefault(actionName, EInputDeviceType.MOUSE, preset);
248 case EInputDeviceType.GAMEPAD:
250 if (!
m_Binding.IsDefault(actionName, EInputDeviceType.GAMEPAD, preset))
252 m_Binding.ResetDefault(actionName, EInputDeviceType.GAMEPAD, preset);
269 array<string> contexts = {};
277 foreach (SCR_KeyBindingEntry entry:
category.m_KeyBindingEntries)
279 if (device == EInputDeviceType.GAMEPAD)
284 if (device == EInputDeviceType.GAMEPAD && !entry.m_sPresetGamepadOptional.IsEmpty())
285 finalPreset = devicePrefix + entry.m_sPresetGamepadOptional;
286 else if (!entry.m_sPreset.IsEmpty())
287 finalPreset = devicePrefix + entry.m_sPreset;
289 if (device == EInputDeviceType.GAMEPAD && !entry.m_sActionNameGamepadOptional.IsEmpty())
290 actionName = entry.m_sActionNameGamepadOptional;
292 actionName = entry.m_sActionName;
324 Print(
"SCR_SettingsManagerKeybindModule: Controller presets not present, check init process!",
LogLevel.ERROR);
344 array<ref SCR_ControllerPreset> controllerPresets = {};
348 array<ResourceName> presets = {};
353 if (controllerPresets.IsIndexValid(presetIndex))
358 if (controllerPresets.IsIndexValid(
index))
360 preset = controllerPresets.Get(
index);
377 array<ref SCR_ControllerPreset> joystickPresets = {};
381 array<ResourceName> presets = {};
386 if (joystickPresets.IsIndexValid(presetIndex))
391 if (joystickPresets.IsIndexValid(
index))
393 preset = joystickPresets.Get(
index);
411 array<ref SCR_ControllerPreset> joystickPresets = {};
415 array<ResourceName> presets = {};
416 presets.Insert(
path);
431 array<ResourceName> setPresets = {};
435 if (setPresets.Contains(preset.GetResourceName()))
ArmaReforgerScripted GetGame()
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void SetModuleType(ESettingManagerModuleType managerType)
void SCR_SettingsManagerModuleBase()
ESettingManagerModuleType
Controller preset config class.
ResourceName GetResourceName()
Controller presets config root.
static const ResourceName KEY_BINDING_CONFIG
array< ref SCR_KeyBindingCombo > GetCustomComboKeys()
ref InputBinding m_Binding
void ResetAction(string actionName, string preset="", EInputDeviceType device=EInputDeviceType.KEYBOARD)
void SetFilterForActionByIndex(string actionName, string actionPreset, int filterIndex, int keybindIndex, SCR_EActionPrefixType prefixType, EInputDeviceType device=EInputDeviceType.KEYBOARD)
const string PRIMARY_PRESET_PREFIX
void GetControllerPresets(notnull out array< ref SCR_ControllerPreset > controllerPresets)
ref SCR_ControllerPresetsConfig m_ControllerPresetsConfig
void AddComboToActionByIndex(string actionName, string preset, int comboIndex, int keybindIndex, string filterName=string.Empty, int comboPosition=0)
static const ResourceName JOYSTICK_0_PRESETS_CONFIG
InputBinding GetInputBindings()
array< ref SCR_KeyBindingBind > GetCustomBinds()
ref SCR_KeyBindingMenuConfig m_KeybindConfig
void SCR_SettingsManagerKeybindModule()
int GetActionBindCount(string actionName, string actionPreset=string.Empty, EInputDeviceType device=EInputDeviceType.KEYBOARD)
void SelectJoystickPreset(int presetIndex=-1)
void AddKeybindToActionByIndex(string actionName, string preset, int bindIndex, string filterName=string.Empty)
void DeleteActionBindByIndex(string actionName, int keybindIndex, string actionPreset="", EInputDeviceType device=EInputDeviceType.KEYBOARD)
void ResetAllActions(EInputDeviceType device=EInputDeviceType.KEYBOARD)
bool IsActionConflicted(string actionName, notnull out array< SCR_KeyBindingEntry > confirmedConflicts, int bindIndex, string preset=string.Empty)
returns false if the action has no conflicts (no other action in keybind settings with same bind),...
const string GAMEPAD_PRESET_PREFIX
ref SCR_ControllerPresetsConfig m_JoystickPresetsConfig
array< ref SCR_KeyBindingFilter > GetFilters(SCR_EActionPrefixType filterType)
static const ResourceName JOYSTICK_1_PRESETS_CONFIG
int GetActivePresetIndex(notnull array< ref SCR_ControllerPreset > presets)
string GetPrimaryPresetPrefix()
void SelectControllerPresets(int presetIndex=-1)
void StartCaptureForAction(string actionName, string actionPreset, EInputDeviceType device=EInputDeviceType.KEYBOARD, bool append=false)
void GetJoystickPresets(notnull out array< ref SCR_ControllerPreset > joystickPresets)
Get all preset lists defined for joysticks.
string GetGamepadPresetPrefix()
void UnbindAction(string actionName, string preset="", EInputDeviceType device=EInputDeviceType.KEYBOARD)
void SelectJoystickPresetPath(string path)
static const ResourceName CONTROLLER_PRESETS_CONFIG
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.