diff --git a/Mod/Addons/dzn_EJAM.pbo b/Mod/Addons/dzn_EJAM.pbo deleted file mode 100644 index 63a5cbd..0000000 Binary files a/Mod/Addons/dzn_EJAM.pbo and /dev/null differ diff --git a/Mod/Addons/dzn_EJAM.pbo.10Dozen.bisign b/Mod/Addons/dzn_EJAM.pbo.10Dozen.bisign deleted file mode 100644 index eb2e8a3..0000000 Binary files a/Mod/Addons/dzn_EJAM.pbo.10Dozen.bisign and /dev/null differ diff --git a/Source/Addons/Init.sqf b/Source/Addons/Init.sqf deleted file mode 100644 index 52d5ad7..0000000 --- a/Source/Addons/Init.sqf +++ /dev/null @@ -1,77 +0,0 @@ - -#include "macro.hpp" - -call compile preprocessFileLineNumbers format ["%1\Enums.sqf", PATH]; -call compile preprocessFileLineNumbers format ["%1\Functions.sqf", PATH]; -call compile preprocessFileLineNumbers format ["%1\Settings.sqf", PATH]; - -// Exit at dedicated or headless client -if (!hasInterface) exitWith {}; -// Init main -[] spawn { - waitUntil { !isNull player && local player }; // Handle 3DEN and/or specator - sleep 5; - - GVAR(ClassFamiliesCache) = call CBA_fnc_createNamespace; - GVAR(ConfigData) = call CBA_fnc_createNamespace; - - if (missionNamespace getVariable ["ace_overheating_enabled",false]) then { - // Wait ACE init - waitUntil { - !isNil "ace_overheating_cacheWeaponData" - && !isNil "ace_overheating_cacheSilencerData" - }; - - // Update ACE Overheating data with custom mapping - call GVAR(fnc_processMappingData); - - // Run ACE Jammed handler if ACE Overheating enabled - GVAR(ACE_Jammed_EH) = [ - "ace_weaponJammed" - , { - if (_this select 1 != primaryWeapon player) exitWith {}; - call GVAR(fnc_setJammed); - } - ] call CBA_fnc_addEventHandler; - }; - - if (!(missionNamespace getVariable ["ace_overheating_enabled",false]) || GVAR(ForceOverallChance)) then { - - // Run EJAM's FiredEH if ACE Overheating disabled OR EJAM Jam chance forced - GVAR(FiredEH) = player addEventHandler ["Fired", { call GVAR(fnc_firedEH) }]; - }; - - // Add ACE Self-Interecation action if ACE Interaction is running - if (!isNil "ace_interact_menu_fnc_createAction") exitWith { - GVAR(ACE_InspectActionClass) = [ - SVAR(ACE_Action_Inspect) - , LOCALIZE_FORMAT_STR("Action_Inspect") - , getText (configFile >> "CfgWeapons" >> primaryWeapon player >> "picture") - , { call GVAR(fnc_inspectWeapon) } - , { true } - ] call ace_interact_menu_fnc_createAction; - - [ - typeof player, 1 - , ["ACE_SelfActions", "ACE_Equipment"] - , GVAR(ACE_InspectActionClass) - ] call ace_interact_menu_fnc_addActionToClass; - - // Loop to handle gun icon change - GVAR(CurrentWeapon) = primaryWeapon player; - while { true } do { - sleep 2; - if (GVAR(CurrentWeapon) != primaryWeapon player && primaryWeapon player != "") then { - GVAR(CurrentWeapon) = primaryWeapon player; - GVAR(ACE_InspectActionClass) set [2, getText(configFile >> "CfgWeapons" >> GVAR(CurrentWeapon) >> "picture")]; - - // Cache weapon family - GVAR(CurrentWeapon) spawn dzn_EJAM_fnc_getClassFamily - }; - - if (GVAR(Force)) then { - ace_overheating_unJamFailChance = 1; - }; - }; - }; -}; diff --git a/Source/Addons/functions/fnc_processWeaponFixed.sqf b/Source/Addons/functions/fnc_processWeaponFixed.sqf deleted file mode 100644 index ecd5b7a..0000000 --- a/Source/Addons/functions/fnc_processWeaponFixed.sqf +++ /dev/null @@ -1,85 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_processWeaponFixed - -Description: - Verify weapon states and unjam weapon - -Parameters: - nothing - -Returns: - nothing - -Examples: - (begin example) - call dzn_EJAM_fnc_processWeaponFixed - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -if (isNil { player getVariable SVAR(WeaponState) }) exitWith {}; - -private _gun = [primaryWeapon player] call BIS_fnc_baseWeapon; -(call GVAR(fnc_getWeaponState)) params ["_bolt","_chamber","_case","_mag"]; - -if ( - _bolt != "bolt_not_closed" - && _chamber in ["chamber_ready","chamber_empty"] - && _case == "case_ejected" - && _mag == "mag_attached" -) then { - - // Unset weapon from jamming/weapon state lists - private _causes = player getVariable SVAR(Cause); - private _states = player getVariable SVAR(WeaponState); - - player setVariable [ - SVAR(WeaponState) - , _states - (_states select { _gun == _x select 0 }) - ]; - player setVariable [ - SVAR(Cause) - , _causes - (_causes select { _gun == _x select 0 }) - ]; - player setVariable [SVAR(RemovedMagazine), nil]; - player setVariable [SVAR(LooseRound), nil]; - - [] spawn { - if (isNil "ace_common_fnc_displayTextStructured") then { - hint parseText LOCALIZE_FORMAT_STR("Hint_WeaponOK"); - uiSleep 2; - hint ""; - } else { - uiSleep 0.75; - hint ""; - }; - }; - - // Unjamming - if !(missionNamespace getVariable ["ace_overheating_enabled",false]) then { - - // No ACE Overheating - // Remove Prevent Fire handler once all guns were unjammed - if ((player getVariable [SVAR(Cause), []]) isEqualTo []) then { - player removeAction GVAR(PreventFireID); - GVAR(PreventFireID) = nil; - }; - - } else { - - // ACE Overheating enabled - private _oldFailChance = ace_overheating_unJamFailChance; - ace_overheating_unJamFailChance = 0; - - private _family = (primaryWeapon player) call GVAR(fnc_getClassFamily); - { - [player, _x, true] call ace_overheating_fnc_clearJam; - } forEach _family; - - ace_overheating_unJamFailChance = _oldFailChance; - }; -}; \ No newline at end of file diff --git a/Source/Addons/functions/fnc_setJammed.sqf b/Source/Addons/functions/fnc_setJammed.sqf deleted file mode 100644 index af3ffd8..0000000 --- a/Source/Addons/functions/fnc_setJammed.sqf +++ /dev/null @@ -1,78 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_setJammed - -Description: - Selects and applies Jam cause of current primary weapon - -Parameters: - nothing - -Returns: - nothing - -Examples: - (begin example) - call dzn_EJAM_fnc_setJammed - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -private _gun = [primaryWeapon player] call BIS_fnc_baseWeapon; -private _weights = [_gun, "malfunction"] call GVAR(fnc_getMappingData); -private _cause = GVAR(Causes) selectRandomWeighted _weights; - -_cause params ["_causeID","_weaponState"]; - -// Set weapon state -_weaponState call GVAR(fnc_setWeaponState); - -// List weapon as jammed -private _jamCauses = player getVariable [SVAR(Cause), []]; -if ((_jamCauses select { _gun == _x # 0 }) isEqualTo []) then { - - // Add gun to cause list - _jamCauses pushBack [_gun, _causeID]; - player setVariable [SVAR(Cause), _jamCauses]; -} else { - - // Update gun in cause list (actually there is no case for that) - private _itemInList = (_jamCauses select { _gun == _x # 0 }) # 0; - _itemInList set [1, _causeID]; -}; - -// Set gun jamming -if !(missionNamespace getVariable ["ace_overheating_enabled",false]) then { - // No ACE_Overheating - - if (isNil SVAR(PreventFireID)) then { - // Adding prevent fire handler - // until player's weapon is in jammed list - it will prevent firing from this gun but allow other - GVAR(PreventFireID) = player addAction [ - "", { - playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0]; - }, "", 0, false, true, "DefaultAction" - , format [ - "_muzzle = str(currentMuzzle player) splitString '""' joinString ''; - (_muzzle == primaryWeapon player) - && [player, primaryWeapon player] call CBA_fnc_canUseWeapon - && ""inspect"" call %1" - , SVAR(fnc_checkJammed) - ] - ]; - }; -} else { - - // ACE_Overheating - [player, primaryWeapon player] call ace_overheating_fnc_jamWeapon; - - [] spawn { - // Async jam whole weapon family (w. and w/o grips) - private _aceJammed = player getVariable ["ace_overheating_jammedWeapons", []]; - private _family = (primaryWeapon player) call GVAR(fnc_getClassFamily); - { _aceJammed pushBackUnique _x; } forEach _family; - }; -}; \ No newline at end of file diff --git a/Source/Addons/stringtable.xml b/Source/Addons/stringtable.xml deleted file mode 100644 index 3ca0951..0000000 --- a/Source/Addons/stringtable.xml +++ /dev/null @@ -1,471 +0,0 @@ - - - - - - - Unjam via EJAM only - Починка только через EJAM - 武器只能使用EJAM排障 - 武器只能使用EJAM排障 - - - Force EJAM unjam logic over ACE - Принудительно использовать логику починки EJAM вместо ACE - 强制使用EJAM排障覆盖ACE - 強制使用EJAM排障覆蓋ACE - - - - Override jam chance - Перезаписать шанс на заклинивание - 重新定义武器卡弹概率 - 重新定義武器卡彈概率 - - - Force EJAM Overall jam chance over ACE jamming logic. - Принудительно использовать общий шанс на заклинивание. - 强行让EJAM覆盖ACE卡弹机制 - 强行讓EJAM覆蓋ACE卡彈機制 - - - - Overall jam chance - Общий шанс заклинивания - 整体卡弹概率 - 整體卡彈概率 - - - Default jam chance for all primary weapons. From 0 to 100. Custom weapon setting will be used if set. - Шанс на клин для всего основного оружия. От 0 до 100. Если для оружия указаны специфические настройки - будут использованы они. - 所有主武器的默认卡弹概率. 从0到100. 自定义武器设置后生效 - 所有主武器的默認卡彈概率.從0到100.自定義武器設定後生效 - - - - (Chance of) Feed failure - (Шанс на) Неподачу патрона - 导气系统故障概率 - 導氣系統故障概率 - - - Chance for specific malfunction to happen if weapon got jammed. - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - (Chance of) Chamber failure - (Шанс на) Утыкание патрона - 供弹失败概率 - 供彈失敗概率 - - - Chance for specific malfunction to happen if weapon got jammed - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - (Chance of) Dud - (Шанс на) Осечка - 哑弹概率 - 啞彈概率 - - - Chance for specific malfunction to happen if weapon got jammed - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - (Chance of) Extraction failure - (Шанс на) Неизвлечение гильзы - 抽壳失败概率 - 抽殼失敗概率 - - - Chance for specific malfunction to happen if weapon got jammed - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - (Chance of) Ejection failure - (Шанс на) Прихват гильзы - 抛壳失败概率 - 拋殼失敗概率 - - - Chance for specific malfunction to happen if weapon got jammed - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - - Subsonic ammunition penalty - Пенальти дозвуковых боеприпасов - 亚音速弹卡弹概率 - 亞音速彈卡彈概率 - - - Jam chance penalty on using subsonic ammo. Value will be added to weapon's jam chance. - Штраф к шансу на заклинивание при использовании дозвуковых патронов. Значение будет добавляться к шансу на клин для оружия. - 额外增加使用亚音速弹药时的卡弹概率 - 額外新增使用亞音速彈藥時的卡彈概率 - - - - Weapon settings - Настройки оружия - 武器设置 - 武器設定 - - - Custom settings for specific weapon. In format [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. Use EJAM Configurator by [ call dzn_EJAM_Configure ] - Настройки для конкретных классов оружия. В формтае [@Класс, @Шанс_на_клин, @Шанс_на_поломку_типа#1...5]. Используйте конфигуратор вызовом [ call dzn_EJAM_Configure ] - 特定武器的自定义设置. 格式为 [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. 使用EJAM配置程序为 [ call dzn_EJAM_Configure ] - 特定武器的自定義設定. 格式為 [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. 使用EJAM配寘程式為 [ call dzn_EJAM_Configure ] - - - - - WEAPON MALFUNCTION - ОРУЖИЕ НЕИСПРАВНО - 武器故障 - 武器故障 - - - - CLOSE - ЗАКРЫТЬ - 关闭 - 關閉 - - - - - Bolt closed - Затвор в переднем положении - 枪机闭合 - 槍機閉合 - - - Bolt <t color="#f79400">not closed</t> - Затвор <t color="#f79400">в среднем положении</t> - 枪机 <t color="#f79400">未闭合</t> - 槍機 <t color="#f79400">未閉合</t> - - - Bolt <t color="#00b9f7">opened</t> - Затвор <t color="#00b9f7">в заднем положении</t> - 枪机 <t color="#00b9f7">已打开</t> - 槍機 <t color="#00b9f7">已打開</t> - - - Chamber empty - Патронник пустой - 枪膛内已清空 - 槍膛內已清空 - - - Chamber <t color="#00b9f7">loaded</t> - Патрон <t color="#00b9f7">в патроннике</t> - 枪膛内 <t color="#00b9f7">已供弹</t> - 槍膛內 <t color="#00b9f7">已供彈</t> - - - Round <t color="#f79400">stuck</t> - Патрон <t color="#f79400">уткнулся</t> - 子弹 <t color="#f79400">卡住</t> - 子彈 <t color="#f79400">卡住</t> - - - Round <t color="#f79400">not extracted</t> - Гильза <t color="#f79400">не извлечена</t> - 子弹 <t color="#f79400">未入膛</t> - 子彈 <t color="#f79400">未入膛</t> - - - Case <t color="#f79400">not ejected</t> - Гильза <t color="#f79400">не выброшена</t> - 弹壳 <t color="#f79400">未抛出</t> - 彈殼 <t color="#f79400">未拋出</t> - - - Case ejected - Гильза выброшена - 弹壳已抛出 - 彈殼已抛出 - - - Magazine attached - Магазин присоединен - 已插入弹匣 - 已插入彈匣 - - - Magazine <t color="#00b9f7">detached</t> - Магазин <t color="#00b9f7">отсоединен<</t>/Russian> - 弹匣 <t color="#00b9f7">卸下</t> - 彈匣 <t color="#00b9f7">卸下</t> - - - - - - Inspect weapon menu - Проверить оружие (меню) - 武器检查菜单 - 武器檢查選單 - - - Inspect weapon (no menu) - Проверить оружие (без меню) - 武器检查 (无菜单) - 武器檢查 (无菜单) - - - Attach/Detach magazine - Присоединить/Отсоединить магазин - 装入/卸下 弹匣 - 裝入/卸下 彈匣 - - - - Pull bolt - Передернуть затвор - 拉动枪机 - 拉動槍機 - - - Open bolt - Отвести затвор - 打开枪机 - 打開槍機 - - - Clear chamber - Очистить патронник - 清理膛室 - 清理膛室 - - - Remove case - Удалить гильзу - 清理卡住的弹壳 - 清理卡住的彈殼 - - - Detach magazine - Отсоединить магазин - 卸下弹匣 - 卸下彈匣 - - - Attach magazine - Присоединить магазин - 装入弹匣 - 裝入彈匣 - - - Inspect weapon - Проверить оружие - 检查武器 - 檢查武器 - - - - - Pulling the bolt - Передергиваем затвор - 正在拉动枪机 - 正在拉動槍機 - - - Opening the bolt - Отводим затвор назад - 正在打开枪机 - 正在打開槍機 - - - Clearing the chamber - Извлекаем патрон из патронника - 正在清理膛室 - 正在清理膛室 - - - Removing the case - Извлекаем гильзу - 正在清理卡住的弹壳 - 正在清理卡住的彈殼 - - - Detaching magazine - Отсоединяем магазин - 正在卸下弹匣 - 正在卸下彈匣 - - - Attaching magazine - Присоединием магазин - 正在装入弹匣 - 正在裝入彈匣 - - - Inspecting - Проверка - 正在检查武器 - 正在檢查武器 - - - - - Magazine dropped - Магазин сброшен - 弹匣脱落 - 彈匣脫落 - - - Magazine attached - Магазин присоединен - 弹匣已裝入 - 彈匣已裝入 - - - Weapon is functioning normally - Оружие функционирует нормально - 武器已可以正常使用 - 武器已可以正常使用 - - - Not possible to perform action! - Невозможно выполнить действие! - 不能执行该命令! - 不能執行該命令! - - - No magazine to load! - Нет магазинов! - 武器无弹匣! - 武器無彈匣! - - - - - - dzn EJAM Weapon Configurator - dzn EJAM Конфигуратор оружия - dzn EJAM 自定义武器设置 - dzn EJAM自定義武器設定 - - - Weapon - Оружие - 武器 - 武器 - - - No weapon selected - Оружие не выбрано - 没有选择武器 - 沒有選擇武器 - - - Filter... - Фильтр... - 搜索栏 - 蒐索欄 - - - - - Save - Сохранить - 保存 - 保存 - - - Copy - Копировать - 复制 - 複製 - - - Paste - Вставить - 粘贴 - 粘貼 - - - Reset - Сброс - 重置 - 重置 - - - Close - Закрыть - 关闭 - 關閉 - - - - - Enter/NumEnter to apply filter. Use "|" for multiple filter values - Enter/NumEnter для применения фильтра. Используйте "|" для фильтрации по нескольким значениям - 输入武器名称后. 按左Shift+回车或小键盘回车即可执行搜索. 搜索多个武器时可以用 "|" 将几个关键词隔开 - 輸入武器名稱後. 按左Shift+回車或小鍵盤回車即可執行蒐索. 蒐索多個武器時可以用 "|" 將幾個關鍵字隔開 - - - Unsets weapon settings - Сбрасывает настройки для оружия - 取消武器设置 - 取消武器設定 - - - Double clicking list element will also apply copied settings! - Двойной клик по оружию из списка также применит скопированные настройки! - 双击列表内容也能应用复制的设置文本! - 按兩下清單內容也能應用複製的設定文字! - - - - - No data to apply! - Нет данных для применения! - 无数据可应用! - 無數據可應用! - - - - Applied! - Применено! - 设置已应用! - 設定已應用! - - - Config copied! - Конфигурация скопирована! - 设置已复制! - 設定已複製! - - - Config saved! - Конфигурация сохранена! - 设置已保存! - 設定已保存! - - - - - \ No newline at end of file diff --git a/Source/Script/Enums.sqf b/Source/Script/Enums.sqf deleted file mode 100644 index 43d03da..0000000 --- a/Source/Script/Enums.sqf +++ /dev/null @@ -1,89 +0,0 @@ -#include "macro.hpp" - -// Causes list in format: [ @ID, [@BoltState, @ChamberState, @CaseState, @MagState] ] -GVAR(Causes) = [ - [ - /* "Неподача патрона" */ - /* To fix: "pull_bolt" */ - "feed_failure" - ,["bolt_closed","chamber_empty","case_ejected","mag_attached"] - ] - ,[ - /* "Утыкание патрона" */ - /* To fix: "open_bolt","detach_mag","clear_chamber" */ - "feed_failure_2" - ,["bolt_not_closed","chamber_stucked","case_ejected","mag_attached"] - - ] - ,[ - /* "Осечка" */ - /* To fix: "pull_bolt" */ - "dud" - ,["bolt_closed","chamber_ready","case_ejected","mag_attached"] - ] - ,[ - /* "Неизвлечение гильзы" */ - /* To fix: "open_bolt","detach_mag","remove_case","clear_chamber" */ - "fail_to_extract" - ,["bolt_not_closed","chamber_not_extracted","case_not_ejected","mag_attached"] - ] - ,[ - /* "Прихват гильзы" */ - /* To fix: "open_bolt","remove_case" */ - "fail_to_eject" - ,["bolt_not_closed","chamber_empty","case_not_ejected","mag_attached"] - ] -]; - -// , [ -// /* Затяжной выстрел */ -// /* To fix: "pull_bolt" */ -// "hang_fire" -// , ["bolt_closed","chamber_ready","case_ejected","mag_attached"] -// ] -// , [ -// /* Неконтролируемый автоматический огонь */ -// /* To fix: "detach_mag" or reload */ -// "unmanned_fire" -// , ["bolt_closed","chamber_ready","case_ejected","mag_attached"] -// ] - - -// Weapon States; In format [@ID, @DisplayName] -GVAR(States) = [ - ["bolt_closed" ,localize "STR_EJAM_State_BoltClosed"] - ,["bolt_not_closed" ,localize "STR_EJAM_State_BoltNotClosed"] - ,["bolt_opened" ,localize "STR_EJAM_State_BoltOpened"] - ,["chamber_empty" ,localize "STR_EJAM_State_ChamberEmpty"] - ,["chamber_ready" ,localize "STR_EJAM_State_ChamberReady"] - ,["chamber_stucked" ,localize "STR_EJAM_State_ChamberStucked"] - ,["chamber_not_extracted" ,localize "STR_EJAM_State_ChamberNotExtracted"] - ,["case_not_ejected" ,localize "STR_EJAM_State_ChamberNotEjected"] - ,["case_ejected" ,localize "STR_EJAM_State_CaseEjected"] - ,["mag_attached" ,localize "STR_EJAM_State_MagAttached"] - ,["mag_detached" ,localize "STR_EJAM_State_MagDetached"] -]; - -// Actions; In format [@ID, @DisplayName, @ProgressBarDisplayText, @TimeSpent] -GVAR(FixActions) = [ - ["pull_bolt" ,localize "STR_EJAM_Action_PullBolt" , localize "STR_EJAM_Action_PullBolt_Process" , 0.5] - ,["open_bolt" ,localize "STR_EJAM_Action_OpenBolt" , localize "STR_EJAM_Action_OpenBolt_Process" , 0.5] - ,["clear_chamber" ,localize "STR_EJAM_Action_ClearChamber" , localize "STR_EJAM_Action_ClearChamber_Process" , 3] - ,["remove_case" ,localize "STR_EJAM_Action_RemoveCase" , localize "STR_EJAM_Action_RemoveCase_Process" , 1.5] - ,["detach_mag" ,localize "STR_EJAM_Action_MagDetach" , localize "STR_EJAM_Action_MagDetach_Process" , 0.3] - ,["attach_mag" ,localize "STR_EJAM_Action_MagAttach" , localize "STR_EJAM_Action_MagAttach_Process" , 0.75] - ,["inspect" ,localize "STR_EJAM_Action_Inspect" , localize "STR_EJAM_Action_Inspect_Process" , 0.5] -]; - -GVAR(Defaults) = [ - "bolt_closed" - , "chamber_ready" - , "case_ejected" - , "mag_attached" -]; - -GVAR(Mapping) = [ - [ - "arifle_MX_F", 0.05, 45, 10, 45, 0, 0 - ] -]; \ No newline at end of file diff --git a/Source/Script/Functions.sqf b/Source/Script/Functions.sqf deleted file mode 100644 index cd30ae0..0000000 --- a/Source/Script/Functions.sqf +++ /dev/null @@ -1,33 +0,0 @@ -#include "macro.hpp" - -COMPILE_FUNCTION(fnc_firedEH); -COMPILE_FUNCTION(fnc_getMappingData); -COMPILE_FUNCTION(fnc_processMappingData); - -COMPILE_FUNCTION(fnc_checkJammed); -COMPILE_FUNCTION(fnc_setJammed); - -COMPILE_FUNCTION(fnc_getJamCause); -COMPILE_FUNCTION(fnc_setWeaponState); -COMPILE_FUNCTION(fnc_getWeaponState); - -COMPILE_FUNCTION(fnc_inspectWeapon); -COMPILE_FUNCTION(fnc_doAction); -COMPILE_FUNCTION(fnc_doHotkeyAction); - -COMPILE_FUNCTION(fnc_pullBolt); -COMPILE_FUNCTION(fnc_manageMagazine); -COMPILE_FUNCTION(fnc_processWeaponFixed); -COMPILE_FUNCTION(fnc_isMagAttached); -COMPILE_FUNCTION(fnc_hasMagazine); - -COMPILE_FUNCTION(fnc_playActionSound); -COMPILE_FUNCTION(fnc_getEnumText); -COMPILE_FUNCTION(fnc_getClassFamily); - -COMPILE_FUNCTION(fnc_uiShowUnjamMenu); -COMPILE_FUNCTION(fnc_uiShowBriefState); -COMPILE_FUNCTION(fnc_uiShowProgressBar); -COMPILE_FUNCTION(fnc_uiShowConfig); - -GVAR(Configure) = { [] spawn GVAR(fnc_uiShowConfig); }; \ No newline at end of file diff --git a/Source/Script/Settings.sqf b/Source/Script/Settings.sqf deleted file mode 100644 index 6b1d166..0000000 --- a/Source/Script/Settings.sqf +++ /dev/null @@ -1,181 +0,0 @@ -#include "macro.hpp" - -// Addon Settings - -private _add = { - params ["_var","_type","_val",["_exp", "No Expression"],["_subcat", ""],["_isGlobal", false]]; - - private _arr = [ - FORMAT_VAR(_var) - , _type - , [LOCALIZE_FORMAT_STR(_var), LOCALIZE_FORMAT_STR_desc(_var)] - , if (_subcat == "") then { TITLE } else { [TITLE, _subcat] } - , _val - , _isGlobal - ]; - - if !(typename _exp == "STRING" && { _exp == "No Expression" }) then { _arr pushBack _exp; }; - _arr call CBA_Settings_fnc_init; -}; - -private _addLocal = { - params ["_var", "_type", "_val"]; - [_var, _type, _val, nil, nil, false] call _add; -}; - -// Option to override ACE Unjam -[ - "Force" - , "CHECKBOX" - , true -] call _add; - -// Option to force EJAM's Jam chance over ACE -[ - "ForceOverallChance" - , "CHECKBOX" - , true -] call _add; - -// Overall jam chance -[ - "OverallChanceSetting" - , "SLIDER" - , [0,100, 0.01, 2] - , { - GVAR(OverallChance) = _this; - - // Reset cache - player setVariable [SVAR(FiredLastGunData), nil]; - } -] call _add; - -// Chance of Malfunctions -[ - "feed_failure_ChanceSettings" - , "SLIDER" - , [0, 100, 30, 0] - , { /* Reset cache */ player setVariable [SVAR(FiredLastGunData), nil]; } -] call _add; - -[ - "feed_failure_2_ChanceSettings" - , "SLIDER" - , [0, 100, 20, 0] - , { /* Reset cache */ player setVariable [SVAR(FiredLastGunData), nil]; } -] call _add; - -[ - "dud_ChanceSettings" - , "SLIDER" - , [0, 100, 30, 0] - , { /* Reset cache */ player setVariable [SVAR(FiredLastGunData), nil]; } -] call _add; - -[ - "fail_to_extract_ChanceSettings" - , "SLIDER" - , [0, 100, 20, 0] - , { /* Reset cache */ player setVariable [SVAR(FiredLastGunData), nil]; } -] call _add; - -[ - "fail_to_eject_ChanceSettings" - , "SLIDER" - , [0, 100, 20, 0] - , { /* Reset cache */ player setVariable [SVAR(FiredLastGunData), nil]; } -] call _add; - -// Subsonic ammo effect on jam chance -[ - "SubsonicJamEffectSetting" - , "EDITBOX" - , "20" - , { - GVAR(SubsonicJamEffect) = parseNumber _this; - } -] call _add; - -// Mapping of gun classes on jam settings -[ - "MappingSettings" - , "EDITBOX" - , str(GVAR(Mapping)) select [1, count str(GVAR(Mapping)) -2] - , { - GVAR(Mapping) = call compile ("[" + _this + "]"); - call GVAR(fnc_processMappingData); - - // Reset cache - player setVariable [SVAR(FiredLastGunData), nil]; - } -] call _add; - -// Keybinding -private _addKey = { - params["_var","_str","_downCode",["_defaultKey", nil],["_upCode", { true }]]; - - private _settings = [ - TITLE - , FORMAT_VAR(_var) - , LOCALIZE_FORMAT_STR(_str) - , _downCode - , _upCode - ]; - - if (!isNil "_defaultKey") then { _settings pushBack _defaultKey; }; - _settings call CBA_fnc_addKeybind; -}; - -// Inspect weapon key -[ - "InspectKey" - , "Action_Inspect" - , { call GVAR(fnc_inspectWeapon); true } - , [19, [false,true,false]] -] call _addKey; - -[ - "QuickInspectKey" - , "Action_QuickInspect" - , { "inspect" call GVAR(fnc_doHotkeyAction); true } -] call _addKey; - -// Pull bolt key -[ - "PullBoltKey" - , "Action_PullBolt" - , { "pull_bolt" call GVAR(fnc_doHotkeyAction); true } -] call _addKey; - -// Open bolt key -[ - "OpenBoltKey" - , "Action_OpenBolt" - , { "open_bolt" call GVAR(fnc_doHotkeyAction); true } -] call _addKey; - -// Toggle magazine key -[ - "MagazineKey" - , "Action_MagazineToggle" - , { - (call GVAR(fnc_getWeaponState)) params ["","","","_mag"]; - private _action = if (_mag == "mag_attached") then { "detach_mag" } else { "attach_mag" }; - _action call GVAR(fnc_doHotkeyAction); - true - } -] call _addKey; - -// Clear chamber key -[ - "ClearChamnerKey" - , "Action_ClearChamber" - , { "clear_chamber" call GVAR(fnc_doHotkeyAction); true } -] call _addKey; - -// Remove case key -[ - "RemoveCaseKey" - , "Action_RemoveCase" - , { "remove_case" call GVAR(fnc_doHotkeyAction); true } -] call _addKey; \ No newline at end of file diff --git a/Source/Script/config.cpp b/Source/Script/config.cpp deleted file mode 100644 index 59f8adf..0000000 --- a/Source/Script/config.cpp +++ /dev/null @@ -1,27 +0,0 @@ -class CfgPatches -{ - class dzn_EJAM - { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.1; - requiredAddons[] = {"CBA_MAIN"}; - author[] = {"10Dozen"}; - version = "2.6"; - }; -}; - -class Extended_PreInit_EventHandlers -{ - class dzn_EJAM - { - init = call compile preprocessFileLineNumbers "\dzn_EJAM\Init.sqf"; - }; -}; - -#include "ui\dialog.hpp" -#include "ui\dzn_EJAM_Menu.hpp" -#include "ui\dzn_EJAM_ProgressBar.hpp" -#include "ui\dzn_EJAM_Config.hpp" - -#include "sounds\CfgSounds.hpp" \ No newline at end of file diff --git a/Source/Script/description.ext b/Source/Script/description.ext deleted file mode 100644 index 874614c..0000000 --- a/Source/Script/description.ext +++ /dev/null @@ -1,12 +0,0 @@ - -#include "dzn_EJAM\ui\dialog.hpp" -#include "dzn_EJAM\ui\dzn_EJAM_Menu.hpp" -#include "dzn_EJAM\ui\dzn_EJAM_ProgressBar.hpp" -#include "dzn_EJAM\ui\dzn_EJAM_Config.hpp" -#include "dzn_EJAM\sounds\CfgSounds.hpp" - - -enableDebugConsole = 1; -disabledAI = 1; -respawn = 3; -respawnDelay = 9999999; diff --git a/Source/Script/functions/fnc_checkJammed.sqf b/Source/Script/functions/fnc_checkJammed.sqf deleted file mode 100644 index 53a7d31..0000000 --- a/Source/Script/functions/fnc_checkJammed.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_checkJammed - -Description: - Check whether primary weapon is jammed and (a) cause set, (b) cause not set. - -Parameters: - _this - Need to check both ACE and EJAM jamming is set - -Returns: - _checkType - Type fo check: "inspect" (check that both cause and ace_overheat is set) or "cause" (check that ace is jammed but no cause set) - -Examples: - (begin example) - _isJammed = true call dzn_EJAM_fnc_checkJammed; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -private _aceJammed = !(missionNamespace getVariable ["ace_overheating_enabled", false]) || (primaryWeapon player) in (player getVariable ["ace_overheating_jammedWeapons", []]); -private _causeSet = (call GVAR(fnc_getJamCause)) != ""; - -private _result = false; - -switch toLower(_this) do { - case "inspect": { - _result = _aceJammed && _causeSet; - }; - case "cause": { - _result = _aceJammed && !_causeSet; - }; -}; - -(_result) \ No newline at end of file diff --git a/Source/Script/functions/fnc_doAction.sqf b/Source/Script/functions/fnc_doAction.sqf deleted file mode 100644 index 6c8fe62..0000000 --- a/Source/Script/functions/fnc_doAction.sqf +++ /dev/null @@ -1,132 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_doAction - -Description: - Process selected action from Weapon Malfunction menu and return to malfunction menu. - -Parameters: - _actionName - action to perform - -Returns: - nothing - -Examples: - (begin example) - "pull_bolt" call dzn_EJAM_fnc_doAction; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -params ["_actionID", ["_isMenuAction", true]]; - -GVAR(ActionInProgress) = true; - -// Update magazine state -[nil, nil, nil, if (call GVAR(fnc_isMagAttached)) then { "mag_attached" } else { "mag_detached" }] call GVAR(fnc_setWeaponState); - -#define REMOVE_ROUND if ((player getVariable SVAR(RemovedMagazine) select 1) > 0) then { player setVariable [SVAR(LooseRound), true]; } -#define SHOW_MENU if (_args) then { call GVAR(fnc_inspectWeapon) } else { "state" call GVAR(fnc_uiShowBriefState) } -#define FINISH_ACTION GVAR(ActionInProgress) = nil -#define PLAY_ANIMATION if (stance player != "PRONE" && vehicle player == player) then { player playActionNow "DismountOptic"; } - -private _title = [_actionID, "process"] call GVAR(fnc_getEnumText); -private _args = _isMenuAction; -private _time = [_actionID, "time"] call GVAR(fnc_getEnumText);; -private _code = {}; - -private _needExecute = true; -private _needSound = true; - -switch (_actionID) do { - case "pull_bolt": { - _code = { - call GVAR(fnc_pullBolt); - SHOW_MENU; - FINISH_ACTION; - }; - }; - case "open_bolt": { - _code = { - ["bolt_opened",nil,nil,nil] call GVAR(fnc_setWeaponState); - SHOW_MENU; - FINISH_ACTION; - }; - }; - case "clear_chamber": { - PLAY_ANIMATION; - _code = { - REMOVE_ROUND; - [nil,"chamber_empty",nil,nil] call GVAR(fnc_setWeaponState); - SHOW_MENU; - FINISH_ACTION; - }; - }; - case "remove_case": { - PLAY_ANIMATION; - _code = { - [nil,nil,"case_ejected",nil] call GVAR(fnc_setWeaponState); - SHOW_MENU; - FINISH_ACTION; - }; - }; - case "detach_mag": { - if ((primaryWeaponMagazine player) isEqualTo []) exitWith { - FINISH_ACTION; - _needExecute = false; - }; - - _code = { - true call GVAR(fnc_manageMagazine); - [nil, nil, nil, if (call GVAR(fnc_isMagAttached)) then { "mag_attached" } else { "mag_detached" }] call GVAR(fnc_setWeaponState); - SHOW_MENU; - FINISH_ACTION; - }; - }; - case "attach_mag": { - if !(call GVAR(fnc_hasMagazine)) exitWith { - FINISH_ACTION; - private _msg = [LOCALIZE_FORMAT_STR("Hint_NoMag"),1.5]; - if (isNil "ace_common_fnc_displayTextStructured") then { - hint parseText (_msg select 0); - } else { - _msg call ace_common_fnc_displayTextStructured; - }; - - _needExecute = false; - }; - - _code = { - false call GVAR(fnc_manageMagazine); - [nil, nil, nil, if (call GVAR(fnc_isMagAttached)) then { "mag_attached" } else { "mag_detached" }] call GVAR(fnc_setWeaponState); - SHOW_MENU; - FINISH_ACTION; - }; - }; - case "inspect": { - _code = { - "state" call GVAR(fnc_uiShowBriefState); - FINISH_ACTION; - }; - _needSound = false; - }; -}; - -if !(_needExecute) exitWith {}; - -if (isNil "ace_common_fnc_progressBar") then { - - // No ACE: use custom progress bar - [_time, _title, _code, _args] call GVAR(fnc_uiShowProgressBar); -} else { - - // ACE detected: use ace progress bar - [_time, _args, _code, {}, _title, {true}, ["isNotInside", "isNotSwimming", "isNotSitting"]] call ace_common_fnc_progressBar; -}; - -if (_needSound) then { - _actionID call GVAR(fnc_playActionSound); -}; \ No newline at end of file diff --git a/Source/Script/functions/fnc_doHotkeyAction.sqf b/Source/Script/functions/fnc_doHotkeyAction.sqf deleted file mode 100644 index 6070d1d..0000000 --- a/Source/Script/functions/fnc_doHotkeyAction.sqf +++ /dev/null @@ -1,41 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_doHotkeyAction - -Description: - Process hotkey action init - -Parameters: - _actionName - action to perform - -Returns: - nothing - -Examples: - (begin example) - "pull_bolt" call dzn_EJAM_fnc_doHotkeyAction; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -if !(isNil SVAR(ActionInProgress)) exitWith {}; - -if !("inspect" call GVAR(fnc_checkJammed)) exitWith { - "OK" call GVAR(fnc_uiShowBriefState); -}; - -(call GVAR(fnc_getWeaponState)) params ["_bolt","_chamber","_case","_mag"]; -private _actionID = _this; - -if ( - (_actionID == "clear_chamber" && (_mag == "mag_attached" || _bolt in ["bolt_closed","bolt_not_closed"])) - || - (_actionID == "remove_case" && _bolt in ["bolt_closed","bolt_not_closed"]) -) exitWith { - "no_access" call GVAR(fnc_uiShowBriefState); -}; - -[_actionID, false] call GVAR(fnc_doAction); \ No newline at end of file diff --git a/Source/Script/functions/fnc_firedEH.sqf b/Source/Script/functions/fnc_firedEH.sqf deleted file mode 100644 index 2be2944..0000000 --- a/Source/Script/functions/fnc_firedEH.sqf +++ /dev/null @@ -1,70 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_firedEH - -Description: - -- - -Parameters: - _FiredEH - Eventhandler data of "Fired" EH - -Returns: - nothing - -Examples: - (begin example) - _firedEH call dzn_EJAM_fnc_firedEH; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; - -private _gun = primaryWeapon player; - -if ( _weapon != _gun || {_muzzle != _gun} || "inspect" call GVAR(fnc_checkJammed) ) exitWith { - // Exit if fired not a main muzzle (e.g. UGL) OR weapon already jammed -}; - -// Get jam chacne (from config or overall) -private _lastFiredGunData = player getVariable [SVAR(FiredLastGunData), []]; -private _jamChance = 0; -if (_lastFiredGunData isEqualTo [] || { _gun != _lastFiredGunData select 0 }) then { - // No gun data - get from mapping - _jamChance = [_gun, "jam"] call GVAR(fnc_getMappingData); - player setVariable [SVAR(FiredLastGunData), [_gun, _jamChance]]; -} else { - // Gun data cached - _jamChance = _lastFiredGunData select 1; -}; - -// Check is subsonic to enlarge jam chance -private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); -private _subsonicSpeed = getNumber (configFile >> "CfgAmmo" >> _ammo >> "typicalSpeed") < 343; -private _lowAudible = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire") < 10; -if (_subsonicSpeed && _lowAudible ) then { - _jamChance = _jamChance + GVAR(SubsonicJamEffect); -}; - -// Get random value -private _random = random 100; - -// Check random vs jam chance to modify -if (_random <= _jamChance) then { - call GVAR(fnc_setJammed); - - // Stop firing - _gun spawn { - private _gun = _this; - private _frame = diag_frameno; - private _ammo = player ammo _gun; - if (_ammo > 0) then { - player setAmmo [_gun, 0]; - waitUntil {_frame < diag_frameno}; - player setAmmo [_gun, _ammo]; - }; - }; -}; \ No newline at end of file diff --git a/Source/Script/functions/fnc_getClassFamily.sqf b/Source/Script/functions/fnc_getClassFamily.sqf deleted file mode 100644 index 508e484..0000000 --- a/Source/Script/functions/fnc_getClassFamily.sqf +++ /dev/null @@ -1,76 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_getClassFamily - -Description: - Search and return all guns of the same family - (e.g. base weapon and all weapons models w. grip) - -Parameters: - _gunClass - Classname to get family - -Returns: - _familyClasses - List of all family classes - -Examples: - (begin example) - _familyClasses = _gunClass call dzn_EJAM_fnc_getClassFamily; // [@Weapon1, @Weapon2 ... ] - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -private _class = _this; -private _parent = [_class] call BIS_fnc_baseWeapon; -private _result = []; - -if (!isNil { GVAR(ClassFamiliesCache) getVariable _parent }) then { - // Return cached data - _result = GVAR(ClassFamiliesCache) getVariable _parent; - -} else { - // Get data - private _fnc_gfc = { - params ["_class", "_par","_type",["_config","CfgWeapons"]]; - private _result = switch toUpper(_type) do { - case "T"; - case "TXT"; - case "TEXT": { (getText (configFile >> _config >> _class >> _par)) }; - case "A"; - case "ARR"; - case "ARRAY": { (getArray (configFile >> _config >> _class >> _par)) }; - case "N"; - case "NUM"; - case "NUMBER": { (getNumber (configFile >> _config >> _class >> _par)) }; - }; - _result - }; - - private _allGunClasses = configFile >> "CfgWeapons"; - for "_i" from 0 to ((count _allGunClasses) - 1) do { - private _classItem = configName (_allGunClasses select _i); - - if (_classItem != "access") then { - if ( - [_classItem,"type","n"] call _fnc_gfc == 1 - && { - [_classItem,"picture","t"] call _fnc_gfc != "" - && [_classItem,"model","t"] call _fnc_gfc != "" - && [_classItem,"scope","n"] call _fnc_gfc == 2 - } - ) then { - private _baseClass = [_classItem] call BIS_fnc_baseWeapon; - if (_baseClass == _parent) then { - _result pushBack _classItem; - }; - }; - }; - }; - - // Cache data - GVAR(ClassFamiliesCache) setVariable [_parent, _result]; -}; - -(_result) \ No newline at end of file diff --git a/Source/Script/functions/fnc_getEnumText.sqf b/Source/Script/functions/fnc_getEnumText.sqf deleted file mode 100644 index cc77079..0000000 --- a/Source/Script/functions/fnc_getEnumText.sqf +++ /dev/null @@ -1,47 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_getEnumText - -Description: - Resolve enum value to localized text - -Parameters: - _enumValue - Value of enum - _enumType - Type of the enum to search: "state", "action", "process", "time" - -Returns: - _text - Localized text value - -Examples: - (begin example) - _boltStateText = ["bolt_not_closed", "state"] call dzn_EJAM_fnc_getEnumText; - _pullProcess = ["pull_bolt", "process"] call dzn_EJAM_fnc_getEnumText; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -params ["_text", "_source"]; - -_text = toLower(_text); -_source = toLower(_source); - -private _result = ""; -switch (_source) do { - case "state": { - _result = (GVAR(States) select { _x select 0 == _text }) select 0 select 1; - }; - case "action": { - _result = (GVAR(FixActions) select { _x select 0 == _text }) select 0 select 1; - }; - case "process": { - _result = (GVAR(FixActions) select { _x select 0 == _text }) select 0 select 2; - }; - case "time": { - _result = (GVAR(FixActions) select { _x select 0 == _text }) select 0 select 3; - }; -}; - -(_result) \ No newline at end of file diff --git a/Source/Script/functions/fnc_getJamCause.sqf b/Source/Script/functions/fnc_getJamCause.sqf deleted file mode 100644 index f8e9680..0000000 --- a/Source/Script/functions/fnc_getJamCause.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_getJamCause - -Description: - Return current primary weapon jam cause or "" if not set - -Parameters: - nothing - -Returns: - _jamCause - Cause enum value or "" - -Examples: - (begin example) - _cause = call dzn_EJAM_fnc_getJamCause; // "dud" - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -private _gun = [primaryWeapon player] call BIS_fnc_baseWeapon; -private _cause = ((player getVariable [SVAR(Cause), []]) select { _gun == _x # 0 }); - -if (_cause isEqualTo []) exitWith { "" }; - -(_cause # 0 # 1) \ No newline at end of file diff --git a/Source/Script/functions/fnc_getMappingData.sqf b/Source/Script/functions/fnc_getMappingData.sqf deleted file mode 100644 index cceecf6..0000000 --- a/Source/Script/functions/fnc_getMappingData.sqf +++ /dev/null @@ -1,66 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_getMappingData - -Description: - Return jam/malfunctions mapping data. - -Parameters: - _weaponClass - Classname of weapon to get data - _dataType - Type of data to return: "jam" or "malfunction" - _isForConfig - (optional) Is data returned for config or for inner functions. Default: false - -Returns: - _data - Mapping data ( for "jam") or ( of "malfunction") - -Examples: - (begin example) - _jamCahcne = [_gun, "jam"] call dzn_EJAM_fnc_getMappingData; // 1.5 - _malfunctionWeights = [_gun, "malfunction"] call dzn_EJAM_fnc_getMappingData; // [20,20,25,25,10] - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -params ["_gun", "_type", ["_isForConfig", false]]; - -_gun = [_gun] call BIS_fnc_baseWeapon; -_type = toLower(_type); - -private _data = []; -private _result = -1; - -if (!isNil { GVAR(ConfigData) getVariable _gun}) then { - // Customized data found - _data = [] + (GVAR(ConfigData) getVariable _gun); - -} else { - // No custom data - use overall - if !(_isForConfig) then { - _data = [ - GVAR(OverallChance) - , GVAR(feed_failure_ChanceSettings) - , GVAR(feed_failure_2_ChanceSettings) - , GVAR(dud_ChanceSettings) - , GVAR(fail_to_extract_ChanceSettings) - , GVAR(fail_to_eject_ChanceSettings) - ]; - } else { - _data = [0,0,0,0,0,0]; - }; - -}; - -switch toLower(_type) do { - case "jam": { - _result = _data select 0; - }; - case "malfunction": { - _data deleteAt 0; - _result = _data; - }; -}; - -(_result) \ No newline at end of file diff --git a/Source/Script/functions/fnc_getWeaponState.sqf b/Source/Script/functions/fnc_getWeaponState.sqf deleted file mode 100644 index dc653ec..0000000 --- a/Source/Script/functions/fnc_getWeaponState.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_getWeaponState - -Description: - Return state of current primary weapon elements (bolt, chamber, case ejection port and magazine) - -Parameters: - nothing - -Returns: - _weaponState - List of weapon parts states - -Examples: - (begin example) - _weaponState = call dzn_EJAM_fnc_getWeaponState; // ["bolt_not_closed","chamber_stucked","case_ejected","mag_attached"] - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -private _gun = [primaryWeapon player] call BIS_fnc_baseWeapon; -private _state = ((player getVariable [SVAR(WeaponState), []]) select { _gun == _x # 0 }); - -if (_state isEqualTo []) exitWith { [] }; - -_state = [] + (_state # 0); -_state deleteAt 0; - -(_state) \ No newline at end of file diff --git a/Source/Script/functions/fnc_hasMagazine.sqf b/Source/Script/functions/fnc_hasMagazine.sqf deleted file mode 100644 index 1b24c0e..0000000 --- a/Source/Script/functions/fnc_hasMagazine.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_hasMagazine - -Description: - Returns true if player has magazine to current primary weapon. - -Parameters: - nothing - -Returns: - _hasMagazine - Does player has magazine - -Examples: - (begin example) - _hasMagazine = call dzn_EJAM_fnc_hasMagazine; // true - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -private _weaponMags = (getArray (configFile >> "CfgWeapons" >> primaryWeapon player >> "magazines")) apply { toLower(_x) }; -private _mag = []; -{ - if (toLower(_x select 0) in _weaponMags) exitWith { _mag = _x; }; -} forEach (magazinesAmmo player); - -private _result = !(_mag isEqualTo []); - -(_result) \ No newline at end of file diff --git a/Source/Script/functions/fnc_inspectWeapon.sqf b/Source/Script/functions/fnc_inspectWeapon.sqf deleted file mode 100644 index 6dbe879..0000000 --- a/Source/Script/functions/fnc_inspectWeapon.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_inspectWeapon - -Description: - Open Unjam menu or draw hint if weapon is not jammed. - -Parameters: - nothing - -Returns: - nothing - -Examples: - (begin example) - call dzn_EJAM_fnc_inspectWeapon; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -if ("inspect" call GVAR(fnc_checkJammed)) then { - [] spawn GVAR(fnc_uiShowUnjamMenu); -} else { - hint parseText format [ - "%1
" - , LOCALIZE_FORMAT_STR("Hint_WeaponOK") - , getText (configFile >> "CfgWeapons" >> primaryWeapon player >> "picture") - ]; -}; \ No newline at end of file diff --git a/Source/Script/functions/fnc_isMagAttached.sqf b/Source/Script/functions/fnc_isMagAttached.sqf deleted file mode 100644 index 18eda9e..0000000 --- a/Source/Script/functions/fnc_isMagAttached.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_isMagAttached - -Description: - Process selected action from Weapon Malfunction menu - -Parameters: - nothing - -Returns: - _isMagAttached - Is magazine attached to primary weapon - -Examples: - (begin example) - call dzn_EJAM_fnc_isMagAttached; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -private _result = (weaponState player select 3) != ""; - -(_result) \ No newline at end of file diff --git a/Source/Script/functions/fnc_manageMagazine.sqf b/Source/Script/functions/fnc_manageMagazine.sqf deleted file mode 100644 index 767c4e8..0000000 --- a/Source/Script/functions/fnc_manageMagazine.sqf +++ /dev/null @@ -1,68 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_manageMagazine - -Description: - Process magazine detach/attach action called from Weapon Malfunction menu. - If appropriate setting is turned on - detached magazine will be dropped in front of player, - -Parameters: - _needRemove - Should magazine be detached (true) or attached (false) from weapon - -Returns: - nothing - -Examples: - (begin example) - true call dzn_EJAM_fnc_manageMagazine; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -private _needRemove = _this; -private _gun = primaryWeapon player; -private _msg = []; - -if (_needRemove) then { - private _allMags = magazinesAmmo player; - private _gunMagClass = (primaryWeaponMagazine player) select 0; - private _gunMagAmmo = player ammo _gun; - - player removePrimaryWeaponItem _gunMagClass; - player addMagazine [_gunMagClass, _gunMagAmmo]; - - if ((magazinesAmmo player) isEqualTo _allMags) then { - private _holder = createVehicle ["WeaponHolderSimulated",player modelToWorld [0,0.75,0], [],0,"CAN_COLLIDE"]; - _holder addMagazineAmmoCargo [_gunMagClass, 1, _gunMagAmmo]; - - "drop_mag" call GVAR(fnc_playActionSound); - _msg = [LOCALIZE_FORMAT_STR("Hint_MagDropped"), 1.5]; - }; -} else { - private _weaponMags = (getArray (configFile >> "CfgWeapons" >> _gun >> "magazines")) apply { toLower(_x) }; - private _mag = []; - { - if (toLower(_x select 0) in _weaponMags) exitWith { _mag = _x; }; - } forEach (magazinesAmmo player); - - if (_mag isEqualTo []) then { - _msg = [LOCALIZE_FORMAT_STR("Hint_NoMag"),1.5]; - } else { - player addPrimaryWeaponItem (_mag select 0); - player setAmmo [primaryWeapon player, (_mag select 1)]; - player removeMagazine (_mag select 0); - - _msg = [LOCALIZE_FORMAT_STR("Hint_MagAttached"),1.5] - }; -}; - -if (_msg isEqualTo []) exitWith {}; - -if (isNil "ace_common_fnc_displayTextStructured") then { - hint parseText (_msg select 0); -} else { - _msg call ace_common_fnc_displayTextStructured; -}; \ No newline at end of file diff --git a/Source/Script/functions/fnc_playActionSound.sqf b/Source/Script/functions/fnc_playActionSound.sqf deleted file mode 100644 index 698e850..0000000 --- a/Source/Script/functions/fnc_playActionSound.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_playActionSound - -Description: - Plays appropriate action sound in 3D - -Parameters: - _actionName - action to perform - -Returns: - nothing - -Examples: - (begin example) - "pull_bolt" call dzn_EJAM_fnc_playActionSound; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -private _actionID = _this; - -player say3d [_actionID, 1000, 1]; \ No newline at end of file diff --git a/Source/Script/functions/fnc_processMappingData.sqf b/Source/Script/functions/fnc_processMappingData.sqf deleted file mode 100644 index 95cf54d..0000000 --- a/Source/Script/functions/fnc_processMappingData.sqf +++ /dev/null @@ -1,49 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_processMappingData - -Description: - Update ACE Overheating cache data and set up EJAM customized config - according to dzn_EJAM Jam chance Mapping - -Parameters: - nothing - -Returns: - nothing - -Examples: - (begin example) - call dzn_EJAM_fnc_processMappingData; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -// Reset EJAM's config -private _configVars = allVariables GVAR(ConfigData); -{ - GVAR(ConfigData) setVariable [_x, nil]; -} forEach _configVars; - -{ - _x params ["_gun","_jamChance"]; - - _gun = [_gun] call BIS_fnc_baseWeapon; - - if (isNil {ace_overheating_cacheWeaponData getVariable _gun}) then { - [_gun] call ace_overheating_fnc_getWeaponData; - }; - - private _data = ace_overheating_cacheWeaponData getVariable _gun; - - // Set ACE Overheating customized data - _data set [2, _jamChance/100]; - ace_overheating_cacheWeaponData setVariable [_gun, _data]; - - // Set EJAM customized data for weapon - GVAR(ConfigData) setVariable [_gun, _x select [1,6]]; - -} forEach GVAR(Mapping); \ No newline at end of file diff --git a/Source/Script/functions/fnc_processWeaponFixed.sqf b/Source/Script/functions/fnc_processWeaponFixed.sqf deleted file mode 100644 index ecd5b7a..0000000 --- a/Source/Script/functions/fnc_processWeaponFixed.sqf +++ /dev/null @@ -1,85 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_processWeaponFixed - -Description: - Verify weapon states and unjam weapon - -Parameters: - nothing - -Returns: - nothing - -Examples: - (begin example) - call dzn_EJAM_fnc_processWeaponFixed - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -if (isNil { player getVariable SVAR(WeaponState) }) exitWith {}; - -private _gun = [primaryWeapon player] call BIS_fnc_baseWeapon; -(call GVAR(fnc_getWeaponState)) params ["_bolt","_chamber","_case","_mag"]; - -if ( - _bolt != "bolt_not_closed" - && _chamber in ["chamber_ready","chamber_empty"] - && _case == "case_ejected" - && _mag == "mag_attached" -) then { - - // Unset weapon from jamming/weapon state lists - private _causes = player getVariable SVAR(Cause); - private _states = player getVariable SVAR(WeaponState); - - player setVariable [ - SVAR(WeaponState) - , _states - (_states select { _gun == _x select 0 }) - ]; - player setVariable [ - SVAR(Cause) - , _causes - (_causes select { _gun == _x select 0 }) - ]; - player setVariable [SVAR(RemovedMagazine), nil]; - player setVariable [SVAR(LooseRound), nil]; - - [] spawn { - if (isNil "ace_common_fnc_displayTextStructured") then { - hint parseText LOCALIZE_FORMAT_STR("Hint_WeaponOK"); - uiSleep 2; - hint ""; - } else { - uiSleep 0.75; - hint ""; - }; - }; - - // Unjamming - if !(missionNamespace getVariable ["ace_overheating_enabled",false]) then { - - // No ACE Overheating - // Remove Prevent Fire handler once all guns were unjammed - if ((player getVariable [SVAR(Cause), []]) isEqualTo []) then { - player removeAction GVAR(PreventFireID); - GVAR(PreventFireID) = nil; - }; - - } else { - - // ACE Overheating enabled - private _oldFailChance = ace_overheating_unJamFailChance; - ace_overheating_unJamFailChance = 0; - - private _family = (primaryWeapon player) call GVAR(fnc_getClassFamily); - { - [player, _x, true] call ace_overheating_fnc_clearJam; - } forEach _family; - - ace_overheating_unJamFailChance = _oldFailChance; - }; -}; \ No newline at end of file diff --git a/Source/Script/functions/fnc_pullBolt.sqf b/Source/Script/functions/fnc_pullBolt.sqf deleted file mode 100644 index 76a32de..0000000 --- a/Source/Script/functions/fnc_pullBolt.sqf +++ /dev/null @@ -1,64 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_pullBolt - -Description: - Process bolt pulling action called from Weapon Malfunctions menu - -Parameters: - nothing - -Returns: - nothing - -Examples: - (begin example) - call dzn_EJAM_fnc_pullBolt; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -#define REMOVE_ROUND if ((player getVariable SVAR(RemovedMagazine) select 1) > 0) then { player setVariable [SVAR(LooseRound), true]; } - -(call GVAR(fnc_getWeaponState)) params ["_bolt","_chamber","_case","_mag"]; - -private _hasAmmo = player ammo (currentWeapon player) > 0; - -if (_case == "case_not_ejected") then { - if (_mag == "mag_attached" && _hasAmmo) then { - ["bolt_not_closed","chamber_stucked",nil,nil] call GVAR(fnc_setWeaponState); - } else { - ["bolt_not_closed",nil,nil,nil] call GVAR(fnc_setWeaponState); - }; -} else { - if (_chamber == "chamber_stucked") then { - ["bolt_not_closed",nil,nil,nil] call GVAR(fnc_setWeaponState); - } else { - if (_chamber == "chamber_empty") then { - if (_mag == "mag_attached" && _hasAmmo) then { - ["bolt_closed","chamber_ready",nil,nil] call GVAR(fnc_setWeaponState); - } else { - ["bolt_closed",nil,nil,nil] call GVAR(fnc_setWeaponState); - }; - } else { - if (_chamber in ["chamber_not_extracted","chamber_ready"]) then { - if (_mag == "mag_attached" && _hasAmmo) then { - if (_bolt == "bolt_opened") then { - ["bolt_not_closed","chamber_stucked",nil,nil] call GVAR(fnc_setWeaponState); - } else { - if (_chamber == "chamber_ready") then { REMOVE_ROUND; }; - ["bolt_closed","chamber_ready",nil,nil] call GVAR(fnc_setWeaponState); - }; - } else { - if (_chamber == "chamber_ready") then { REMOVE_ROUND; }; - ["bolt_closed","chamber_empty",nil,nil] call GVAR(fnc_setWeaponState); - }; - }; - }; - }; -}; - -call GVAR(fnc_processWeaponFixed); \ No newline at end of file diff --git a/Source/Script/functions/fnc_setWeaponState.sqf b/Source/Script/functions/fnc_setWeaponState.sqf deleted file mode 100644 index a660f33..0000000 --- a/Source/Script/functions/fnc_setWeaponState.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_setWeaponState - -Description: - Set/updates state of current equipped weapon elements (bolt, chamber, case ejection port and magazine) - -Parameters: - _weaponState - List of weapon parts states - -Returns: - nothing - -Examples: - (begin example) - [ - "bolt_closed" - ,"chamber_empty" - ,"case_ejected" - ,"mag_attached" - ] call dzn_EJAM_fnc_setWeaponState; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -private _gun = [primaryWeapon player] call BIS_fnc_baseWeapon; -private _weaponStates = player getVariable [SVAR(WeaponState), []]; - -if ((_weaponStates select { _gun == _x # 0 }) isEqualTo []) then { - - // First time set - _weaponStates pushBack ([_gun] + _this); - player setVariable [SVAR(WeaponState), _weaponStates]; -} else { - - // Update state (parse _this with _currentState as defaults) - private _currentState = (_weaponStates select { _gun == _x # 0 }) # 0; - - params[ - ["_boltState", _currentState # 1] - ,["_chamberState", _currentState # 2] - ,["_caseState", _currentState # 3] - ,["_magState", _currentState # 4] - ]; - - _currentState set [1, _boltState]; - _currentState set [2, _chamberState]; - _currentState set [3, _caseState]; - _currentState set [4, _magState]; -}; diff --git a/Source/Script/functions/fnc_uiShowBriefState.sqf b/Source/Script/functions/fnc_uiShowBriefState.sqf deleted file mode 100644 index fe6830b..0000000 --- a/Source/Script/functions/fnc_uiShowBriefState.sqf +++ /dev/null @@ -1,54 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_uiShowBriefState - -Description: - Draw hint message of weapon state - -Parameters: - _messageType - Message type to display: "ok", "state" - -Returns: - nothing - -Examples: - (begin example) - "ok" call dzn_EJAM_fnc_uiShowBriefState; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -switch toLower(_this) do { - case "ok": { - hint parseText format [ - "%1
" - , LOCALIZE_FORMAT_STR("Hint_WeaponOK") - , getText (configFile >> "CfgWeapons" >> primaryWeapon player >> "picture") - ]; - }; - case "no_access": { - hint parseText format [ - "%1
" - , LOCALIZE_FORMAT_STR("Hint_NoAccess") - , getText (configFile >> "CfgWeapons" >> primaryWeapon player >> "picture") - ]; - }; - case "state": { - (call GVAR(fnc_getWeaponState)) params [ - ["_bolt", GVAR(Defaults) # 0] - , "" - , "" - ,["_mag", GVAR(Defaults) # 3] - ]; - - hint parseText format [ - "%1
%2
" - , [_bolt, "state"] call GVAR(fnc_getEnumText) - , [_mag, "state"] call GVAR(fnc_getEnumText) - , getText (configFile >> "CfgWeapons" >> primaryWeapon player >> "picture") - ]; - }; -}; diff --git a/Source/Script/functions/fnc_uiShowConfig.sqf b/Source/Script/functions/fnc_uiShowConfig.sqf deleted file mode 100644 index e418330..0000000 --- a/Source/Script/functions/fnc_uiShowConfig.sqf +++ /dev/null @@ -1,407 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_uiShowConfig - -Description: - Draw EJAM Weapon Configurator UI menu. - -Parameters: - nothing - -Returns: - nothing - -Examples: - (begin example) - [] spawn dzn_EJAM_fnc_uiShowConfig; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -closeDialog 2; -sleep 0.001; - -// Prerparation -GVAR(SearchRun) = false; - -// Define UI functions -fnc_EJAM_gfc = { - params ["_class", "_par","_type",["_config","CfgWeapons"]]; - private _result = switch toUpper(_type) do { - case "T"; - case "TXT"; - case "TEXT": { (getText (configFile >> _config >> _class >> _par)) }; - case "A"; - case "ARR"; - case "ARRAY": { (getArray (configFile >> _config >> _class >> _par)) }; - case "N"; - case "NUM"; - case "NUMBER": { (getNumber (configFile >> _config >> _class >> _par)) }; - }; - _result -}; - -fnc_EJAM_filterWeapons = { - private _searchString = _this; - private _searchList = if (count (_searchString splitString "|") > 0) then { - _searchString splitString " " joinString "" splitString "|"; - } else { - [_searchString] - }; - - private _resultList = []; - private _allGunClasses = configFile >> "CfgWeapons"; - for "_i" from 0 to ((count _allGunClasses) - 1) do { - - private _class = configName (_allGunClasses select _i); - - if (_class != "access") then { - private _name = [_class,"displayName","t"] call fnc_EJAM_gfc; - - // Filter only classes with picture, model and scope=2 - if ( - [_class,"type","n"] call fnc_EJAM_gfc == 1 - && { - [_class,"picture","t"] call fnc_EJAM_gfc != "" - && [_class,"model","t"] call fnc_EJAM_gfc != "" - && [_class,"scope","n"] call fnc_EJAM_gfc == 2 - } - ) then { - private _found = false; - private _baseClass = [_class] call BIS_fnc_baseWeapon; - - if !(_baseClass in _resultList) then { - private _name = [_baseClass,"displayName","t"] call fnc_EJAM_gfc; - - { - // Filter by string and source - if ( [_x, _name, false] call BIS_fnc_inString ) then { - _found = true; - }; - } forEach _searchList; - - if (_found) then { - _resultList pushBackUnique _class; - }; - }; - }; - }; - }; - - _resultList -}; - -fnc_EJAM_collectSliderData = { - private _gun = call fnc_EJAM_uiGetSelected; - private _display = (findDisplay 134802); - private _data = [_gun]; - - // Jam chance w. 0.00 accuracy & other sliders w. 0.0 accuracy - { - private _accuracy = if (_forEachIndex == 0) then { 100 } else { 10 }; - _data pushBack (floor (sliderPosition (_display displayCtrl _x) * _accuracy) / _accuracy); - } forEach [6040, 6041,6042,6043,6044,6045]; - - (_data) -}; - - - -fnc_EJAM_uiOnFilterKeyDown = { - params ["_control", "_key", "_shift", "_ctrl", "_alt"]; - - // Exit if key is not ENTER or NumEnter - if (!(_key in [28,156]) || GVAR(SearchRun)) exitWith {}; - - private _serachString = ctrlText _control; - GVAR(SearchRun) = true; - - private _list = _serachString call fnc_EJAM_filterWeapons; - - // Update listbox - _list call fnc_EJAM_uiUpatdeListbox; - - [] spawn { - uiSleep 0.5; - GVAR(SearchRun) = false; - }; -}; - -fnc_EJAM_uiUpatdeListbox = { - private _list = _this; - private _ctrlList = ((findDisplay 134802) displayCtrl 6011); - - lbClear _ctrlList; - //["", false] call fnc_EJAM_uiUpdateSliders; - - if !(_list isEqualTo []) then { - { - _ctrlList lbAdd ([_x,"displayName","t"] call fnc_EJAM_gfc); - _ctrlList lbSetPicture [_forEachIndex, [_x,"picture","t"] call fnc_EJAM_gfc]; - _ctrlList lbSetData [_forEachIndex, _x]; - } forEach _list; - - lbSort _ctrlList; - _ctrlList lbSetCurSel 0; - }; -}; - -fnc_EJAM_uiGetSelected = { - private _display = (findDisplay 134802); - private _lbCtrl = (_display displayCtrl 6011); - private _gun = _lbCtrl lbData (lbCurSel _lbCtrl); - - (_gun) -}; - -fnc_EJAM_uiOnGunSelected = { - params ["_control", "_selectedIndex"]; - - private _class = call fnc_EJAM_uiGetSelected; - - _class call fnc_EJAM_uiUpdateWeaponData; - [_class, true] call fnc_EJAM_uiUpdateSliders; - true call fnc_EJAM_uiUpdateButtons; -}; - -fnc_EJAM_uiUpdateWeaponData = { - private _class = _this; - private _display = (findDisplay 134802); - - private _gunName = parseText format [ - "%1 %2" - , [_class,"displayName","t"] call fnc_EJAM_gfc - , [_class,"author","t"] call fnc_EJAM_gfc - ]; - private _gunImage = parseText format [ - "" - , [_class,"picture","t"] call fnc_EJAM_gfc - ]; - - ((findDisplay 134802) displayCtrl 6021) ctrlSetStructuredText _gunName; - ((findDisplay 134802) displayCtrl 6020) ctrlSetStructuredText _gunImage; -}; - -fnc_EJAM_uiUpdateSliders = { - params ["_class","_enable", ["_sliderData", []]]; - - private _display = (findDisplay 134802); - private _data = [ - [6040, 0] - ,[6041, 0] - ,[6042, 0] - ,[6043, 0] - ,[6044, 0] - ,[6045, 0] - ]; - - if (_enable && _class != "") then { - private _jamChance = 0; - private _malfunctionWeights = 0; - - if (_sliderData isEqualTo []) then { - _jamChance = [_class, "jam", true] call GVAR(fnc_getMappingData); - _malfunctionWeights = [_class, "malfunction", true] call GVAR(fnc_getMappingData); - } else { - _jamChance = _sliderData # 0; - _malfunctionWeights = _sliderData select [1,5]; - }; - - (_data # 0) set [1, _jamChance]; - (_data # 1) set [1, _malfunctionWeights # 0]; - (_data # 2) set [1, _malfunctionWeights # 1]; - (_data # 3) set [1, _malfunctionWeights # 2]; - (_data # 4) set [1, _malfunctionWeights # 3]; - (_data # 5) set [1, _malfunctionWeights # 4]; - - { - _x params ["_ctrlId","_val"]; - - ((findDisplay 134802) displayCtrl _ctrlId) ctrlEnable true; - ((findDisplay 134802) displayCtrl _ctrlId) sliderSetPosition _val; - [nil, _val, _ctrlId - 10, if (_forEachIndex == 0) then { 100 } else { 10 }] call fnc_EJAM_uiOnSliderChanged; - } forEach _data; - } else { - { - ((findDisplay 134802) displayCtrl (_x select 0)) sliderSetPosition 0; - ((findDisplay 134802) displayCtrl (_x select 0)) ctrlEnable false; - [nil, 0, (_x select 0) - 10] call fnc_EJAM_uiOnSliderChanged; - } forEach _data; - } -}; - -fnc_EJAM_uiOnSliderChanged = { - params ["_control", "_newValue", "_labelIDC", ["_accuracy", 10]]; - - private _text = ( - ((ctrlText ((findDisplay 134802) displayCtrl _labelIDC)) splitString "%" select 0) - ) splitString " " joinString " "; - - ((findDisplay 134802) displayCtrl _labelIDC) ctrlSetStructuredText parseText format [ - "%1 %3 %2" - , _text - , (floor (_newValue * _accuracy)) / _accuracy - , "%" - ]; -}; - -fnc_EJAM_uiUpdateButtons = { - private _display = (findDisplay 134802); - private _data = [6050, 6051, 6052, 6053]; - - { - ((findDisplay 134802) displayCtrl _x) ctrlEnable _this; - } forEach _data; -}; - -fnc_EJAM_uiOnSaveClick = { - private _newMappingData = call fnc_EJAM_collectSliderData; - private _isReset = (_newMappingData select [1,6]) isEqualTo [0,0,0,0,0,0]; - - private _mapping = GVAR(Mapping) select { _newMappingData select 0 == _x select 0 }; - if (_mapping isEqualTo []) then { - if !(_isReset) then { - GVAR(Mapping) pushBack _newMappingData; - }; - } else { - if !(_isReset) then { - private _map = _mapping select 0; - for "_i" from 0 to (count _map) - 1 do { - _map set [_i, _newMappingData select _i]; - }; - } else { - GVAR(Mapping) = GVAR(Mapping) - (_mapping); - }; - }; - - [ - SVAR(MappingSettings) - , str(GVAR(Mapping)) select [1, count str(GVAR(Mapping)) -2] - , 0 - , "server" - , true - ] call CBA_settings_fnc_set; - - private _draw = [ - parseText format ["%1", [_newMappingData select 0,"displayName","t"] call fnc_EJAM_gfc] - , lineBreak - , parseText format ["%1", LOCALIZE_FORMAT_STR("Config_SavedHint")] - , lineBreak - ]; - hint (composeText _draw); -}; - -fnc_EJAM_uiOnCopyClick = { - private _data = call fnc_EJAM_collectSliderData; - - GVAR(ConfigClipboard) = _data; - copyToClipboard str(_data); - - private _draw = [ - parseText format ["%1", [_data select 0,"displayName","t"] call fnc_EJAM_gfc] - , lineBreak - , parseText format ["%1", LOCALIZE_FORMAT_STR("Config_CopiedHint")] - , lineBreak - ]; - hint (composeText _draw); -}; - -fnc_EJAM_uiOnApplyClick = { - private _instantSave = if (isNil "_this") then { false } else { true }; - - if (isNil SVAR(ConfigClipboard)) exitWith { - hint parseText format [ - "%1" - , LOCALIZE_FORMAT_STR("Config_NoDataHint") - ]; - }; - - private _gun = call fnc_EJAM_uiGetSelected; - private _data = GVAR(ConfigClipboard); - - [_gun, true, _data select [1,6]] call fnc_EJAM_uiUpdateSliders; - - private _draw = [ - parseText format ["%1", [_gun,"displayName","t"] call fnc_EJAM_gfc] - , lineBreak - , parseText format ["APPLIED!", LOCALIZE_FORMAT_STR("Config_ApplidHint")] - , lineBreak - ]; - hint (composeText _draw); - - if (_instantSave) then { - call fnc_EJAM_uiOnSaveClick; - } else { - [] spawn { - sleep 0.5; - call fnc_EJAM_uiOnSaveClick; - }; - }; -}; - -fnc_EJAM_uiOnLBDblClick = { - params ["_control", "_selectedIndex"]; - true call fnc_EJAM_uiOnApplyClick; -}; - -fnc_EJAM_uiOnResetClick = { - private _gun = call fnc_EJAM_uiGetSelected; - [_gun, true, [0,0,0,0,0,0]] call fnc_EJAM_uiUpdateSliders; - call fnc_EJAM_uiOnSaveClick; -}; - -// Draw -// --- Dialog -createDialog "dzn_EJAM_Config_Group"; -private _display = (findDisplay 134802); -#define GET_CTRL(X) (_display displayCtrl X) - -// --- Title -GET_CTRL(6002) ctrlSetStructuredText parseText LOCALIZE_FORMAT_STR("Config_Title"); -GET_CTRL(6003) ctrlSetStructuredText parseText LOCALIZE_FORMAT_STR("Config_CloseBtn"); -GET_CTRL(6010) ctrlSetStructuredText parseText LOCALIZE_FORMAT_STR("Config_SectionLabel"); -GET_CTRL(6010) ctrlSetStructuredText parseText LOCALIZE_FORMAT_STR("Config_SectionLabel"); - -// --- Filter -GET_CTRL(6012) ctrlSetText LOCALIZE_FORMAT_STR("Config_FilterLabel"); -GET_CTRL(6012) ctrlSetTooltip LOCALIZE_FORMAT_STR("Config_FilterTooltip"); -GET_CTRL(6012) ctrlSetEventHandler ["KeyDown", "_this call fnc_EJAM_uiOnFilterKeyDown;"]; -GET_CTRL(6011) ctrlSetEventHandler ["LBSelChanged", "_this call fnc_EJAM_uiOnGunSelected"]; -GET_CTRL(6011) ctrlSetEventHandler ["LBDblClick", "_this call fnc_EJAM_uiOnLBDblClick"]; - -// --- Weapon data -GET_CTRL(6021) ctrlSetStructuredText parseText format [ - "%1" - , LOCALIZE_FORMAT_STR("Config_PlaceholderLabel") -]; - -// --- Sliders -{ - GET_CTRL(_x) sliderSetRange [0,100]; - GET_CTRL(_x) sliderSetSpeed (if (_forEachIndex == 0) then { [0.01,10] } else { [0.1,25] }); - GET_CTRL(_x) ctrlEnable false; - GET_CTRL(_x) ctrlSetEventHandler [ - "SliderPosChanged" - , format ["_this pushBack %1; _this pushBack %2; _this call fnc_EJAM_uiOnSliderChanged", _x - 10, if (_forEachIndex == 0) then { 100 } else { 10 }] - ]; -} forEach [6040, 6041, 6042, 6043, 6044, 6045]; - -// --- Buttons -false call fnc_EJAM_uiUpdateButtons; -GET_CTRL(6050) ctrlSetEventHandler ["ButtonClick", "_this call fnc_EJAM_uiOnSaveClick"]; -GET_CTRL(6050) ctrlSetStructuredText parseText LOCALIZE_FORMAT_STR("Config_SaveBtn"); - -GET_CTRL(6051) ctrlSetEventHandler ["ButtonClick", "_this call fnc_EJAM_uiOnCopyClick"]; -GET_CTRL(6051) ctrlSetStructuredText parseText LOCALIZE_FORMAT_STR("Config_CopyBtn"); - -GET_CTRL(6052) ctrlSetEventHandler ["ButtonClick", "_this call fnc_EJAM_uiOnApplyClick"]; -GET_CTRL(6052) ctrlSetStructuredText parseText LOCALIZE_FORMAT_STR("Config_PasteBtn"); -GET_CTRL(6052) ctrlSetTooltip LOCALIZE_FORMAT_STR("Config_PasteTooltip"); - -GET_CTRL(6053) ctrlSetEventHandler ["ButtonClick", "_this call fnc_EJAM_uiOnResetClick"]; -GET_CTRL(6053) ctrlSetStructuredText parseText LOCALIZE_FORMAT_STR("Config_ResetBtn"); -GET_CTRL(6053) ctrlSetTooltip LOCALIZE_FORMAT_STR("Config_ResetTooltip"); - diff --git a/Source/Script/functions/fnc_uiShowProgressBar.sqf b/Source/Script/functions/fnc_uiShowProgressBar.sqf deleted file mode 100644 index 36da41a..0000000 --- a/Source/Script/functions/fnc_uiShowProgressBar.sqf +++ /dev/null @@ -1,69 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_uiShowProgressBar - -Description: - Draw progress bar and execute given code when on finished - -Parameters: - _drawTime - Time to draw progress bar - _title - Title text on progress bar - _code - Code to execute on finish - _args - Arguments to use in code - -Returns: - nothing - -Examples: - (begin example) - [10, "In progress", { hint (_args) }, "Hint message on finish"] spawn dzn_EJAM_fnc_uiShowProgressBar; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -params ["_drawTime","_title","_code",["_args", []]]; - -// Prepare data -private _strCode = ((str(_code) splitString "") select [1, count str(_code) - 2]) joinString ""; -_code = compile format ["private _args = _this; %1", _strCode]; - -// Draw -private _dialog = createDialog "dzn_EJAM_ProgressBar_Group"; -private _display = (findDisplay 134804); -#define GET_CTRL(X) (_display displayCtrl X) - -GET_CTRL(6503) ctrlSetStructuredText (parseText format ["%1", _title]); - -// Animate -private _posX = ctrlPosition GET_CTRL(6502) select 0; -private _posY = ctrlPosition GET_CTRL(6502) select 1; -private _wMax = ctrlPosition GET_CTRL(6503) select 2; -private _h = ctrlPosition GET_CTRL(6502) select 3; - -[ - { - (_this select 0) params ["_drawTime","_startTime","_wMax","_posX","_posY","_h","_onFinish","_onFinishArgs"]; - private _timeSpent = CBA_missionTime - _startTime; - - if (_timeSpent >= _drawTime) then { - closeDialog 2; - (_this select 1) call CBA_fnc_removePerFrameHandler; - _onFinishArgs spawn _onFinish; - } else { - - if (isNull (findDisplay 134804) || !alive player) exitWith { - closeDialog 2; - (_this select 1) call CBA_fnc_removePerFrameHandler; - hint "Canceled"; - }; - - ((findDisplay 134804) displayCtrl 6502) ctrlSetPosition [_posX, _posY, (_wMax * _timeSpent / _drawTime), _h]; - ((findDisplay 134804) displayCtrl 6502) ctrlCommit 0; - }; - } - , 0 - , [_drawTime, CBA_missionTime, _wMax, _posX, _posY, _h, _code, _args] -] call CBA_fnc_addPerFrameHandler; diff --git a/Source/Script/functions/fnc_uiShowUnjamMenu.sqf b/Source/Script/functions/fnc_uiShowUnjamMenu.sqf deleted file mode 100644 index 3817078..0000000 --- a/Source/Script/functions/fnc_uiShowUnjamMenu.sqf +++ /dev/null @@ -1,144 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: dzn_EJAM_fnc_uiShowUnjamMenu - -Description: - Draw Unjam UI menu. - -Parameters: - nothing - -Returns: - nothing - -Examples: - (begin example) - [] spawn dzn_EJAM_fnc_uiShowUnjamMenu; - (end) - -Author: - 10Dozen ----------------------------------------------------------------------------- */ - -#include "..\macro.hpp" - -closeDialog 2; -hintSilent ""; -sleep 0.001; - -// ** -// Get weapon state -[ - nil, nil, nil - , if (call GVAR(fnc_isMagAttached)) then { "mag_attached" } else { "mag_detached" } -] call GVAR(fnc_setWeaponState); - -(call GVAR(fnc_getWeaponState)) params ["_bolt","_chamber","_case","_mag"]; - -// ** -// Prepare data -private _parseAndFormatLeft = { - parseText format ["%1", _this] -}; -private _parseAndFormatCenter = { - parseText format ["%1", _this] -}; - -private _titleText = (LOCALIZE_FORMAT_STR("Menu_Title")) call _parseAndFormatLeft; -private _closeBtnText = LOCALIZE_FORMAT_STR("Menu_Close"); - -private _gunText = (getText (configFile >> "CfgWeapons" >> primaryWeapon player >> "displayName")) call _parseAndFormatCenter; -private _img = parseText format [ - "" - , getText (configFile >> "CfgWeapons" >> primaryWeapon player >> "picture") -]; -private _boltText = [_bolt, "state"] call GVAR(fnc_getEnumText) call _parseAndFormatCenter; -private _chamberText = ([_chamber, "state"] call GVAR(fnc_getEnumText)) call _parseAndFormatCenter; -private _caseText = ([_case, "state"] call GVAR(fnc_getEnumText)) call _parseAndFormatCenter; -private _magText = ([_mag, "state"] call GVAR(fnc_getEnumText)) call _parseAndFormatCenter; - -private _pullBoltActionText = ["pull_bolt", "action"] call GVAR(fnc_getEnumText) call _parseAndFormatLeft; -private _clearChamberActionText = ["clear_chamber", "action"] call GVAR(fnc_getEnumText) call _parseAndFormatLeft; -private _openBoltActionText = ["open_bolt", "action"] call GVAR(fnc_getEnumText) call _parseAndFormatLeft; -private _clearCaseActionText = ["remove_case", "action"] call GVAR(fnc_getEnumText) call _parseAndFormatLeft; -private _magActionText = [ - if (_mag == "mag_attached") then { "detach_mag" } else { "attach_mag" } - , "action" -] call GVAR(fnc_getEnumText) call _parseAndFormatLeft; - - -// ** -// Show menu -createDialog "dzn_EJAM_Menu_Group"; - -private _display = (findDisplay 134802); -#define GET_CTRL(X) (_display displayCtrl X) - -// --- Title and Image -GET_CTRL(6002) ctrlSetStructuredText _titleText; -GET_CTRL(6003) ctrlSetText _closeBtnText; - -GET_CTRL(6010) ctrlSetStructuredText _img; -GET_CTRL(6011) ctrlSetStructuredText _gunText; - -// --- State labels -GET_CTRL(6012) ctrlSetStructuredText _boltText; -GET_CTRL(6013) ctrlSetStructuredText _chamberText; -GET_CTRL(6014) ctrlSetStructuredText _magText; -GET_CTRL(6015) ctrlSetStructuredText _caseText; - -// --- Buttons -GET_CTRL(6020) ctrlSetStructuredText _pullBoltActionText; -GET_CTRL(6021) ctrlSetStructuredText _clearChamberActionText; -GET_CTRL(6022) ctrlSetStructuredText _magActionText; -GET_CTRL(6023) ctrlSetStructuredText _openBoltActionText; -GET_CTRL(6024) ctrlSetStructuredText _clearCaseActionText; - -// --- Set button states & onclick -private _generateActionCode = { - compile format ["closeDialog 2; ""%1"" spawn %2", _this, SVAR(fnc_doAction)] -}; -private _isActive = false; - -// --- --- Close -GET_CTRL(6003) ctrlAddEventHandler ["ButtonClick", { closeDialog 2; }]; - -// --- --- Bolt pull -GET_CTRL(6020) ctrlAddEventHandler ["ButtonClick", "pull_bolt" call _generateActionCode]; -GET_CTRL(6020) ctrlSetFont "PuristaLight"; - -// --- --- Bolt open -if (_bolt != "bolt_opened") then { - _isActive = true; - GET_CTRL(6023) ctrlAddEventHandler ["ButtonClick", "open_bolt" call _generateActionCode]; -} else { - _isActive = false; -}; - -GET_CTRL(6023) ctrlEnable _isActive; - -// --- --- Chamber -if (_bolt == "bolt_opened" && _mag == "mag_detached" && _chamber == "chamber_stucked" && _case == "case_ejected") then { - _isActive = true; - GET_CTRL(6021) ctrlAddEventHandler ["ButtonClick", "clear_chamber" call _generateActionCode]; -} else { - _isActive = false; -}; - -GET_CTRL(6021) ctrlEnable _isActive; - -// --- --- Case -if (_bolt == "bolt_opened" && _case == "case_not_ejected") then { - _isActive = true; - GET_CTRL(6024) ctrlAddEventHandler ["ButtonClick", "remove_case" call _generateActionCode]; -} else { - _isActive = false; -}; - -GET_CTRL(6024) ctrlEnable _isActive; - -// --- --- Magazine detach -if (_mag == "mag_attached") then { - GET_CTRL(6022) ctrlAddEventHandler ["ButtonClick", "detach_mag" call _generateActionCode]; -} else { - GET_CTRL(6022) ctrlAddEventHandler ["ButtonClick", "attach_mag" call _generateActionCode]; -}; \ No newline at end of file diff --git a/Source/Script/sounds/BoltOpen.ogg b/Source/Script/sounds/BoltOpen.ogg deleted file mode 100644 index 92c92f8..0000000 Binary files a/Source/Script/sounds/BoltOpen.ogg and /dev/null differ diff --git a/Source/Script/sounds/BoltPull.ogg b/Source/Script/sounds/BoltPull.ogg deleted file mode 100644 index 4572cd3..0000000 Binary files a/Source/Script/sounds/BoltPull.ogg and /dev/null differ diff --git a/Source/Script/sounds/CfgSounds.hpp b/Source/Script/sounds/CfgSounds.hpp deleted file mode 100644 index 8b6a27d..0000000 --- a/Source/Script/sounds/CfgSounds.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#define SOUND_CLASS(X,Y) class X { \ - sound[] = {Y, 1, 1}; \ - name = ""; \ - titles[] = {0, ""}; \ -} - -#include "..\macro.hpp" - -class CfgSounds -{ - sounds[] = {}; - SOUND_CLASS(open_bolt, SND(BoltOpen.ogg)); - SOUND_CLASS(pull_bolt, SND(BoltPull.ogg)); - SOUND_CLASS(attach_mag, SND(MagAttach.ogg)); - SOUND_CLASS(detach_mag, SND(MagDetach.ogg)); - SOUND_CLASS(clear_chamber, SND(Fixing.ogg)); - SOUND_CLASS(remove_case, SND(Fixing.ogg)); - SOUND_CLASS(drop_mag, SND(MagDrop.ogg)); -}; \ No newline at end of file diff --git a/Source/Script/sounds/Fixing.ogg b/Source/Script/sounds/Fixing.ogg deleted file mode 100644 index 61356bd..0000000 Binary files a/Source/Script/sounds/Fixing.ogg and /dev/null differ diff --git a/Source/Script/sounds/MagAttach.ogg b/Source/Script/sounds/MagAttach.ogg deleted file mode 100644 index 852649d..0000000 Binary files a/Source/Script/sounds/MagAttach.ogg and /dev/null differ diff --git a/Source/Script/sounds/MagDetach.ogg b/Source/Script/sounds/MagDetach.ogg deleted file mode 100644 index 26b9c9f..0000000 Binary files a/Source/Script/sounds/MagDetach.ogg and /dev/null differ diff --git a/Source/Script/sounds/MagDrop.ogg b/Source/Script/sounds/MagDrop.ogg deleted file mode 100644 index cf74e9b..0000000 Binary files a/Source/Script/sounds/MagDrop.ogg and /dev/null differ diff --git a/Source/Script/stringtable.xml b/Source/Script/stringtable.xml deleted file mode 100644 index 3ca0951..0000000 --- a/Source/Script/stringtable.xml +++ /dev/null @@ -1,471 +0,0 @@ - - - - - - - Unjam via EJAM only - Починка только через EJAM - 武器只能使用EJAM排障 - 武器只能使用EJAM排障 - - - Force EJAM unjam logic over ACE - Принудительно использовать логику починки EJAM вместо ACE - 强制使用EJAM排障覆盖ACE - 強制使用EJAM排障覆蓋ACE - - - - Override jam chance - Перезаписать шанс на заклинивание - 重新定义武器卡弹概率 - 重新定義武器卡彈概率 - - - Force EJAM Overall jam chance over ACE jamming logic. - Принудительно использовать общий шанс на заклинивание. - 强行让EJAM覆盖ACE卡弹机制 - 强行讓EJAM覆蓋ACE卡彈機制 - - - - Overall jam chance - Общий шанс заклинивания - 整体卡弹概率 - 整體卡彈概率 - - - Default jam chance for all primary weapons. From 0 to 100. Custom weapon setting will be used if set. - Шанс на клин для всего основного оружия. От 0 до 100. Если для оружия указаны специфические настройки - будут использованы они. - 所有主武器的默认卡弹概率. 从0到100. 自定义武器设置后生效 - 所有主武器的默認卡彈概率.從0到100.自定義武器設定後生效 - - - - (Chance of) Feed failure - (Шанс на) Неподачу патрона - 导气系统故障概率 - 導氣系統故障概率 - - - Chance for specific malfunction to happen if weapon got jammed. - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - (Chance of) Chamber failure - (Шанс на) Утыкание патрона - 供弹失败概率 - 供彈失敗概率 - - - Chance for specific malfunction to happen if weapon got jammed - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - (Chance of) Dud - (Шанс на) Осечка - 哑弹概率 - 啞彈概率 - - - Chance for specific malfunction to happen if weapon got jammed - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - (Chance of) Extraction failure - (Шанс на) Неизвлечение гильзы - 抽壳失败概率 - 抽殼失敗概率 - - - Chance for specific malfunction to happen if weapon got jammed - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - (Chance of) Ejection failure - (Шанс на) Прихват гильзы - 抛壳失败概率 - 拋殼失敗概率 - - - Chance for specific malfunction to happen if weapon got jammed - Шанс, что с оружием случится данная неисправность, если оружие заклинило - 武器卡弹后发生特定故障的概率 - 武器卡彈後發生特定故障的概率 - - - - Subsonic ammunition penalty - Пенальти дозвуковых боеприпасов - 亚音速弹卡弹概率 - 亞音速彈卡彈概率 - - - Jam chance penalty on using subsonic ammo. Value will be added to weapon's jam chance. - Штраф к шансу на заклинивание при использовании дозвуковых патронов. Значение будет добавляться к шансу на клин для оружия. - 额外增加使用亚音速弹药时的卡弹概率 - 額外新增使用亞音速彈藥時的卡彈概率 - - - - Weapon settings - Настройки оружия - 武器设置 - 武器設定 - - - Custom settings for specific weapon. In format [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. Use EJAM Configurator by [ call dzn_EJAM_Configure ] - Настройки для конкретных классов оружия. В формтае [@Класс, @Шанс_на_клин, @Шанс_на_поломку_типа#1...5]. Используйте конфигуратор вызовом [ call dzn_EJAM_Configure ] - 特定武器的自定义设置. 格式为 [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. 使用EJAM配置程序为 [ call dzn_EJAM_Configure ] - 特定武器的自定義設定. 格式為 [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. 使用EJAM配寘程式為 [ call dzn_EJAM_Configure ] - - - - - WEAPON MALFUNCTION - ОРУЖИЕ НЕИСПРАВНО - 武器故障 - 武器故障 - - - - CLOSE - ЗАКРЫТЬ - 关闭 - 關閉 - - - - - Bolt closed - Затвор в переднем положении - 枪机闭合 - 槍機閉合 - - - Bolt <t color="#f79400">not closed</t> - Затвор <t color="#f79400">в среднем положении</t> - 枪机 <t color="#f79400">未闭合</t> - 槍機 <t color="#f79400">未閉合</t> - - - Bolt <t color="#00b9f7">opened</t> - Затвор <t color="#00b9f7">в заднем положении</t> - 枪机 <t color="#00b9f7">已打开</t> - 槍機 <t color="#00b9f7">已打開</t> - - - Chamber empty - Патронник пустой - 枪膛内已清空 - 槍膛內已清空 - - - Chamber <t color="#00b9f7">loaded</t> - Патрон <t color="#00b9f7">в патроннике</t> - 枪膛内 <t color="#00b9f7">已供弹</t> - 槍膛內 <t color="#00b9f7">已供彈</t> - - - Round <t color="#f79400">stuck</t> - Патрон <t color="#f79400">уткнулся</t> - 子弹 <t color="#f79400">卡住</t> - 子彈 <t color="#f79400">卡住</t> - - - Round <t color="#f79400">not extracted</t> - Гильза <t color="#f79400">не извлечена</t> - 子弹 <t color="#f79400">未入膛</t> - 子彈 <t color="#f79400">未入膛</t> - - - Case <t color="#f79400">not ejected</t> - Гильза <t color="#f79400">не выброшена</t> - 弹壳 <t color="#f79400">未抛出</t> - 彈殼 <t color="#f79400">未拋出</t> - - - Case ejected - Гильза выброшена - 弹壳已抛出 - 彈殼已抛出 - - - Magazine attached - Магазин присоединен - 已插入弹匣 - 已插入彈匣 - - - Magazine <t color="#00b9f7">detached</t> - Магазин <t color="#00b9f7">отсоединен<</t>/Russian> - 弹匣 <t color="#00b9f7">卸下</t> - 彈匣 <t color="#00b9f7">卸下</t> - - - - - - Inspect weapon menu - Проверить оружие (меню) - 武器检查菜单 - 武器檢查選單 - - - Inspect weapon (no menu) - Проверить оружие (без меню) - 武器检查 (无菜单) - 武器檢查 (无菜单) - - - Attach/Detach magazine - Присоединить/Отсоединить магазин - 装入/卸下 弹匣 - 裝入/卸下 彈匣 - - - - Pull bolt - Передернуть затвор - 拉动枪机 - 拉動槍機 - - - Open bolt - Отвести затвор - 打开枪机 - 打開槍機 - - - Clear chamber - Очистить патронник - 清理膛室 - 清理膛室 - - - Remove case - Удалить гильзу - 清理卡住的弹壳 - 清理卡住的彈殼 - - - Detach magazine - Отсоединить магазин - 卸下弹匣 - 卸下彈匣 - - - Attach magazine - Присоединить магазин - 装入弹匣 - 裝入彈匣 - - - Inspect weapon - Проверить оружие - 检查武器 - 檢查武器 - - - - - Pulling the bolt - Передергиваем затвор - 正在拉动枪机 - 正在拉動槍機 - - - Opening the bolt - Отводим затвор назад - 正在打开枪机 - 正在打開槍機 - - - Clearing the chamber - Извлекаем патрон из патронника - 正在清理膛室 - 正在清理膛室 - - - Removing the case - Извлекаем гильзу - 正在清理卡住的弹壳 - 正在清理卡住的彈殼 - - - Detaching magazine - Отсоединяем магазин - 正在卸下弹匣 - 正在卸下彈匣 - - - Attaching magazine - Присоединием магазин - 正在装入弹匣 - 正在裝入彈匣 - - - Inspecting - Проверка - 正在检查武器 - 正在檢查武器 - - - - - Magazine dropped - Магазин сброшен - 弹匣脱落 - 彈匣脫落 - - - Magazine attached - Магазин присоединен - 弹匣已裝入 - 彈匣已裝入 - - - Weapon is functioning normally - Оружие функционирует нормально - 武器已可以正常使用 - 武器已可以正常使用 - - - Not possible to perform action! - Невозможно выполнить действие! - 不能执行该命令! - 不能執行該命令! - - - No magazine to load! - Нет магазинов! - 武器无弹匣! - 武器無彈匣! - - - - - - dzn EJAM Weapon Configurator - dzn EJAM Конфигуратор оружия - dzn EJAM 自定义武器设置 - dzn EJAM自定義武器設定 - - - Weapon - Оружие - 武器 - 武器 - - - No weapon selected - Оружие не выбрано - 没有选择武器 - 沒有選擇武器 - - - Filter... - Фильтр... - 搜索栏 - 蒐索欄 - - - - - Save - Сохранить - 保存 - 保存 - - - Copy - Копировать - 复制 - 複製 - - - Paste - Вставить - 粘贴 - 粘貼 - - - Reset - Сброс - 重置 - 重置 - - - Close - Закрыть - 关闭 - 關閉 - - - - - Enter/NumEnter to apply filter. Use "|" for multiple filter values - Enter/NumEnter для применения фильтра. Используйте "|" для фильтрации по нескольким значениям - 输入武器名称后. 按左Shift+回车或小键盘回车即可执行搜索. 搜索多个武器时可以用 "|" 将几个关键词隔开 - 輸入武器名稱後. 按左Shift+回車或小鍵盤回車即可執行蒐索. 蒐索多個武器時可以用 "|" 將幾個關鍵字隔開 - - - Unsets weapon settings - Сбрасывает настройки для оружия - 取消武器设置 - 取消武器設定 - - - Double clicking list element will also apply copied settings! - Двойной клик по оружию из списка также применит скопированные настройки! - 双击列表内容也能应用复制的设置文本! - 按兩下清單內容也能應用複製的設定文字! - - - - - No data to apply! - Нет данных для применения! - 无数据可应用! - 無數據可應用! - - - - Applied! - Применено! - 设置已应用! - 設定已應用! - - - Config copied! - Конфигурация скопирована! - 设置已复制! - 設定已複製! - - - Config saved! - Конфигурация сохранена! - 设置已保存! - 設定已保存! - - - - - \ No newline at end of file diff --git a/Source/Script/ui/dzn_EJAM_Config.hpp b/Source/Script/ui/dzn_EJAM_Config.hpp deleted file mode 100644 index 4218b99..0000000 --- a/Source/Script/ui/dzn_EJAM_Config.hpp +++ /dev/null @@ -1,269 +0,0 @@ - -#define GUI_GRID_X (0) -#define GUI_GRID_Y (0) -#define GUI_GRID_W (0.025) -#define GUI_GRID_H (0.04) -#define GUI_GRID_WAbs (1) -#define GUI_GRID_HAbs (1) - - -class dzn_EJAM_Config_Group: RscControlsGroup -{ - idd = 134802; - idc = 6000; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 1 * GUI_GRID_H + GUI_GRID_Y; - w = 40 * GUI_GRID_W; - h = 24 * GUI_GRID_H; - colorBackground[] = {0,0,0,0.75}; - - class controls - { - // -- Title, BG and Close btn - class dzn_EJAM_Config_BG: IGUIBack - { - idc = 6001; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 1 * GUI_GRID_H + GUI_GRID_Y; - w = 40 * GUI_GRID_W; - h = 24 * GUI_GRID_H; - colorBackground[] = {0,0,0,0.75}; - }; - class dzn_EJAM_Config_TitleLabel: RscStructuredText - { - idc = 6002; - text = "dzn EJAM Weapon Configurator"; //--- ToDo: Localize; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 34 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {0.77,0.51,0.08,0.8}; - font = "PuristaMedium"; - }; - class dzn_EJAM_Config_CloseBtn: RscButtonMenu - { - idc = 6003; - text = "CLOSE"; //--- ToDo: Localize; - x = 34 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 6 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - onButtonClick = "closeDialog 2;"; - }; - - // List box and search - class dzn_EJAM_Config_ListFrame: RscFrame - { - idc = 6010; - text = "Weapon"; //--- ToDo: Localize; - x = 0.5 * GUI_GRID_W + GUI_GRID_X; - y = 1 * GUI_GRID_H + GUI_GRID_Y; - w = 15.5 * GUI_GRID_W; - h = 23.5 * GUI_GRID_H; - sizeEx = 1.1 * GUI_GRID_H; - }; - class dzn_EJAM_Config_List: RscListbox - { - idc = 6011; - x = 1 * GUI_GRID_W + GUI_GRID_X; - y = 3.5 * GUI_GRID_H + GUI_GRID_Y; - w = 14.5 * GUI_GRID_W; - h = 20.5 * GUI_GRID_H; - }; - class dzn_EJAM_Config_ListEdit: RscEdit - { - idc = 6012; - text = "Filter..."; //--- ToDo: Localize; - x = 1 * GUI_GRID_W + GUI_GRID_X; - y = 2.1 * GUI_GRID_H + GUI_GRID_Y; - w = 14.5 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {0,0,0,1}; - }; - - // Weapon data - class dzn_EJAM_Config_ImageLabel: RscStructuredText - { - idc = 6020; - text = ""; // "IMAGE"; - x = 16.5 * GUI_GRID_W + GUI_GRID_X; - y = 3 * GUI_GRID_H + GUI_GRID_Y; - w = 23 * GUI_GRID_W; - h = 4.5 * GUI_GRID_H; - }; - class dzn_EJAM_Config_GunLabel: RscStructuredText - { - idc = 6021; - text = ""; // "AK-74 (RHS)" - x = 16.5 * GUI_GRID_W + GUI_GRID_X; - y = 2 * GUI_GRID_H + GUI_GRID_Y; - w = 23 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {-1,-1,-1,0}; - }; - - // Weapon Settings - class dzn_EJAM_Config_JamLabel: RscStructuredText - { - idc = 6030; - text = "Jam chance"; //--- ToDo: Localize; - x = 16.5 * GUI_GRID_W + GUI_GRID_X; - y = 8 * GUI_GRID_H + GUI_GRID_Y; - w = 9.5 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {-1,-1,-1,0}; - }; - class dzn_EJAM_Config_Malfunction1Label: RscStructuredText - { - idc = 6031; - text = "Feed failure"; //--- ToDo: Localize; - x = 16.5 * GUI_GRID_W + GUI_GRID_X; - y = 10 * GUI_GRID_H + GUI_GRID_Y; - w = 9.5 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {-1,-1,-1,0}; - }; - class dzn_EJAM_Config_Malfunction2Label: RscStructuredText - { - idc = 6032; - text = "Chamber failure"; //--- ToDo: Localize; - x = 16.5 * GUI_GRID_W + GUI_GRID_X; - y = 11.5 * GUI_GRID_H + GUI_GRID_Y; - w = 9.5 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {-1,-1,-1,0}; - }; - class dzn_EJAM_Config_Malfunction3Label: RscStructuredText - { - idc = 6033; - text = "Dud"; //--- ToDo: Localize; - x = 16.5 * GUI_GRID_W + GUI_GRID_X; - y = 13 * GUI_GRID_H + GUI_GRID_Y; - w = 9.5 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {-1,-1,-1,0}; - }; - class dzn_EJAM_Config_Malfunction4Label: RscStructuredText - { - idc = 6034; - text = "Extraction failure"; //--- ToDo: Localize; - x = 16.5 * GUI_GRID_W + GUI_GRID_X; - y = 14.5 * GUI_GRID_H + GUI_GRID_Y; - w = 9.5 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {-1,-1,-1,0}; - }; - class dzn_EJAM_Config_Malfunction5Label: RscStructuredText - { - idc = 6035; - text = "Ejection failure"; //--- ToDo: Localize; - x = 16.5 * GUI_GRID_W + GUI_GRID_X; - y = 16 * GUI_GRID_H + GUI_GRID_Y; - w = 9.5 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {-1,-1,-1,0}; - }; - - // --- Sliders - class dzn_EJAM_Config_JamSlider: RscXSliderH - { - style = 1078; - idc = 6040; - x = 26.5 * GUI_GRID_W + GUI_GRID_X; - y = 8 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - }; - class dzn_EJAM_Config_Malfunction1Slider: RscXSliderH - { - idc = 6041; - x = 26.5 * GUI_GRID_W + GUI_GRID_X; - y = 10 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - }; - class dzn_EJAM_Config_Malfunction2Slider: RscXSliderH - { - idc = 6042; - x = 26.5 * GUI_GRID_W + GUI_GRID_X; - y = 11.5 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - }; - class dzn_EJAM_Config_Malfunction3Slider: RscXSliderH - { - idc = 6043; - x = 26.5 * GUI_GRID_W + GUI_GRID_X; - y = 13 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - }; - class dzn_EJAM_Config_Malfunction4Slider: RscXSliderH - { - idc = 6044; - x = 26.5 * GUI_GRID_W + GUI_GRID_X; - y = 14.5 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - }; - class dzn_EJAM_Config_Malfunction5Slider: RscXSliderH - { - idc = 6045; - x = 26.5 * GUI_GRID_W + GUI_GRID_X; - y = 16 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - }; - - // --- Buttons - class dzn_EJAM_Config_SaveBtn: RscButtonMenu - { - idc = 6050; - text = "SAVE"; //--- ToDo: Localize; - x = 16.5 * GUI_GRID_W + GUI_GRID_X; - y = 23.5 * GUI_GRID_H + GUI_GRID_Y; - w = 6 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - class dzn_EJAM_Config_CopyBtn: RscButtonMenu - { - idc = 6051; - text = "COPY"; //--- ToDo: Localize; - x = 23.5 * GUI_GRID_W + GUI_GRID_X; - y = 23.5 * GUI_GRID_H + GUI_GRID_Y; - w = 6 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - class dzn_EJAM_Config_ApplyBtn: RscButtonMenu - { - idc = 6052; - text = "Paste"; //--- ToDo: Localize; - x = 30.5 * GUI_GRID_W + GUI_GRID_X; - y = 23.5 * GUI_GRID_H + GUI_GRID_Y; - w = 6 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - class dzn_EJAM_Config_ResetBtn: RscButtonMenu - { - idc = 6053; - text = "Reset"; //--- ToDo: Localize; - x = 30.5 * GUI_GRID_W + GUI_GRID_X; - y = 22 * GUI_GRID_H + GUI_GRID_Y; - w = 6 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - - }; -}; - - - - - - - diff --git a/Source/Script/ui/dzn_EJAM_Menu.hpp b/Source/Script/ui/dzn_EJAM_Menu.hpp deleted file mode 100644 index 47cde3a..0000000 --- a/Source/Script/ui/dzn_EJAM_Menu.hpp +++ /dev/null @@ -1,190 +0,0 @@ -#define GUI_GRID_X (0) -#define GUI_GRID_Y (0) -#define GUI_GRID_W (0.025) -#define GUI_GRID_H (0.04) -#define GUI_GRID_WAbs (1) -#define GUI_GRID_HAbs (1) - -class dzn_EJAM_Menu_Group: RscControlsGroup -{ - idd = 134802; - idc = 6000; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 40 * GUI_GRID_W; - h = 19 * GUI_GRID_H; - colorBackground[] = {0,0,0,0.75}; - - class controls - { - // HEADER & BG - class dzn_EJAM_Menu_BG: RscFrame - { - idc = 6001; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 40 * GUI_GRID_W; - h = 19 * GUI_GRID_H; - colorBackground[] = {0,0,0,0.75}; - style=0; - }; - class dzn_EJAM_Menu_TitleLabel: RscStructuredText - { - idc = 6002; - text = ""; //--- TITLE - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 34 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {0.77,0.51,0.08,0.8}; - font = "PuristaMedium"; - }; - class dzn_EJAM_Menu_CloseBtn: RscButtonMenu - { - idc = 6003; - text = ""; //--- CLOSE - x = 34 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 6 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - - - // IMAGE - class dzn_EJAM_Menu_ImageLabel: RscStructuredText - { - idc = 6010; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 1 * GUI_GRID_H + GUI_GRID_Y; - w = 40 * GUI_GRID_W; - h = 14 * GUI_GRID_H; - colorBackground[] = {-1,-1,-1,0}; - }; - class dzn_EJAM_Menu_GunNameLabel: RscStructuredText - { - idc = 6011; - text = ""; //--- AK-74 - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 1 * GUI_GRID_H + GUI_GRID_Y; - w = 40 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {-1,-1,-1,0}; - font = "PuristaLight"; - }; - - - // STATES - class dzn_EJAM_Menu_BoltLabel: RscStructuredText - { - idc = 6012; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 15 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - text = ""; //--- Bolt state - colorBackground[] = {-1,-1,-1,0}; - font = "PuristaLight"; - }; - class dzn_EJAM_Menu_ChamberLabel: RscStructuredText - { - idc = 6013; - x = 13.5 * GUI_GRID_W + GUI_GRID_X; - y = 15 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - text = ""; //--- Chamber state - colorBackground[] = {-1,-1,-1,0}; - font = "PuristaLight"; - }; - class dzn_EJAM_Menu_MagazineLabel: RscStructuredText - { - idc = 6014; - x = 27 * GUI_GRID_W + GUI_GRID_X; - y = 15 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - text = ""; //--- Magazine state - colorBackground[] = {-1,-1,-1,0}; - font = "PuristaLight"; - }; - class dzn_EJAM_Menu_ExtractionLabel: RscStructuredText - { - idc = 6015; - x = 13.5 * GUI_GRID_W + GUI_GRID_X; - y = 16 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - text = ""; //--- Extraction state - colorBackground[] = {-1,-1,-1,0}; - font = "PuristaLight"; - }; - - - // BUTTONS - class dzn_EJAM_Menu_PullBoltBtn: RscButtonMenu - { - idc = 6020; - text = ""; //--- ToDo: Localize; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 17 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - class dzn_EJAM_Menu_ChamberBtn: RscButtonMenu - { - idc = 6021; - text = ""; //--- ToDo: Localize; - x = 13.5 * GUI_GRID_W + GUI_GRID_X; - y = 17 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - class dzn_EJAM_Menu_DetachMagazineBtn: RscButtonMenu - { - idc = 6022; - text = ""; //--- ToDo: Localize; - x = 27 * GUI_GRID_W + GUI_GRID_X; - y = 17 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - class dzn_EJAM_Menu_OpenBoltBtn: RscButtonMenu - { - idc = 6023; - text = ""; //--- ToDo: Localize; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 18 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - class dzn_EJAM_Menu_ExtractionBtn: RscButtonMenu - { - idc = 6024; - text = ""; //--- ToDo: Localize; - x = 13.5 * GUI_GRID_W + GUI_GRID_X; - y = 18 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - - /* - class dzn_EJAM_Menu_AttachMagazineBtn: RscButtonMenu - { - idc = 6025; - text = ""; //--- ToDo: Localize; - x = 27 * GUI_GRID_W + GUI_GRID_X; - y = 18 * GUI_GRID_H + GUI_GRID_Y; - w = 13 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - font = "PuristaLight"; - }; - - */ - }; -}; \ No newline at end of file diff --git a/Source/Script/ui/dzn_EJAM_ProgressBar.hpp b/Source/Script/ui/dzn_EJAM_ProgressBar.hpp deleted file mode 100644 index e11bf78..0000000 --- a/Source/Script/ui/dzn_EJAM_ProgressBar.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#define GUI_GRID_X (0) -#define GUI_GRID_Y (0) -#define GUI_GRID_W (0.025) -#define GUI_GRID_H (0.04) -#define GUI_GRID_WAbs (1) -#define GUI_GRID_HAbs (1) - -class dzn_EJAM_ProgressBar_Group: RscControlsGroup -{ - idd = 134804; - idc = 6500; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 40 * GUI_GRID_W; - h = 19 * GUI_GRID_H; - colorBackground[] = {0,0,0,0.75}; - - class controls - { - - class dzn_EJAM_Progress_BG: RscStructuredText - { - idc = 6503; - x = 1 * GUI_GRID_W + GUI_GRID_X; - y = 1 * GUI_GRID_H + GUI_GRID_Y; - w = 38 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {0,0,0,0.25}; - }; - class dzn_EJAM_Progress_Bar: RscStructuredText - { - idc = 6502; - x = 1 * GUI_GRID_W + GUI_GRID_X; - y = 1.1 * GUI_GRID_H + GUI_GRID_Y; - w = 0 * GUI_GRID_W; - h = 0.8 * GUI_GRID_H; - colorBackground[] = {0.77,0.51,0.08,0.8}; - }; - class dzn_EJAM_Progress_Title: RscStructuredText - { - idc = 6501; - text = ""; //--- ToDo: Localize; - x = 1 * GUI_GRID_W + GUI_GRID_X; - y = 1 * GUI_GRID_H + GUI_GRID_Y; - w = 38 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - colorBackground[] = {1,1,1,0}; - }; - }; -}; - diff --git a/readme.md b/readme.md index 9b9c0f0..88f9109 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1379304937 -#### Version: 2 +#### Version: 2.7 Adds a little bit more complex logic to ACE jamming effect. @@ -34,11 +34,14 @@ Note: Credits: 10Dozen - scripting; hyper's youtube channel (https://www.youtube.com/channel/UCSezUnbvCLYBXuUlPcXU_QQ) - sound. +KICKASS (Chinese, Chinese simplified translation) +EckoMoire (Portuguese translation) +Ralf (German translation) License: APL-SA --- -Версия: 2 +Версия: 2.7 Мод добавляет логику заклинивания оружия в ванильную игру или расширяет логику работы с заклинившим оружием в ACE (ACE Overheating). Клиентский мод, при установке на сервер - применяет единые настройки для всех клиентов. @@ -65,5 +68,8 @@ License: APL-SA [h1]Credits:[/h1] 10Dozen - scripting; hyper's youtube channel ( https://www.youtube.com/channel/UCSezUnbvCLYBXuUlPcXU_QQ ) - sound. +KICKASS (Chinese, Chinese simplified translation) +EckoMoire (Portuguese translation) +Ralf (German translation) [h1]License: APL-SA[/h1] diff --git a/Mod/Keys/10Dozen.bikey b/source/Keys/10Dozen.bikey similarity index 100% rename from Mod/Keys/10Dozen.bikey rename to source/Keys/10Dozen.bikey diff --git a/Source/Addons/Enums.sqf b/source/dzn_EJAM/Enums.sqf similarity index 100% rename from Source/Addons/Enums.sqf rename to source/dzn_EJAM/Enums.sqf diff --git a/Source/Addons/Functions.sqf b/source/dzn_EJAM/Functions.sqf similarity index 89% rename from Source/Addons/Functions.sqf rename to source/dzn_EJAM/Functions.sqf index cd30ae0..40f2de5 100644 --- a/Source/Addons/Functions.sqf +++ b/source/dzn_EJAM/Functions.sqf @@ -1,11 +1,14 @@ #include "macro.hpp" +COMPILE_FUNCTION(fnc_initPlayer); COMPILE_FUNCTION(fnc_firedEH); COMPILE_FUNCTION(fnc_getMappingData); COMPILE_FUNCTION(fnc_processMappingData); +COMPILE_FUNCTION(fnc_isInVehicleCrew); COMPILE_FUNCTION(fnc_checkJammed); COMPILE_FUNCTION(fnc_setJammed); +COMPILE_FUNCTION(fnc_setUnjammed); COMPILE_FUNCTION(fnc_getJamCause); COMPILE_FUNCTION(fnc_setWeaponState); diff --git a/Source/Script/Init.sqf b/source/dzn_EJAM/Init.sqf similarity index 71% rename from Source/Script/Init.sqf rename to source/dzn_EJAM/Init.sqf index 52d5ad7..2852907 100644 --- a/Source/Script/Init.sqf +++ b/source/dzn_EJAM/Init.sqf @@ -1,4 +1,3 @@ - #include "macro.hpp" call compile preprocessFileLineNumbers format ["%1\Enums.sqf", PATH]; @@ -7,6 +6,9 @@ call compile preprocessFileLineNumbers format ["%1\Settings.sqf", PATH]; // Exit at dedicated or headless client if (!hasInterface) exitWith {}; + + + // Init main [] spawn { waitUntil { !isNull player && local player }; // Handle 3DEN and/or specator @@ -14,6 +16,12 @@ if (!hasInterface) exitWith {}; GVAR(ClassFamiliesCache) = call CBA_fnc_createNamespace; GVAR(ConfigData) = call CBA_fnc_createNamespace; + GVAR(ACEUnjamFailChance) = 0.1; + + player addEventHandler ["Respawn", { + params ["_unit", "_corpse"]; + call GVAR(fnc_initPlayer); + }]; if (missionNamespace getVariable ["ace_overheating_enabled",false]) then { // Wait ACE init @@ -22,6 +30,8 @@ if (!hasInterface) exitWith {}; && !isNil "ace_overheating_cacheSilencerData" }; + GVAR(ACEUnjamFailChance) = ace_overheating_unJamFailChance; + // Update ACE Overheating data with custom mapping call GVAR(fnc_processMappingData); @@ -32,14 +42,10 @@ if (!hasInterface) exitWith {}; if (_this select 1 != primaryWeapon player) exitWith {}; call GVAR(fnc_setJammed); } - ] call CBA_fnc_addEventHandler; + ] call CBA_fnc_addEventHandler; }; - if (!(missionNamespace getVariable ["ace_overheating_enabled",false]) || GVAR(ForceOverallChance)) then { - - // Run EJAM's FiredEH if ACE Overheating disabled OR EJAM Jam chance forced - GVAR(FiredEH) = player addEventHandler ["Fired", { call GVAR(fnc_firedEH) }]; - }; + [] call GVAR(fnc_initPlayer); // Add ACE Self-Interecation action if ACE Interaction is running if (!isNil "ace_interact_menu_fnc_createAction") exitWith { @@ -56,22 +62,23 @@ if (!hasInterface) exitWith {}; , ["ACE_SelfActions", "ACE_Equipment"] , GVAR(ACE_InspectActionClass) ] call ace_interact_menu_fnc_addActionToClass; - - // Loop to handle gun icon change + + // Loop to handle gun icon change GVAR(CurrentWeapon) = primaryWeapon player; - while { true } do { - sleep 2; - if (GVAR(CurrentWeapon) != primaryWeapon player && primaryWeapon player != "") then { - GVAR(CurrentWeapon) = primaryWeapon player; - GVAR(ACE_InspectActionClass) set [2, getText(configFile >> "CfgWeapons" >> GVAR(CurrentWeapon) >> "picture")]; + GVAR(UnjamChanceOverridePFH) = [{ + if (!alive player) exitWith {}; + private _pw = primaryWeapon player; + if (_pw != "" && GVAR(CurrentWeapon) != _pw) then { + GVAR(CurrentWeapon) = _pw; + GVAR(ACE_InspectActionClass) set [2, getText(configFile >> "CfgWeapons" >> _pw >> "picture")]; // Cache weapon family - GVAR(CurrentWeapon) spawn dzn_EJAM_fnc_getClassFamily + _pw spawn GVAR(fnc_getClassFamily); }; if (GVAR(Force)) then { - ace_overheating_unJamFailChance = 1; + ace_overheating_unJamFailChance = [GVAR(ACEUnjamFailChance), 1] select (currentWeapon player == _pw); }; - }; + }] call CBA_fnc_addPerFrameHandler; }; }; diff --git a/Source/Addons/Settings.sqf b/source/dzn_EJAM/Settings.sqf similarity index 73% rename from Source/Addons/Settings.sqf rename to source/dzn_EJAM/Settings.sqf index 6b1d166..58ba4d9 100644 --- a/Source/Addons/Settings.sqf +++ b/source/dzn_EJAM/Settings.sqf @@ -54,7 +54,7 @@ private _addLocal = { [ "feed_failure_ChanceSettings" , "SLIDER" - , [0, 100, 30, 0] + , [0, 100, 60, 0] , { /* Reset cache */ player setVariable [SVAR(FiredLastGunData), nil]; } ] call _add; @@ -68,7 +68,7 @@ private _addLocal = { [ "dud_ChanceSettings" , "SLIDER" - , [0, 100, 30, 0] + , [0, 100, 60, 0] , { /* Reset cache */ player setVariable [SVAR(FiredLastGunData), nil]; } ] call _add; @@ -90,12 +90,21 @@ private _addLocal = { [ "SubsonicJamEffectSetting" , "EDITBOX" - , "20" + , "0.05" , { GVAR(SubsonicJamEffect) = parseNumber _this; } ] call _add; +[ + "SubsonicMagazinesSettings" + , "EDITBOX" + , '"cup_30rnd_subsonic_545x39_ak_m","cup_20rnd_subsonic_545x39_aksu_m","cup_30rnd_subsonic_545x39_ak74m_m","cup_30rnd_subsonic_545x39_ak74_plum_m","cup_30rnd_subsonic_762x39_ak47_m","cup_20rnd_subsonic_762x39_amd63_m","cup_30rnd_subsonic_762x39_ak47_bakelite_m","cup_30rnd_subsonic_762x39_ak103_bakelite_m","cup_30rnd_subsonic_762x39_akm_bakelite_desert_m","cup_30rnd_subsonic_545x39_fort224_m","rhs_30rnd_545x39_7u1_ak","rhs_45rnd_545x39_7u1_ak","rhs_30rnd_762x39mm_u","rhs_30rnd_762x39mm_bakelite_u","rhs_30rnd_762x39mm_polymer_u","hlc_30rnd_545x39_s_ak","hlc_30rnd_545x39_s_ak_plum","hlc_30rnd_545x39_s_ak_black","hlc_20rnd_762x51_s_fal","hlc_10rnd_762x51_s_fal","hlc_20rnd_762x51_s_g3"' + , { + GVAR(SubsonicMagazines) = (call compile ("[" + _this + "]")) apply { toLower _x }; + } +] call _add; + // Mapping of gun classes on jam settings [ "MappingSettings" @@ -111,8 +120,9 @@ private _addLocal = { ] call _add; // Keybinding +#define ALLOW_OVERRIDE !([] call GVAR(fnc_isInVehicleCrew)) private _addKey = { - params["_var","_str","_downCode",["_defaultKey", nil],["_upCode", { true }]]; + params["_var","_str","_downCode",["_defaultKey", nil],["_upCode", { false }]]; private _settings = [ TITLE @@ -130,28 +140,29 @@ private _addKey = { [ "InspectKey" , "Action_Inspect" - , { call GVAR(fnc_inspectWeapon); true } + , { call GVAR(fnc_inspectWeapon); ALLOW_OVERRIDE } , [19, [false,true,false]] + , { true } ] call _addKey; [ "QuickInspectKey" , "Action_QuickInspect" - , { "inspect" call GVAR(fnc_doHotkeyAction); true } + , { "inspect" call GVAR(fnc_doHotkeyAction); ALLOW_OVERRIDE } ] call _addKey; // Pull bolt key [ "PullBoltKey" , "Action_PullBolt" - , { "pull_bolt" call GVAR(fnc_doHotkeyAction); true } + , { "pull_bolt" call GVAR(fnc_doHotkeyAction); ALLOW_OVERRIDE } ] call _addKey; // Open bolt key [ "OpenBoltKey" , "Action_OpenBolt" - , { "open_bolt" call GVAR(fnc_doHotkeyAction); true } + , { "open_bolt" call GVAR(fnc_doHotkeyAction); ALLOW_OVERRIDE } ] call _addKey; // Toggle magazine key @@ -162,7 +173,7 @@ private _addKey = { (call GVAR(fnc_getWeaponState)) params ["","","","_mag"]; private _action = if (_mag == "mag_attached") then { "detach_mag" } else { "attach_mag" }; _action call GVAR(fnc_doHotkeyAction); - true + ALLOW_OVERRIDE } ] call _addKey; diff --git a/Source/Addons/config.cpp b/source/dzn_EJAM/config.cpp similarity index 96% rename from Source/Addons/config.cpp rename to source/dzn_EJAM/config.cpp index 59f8adf..749cadb 100644 --- a/Source/Addons/config.cpp +++ b/source/dzn_EJAM/config.cpp @@ -7,7 +7,7 @@ class CfgPatches requiredVersion = 0.1; requiredAddons[] = {"CBA_MAIN"}; author[] = {"10Dozen"}; - version = "2.6"; + version = "2.7"; }; }; diff --git a/Source/Addons/functions/fnc_checkJammed.sqf b/source/dzn_EJAM/functions/fnc_checkJammed.sqf similarity index 100% rename from Source/Addons/functions/fnc_checkJammed.sqf rename to source/dzn_EJAM/functions/fnc_checkJammed.sqf diff --git a/Source/Addons/functions/fnc_doAction.sqf b/source/dzn_EJAM/functions/fnc_doAction.sqf similarity index 100% rename from Source/Addons/functions/fnc_doAction.sqf rename to source/dzn_EJAM/functions/fnc_doAction.sqf diff --git a/Source/Addons/functions/fnc_doHotkeyAction.sqf b/source/dzn_EJAM/functions/fnc_doHotkeyAction.sqf similarity index 95% rename from Source/Addons/functions/fnc_doHotkeyAction.sqf rename to source/dzn_EJAM/functions/fnc_doHotkeyAction.sqf index 6070d1d..aaa5506 100644 --- a/Source/Addons/functions/fnc_doHotkeyAction.sqf +++ b/source/dzn_EJAM/functions/fnc_doHotkeyAction.sqf @@ -22,6 +22,7 @@ Author: #include "..\macro.hpp" if !(isNil SVAR(ActionInProgress)) exitWith {}; +if ([] call GVAR(fnc_isInVehicleCrew)) exitWith {}; if !("inspect" call GVAR(fnc_checkJammed)) exitWith { "OK" call GVAR(fnc_uiShowBriefState); diff --git a/Source/Addons/functions/fnc_firedEH.sqf b/source/dzn_EJAM/functions/fnc_firedEH.sqf similarity index 81% rename from Source/Addons/functions/fnc_firedEH.sqf rename to source/dzn_EJAM/functions/fnc_firedEH.sqf index 2be2944..5b0dedb 100644 --- a/Source/Addons/functions/fnc_firedEH.sqf +++ b/source/dzn_EJAM/functions/fnc_firedEH.sqf @@ -24,12 +24,11 @@ Author: params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; private _gun = primaryWeapon player; - if ( _weapon != _gun || {_muzzle != _gun} || "inspect" call GVAR(fnc_checkJammed) ) exitWith { - // Exit if fired not a main muzzle (e.g. UGL) OR weapon already jammed + // Exit if fired not a main muzzle (e.g. UGL) OR weapon already jammed }; -// Get jam chacne (from config or overall) +// Get jam chance (from config or overall) private _lastFiredGunData = player getVariable [SVAR(FiredLastGunData), []]; private _jamChance = 0; if (_lastFiredGunData isEqualTo [] || { _gun != _lastFiredGunData select 0 }) then { @@ -42,10 +41,8 @@ if (_lastFiredGunData isEqualTo [] || { _gun != _lastFiredGunData select 0 }) th }; // Check is subsonic to enlarge jam chance -private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); -private _subsonicSpeed = getNumber (configFile >> "CfgAmmo" >> _ammo >> "typicalSpeed") < 343; -private _lowAudible = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire") < 10; -if (_subsonicSpeed && _lowAudible ) then { +_magazine = toLower(_magazine); +if (GVAR(SubsonicMagazines) findIf { _magazine isEqualTo _x } > -1) then { _jamChance = _jamChance + GVAR(SubsonicJamEffect); }; @@ -55,7 +52,7 @@ private _random = random 100; // Check random vs jam chance to modify if (_random <= _jamChance) then { call GVAR(fnc_setJammed); - + // Stop firing _gun spawn { private _gun = _this; @@ -66,5 +63,5 @@ if (_random <= _jamChance) then { waitUntil {_frame < diag_frameno}; player setAmmo [_gun, _ammo]; }; - }; -}; \ No newline at end of file + }; +}; diff --git a/Source/Addons/functions/fnc_getClassFamily.sqf b/source/dzn_EJAM/functions/fnc_getClassFamily.sqf similarity index 97% rename from Source/Addons/functions/fnc_getClassFamily.sqf rename to source/dzn_EJAM/functions/fnc_getClassFamily.sqf index 508e484..1c16742 100644 --- a/Source/Addons/functions/fnc_getClassFamily.sqf +++ b/source/dzn_EJAM/functions/fnc_getClassFamily.sqf @@ -58,7 +58,7 @@ if (!isNil { GVAR(ClassFamiliesCache) getVariable _parent }) then { && { [_classItem,"picture","t"] call _fnc_gfc != "" && [_classItem,"model","t"] call _fnc_gfc != "" - && [_classItem,"scope","n"] call _fnc_gfc == 2 + && [_classItem,"scope","n"] call _fnc_gfc > 0 } ) then { private _baseClass = [_classItem] call BIS_fnc_baseWeapon; diff --git a/Source/Addons/functions/fnc_getEnumText.sqf b/source/dzn_EJAM/functions/fnc_getEnumText.sqf similarity index 100% rename from Source/Addons/functions/fnc_getEnumText.sqf rename to source/dzn_EJAM/functions/fnc_getEnumText.sqf diff --git a/Source/Addons/functions/fnc_getJamCause.sqf b/source/dzn_EJAM/functions/fnc_getJamCause.sqf similarity index 100% rename from Source/Addons/functions/fnc_getJamCause.sqf rename to source/dzn_EJAM/functions/fnc_getJamCause.sqf diff --git a/Source/Addons/functions/fnc_getMappingData.sqf b/source/dzn_EJAM/functions/fnc_getMappingData.sqf similarity index 100% rename from Source/Addons/functions/fnc_getMappingData.sqf rename to source/dzn_EJAM/functions/fnc_getMappingData.sqf diff --git a/Source/Addons/functions/fnc_getWeaponState.sqf b/source/dzn_EJAM/functions/fnc_getWeaponState.sqf similarity index 100% rename from Source/Addons/functions/fnc_getWeaponState.sqf rename to source/dzn_EJAM/functions/fnc_getWeaponState.sqf diff --git a/Source/Addons/functions/fnc_hasMagazine.sqf b/source/dzn_EJAM/functions/fnc_hasMagazine.sqf similarity index 100% rename from Source/Addons/functions/fnc_hasMagazine.sqf rename to source/dzn_EJAM/functions/fnc_hasMagazine.sqf diff --git a/source/dzn_EJAM/functions/fnc_initPlayer.sqf b/source/dzn_EJAM/functions/fnc_initPlayer.sqf new file mode 100644 index 0000000..bd33ac1 --- /dev/null +++ b/source/dzn_EJAM/functions/fnc_initPlayer.sqf @@ -0,0 +1,47 @@ +/* ---------------------------------------------------------------------------- +Function: dzn_EJAM_fnc_initPlayer + +Description: + Inits player vars and stuff on spawn + +Parameters: + none + +Returns: + nothing + +Examples: + (begin example) + [] call dzn_EJAM_fnc_initPlayer; + (end) + +Author: + 10Dozen +---------------------------------------------------------------------------- */ + +#include "..\macro.hpp" + +player setVariable [SVAR(Cause), []]; +player setVariable [SVAR(RemovedMagazine), nil]; +player setVariable [SVAR(LooseRound), nil]; +player setVariable [SVAR(WeaponState), nil]; + +if (!isNil SVAR(PreventFireID)) then { + player removeAction GVAR(PreventFireID); + GVAR(PreventFireID) = nil; +}; + +// Run EJAM's FiredEH if ACE Overheating disabled OR EJAM Jam chance forced +if (!(missionNamespace getVariable ["ace_overheating_enabled",false]) || GVAR(ForceOverallChance)) then { + GVAR(FiredEH) = player addEventHandler ["Fired", { call GVAR(fnc_firedEH) }]; +}; + +if (!isNil "ace_overheating_unJamFailChance") then { + private _jammedList = player getVariable ["ace_overheating_jammedWeapons", []]; + if (_jammedList isEqualTo []) exitWith {}; + + private _acePreventFireId = player getVariable ["ace_overheating_JammingActionID", -1]; + [player, "DefaultAction", _acePreventFireId] call ace_common_fnc_removeActionEventHandler; + player setVariable ["ace_overheating_JammingActionID", -1]; + player setVariable ["ace_overheating_jammedWeapons", []]; +}; diff --git a/Source/Addons/functions/fnc_inspectWeapon.sqf b/source/dzn_EJAM/functions/fnc_inspectWeapon.sqf similarity index 100% rename from Source/Addons/functions/fnc_inspectWeapon.sqf rename to source/dzn_EJAM/functions/fnc_inspectWeapon.sqf diff --git a/source/dzn_EJAM/functions/fnc_isInVehicleCrew.sqf b/source/dzn_EJAM/functions/fnc_isInVehicleCrew.sqf new file mode 100644 index 0000000..6786e3f --- /dev/null +++ b/source/dzn_EJAM/functions/fnc_isInVehicleCrew.sqf @@ -0,0 +1,31 @@ +/* ---------------------------------------------------------------------------- +Function: dzn_EJAM_fnc_isInVehicleCrew + +Description: + Check whether primary weapon is jammed and (a) cause set, (b) cause not set. + +Parameters: + nothing + +Returns: + _isInVehicleCrew - (boolean) true if player in driver/commander/gunner or turret slot, false if not in vehicle or in cargo + +Examples: + (begin example) + _isInVehicleCrew = [] call dzn_EJAM_fnc_isInVehicleCrew; + (end) + +Author: + 10Dozen +---------------------------------------------------------------------------- */ + +#include "..\macro.hpp" + +// Exit with FALSE if player not in vehicle +if (vehicle player == player) exitWith { false }; + +// Exit with FALSE if player in vehicle's cargo seat +if ((fullCrew vehicle player) findIf {player isEqualTo _x # 0 && {_x # 1 == "cargo" || _x # 1 == "turret"} } > -1) exitWith { false }; + +// Return TRUE if in vehicle crew +true diff --git a/Source/Addons/functions/fnc_isMagAttached.sqf b/source/dzn_EJAM/functions/fnc_isMagAttached.sqf similarity index 100% rename from Source/Addons/functions/fnc_isMagAttached.sqf rename to source/dzn_EJAM/functions/fnc_isMagAttached.sqf diff --git a/Source/Addons/functions/fnc_manageMagazine.sqf b/source/dzn_EJAM/functions/fnc_manageMagazine.sqf similarity index 100% rename from Source/Addons/functions/fnc_manageMagazine.sqf rename to source/dzn_EJAM/functions/fnc_manageMagazine.sqf diff --git a/Source/Addons/functions/fnc_playActionSound.sqf b/source/dzn_EJAM/functions/fnc_playActionSound.sqf similarity index 100% rename from Source/Addons/functions/fnc_playActionSound.sqf rename to source/dzn_EJAM/functions/fnc_playActionSound.sqf diff --git a/Source/Addons/functions/fnc_processMappingData.sqf b/source/dzn_EJAM/functions/fnc_processMappingData.sqf similarity index 100% rename from Source/Addons/functions/fnc_processMappingData.sqf rename to source/dzn_EJAM/functions/fnc_processMappingData.sqf diff --git a/source/dzn_EJAM/functions/fnc_processWeaponFixed.sqf b/source/dzn_EJAM/functions/fnc_processWeaponFixed.sqf new file mode 100644 index 0000000..6b28823 --- /dev/null +++ b/source/dzn_EJAM/functions/fnc_processWeaponFixed.sqf @@ -0,0 +1,47 @@ +/* ---------------------------------------------------------------------------- +Function: dzn_EJAM_fnc_processWeaponFixed + +Description: + Verify weapon states and unjam weapon + +Parameters: + nothing + +Returns: + nothing + +Examples: + (begin example) + call dzn_EJAM_fnc_processWeaponFixed + (end) + +Author: + 10Dozen +---------------------------------------------------------------------------- */ + +#include "..\macro.hpp" + +if (isNil { player getVariable SVAR(WeaponState) }) exitWith {}; + +(call GVAR(fnc_getWeaponState)) params ["_bolt","_chamber","_case","_mag"]; + +if ( + _bolt != "bolt_not_closed" + && _chamber in ["chamber_ready","chamber_empty"] + && _case == "case_ejected" + && _mag == "mag_attached" +) then { + [] spawn { + if (isNil "ace_common_fnc_displayTextStructured") then { + hint parseText LOCALIZE_FORMAT_STR("Hint_WeaponOK"); + uiSleep 2; + hint ""; + } else { + uiSleep 0.75; + hint ""; + }; + }; + + // Unjamming + [] call GVAR(fnc_setUnjammed); +}; \ No newline at end of file diff --git a/Source/Addons/functions/fnc_pullBolt.sqf b/source/dzn_EJAM/functions/fnc_pullBolt.sqf similarity index 100% rename from Source/Addons/functions/fnc_pullBolt.sqf rename to source/dzn_EJAM/functions/fnc_pullBolt.sqf diff --git a/Source/Script/functions/fnc_setJammed.sqf b/source/dzn_EJAM/functions/fnc_setJammed.sqf similarity index 99% rename from Source/Script/functions/fnc_setJammed.sqf rename to source/dzn_EJAM/functions/fnc_setJammed.sqf index af3ffd8..5afb6ea 100644 --- a/Source/Script/functions/fnc_setJammed.sqf +++ b/source/dzn_EJAM/functions/fnc_setJammed.sqf @@ -56,7 +56,7 @@ if !(missionNamespace getVariable ["ace_overheating_enabled",false]) then { playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0]; }, "", 0, false, true, "DefaultAction" , format [ - "_muzzle = str(currentMuzzle player) splitString '""' joinString ''; + "_muzzle = str(currentMuzzle player) splitString '""' joinString ''; (_muzzle == primaryWeapon player) && [player, primaryWeapon player] call CBA_fnc_canUseWeapon && ""inspect"" call %1" diff --git a/source/dzn_EJAM/functions/fnc_setUnjammed.sqf b/source/dzn_EJAM/functions/fnc_setUnjammed.sqf new file mode 100644 index 0000000..f4c09eb --- /dev/null +++ b/source/dzn_EJAM/functions/fnc_setUnjammed.sqf @@ -0,0 +1,60 @@ +/* ---------------------------------------------------------------------------- +Function: dzn_EJAM_fnc_setUnjammed + +Description: + Unjams player's primary weapon + +Parameters: + nothing + +Returns: + nothing + +Examples: + (begin example) + [] call dzn_EJAM_fnc_setUnjammed + (end) + +Author: + 10Dozen +---------------------------------------------------------------------------- */ + +#include "..\macro.hpp" + +private _gun = [primaryWeapon player] call BIS_fnc_baseWeapon; + +// Unset weapon from jamming/weapon state lists +private _causes = player getVariable SVAR(Cause); +private _states = player getVariable SVAR(WeaponState); + +player setVariable [ + SVAR(WeaponState) + , _states - (_states select { _gun == _x select 0 }) +]; +player setVariable [ + SVAR(Cause) + , _causes - (_causes select { _gun == _x select 0 }) +]; +player setVariable [SVAR(RemovedMagazine), nil]; +player setVariable [SVAR(LooseRound), nil]; + + +if !(missionNamespace getVariable ["ace_overheating_enabled",false]) then { + // No ACE Overheating + // Remove Prevent Fire handler once all guns were unjammed + if ((player getVariable [SVAR(Cause), []]) isEqualTo []) then { + player removeAction GVAR(PreventFireID); + GVAR(PreventFireID) = nil; + }; +} else { + // ACE Overheating enabled + private _oldFailChance = ace_overheating_unJamFailChance; + + private _family = _gun call GVAR(fnc_getClassFamily); + { + ace_overheating_unJamFailChance = 0; + [player, _x, true] call ace_overheating_fnc_clearJam; + } forEach _family; + + ace_overheating_unJamFailChance = _oldFailChance; +}; \ No newline at end of file diff --git a/Source/Addons/functions/fnc_setWeaponState.sqf b/source/dzn_EJAM/functions/fnc_setWeaponState.sqf similarity index 100% rename from Source/Addons/functions/fnc_setWeaponState.sqf rename to source/dzn_EJAM/functions/fnc_setWeaponState.sqf diff --git a/Source/Addons/functions/fnc_uiShowBriefState.sqf b/source/dzn_EJAM/functions/fnc_uiShowBriefState.sqf similarity index 100% rename from Source/Addons/functions/fnc_uiShowBriefState.sqf rename to source/dzn_EJAM/functions/fnc_uiShowBriefState.sqf diff --git a/Source/Addons/functions/fnc_uiShowConfig.sqf b/source/dzn_EJAM/functions/fnc_uiShowConfig.sqf similarity index 100% rename from Source/Addons/functions/fnc_uiShowConfig.sqf rename to source/dzn_EJAM/functions/fnc_uiShowConfig.sqf diff --git a/Source/Addons/functions/fnc_uiShowProgressBar.sqf b/source/dzn_EJAM/functions/fnc_uiShowProgressBar.sqf similarity index 100% rename from Source/Addons/functions/fnc_uiShowProgressBar.sqf rename to source/dzn_EJAM/functions/fnc_uiShowProgressBar.sqf diff --git a/Source/Addons/functions/fnc_uiShowUnjamMenu.sqf b/source/dzn_EJAM/functions/fnc_uiShowUnjamMenu.sqf similarity index 100% rename from Source/Addons/functions/fnc_uiShowUnjamMenu.sqf rename to source/dzn_EJAM/functions/fnc_uiShowUnjamMenu.sqf diff --git a/Source/Addons/macro.hpp b/source/dzn_EJAM/macro.hpp similarity index 100% rename from Source/Addons/macro.hpp rename to source/dzn_EJAM/macro.hpp diff --git a/Source/Addons/sounds/BoltOpen.ogg b/source/dzn_EJAM/sounds/BoltOpen.ogg similarity index 100% rename from Source/Addons/sounds/BoltOpen.ogg rename to source/dzn_EJAM/sounds/BoltOpen.ogg diff --git a/Source/Addons/sounds/BoltPull.ogg b/source/dzn_EJAM/sounds/BoltPull.ogg similarity index 100% rename from Source/Addons/sounds/BoltPull.ogg rename to source/dzn_EJAM/sounds/BoltPull.ogg diff --git a/Source/Addons/sounds/CfgSounds.hpp b/source/dzn_EJAM/sounds/CfgSounds.hpp similarity index 100% rename from Source/Addons/sounds/CfgSounds.hpp rename to source/dzn_EJAM/sounds/CfgSounds.hpp diff --git a/Source/Addons/sounds/Fixing.ogg b/source/dzn_EJAM/sounds/Fixing.ogg similarity index 100% rename from Source/Addons/sounds/Fixing.ogg rename to source/dzn_EJAM/sounds/Fixing.ogg diff --git a/Source/Addons/sounds/MagAttach.ogg b/source/dzn_EJAM/sounds/MagAttach.ogg similarity index 100% rename from Source/Addons/sounds/MagAttach.ogg rename to source/dzn_EJAM/sounds/MagAttach.ogg diff --git a/Source/Addons/sounds/MagDetach.ogg b/source/dzn_EJAM/sounds/MagDetach.ogg similarity index 100% rename from Source/Addons/sounds/MagDetach.ogg rename to source/dzn_EJAM/sounds/MagDetach.ogg diff --git a/Source/Addons/sounds/MagDrop.ogg b/source/dzn_EJAM/sounds/MagDrop.ogg similarity index 100% rename from Source/Addons/sounds/MagDrop.ogg rename to source/dzn_EJAM/sounds/MagDrop.ogg diff --git a/source/dzn_EJAM/stringtable.xml b/source/dzn_EJAM/stringtable.xml new file mode 100644 index 0000000..33a7714 --- /dev/null +++ b/source/dzn_EJAM/stringtable.xml @@ -0,0 +1,659 @@ + + + + + + + + Unjam via EJAM only + Починка только через EJAM + 武器只能使用EJAM排障 + 武器只能使用EJAM排障 + Entstörung nur über EJAM + Destravar apenas pelo EJAM + + + Force EJAM unjam logic over ACE + Принудительно использовать логику починки EJAM вместо ACE + 强制使用EJAM排障覆盖ACE + 強制使用EJAM排障覆蓋ACE + Erzwinge EJAM Logik über ACE-Jam-Logik + Forçar configurações do EJAM sobre o ACE + + + + Override jam chance + Перезаписать шанс на заклинивание + 重新定义武器卡弹概率 + 重新定義武器卡彈概率 + Allgemeine Chance auf Ladehemmungen überschreiben + Sobrepor a chance de trava + + + Force EJAM Overall jam chance over ACE jamming logic. + Принудительно использовать общий шанс на заклинивание. + 强行让EJAM覆盖ACE卡弹机制 + 强行讓EJAM覆蓋ACE卡彈機制 + Erwinge EJAM Allgemeine Chance auf Ladehemmungen über ACE-Jam-Logik + Forçar a chance geral de trava do EJAM sobre a lógica do ACE + + + + Overall jam chance + Общий шанс заклинивания + 整体卡弹概率 + 整體卡彈概率 + Allgemeine Chance auf Ladehemmungen + Chance geral de trava + + + Default jam chance for all primary weapons. From 0 to 100. Custom weapon setting will be used if set. + Шанс на клин для всего основного оружия. От 0 до 100. Если для оружия указаны специфические настройки - будут использованы они. + 所有主武器的默认卡弹概率. 从0到100. 自定义武器设置后生效 + 所有主武器的默認卡彈概率.從0到100.自定義武器設定後生效 + Standardmäßige Chance auf Ladehemmungen für alle Primärwaffen. Von 0 bis 100. Die benutzerdefinierte Waffeneinstellung wird verwendet, wenn sie eingestellt ist. + Chance padrão para todas as armas primárias. De 0 a 100. Configurações personalizadas serão utilizadas se definidas. + + + + (Chance of) Feed failure + (Шанс на) Неподачу патрона + 导气系统故障概率 + 導氣系統故障概率 + (Chance auf) Zufuhrausfall + (Chance) Falha de Alimentação + + + Chance for specific malfunction to happen if weapon got jammed. + Шанс, что с оружием случится данная неисправность, если оружие заклинило + 武器卡弹后发生特定故障的概率 + 武器卡彈後發生特定故障的概率 + Möglichkeit einer spezifischen Fehlfunktion, wenn die Waffe blockiert wurde + Chance de ocorrer esse defeito específico se a arma travar. + + + (Chance of) Chamber failure + (Шанс на) Утыкание патрона + 供弹失败概率 + 供彈失敗概率 + (Chance auf) Kammerausfall + (Chance) Falha na Câmara + + + Chance for specific malfunction to happen if weapon got jammed + Шанс, что с оружием случится данная неисправность, если оружие заклинило + 武器卡弹后发生特定故障的概率 + 武器卡彈後發生特定故障的概率 + Möglichkeit einer spezifischen Fehlfunktion, wenn die Waffe blockiert wurde + Chance de ocorrer esse defeito específico se a arma travar. + + + (Chance of) Dud + (Шанс на) Осечка + 哑弹概率 + 啞彈概率 + (Chance auf) Blindgänger + (Chance) Projétil Falho + + + Chance for specific malfunction to happen if weapon got jammed + Шанс, что с оружием случится данная неисправность, если оружие заклинило + 武器卡弹后发生特定故障的概率 + 武器卡彈後發生特定故障的概率 + Möglichkeit einer spezifischen Fehlfunktion, wenn die Waffe blockiert wurde + Chance de ocorrer esse defeito específico se a arma travar. + + + (Chance of) Extraction failure + (Шанс на) Неизвлечение гильзы + 抽壳失败概率 + 抽殼失敗概率 + (Chance des) Extraktionsversagens + (Chance) Falha de Extração do estojo do cartucho + + + Chance for specific malfunction to happen if weapon got jammed + Шанс, что с оружием случится данная неисправность, если оружие заклинило + 武器卡弹后发生特定故障的概率 + 武器卡彈後發生特定故障的概率 + Möglichkeit einer spezifischen Fehlfunktion, wenn die Waffe blockiert wurde + Chance de ocorrer esse defeito específico se a arma travar. + + + (Chance of) Ejection failure + (Шанс на) Прихват гильзы + 抛壳失败概率 + 拋殼失敗概率 + (Chance auf) Auswurfversagen + (Chance) Falha de Ejeção + + + Chance for specific malfunction to happen if weapon got jammed + Шанс, что с оружием случится данная неисправность, если оружие заклинило + 武器卡弹后发生特定故障的概率 + 武器卡彈後發生特定故障的概率 + Möglichkeit einer spezifischen Fehlfunktion, wenn die Waffe blockiert wurde + Chance de ocorrer esse defeito específico se a arma travar. + + + + + + Subsonic ammunition penalty + Пенальти дозвуковых боеприпасов + 亚音速弹卡弹概率 + 亞音速彈卡彈概率 + Strafe für Unterschall-Munition + Penalidade de munições subsônicas + + + Jam chance penalty on using subsonic ammo. Value will be added to weapon's jam chance. + Штраф к шансу на заклинивание при использовании дозвуковых патронов. Значение будет добавляться к шансу на клин для оружия. + 额外增加使用亚音速弹药时的卡弹概率 + 額外新增使用亞音速彈藥時的卡彈概率 + Strafe für die Verwendung von Unterschall-Munition. Der Wert wird der Blockierungschance der Waffe hinzugefügt. + Penalidade na chance de travar a arma ao utilizar munição subsônica. Valor será adicionado à chance de trava. + + + Subsonic magazines + Дозвуковые боеприпасы + + + Magazine classes of subsonic ammunition that cause penalty. List only magazines for weapons that are NOT subsonic by design (e.g. AS Val mags shouldn't be listed, but subsonic AKM magazines should) + Классы магазинов с дозвуковыми патронами которые способствуют повышению шанса на клин. Вносите только магазины для оружия которое не расчитано на дозвуковые патроны по умолчанию (т.е. магазины АС Вал не нужно записывать, а вот дозвуковые магазины к АКМ - должны) + + + + Weapon settings + Настройки оружия + 武器设置 + 武器設定 + Waffen-Einstellungen + Configuraçõe de Arma + + + Custom settings for specific weapon. In format [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. Use EJAM Configurator by [ call dzn_EJAM_Configure ] + Настройки для конкретных классов оружия. В формтае [@Класс, @Шанс_на_клин, @Шанс_на_поломку_типа#1...5]. Используйте конфигуратор вызовом [ call dzn_EJAM_Configure ] + 特定武器的自定义设置. 格式为 [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. 使用EJAM配置程序为 [ call dzn_EJAM_Configure ] + 特定武器的自定義設定. 格式為 [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. 使用EJAM配寘程式為 [ call dzn_EJAM_Configure ] + Benutzerdefinierte Einstellungen für bestimmte Waffen. Im Format @WeaponClass, @JamChance, @MalfunctionChance#1...5]. Verwenden Sie den EJAM-Konfigurator durch [ call dzn_EJAM_Configure ]. + Configurações personalizadas para arma específica. No formato [@WeaponClass, @JamChance, @MalfunctionChance#1...5]. Use o configurador EJAM com [ call dzn_EJAM_Configure ] + + + + + WEAPON MALFUNCTION + ОРУЖИЕ НЕИСПРАВНО + 武器故障 + 武器故障 + WAFFEN-FEHLFUNKTION + ARMA DEFEITUOSA + + + + CLOSE + ЗАКРЫТЬ + 关闭 + 關閉 + SCHLIEßEN + FECHAR + + + + + Bolt closed + Затвор в переднем положении + 枪机闭合 + 槍機閉合 + Verschluss geschlossen + Ferrolho fechado + + + Bolt <t color="#f79400">not closed</t> + Затвор <t color="#f79400">в среднем положении</t> + 枪机 <t color="#f79400">未闭合</t> + 槍機 <t color="#f79400">未閉合</t> + Verschluss <t color="#f79400">nicht geschlossen</t> + Ferrolho <t color="#f79400">solto</t> + + + Bolt <t color="#00b9f7">opened</t> + Затвор <t color="#00b9f7">в заднем положении</t> + 枪机 <t color="#00b9f7">已打开</t> + 槍機 <t color="#00b9f7">已打開</t> + Verschluss <t color="#00b9f7">geöffnet</t> + Ferrolho <t color="#00b9f7">aberto</t> + + + Chamber empty + Патронник пустой + 枪膛内已清空 + 槍膛內已清空 + Kammer leer + Câmara vazia + + + Chamber <t color="#00b9f7">loaded</t> + Патрон <t color="#00b9f7">в патроннике</t> + 枪膛内 <t color="#00b9f7">已供弹</t> + 槍膛內 <t color="#00b9f7">已供彈</t> + Kammer <t color="#00b9f7">geladen</t> + Câmara <t color="#00b9f7">carregada</t> + + + Round <t color="#f79400">stuck</t> + Патрон <t color="#f79400">уткнулся</t> + 子弹 <t color="#f79400">卡住</t> + 子彈 <t color="#f79400">卡住</t> + Patrone <t color="#f79400">blockiert</t> + Cartucho <t color="#f79400">preso</t> + + + Round <t color="#f79400">not extracted</t> + Гильза <t color="#f79400">не извлечена</t> + 子弹 <t color="#f79400">未入膛</t> + 子彈 <t color="#f79400">未入膛</t> + Patrone <t color="#f79400">nicht entnommen</t> + Cartucho <t color="#f79400">não extraído</t> + + + Case <t color="#f79400">not ejected</t> + Гильза <t color="#f79400">не выброшена</t> + 弹壳 <t color="#f79400">未抛出</t> + 彈殼 <t color="#f79400">未拋出</t> + Hülse <t color="#f79400">nicht ausgeworfen</t> + Estojo <t color="#f79400">não ejetado</t> + + + Case ejected + Гильза выброшена + 弹壳已抛出 + 彈殼已抛出 + Hülse ausgeworfen + Estojo ejetado + + + Magazine attached + Магазин присоединен + 已插入弹匣 + 已插入彈匣 + Magazin eingelegt + Carregador inserido + + + Magazine <t color="#00b9f7">detached</t> + Магазин <t color="#00b9f7">отсоединен<</t>/Russian> + 弹匣 <t color="#00b9f7">卸下</t> + 彈匣 <t color="#00b9f7">卸下</t> + Magazin <t color="#00b9f7">entfernt</t> + Carregador <t color="#00b9f7">removido</t> + + + + + + Inspect weapon menu + Проверить оружие (меню) + 武器检查菜单 + 武器檢查選單 + Waffe untersuchen Menü + Inspecionar Arma (menu) + + + Inspect weapon (no menu) + Проверить оружие (без меню) + 武器检查 (无菜单) + 武器檢查 (无菜单) + Waffe untersuchen (Kein Menü) + Inspecionar Arma (sem menu) + + + Attach/Detach magazine + Присоединить/Отсоединить магазин + 装入/卸下 弹匣 + 裝入/卸下 彈匣 + Magazin einlegen/auswerfen + Inserir/Remover carregador + + + + Pull bolt + Передернуть затвор + 拉动枪机 + 拉動槍機 + Verschluss ziehen + Puxar ferrolho + + + Open bolt + Отвести затвор + 打开枪机 + 打開槍機 + Verschluss öffnen + Abrir ferrolho + + + Clear chamber + Очистить патронник + 清理膛室 + 清理膛室 + Kammer leeren + Limpar câmara + + + Remove case + Удалить гильзу + 清理卡住的弹壳 + 清理卡住的彈殼 + Hülse entfernen + Remover estojo + + + Detach magazine + Отсоединить магазин + 卸下弹匣 + 卸下彈匣 + Magazin auswerfen + Remover carregador + + + Attach magazine + Присоединить магазин + 装入弹匣 + 裝入彈匣 + Magazin einlegen + Inserir carregador + + + Inspect weapon + Проверить оружие + 检查武器 + 檢查武器 + Waffe untersuchen + Inspercionar Arma + + + + + Pulling the bolt + Передергиваем затвор + 正在拉动枪机 + 正在拉動槍機 + Ziehen des Verschlusses + Puxando o ferrolho + + + Opening the bolt + Отводим затвор назад + 正在打开枪机 + 正在打開槍機 + Öffnen des Verschlusses + Abrindo o ferrolho + + + Clearing the chamber + Извлекаем патрон из патронника + 正在清理膛室 + 正在清理膛室 + Kammer leeren + Limpando a câmara + + + Removing the case + Извлекаем гильзу + 正在清理卡住的弹壳 + 正在清理卡住的彈殼 + Entfernen der Hülse + Removendo o estojo + + + Detaching magazine + Отсоединяем магазин + 正在卸下弹匣 + 正在卸下彈匣 + Werfe Magazin aus + Removendo o carregador + + + Attaching magazine + Присоединием магазин + 正在装入弹匣 + 正在裝入彈匣 + Lege Magazin ein + Inserindo o carregador + + + Inspecting + Проверка + 正在检查武器 + 正在檢查武器 + Untersuche Waffe + Inspecionando + + + + + Magazine dropped + Магазин сброшен + 弹匣脱落 + 彈匣脫落 + Magazin fallen gelassen + Carregador removido + + + Magazine attached + Магазин присоединен + 弹匣已裝入 + 彈匣已裝入 + Magazin eingelegt + Carregador inserido + + + Weapon is functioning normally + Оружие функционирует нормально + 武器已可以正常使用 + 武器已可以正常使用 + Waffe funktioniert normal + Não foi possível efetuar essa ação! + + + Not possible to perform action! + Невозможно выполнить действие! + 不能执行该命令! + 不能執行該命令! + Keine Aktion möglich! + Sem carregador para inserir! + + + No magazine to load! + Нет магазинов! + 武器无弹匣! + 武器無彈匣! + Kein Magazin zum Laden! + dzn EJAM Configurador de Arma + + + + + + dzn EJAM Weapon Configurator + dzn EJAM Конфигуратор оружия + dzn EJAM 自定义武器设置 + dzn EJAM自定義武器設定 + dzn EJAM Waffen-Konfigurator + dzn EJAM Configurador de Arma + + + Weapon + Оружие + 武器 + 武器 + Waffe + Arma + + + No weapon selected + Оружие не выбрано + 没有选择武器 + 沒有選擇武器 + Keine Waffe ausgewählt + Nenhuma arma selecionada + + + Filter... + Фильтр... + 搜索栏 + 蒐索欄 + Filtern... + Filtro... + + + + + Save + Сохранить + 保存 + 保存 + Speichern + Salvar + + + Copy + Копировать + 复制 + 複製 + Kopieren + Copiar + + + Paste + Вставить + 粘贴 + 粘貼 + Einfügen + Colar + + + Reset + Сброс + 重置 + 重置 + Zurücksetzen + Resetar + + + Close + Закрыть + 关闭 + 關閉 + Schließen + Fechar + + + + + Enter/NumEnter to apply filter. Use "|" for multiple filter values + Enter/NumEnter для применения фильтра. Используйте "|" для фильтрации по нескольким значениям + 输入武器名称后. 按左Shift+回车或小键盘回车即可执行搜索. 搜索多个武器时可以用 "|" 将几个关键词隔开 + 輸入武器名稱後. 按左Shift+回車或小鍵盤回車即可執行蒐索. 蒐索多個武器時可以用 "|" 將幾個關鍵字隔開 + Eingabe/Numpad Eingabe zum Anwenden des Filters. Verwenden Sie "|" für mehrere Filterwerte. + Enter/NumpadEnter para aplicar filtro. Use "|" para múltiplos filtros + + + Unsets weapon settings + Сбрасывает настройки для оружия + 取消武器设置 + 取消武器設定 + Löscht die Waffeneinstellungen + Desfaz configurações de arma + + + Double clicking list element will also apply copied settings! + Двойной клик по оружию из списка также применит скопированные настройки! + 双击列表内容也能应用复制的设置文本! + 按兩下清單內容也能應用複製的設定文字! + Beim Doppelklick auf ein Listenelement werden auch die kopierten Einstellungen übernommen! + Clicar duas vezes no elemento da lista também aplica configurações copiadas! + + + + + No data to apply! + Нет данных для применения! + 无数据可应用! + 無數據可應用! + Keine Daten zu übergeben! + Nenhuma configuração para aplicar! + + + + Applied! + Применено! + 设置已应用! + 設定已應用! + Übergeben! + Aplicado! + + + Config copied! + Конфигурация скопирована! + 设置已复制! + 設定已複製! + Konfiguration kopiert! + Configuração copiada! + + + Config saved! + Конфигурация сохранена! + 设置已保存! + 設定已保存! + Konfiguration gespeichert! + Configuração salva! + + + + + \ No newline at end of file diff --git a/Source/Addons/ui/dialog.hpp b/source/dzn_EJAM/ui/dialog.hpp similarity index 100% rename from Source/Addons/ui/dialog.hpp rename to source/dzn_EJAM/ui/dialog.hpp diff --git a/Source/Addons/ui/dzn_EJAM_Config.hpp b/source/dzn_EJAM/ui/dzn_EJAM_Config.hpp similarity index 100% rename from Source/Addons/ui/dzn_EJAM_Config.hpp rename to source/dzn_EJAM/ui/dzn_EJAM_Config.hpp diff --git a/Source/Addons/ui/dzn_EJAM_Menu.hpp b/source/dzn_EJAM/ui/dzn_EJAM_Menu.hpp similarity index 100% rename from Source/Addons/ui/dzn_EJAM_Menu.hpp rename to source/dzn_EJAM/ui/dzn_EJAM_Menu.hpp diff --git a/Source/Addons/ui/dzn_EJAM_ProgressBar.hpp b/source/dzn_EJAM/ui/dzn_EJAM_ProgressBar.hpp similarity index 100% rename from Source/Addons/ui/dzn_EJAM_ProgressBar.hpp rename to source/dzn_EJAM/ui/dzn_EJAM_ProgressBar.hpp diff --git a/Mod/mod.cpp b/source/mod.cpp similarity index 82% rename from Mod/mod.cpp rename to source/mod.cpp index be058d4..77af182 100644 --- a/Mod/mod.cpp +++ b/source/mod.cpp @@ -4,7 +4,7 @@ action = ""; tooltip = "dzn EJAM"; overview = ""; author = "10Dozen"; -description = "dzn EJAM - Version 2.6"; +description = "dzn EJAM - Version 2.7"; logo = "mod.paa"; logoOver = "mod.paa"; overviewPicture = "mod.paa"; \ No newline at end of file diff --git a/Mod/mod.paa b/source/mod.paa similarity index 100% rename from Mod/mod.paa rename to source/mod.paa diff --git a/Source/20180825013447_1.jpg b/source/resources/20180825013447_1.jpg similarity index 100% rename from Source/20180825013447_1.jpg rename to source/resources/20180825013447_1.jpg diff --git a/Source/20180825013549_1.jpg b/source/resources/20180825013549_1.jpg similarity index 100% rename from Source/20180825013549_1.jpg rename to source/resources/20180825013549_1.jpg diff --git a/Source/OverviewSmall.jpg b/source/resources/OverviewSmall.jpg similarity index 100% rename from Source/OverviewSmall.jpg rename to source/resources/OverviewSmall.jpg diff --git a/source/resources/addon/macro.hpp b/source/resources/addon/macro.hpp new file mode 100644 index 0000000..49e8aec --- /dev/null +++ b/source/resources/addon/macro.hpp @@ -0,0 +1,29 @@ +#define TITLE "dzn Extended Jamming" +#define gADDON EJAM +#define gADDON_NAME dzn_##gADDON + +#define gADDON_PATH \##gADDON_NAME +#define gFNC_PATH gADDON_PATH##\functions\## + +#define QUOTE(s) #s + +#define ADDON QUOTE(gADDON) +#define ADDON_NAME QUOTE(gADDON_NAME) +#define PATH QUOTE(gADDON_PATH) +#define FNC_PATH QUOTE(gFNC_PATH) + +#define GVAR(X) gADDON_NAME##_##X +#define SVAR(X) QUOTE(GVAR(X)) +#define FORMAT_VAR(X) format ["%1_%2", ADDON_NAME, X] + +#define gSTR_NAME(X) STR_##gADDON##_##X +#define STR_NAME(X) QUOTE(gSTR_NAME(X)) + +#define LOCALIZE_FORMAT_STR(X) localize format ["STR_%1_%2", ADDON, X] +#define LOCALIZE_FORMAT_STR_desc(X) localize format ["STR_%1_%2_desc", ADDON, X] + +#define COMPILE_FUNCTION(X) GVAR(X) = compile preprocessFileLineNumbers format ["%1%2.sqf", FNC_PATH, #X] + +#define gSND_PATH gADDON_PATH##\sounds\## +#define gSND(X) gSND_PATH##X +#define SND(X) QUOTE(gSND(X)) diff --git a/source/resources/addon/ui/dialog.hpp b/source/resources/addon/ui/dialog.hpp new file mode 100644 index 0000000..a4793e1 --- /dev/null +++ b/source/resources/addon/ui/dialog.hpp @@ -0,0 +1,9 @@ + +class RscStructuredText; +class RscEdit; +class RscListBox; +class RscFrame; +class RscControlsGroup; +class RscXSliderH; +class IGUIBack; +class RscButtonMenu; diff --git a/Source/Script/macro.hpp b/source/resources/script/macro.hpp similarity index 100% rename from Source/Script/macro.hpp rename to source/resources/script/macro.hpp diff --git a/Source/Script/ui/dialog.hpp b/source/resources/script/ui/dialog.hpp similarity index 100% rename from Source/Script/ui/dialog.hpp rename to source/resources/script/ui/dialog.hpp