diff --git a/addons/ai/CfgVehicles.hpp b/addons/ai/CfgVehicles.hpp index 8fefcd0af..f0f9a72ee 100644 --- a/addons/ai/CfgVehicles.hpp +++ b/addons/ai/CfgVehicles.hpp @@ -2,6 +2,7 @@ class CfgVehicles { class B_TargetSoldier; class CBA_B_InvisibleTarget: B_TargetSoldier { scope = 2; + scopeArsenal = 0; model = QPATHTOF(InvisibleTarget.p3d); icon = "CBA_iconInvisibleTarget"; @@ -11,6 +12,7 @@ class CfgVehicles { class O_TargetSoldier; class CBA_O_InvisibleTarget: O_TargetSoldier { scope = 2; + scopeArsenal = 0; model = QPATHTOF(InvisibleTarget.p3d); icon = "CBA_iconInvisibleTarget"; @@ -20,6 +22,7 @@ class CfgVehicles { class I_TargetSoldier; class CBA_I_InvisibleTarget: I_TargetSoldier { scope = 2; + scopeArsenal = 0; model = QPATHTOF(InvisibleTarget.p3d); icon = "CBA_iconInvisibleTarget"; diff --git a/addons/common/fnc_getMuzzles.sqf b/addons/common/fnc_getMuzzles.sqf index 64441fc4d..d6a7b8d7c 100644 --- a/addons/common/fnc_getMuzzles.sqf +++ b/addons/common/fnc_getMuzzles.sqf @@ -13,7 +13,7 @@ Returns: Examples: (begin example) - _muzzles = "M4A1_RCO_GL" call CBA_fnc_determineMuzzles + _muzzles = "M4A1_RCO_GL" call CBA_fnc_getMuzzles -> ["M4_ACOG_Muzzle", "M203Muzzle"] (end) diff --git a/addons/common/init_perFrameHandler.sqf b/addons/common/init_perFrameHandler.sqf index 320a64fdb..8ae7dcf43 100644 --- a/addons/common/init_perFrameHandler.sqf +++ b/addons/common/init_perFrameHandler.sqf @@ -19,6 +19,7 @@ GVAR(waitUntilAndExecArray) = []; // per frame handler system [QFUNC(onFrame), { + SCRIPT(onFrame); private _tickTime = diag_tickTime; call FUNC(missionTimePFH); @@ -103,6 +104,7 @@ if (isMultiplayer) then { if (isServer) then { // multiplayer server [QFUNC(missionTimePFH), { + SCRIPT(missionTimePFH_server); if (time != GVAR(lastTime)) then { CBA_missionTime = CBA_missionTime + (_tickTime - GVAR(lastTickTime)); GVAR(lastTime) = time; // used to detect paused game @@ -126,6 +128,7 @@ if (isMultiplayer) then { GVAR(lastTickTime) = diag_tickTime; // prevent time skip on clients [QFUNC(missionTimePFH), { + SCRIPT(missionTimePFH_client); if (time != GVAR(lastTime)) then { CBA_missionTime = CBA_missionTime + (_tickTime - GVAR(lastTickTime)); GVAR(lastTime) = time; // used to detect paused game @@ -148,6 +151,7 @@ if (isMultiplayer) then { } else { // single player [QFUNC(missionTimePFH), { + SCRIPT(missionTimePFH_sp); if (time != GVAR(lastTime)) then { CBA_missionTime = CBA_missionTime + (_tickTime - GVAR(lastTickTime)) * accTime; GVAR(lastTime) = time; // used to detect paused game diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index f250da46b..6b17c3925 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -18,6 +18,7 @@ Vous devez d'abord commencer une mission. Należy najpierw uruchomić misję. Önce bir görev başlatmalısınız. + ミッションを開始しておく必要があります。 diff --git a/addons/events/fnc_addPlayerEventHandler.sqf b/addons/events/fnc_addPlayerEventHandler.sqf index a0f5b5629..847e7d660 100644 --- a/addons/events/fnc_addPlayerEventHandler.sqf +++ b/addons/events/fnc_addPlayerEventHandler.sqf @@ -124,6 +124,7 @@ if (_id != -1) then { GVAR(oldLoadout) = []; GVAR(oldLoadoutNoAmmo) = []; GVAR(oldVehicle) = objNull; + GVAR(inVehicle) = false; GVAR(oldTurret) = []; GVAR(oldVisionMode) = -1; GVAR(oldCameraView) = ""; @@ -134,6 +135,7 @@ if (_id != -1) then { GVAR(playerEHInfo) pushBack addMissionEventHandler ["EachFrame", {call FUNC(playerEH_EachFrame)}]; [QFUNC(playerEH_EachFrame), { + SCRIPT(playerEH_EachFrame); private _player = missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player]; if !(_player isEqualTo GVAR(oldUnit)) then { [QGVAR(unitEvent), [_player, GVAR(oldUnit)]] call CBA_fnc_localEvent; @@ -184,12 +186,21 @@ if (_id != -1) then { if !(_data isEqualTo GVAR(oldVehicle)) then { GVAR(oldVehicle) = _data; [QGVAR(vehicleEvent), [_player, _data]] call CBA_fnc_localEvent; + GVAR(inVehicle) = _data != _player; + if (!GVAR(inVehicle)) then { + _data = _player call CBA_fnc_turretPath; + if !(_data isEqualTo GVAR(oldTurret)) then { + GVAR(oldTurret) = _data; + [QGVAR(turretEvent), [_player, _data]] call CBA_fnc_localEvent; + }; + }; }; - - _data = _player call CBA_fnc_turretPath; - if !(_data isEqualTo GVAR(oldTurret)) then { - GVAR(oldTurret) = _data; - [QGVAR(turretEvent), [_player, _data]] call CBA_fnc_localEvent; + if (GVAR(inVehicle)) then { + _data = _player call CBA_fnc_turretPath; + if !(_data isEqualTo GVAR(oldTurret)) then { + GVAR(oldTurret) = _data; + [QGVAR(turretEvent), [_player, _data]] call CBA_fnc_localEvent; + }; }; // handle controlling UAV, UAV entity needed for visionMode @@ -224,6 +235,7 @@ if (_id != -1) then { GVAR(playerEHInfo) pushBack addMissionEventHandler ["Map", {call FUNC(playerEH_Map)}]; [QFUNC(playerEH_Map), { + SCRIPT(playerEH_Map); params ["_data"]; // visibleMap is updated one frame later if !(_data isEqualTo GVAR(oldVisibleMap)) then { GVAR(oldVisibleMap) = _data; @@ -244,6 +256,7 @@ if (_id != -1) then { }; GVAR(playerEHInfo) pushBack ([{ + SCRIPT(playerEH_featureCamera); private _data = call CBA_fnc_getActiveFeatureCamera; if !(_data isEqualTo GVAR(oldFeatureCamera)) then { GVAR(oldFeatureCamera) = _data; diff --git a/addons/events/script_component.hpp b/addons/events/script_component.hpp index dfcca14f6..08bc8ac2c 100644 --- a/addons/events/script_component.hpp +++ b/addons/events/script_component.hpp @@ -39,7 +39,7 @@ #define GETOBJ(obj) (if (obj isEqualType grpNull) then {leader obj} else {obj}) -#include "\a3\editor_f\Data\Scripts\dikCodes.h" +#include "\a3\ui_f\hpp\defineDIKCodes.inc" // key handler system #define MOUSE_OFFSET 0xF0 diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index 1148c245c..22eb8df47 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -49,13 +49,13 @@ _mods = _mods apply { if (isText (_entry >> "description")) then { private _description = getText (_entry >> "description") call CBA_fnc_sanitizeHTML; - _x = _x + format ["
%1", _description]; + _x = _x + format ["
%1
", _description]; }; }; _x }; -_mods = _mods joinString "

"; +_mods = _mods joinString "
"; uiNamespace setVariable [QGVAR(mods), compileFinal str _mods]; diff --git a/addons/jam/CfgWeapons.hpp b/addons/jam/CfgWeapons.hpp index 5c992b835..bbcecc800 100644 --- a/addons/jam/CfgWeapons.hpp +++ b/addons/jam/CfgWeapons.hpp @@ -115,7 +115,7 @@ class CfgWeapons { }; class SMG_03_TR_BASE: Rifle_Base_F { - magazineWell[] = {"CBA_57x28_FNP90"}; + magazineWell[] = {"CBA_57x28_P90"}; }; class SMG_05_base_F: Rifle_Short_Base_F { diff --git a/addons/jam/stringtable.xml b/addons/jam/stringtable.xml index 0d21f0543..595f74d3e 100644 --- a/addons/jam/stringtable.xml +++ b/addons/jam/stringtable.xml @@ -7,6 +7,7 @@ Community Base Addons - Wspólna Amunicja oraz Magazynki Community Base Addons - Munitions et Chargeurs joints Community Base Addons - Birleştirilmiş Cephane Şarjörleri + Community Base Addons - 統合的弾倉 diff --git a/addons/jam/test.sqf b/addons/jam/test.sqf new file mode 100644 index 000000000..925bd99d7 --- /dev/null +++ b/addons/jam/test.sqf @@ -0,0 +1,21 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" +// ---------------------------------------------------------------------------- +// execVM "x\cba\addons\jam\test.sqf" + +LOG("=== Testing Jam ==="); + +private _wellsChecked = []; +{ + private _wpnCfg = _x; + private _xWellArray = getArray (_wpnCfg >> "magazineWell"); + { + if ((_wellsChecked pushBackUnique _x) > -1) then { + if (isNull (configFile >> "CfgMagazineWells" >> _x)) then { + diag_log text format ["ERROR: Well [%1] not valid, used in [%2]", _x,configName _wpnCfg]; + }; + }; + } forEach _xWellArray; +} forEach (configProperties [configFile >> "CfgWeapons", "(isClass _x) && {2 == getNumber (_x >> 'scope')}"]); + +nil; diff --git a/addons/keybinding/fnc_addKeybind.sqf b/addons/keybinding/fnc_addKeybind.sqf index 803814ad5..7fc65e37e 100644 --- a/addons/keybinding/fnc_addKeybind.sqf +++ b/addons/keybinding/fnc_addKeybind.sqf @@ -7,7 +7,7 @@ Description: a function with that keybind being pressed. This file should be included for readable DIK codes: - #include "\a3\editor_f\Data\Scripts\dikCodes.h" + #include "\a3\ui_f\hpp\defineDIKCodes.inc" Additional DIK codes usable with this function: 0xF0: Left mouse button @@ -40,7 +40,7 @@ Returns: Examples: (begin example) // Register a simple keypress to an action - #include "\a3\editor_f\Data\Scripts\dikCodes.h" + #include "\a3\ui_f\hpp\defineDIKCodes.inc" ["MyMod", "MyKey", ["My Pretty Key Name", "My Pretty Tool Tip"], { _this call mymod_fnc_keyDown diff --git a/addons/main_a3/CfgMods.hpp b/addons/main_a3/CfgMods.hpp index ce808b1e5..9f017e74a 100644 --- a/addons/main_a3/CfgMods.hpp +++ b/addons/main_a3/CfgMods.hpp @@ -2,15 +2,13 @@ class CfgMods { class PREFIX { author = "$STR_CBA_Author"; dir = "@CBA_A3"; - name = "Community Base Addons v3.9.1"; + name = "Community Base Addons v0.0.0"; picture = "x\cba\addons\main\logo_cba_ca.paa"; hidePicture = 1; hideName = 1; actionName = "Website"; action = "$STR_CBA_URL"; description = "Bugtracker: https://github.com/CBATeam/CBA_A3/issues
Documentation: https://github.com/CBATeam/CBA_A3/wiki"; - logo = "logo_cba_ca.paa"; - logoOver = "logo_cba_ca.paa"; tooltip = "Community Base Addons"; tooltipOwned = "Community Base Addons Owned"; overview = "What does the name Community Base Addons mean? It is a system that offers a range of features for addon-makers and mission designers. This includes a collection of community-built functions, an integrated keybinding system, and extend event-handler support for compatibility with other 3rd-party addons; and much much more."; diff --git a/addons/settings/script_component.hpp b/addons/settings/script_component.hpp index 5b25304d2..d8695cd8a 100644 --- a/addons/settings/script_component.hpp +++ b/addons/settings/script_component.hpp @@ -163,7 +163,10 @@ #define IS_LOCAL_SETTING(setting) (GVAR(default) getVariable [setting, []] param [7, 0] == 2) #define SANITIZE_PRIORITY(setting,priority,source) (call {\ - private _priority = [0,1,2] select priority;\ + private _priority = priority;\ + if (_priority isEqualType false) then {\ + _priority = parseNumber _priority;\ + };\ if (IS_GLOBAL_SETTING(setting) && {source != "mission"}) exitWith {_priority max 1};\ if (IS_LOCAL_SETTING(setting)) exitWith {_priority min 0};\ _priority\ diff --git a/addons/settings/stringtable.xml b/addons/settings/stringtable.xml index 9b1bbc6c1..9f12e95dd 100644 --- a/addons/settings/stringtable.xml +++ b/addons/settings/stringtable.xml @@ -17,7 +17,7 @@ Configure Addons Modifikationen anpassen Konfiguracja addonów - アドオン設定 + アドオンの設定 模組設定 模组设定 Configurar as Extensões @@ -55,6 +55,7 @@ Adjust addon settings. Zmień ustawienia addonów. Eklenti ayarlarını değiştir. + アドオンの設定を調整します。 Addon Options... @@ -251,7 +252,7 @@ Overwrite\nClients Clients\nüberschreiben - クライアント側から\n上書き + クライアント側で\n上書き 覆寫\n客戶端 覆写\n客户端 Sobrescrever \nClientes @@ -263,7 +264,7 @@ Overwrite\nMission Mission\nüberschreiben - ミッション側から\n上書き + ミッション側で\n上書き 覆寫\n任務 覆写\n任务 Sobrescrever \nMissão @@ -275,7 +276,7 @@ Overwrite\nServer Server\nüberschreiben - サーバー側から\n上書き + サーバー側で\n上書き 覆寫\n伺服器 覆写\n伺服器 Sobrescrever \nServidor @@ -290,6 +291,7 @@ Ce paramètre s'applique. To ustawienie dotyczy. Bu ayar geçerli. + 設定を適用します。 This setting applies after the next mission restart. @@ -297,6 +299,7 @@ Ce paramètre s'applique après le prochain redémarrage de la mission. To ustawienie zostanie zastosowanie po restarcie misji. Bu ayar oyun baştan başladıktan sonra geçerli olur. + この設定は次のミッション開始後に適用されます。 This setting is overwritten by the clients. @@ -363,7 +366,7 @@ Показать настройки по умолчанию: 顯示預設值: 显示预设值: - 標準の変数を表示: + 標準値を表示: Afficher les valeurs par défaut : Pokaż domyślnę wartości: Varsayılan değerleri göster: diff --git a/addons/ui/CfgEventHandlers.hpp b/addons/ui/CfgEventHandlers.hpp index b9df43f07..9b8ec74bd 100644 --- a/addons/ui/CfgEventHandlers.hpp +++ b/addons/ui/CfgEventHandlers.hpp @@ -29,4 +29,10 @@ class Extended_DisplayLoad_EventHandlers { class RscDisplayRemoteMissions { ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(initDisplayRemoteMissions)')); }; + class Display3DEN { + ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(initDisplay3DEN)')); + }; + class RscDisplayCurator { + ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(initDisplayCurator)')); + }; }; diff --git a/addons/ui/CfgFunctions.hpp b/addons/ui/CfgFunctions.hpp index 824f75248..1354ae310 100644 --- a/addons/ui/CfgFunctions.hpp +++ b/addons/ui/CfgFunctions.hpp @@ -19,9 +19,6 @@ class CfgFunctions { class flexiMenu_keyUp { file = QUOTE(PATHTOF(flexiMenu\fnc_keyUp.sqf)); }; - class menu { - file = QUOTE(PATHTOF(flexiMenu\fnc_menu.sqf)); - }; class flexiMenu_menu { file = QUOTE(PATHTOF(flexiMenu\fnc_menu.sqf)); }; diff --git a/addons/ui/RscDisplayOptionsLayout.hpp b/addons/ui/RscDisplayOptionsLayout.hpp index b4103c4dc..01d6726d5 100644 --- a/addons/ui/RscDisplayOptionsLayout.hpp +++ b/addons/ui/RscDisplayOptionsLayout.hpp @@ -4,12 +4,12 @@ class RscDisplayOptionsLayout { class Element021; class Element022: Element021 { idc = 12022; - onMouseEnter = "with uinamespace do {['mouseEnter',_this,''] call RscDisplayOptionsLayout_script;};"; - onMouseExit = "with uinamespace do {['mouseExit',_this,''] call RscDisplayOptionsLayout_script;};"; - onMouseHolding = "with uinamespace do {['mouseMoving',_this,''] call RscDisplayOptionsLayout_script;};"; - onMouseMoving = "with uinamespace do {['mouseMoving',_this,''] call RscDisplayOptionsLayout_script;};"; - onMouseButtonDown = "with uinamespace do {['mouseButtonDown',_this,''] call RscDisplayOptionsLayout_script;};"; - onMouseButtonUp = "with uinamespace do {['mouseButtonUp',_this,''] call RscDisplayOptionsLayout_script;};"; + onMouseEnter = "with uiNamespace do {['mouseEnter',_this,''] call RscDisplayOptionsLayout_script;};"; + onMouseExit = "with uiNamespace do {['mouseExit',_this,''] call RscDisplayOptionsLayout_script;};"; + onMouseHolding = "with uiNamespace do {['mouseMoving',_this,''] call RscDisplayOptionsLayout_script;};"; + onMouseMoving = "with uiNamespace do {['mouseMoving',_this,''] call RscDisplayOptionsLayout_script;};"; + onMouseButtonDown = "with uiNamespace do {['mouseButtonDown',_this,''] call RscDisplayOptionsLayout_script;};"; + onMouseButtonUp = "with uiNamespace do {['mouseButtonUp',_this,''] call RscDisplayOptionsLayout_script;};"; }; #define ADD_ELEMENT(var1) class Element##var1: Element022 {\ idc = __EVAL(12000 + var1);\ diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf index b2b0c6be3..9c1912e4e 100644 --- a/addons/ui/XEH_preInit.sqf +++ b/addons/ui/XEH_preInit.sqf @@ -30,3 +30,19 @@ if (hasInterface) then { }; }]; }; + +// legacy function names +FUNC(Add) = CBA_fnc_flexiMenu_Add; +FUNC(Remove) = CBA_fnc_flexiMenu_Remove; +FUNC(setObjectMenuSource) = CBA_fnc_flexiMenu_setObjectMenuSource; +FUNC(openMenuByDef) = CBA_fnc_flexiMenu_openMenuByDef; +FUNC(keyDown) = CBA_fnc_flexiMenu_keyDown; +FUNC(keyUp) = CBA_fnc_flexiMenu_keyUp; +FUNC(menu) = CBA_fnc_flexiMenu_menu; +FUNC(list) = CBA_fnc_flexiMenu_list; +FUNC(getMenuDef) = CBA_fnc_flexiMenu_getMenuDef; +FUNC(getMenuOption) = CBA_fnc_flexiMenu_getMenuOption; +FUNC(menuShortcut) = CBA_fnc_flexiMenu_menuShortcut; +FUNC(mouseButtonDown) = CBA_fnc_flexiMenu_mouseButtonDown; +FUNC(highlightCaretKey) = CBA_fnc_flexiMenu_highlightCaretKey; +FUNC(execute) = CBA_fnc_flexiMenu_execute; diff --git a/addons/ui/XEH_preStart.sqf b/addons/ui/XEH_preStart.sqf index 076187991..572bd302c 100644 --- a/addons/ui/XEH_preStart.sqf +++ b/addons/ui/XEH_preStart.sqf @@ -1,7 +1,14 @@ #include "script_component.hpp" +if (!hasInterface) exitWith {}; + PREP(initDisplayInterrupt); PREP(initDisplayMultiplayerSetup); PREP(initDisplayOptionsLayout); PREP(initDisplayPassword); PREP(initDisplayRemoteMissions); +PREP(initDisplay3DEN); +PREP(initDisplayCurator); + +PREP(preload3DEN); +PREP(preloadCurator); diff --git a/addons/ui/flexiMenu/fnc_add.sqf b/addons/ui/flexiMenu/fnc_add.sqf index 702ccff5b..d0856faf6 100644 --- a/addons/ui/flexiMenu/fnc_add.sqf +++ b/addons/ui/flexiMenu/fnc_add.sqf @@ -4,7 +4,7 @@ TRACE_1("",_this); // _this = ["player", [DIK_LSHIFT], -3, ["mission\weapon_menuDef.sqf", ["main"]]] -// Note: calling script may require this file for dik codes: #include "\a3\editor_f\Data\Scripts\dikCodes.h" +// Note: calling script may require this file for dik codes: #include "\a3\ui_f\hpp\defineDIKCodes.inc" private _msg = "FLEXIMENU: Unknown Error in fnc_add.sqf"; //Initialize private _key = []; diff --git a/addons/ui/fnc_initDisplay3DEN.sqf b/addons/ui/fnc_initDisplay3DEN.sqf new file mode 100644 index 000000000..0a227520b --- /dev/null +++ b/addons/ui/fnc_initDisplay3DEN.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +params ["_display"]; + +with uiNamespace do { + private _timeStart = diag_tickTime; + if (call FUNC(preload3DEN)) then { + INFO_1("3DEN item list preloaded. Time: %1 ms",round ((diag_tickTime - _timeStart) * 1000)); + }; +}; diff --git a/addons/ui/fnc_initDisplayCurator.sqf b/addons/ui/fnc_initDisplayCurator.sqf new file mode 100644 index 000000000..56cb94175 --- /dev/null +++ b/addons/ui/fnc_initDisplayCurator.sqf @@ -0,0 +1,12 @@ +#include "script_component.hpp" + +params ["_display"]; + +with uiNamespace do { + private _timeStart = diag_tickTime; + if (call FUNC(preloadCurator)) then { + INFO_1("Curator item list preloaded. Time: %1 ms",round ((diag_tickTime - _timeStart) * 1000)); + }; +}; + +RscAttrbuteInventory_weaponAddons = uiNamespace getVariable QGVAR(curatorItemCache); // spelling is "Attrbute" diff --git a/addons/ui/fnc_initDisplayRemoteMissions.sqf b/addons/ui/fnc_initDisplayRemoteMissions.sqf index 5b9e836a0..35ed110cf 100644 --- a/addons/ui/fnc_initDisplayRemoteMissions.sqf +++ b/addons/ui/fnc_initDisplayRemoteMissions.sqf @@ -1,6 +1,9 @@ #include "script_component.hpp" #include "\a3\ui_f\hpp\defineResinclDesign.inc" // can't have this in config, because it redefines some entries, and that makes Mikero's shits its pants +// Function shouldn't be preped, but exit just to be safe because Headless Clients will trigger RscDisplayRemoteMissions and have problems with this +if (!hasInterface) exitWith {}; + params ["_display"]; private _ctrlMaps = _display displayCtrl IDC_SERVER_ISLAND; private _ctrlMissions = _display displayCtrl IDC_SERVER_MISSION; @@ -125,8 +128,9 @@ _display setVariable [QFUNC(filter), { { _x params ["_name", "_value", "_data", "_color"]; + private _classname = _data splitString "." select 0; - if (toLower _name find _filter != -1 && {_showStockMissions || {!(_data in _stockMissions)}}) then { + if (toLower _name find _filter != -1 && {_showStockMissions || {!(_classname in _stockMissions)}}) then { private _index = _ctrlMissions lbAdd _name; _ctrlMissions lbSetValue [_index, _value]; _ctrlMissions lbSetData [_index, _data]; diff --git a/addons/ui/fnc_preload3DEN.sqf b/addons/ui/fnc_preload3DEN.sqf new file mode 100644 index 000000000..5f3c228f2 --- /dev/null +++ b/addons/ui/fnc_preload3DEN.sqf @@ -0,0 +1,188 @@ +#include "script_component.hpp" +/* ---------------------------------------------------------------------------- +Internal Function: cba_ui_fnc_preload3DEN + +Description: + Preload 3den editor ammo box item list. + +Parameters: + None + +Returns: + true: preloaded successfully, false: already preloaded + +Examples: + (begin example) + call cba_ui_fnc_preload3DEN + (end) + +Notes: + To disable cache use: uiNamespace setVariable ["AmmoBox_list", nil]; + +Author: + commy2 +---------------------------------------------------------------------------- */ + +if (!isNil {uiNamespace getVariable "AmmoBox_list"}) exitWith { + INFO("3DEN item list already preloaded."); + false +}; + +private _list = [[],[],[],[],[],[],[],[],[],[],[],[]]; +uiNamespace setVariable ["AmmoBox_list", _list]; + +private _itemTypes = call CBA_fnc_createNamespace; +_itemTypes setVariable ["AssaultRifle", 0]; +_itemTypes setVariable ["Shotgun", 0]; +_itemTypes setVariable ["Rifle", 0]; +_itemTypes setVariable ["SubmachineGun", 0]; +_itemTypes setVariable ["MachineGun", 1]; +_itemTypes setVariable ["SniperRifle", 2]; +_itemTypes setVariable ["Launcher", 3]; +_itemTypes setVariable ["MissileLauncher", 3]; +_itemTypes setVariable ["RocketLauncher", 3]; +_itemTypes setVariable ["Handgun", 4]; +_itemTypes setVariable ["UnknownWeapon", 5]; +_itemTypes setVariable ["AccessoryMuzzle", 6]; +_itemTypes setVariable ["AccessoryPointer", 6]; +_itemTypes setVariable ["AccessorySights", 6]; +_itemTypes setVariable ["AccessoryBipod", 6]; +_itemTypes setVariable ["Uniform", 7]; +_itemTypes setVariable ["Vest", 8]; +_itemTypes setVariable ["Backpack", 9]; +_itemTypes setVariable ["Headgear", 10]; +_itemTypes setVariable ["Glasses", 10]; +_itemTypes setVariable ["Binocular", 11]; +_itemTypes setVariable ["Compass", 11]; +_itemTypes setVariable ["FirstAidKit", 11]; +_itemTypes setVariable ["GPS", 11]; +_itemTypes setVariable ["LaserDesignator", 11]; +_itemTypes setVariable ["Map", 11]; +_itemTypes setVariable ["Medikit", 11]; +_itemTypes setVariable ["MineDetector", 11]; +_itemTypes setVariable ["NVGoggles", 11]; +_itemTypes setVariable ["Radio", 11]; +_itemTypes setVariable ["Toolkit", 11]; +_itemTypes setVariable ["Watch", 11]; +_itemTypes setVariable ["UAVTerminal", 11]; + +//--- Weapons, Magazines and Items +private _cfgWeapons = configFile >> "CfgWeapons"; +private _cfgMagazines = configFile >> "CfgMagazines"; + +private _magazines = []; +private _magazinesLists = []; + +{ + private _item = toLower configName _x; + (_item call BIS_fnc_itemType) params ["_itemCategory", "_itemType"]; + + private _index = _itemTypes getVariable [_itemType, -1]; + if (_index >= 0 && {_itemCategory != "VehicleWeapon"}) then { + private _weaponConfig = _x; + private _isPublic = getNumber (_weaponConfig >> "scope") == 2; + private _listItem = _list select _index; + + if (_isPublic) then { + _displayName = getText (_weaponConfig >> "displayName"); + + // append display name with attachment names + { + _displayName = format [ + "%1 + %2", + _displayName, + getText (_cfgWeapons >> getText (_x >> "item") >> "displayName") + ]; + } forEach ("true" configClasses (_weaponConfig >> "linkeditems")); //configProperties [_weaponConfig >> "linkeditems", "isClass _x"]; + + _listItem pushBack [ + _displayName, + _item, + getText (_weaponConfig >> "picture"), + parseNumber (getNumber (_weaponConfig >> "type") in [4096, 131072]), + false + ]; + }; + + //--- Magazines + if (_isPublic || {_item in ["throw","put"]}) then { + { + private _muzzleConfig = _weaponConfig; + + if (_x != "this") then { + _muzzleConfig = _weaponConfig >> _x; + }; + + { + private _item = toLower _x; + + if (_magazinesLists pushBackUnique [_item, _listItem] != -1) then { + private _magazineConfig = _cfgMagazines >> _item; + + if (getNumber (_magazineConfig >> "scope") == 2) then { + _listItem pushBack [ + getText (_magazineConfig >> "displayName"), + _item, + getText (_magazineConfig >> "picture"), + 2, + _item in _magazines + ]; + + _magazines pushBack _item; + }; + }; + } forEach getArray (_muzzleConfig >> "magazines"); + } forEach getArray (_weaponConfig >> "muzzles"); + }; + }; +} forEach ("true" configClasses _cfgWeapons); + +//--- Backpacks +{ +// In case you are executing the unit test with addons loaded, should an addon +// use the same classname in CfgVehicles and CfgWeapons this isBackpack +// optimization prevents the item from added by twice. +#ifdef DEBUG_MODE_FULL + if (getNumber (_x >> "scope") == 2) +#else + if (getNumber (_x >> "isBackpack") == 1 && {getNumber (_x >> "scope") == 2}) +#endif + then { + private _item = toLower configName _x; + private _itemType = _item call BIS_fnc_itemType select 1; + + private _index = _itemTypes getVariable [_itemType, -1]; + if (_index >= 0) then { + (_list select _index) pushBack [ + getText (_x >> "displayName"), + _item, + getText (_x >> "picture"), + 3, + false + ]; + }; + }; +} forEach ("true" configClasses (configFile >> "CfgVehicles")); + +//--- Glasses +private _listHeadgear = _list select 10; + +{ + if (getNumber (_x >> "scope") == 2) then { + _listHeadgear pushBack [ + getText (_x >> "displayName"), + toLower configName _x, + getText (_x >> "picture"), + 3, + false + ]; + }; +} forEach ("true" configClasses (configFile >> "CfgGlasses")); + +{ + _x sort true; +} forEach _list; + +_itemTypes call CBA_fnc_deleteNamespace; + +true diff --git a/addons/ui/fnc_preloadCurator.sqf b/addons/ui/fnc_preloadCurator.sqf new file mode 100644 index 000000000..773e54f76 --- /dev/null +++ b/addons/ui/fnc_preloadCurator.sqf @@ -0,0 +1,196 @@ +#include "script_component.hpp" +/* ---------------------------------------------------------------------------- +Internal Function: cba_ui_fnc_preloadCurator + +Description: + Preload Zeus ammo box item list. + +Parameters: + None + +Returns: + true: preloaded successfully, false: already preloaded + +Examples: + (begin example) + call cba_ui_fnc_preloadCurator + (end) + +Notes: + To disable cache use in init.sqf: RscAttrbuteInventory_weaponAddons = nil; + +Author: + commy2 +---------------------------------------------------------------------------- */ + +if (!isNil {uiNamespace getVariable QGVAR(curatorItemCache)}) exitWith { + INFO("Curator item list already preloaded."); + false +}; + +private _list = []; +uiNamespace setVariable [QGVAR(curatorItemCache), _list]; + +private _itemTypes = call CBA_fnc_createNamespace; +_itemTypes setVariable ["AssaultRifle", 0]; +_itemTypes setVariable ["Shotgun", 0]; +_itemTypes setVariable ["Rifle", 0]; +_itemTypes setVariable ["SubmachineGun", 0]; +_itemTypes setVariable ["MachineGun", 1]; +_itemTypes setVariable ["SniperRifle", 2]; +_itemTypes setVariable ["Launcher", 3]; +_itemTypes setVariable ["MissileLauncher", 3]; +_itemTypes setVariable ["RocketLauncher", 3]; +_itemTypes setVariable ["Handgun", 4]; +_itemTypes setVariable ["UnknownWeapon", 5]; +_itemTypes setVariable ["AccessoryMuzzle", 6]; +_itemTypes setVariable ["AccessoryPointer", 6]; +_itemTypes setVariable ["AccessorySights", 6]; +_itemTypes setVariable ["AccessoryBipod", 6]; +_itemTypes setVariable ["Uniform", 7]; +_itemTypes setVariable ["Vest", 8]; +_itemTypes setVariable ["Backpack", 9]; +_itemTypes setVariable ["Headgear", 10]; +_itemTypes setVariable ["Glasses", 10]; +_itemTypes setVariable ["Binocular", 11]; +_itemTypes setVariable ["Compass", 11]; +_itemTypes setVariable ["FirstAidKit", 11]; +_itemTypes setVariable ["GPS", 11]; +_itemTypes setVariable ["LaserDesignator", 11]; +_itemTypes setVariable ["Map", 11]; +_itemTypes setVariable ["Medikit", 11]; +_itemTypes setVariable ["MineDetector", 11]; +_itemTypes setVariable ["NVGoggles", 11]; +_itemTypes setVariable ["Radio", 11]; +_itemTypes setVariable ["Toolkit", 11]; +_itemTypes setVariable ["Watch", 11]; +_itemTypes setVariable ["UAVTerminal", 11]; + +//--- Weapons, Magazines and Items +private _cfgPatches = configFile >> "CfgPatches"; +private _cfgVehicles = configFile >> "CfgVehicles"; +private _cfgWeapons = configFile >> "CfgWeapons"; +private _cfgMagazines = configFile >> "CfgMagazines"; + +private _magazines = []; +private _magazinesLists = []; + +{ + private _patchConfig = _cfgPatches >> _x; + _addon = toLower _x; + + private _addonList = [[],[],[],[],[],[],[],[],[],[],[],[]]; + + { + private _item = toLower _x; + (_item call BIS_fnc_itemType) params ["_itemCategory", "_itemType"]; + + private _index = _itemTypes getVariable [_itemType, -1]; + if (_index >= 0 && {_itemCategory != "VehicleWeapon"}) then { + private _weaponConfig = _cfgWeapons >> _item; + private _isPublic = getNumber (_weaponConfig >> "scope") == 2; + private _listItem = _addonList select _index; + + if (_isPublic) then { + _displayName = getText (_weaponConfig >> "displayName"); + + // append display name with attachment names + { + _displayName = format [ + "%1 + %2", + _displayName, + getText (_cfgWeapons >> getText (_x >> "item") >> "displayName") + ]; + } forEach ("true" configClasses (_weaponConfig >> "linkeditems")); //configProperties [_weaponConfig >> "linkeditems", "isClass _x"]; + + private _displayNameShort = _displayName; + private _displayNameShortArray = toArray _displayNameShort; + + if (count _displayNameShortArray > 41) then { + _displayNameShortArray resize 41; + _displayNameShort = format ["%1...", toString _displayNameShortArray]; + }; + + _listItem pushBack [ + _item, + _displayName, + _displayNameShort, + getText (_weaponConfig >> "picture"), + parseNumber (getNumber (_weaponConfig >> "type") in [4096, 131072]), + false + ]; + }; + + //--- Magazines + if (_isPublic || {_item in ["throw","put"]}) then { + { + private _muzzleConfig = _weaponConfig; + + if (_x != "this") then { + _muzzleConfig = _weaponConfig >> _x; + }; + + { + private _item = toLower _x; + + if (_magazinesLists pushBackUnique [_item, _listItem] != -1) then { + private _magazineConfig = _cfgMagazines >> _item; + + if (getNumber (_magazineConfig >> "scope") == 2) then { + private _displayName = getText (_magazineConfig >> "displayName"); + + _listItem pushBack [ + _item, + _displayName, + _displayName, + getText (_magazineConfig >> "picture"), + 2, + _item in _magazines + ]; + + _magazines pushBack _item; + }; + }; + } forEach getArray (_muzzleConfig >> "magazines"); + } forEach getArray (_weaponConfig >> "muzzles"); + }; + }; + } forEach getArray (_patchConfig >> "weapons"); + + { + private _item = toLower _x; + private _weaponConfig = _cfgVehicles >> _item; + +// In case you are executing the unit test with addons loaded, should an addon +// use the same classname in CfgVehicles and CfgWeapons this isBackpack +// optimization prevents the item from added by twice. +#ifdef DEBUG_MODE_FULL + if (getNumber (_weaponConfig >> "scope") == 2) +#else + if (getNumber (_weaponConfig >> "isBackpack") == 1 && {getNumber (_weaponConfig >> "scope") == 2}) +#endif + then { + private _itemType = _item call BIS_fnc_itemType select 1; + + private _index = _itemTypes getVariable [_itemType, -1]; + if (_index >= 0) then { + private _displayName = getText (_weaponConfig >> "displayName"); + + (_addonList select _index) pushBack [ + _item, + _displayName, + _displayName, + getText (_weaponConfig >> "picture"), + 3, + false + ]; + }; + }; + } forEach getArray (_patchConfig >> "units"); + + _list append [_addon, _addonList]; +} forEach call (uiNamespace getVariable QEGVAR(common,addons)); + +_itemTypes call CBA_fnc_deleteNamespace; + +true diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index 7c6bed8f5..739e89540 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -13,6 +13,7 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_UI #endif +#define DEBUG_SYNCHRONOUS #include "\x\cba\addons\main\script_macros.hpp" #include "\a3\ui_f\hpp\defineCommonGrids.inc" diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 31d14ec96..daaa16cb8 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -39,6 +39,7 @@ CBA UI CBA IU CBA UI + CBA UI Store server passwords @@ -46,6 +47,7 @@ Zapamiętuj hasła serwerów Enregistrer les mots de passe serveur Sunucu şifrelerini kaydet + サーバーのパスワードを保存 Setting to store the passwords entered when connecting to a multiplayer server. @@ -53,6 +55,7 @@ Opcja zapamiętywania wprowadzonych haseł do serwerów. Paramètre pour enregistrer les mots de passe entrés quand vous vous connectez à un serveur multijoueur Çok oyunculu bir sunucuya bağlanırken girilen şifreleri kaydetme ayarı. + マルチプレイヤーのサーバーへ接続時に入力されたパスワードの保存設定を行います。 Save passwords @@ -60,6 +63,7 @@ Zapisuj hasła Sauvegarder mots de passe Şifreleri kaydet + パスワードを保存 Passwords are stored when connecting to a multiplayer server. @@ -67,6 +71,7 @@ Hasła są zapisywane podczas łaczenia do serwerów. Les mots de passe sont enregistrés quand vous vous connectez à un serveur multijoueur Çok oyunculu bir sunucuya girerken şifreler kaydedilir. + マルチプレイヤーのサーバーへ接続時にパスワードを保存します。 Do not save passwords @@ -74,6 +79,7 @@ Nie zapisuj haseł Ne pas enregistrer les mots de passe Şifreleri kaydetme + パスワードを保存しない Passwords are not stored when connecting to a multiplayer server. Already stored passwords will not be automatically entered. @@ -81,6 +87,7 @@ Hasła nie są zapisywane podczas łączenia do serwerów. Już zapisane hasła nie bedą wykorzystywane. Les mots de passe ne sont pas enregistrés quand vous vous connectez à un serveur multijoueur.Les mots de passe déjà enregistrés ne seront pas entrés automatiquement. Çok oyunculu bir sunucuya girerken şifreler kaydedilmez. Zaten kayıtlı olan şifreler otomatik olarak doldurulmaz. + マルチプレイヤーのサーバーへ接続時にパスワードを保存しません。既に保存されているパスワードも自動的に入力されません。 Delete passwords @@ -88,6 +95,7 @@ Usuń hasła Supprimer les mots de passe Şifreleri sil + パスワードを削除 Passwords are not stored when connecting to a multiplayer server. Already stored passwords are deleted from the profile. @@ -95,24 +103,29 @@ Hasła nie są zapisywane podczas łączenia do serwerów. Już zapisane hasła zostaną usunięte z profilu. Les mots de passe ne sont pas enregistrés quand vous vous connectez à un serveur multijoueur.Les mots de passe déjà enregistrés vont être supprimés du profile. Çok oyunculu bir sunucuya girerken şifreler kaydedilmez. Zaten kayıtlı olan şifreler bilgisayardan silinir. + マルチプレイヤーのサーバーへ接続時にパスワードを保存しません。既に保存されているパスワードはプロフィールから削除します。 Notification Benachrichtigung Powiadomienie + 通知 Textual feedback to the player. Textrückmeldung an den Spieler. Tekstowa informacja dla gracza. + 文章でプレイヤーに通知します。 Show all missions Alle Missionen anzeigen + 全ミッションを表示 Show custom missions Eigene Missionen anzeigen + カスタム ミッションを表示 diff --git a/addons/ui/test_preload.sqf b/addons/ui/test_preload.sqf new file mode 100644 index 000000000..4c9628a7e --- /dev/null +++ b/addons/ui/test_preload.sqf @@ -0,0 +1,45 @@ +#include "script_component.hpp" +// execVM "\x\cba\addons\ui\test_preload.sqf"; + +isNil { + with uiNamespace do { + // 3DEN + TEST_DEFINED(QFUNC(preload3DEN),""); + + AmmoBox_list = nil; + ["onLoad", [controlNull]] call compile preprocessFile "\a3\3den\UI\Attributes\AmmoBox.sqf"; + private _vanilla = AmmoBox_list; + + AmmoBox_list = nil; + call FUNC(preload3DEN); + private _cba = AmmoBox_list; + + TEST_TRUE(_vanilla isEqualTo _cba,QFUNC(preload3DEN)); + + // Curator + TEST_DEFINED(QFUNC(preloadCurator),""); + + private _unit = player; + private _curator = getAssignedCuratorLogic _unit; + + if (isNull _curator) then { + _curator = createGroup sideLogic createUnit ["ModuleCurator_F", [0,0,0], [], 0, "NONE"]; + _unit assignCurator _curator; + }; + + _curator removeCuratorAddons call EGVAR(common,addons); + _curator addCuratorAddons call EGVAR(common,addons); + + missionNamespace setVariable ["RscAttrbuteInventory_weaponAddons", nil]; + ["onLoad", [displayNull], objNull] call compile preprocessFile "\a3\ui_f_curator\UI\RscCommon\RscAttributeInventory.sqf"; + _vanilla = RscAttributeInventory_list; + + GVAR(curatorItemCache) = nil; + call FUNC(preloadCurator); + missionNamespace setVariable ["RscAttrbuteInventory_weaponAddons", GVAR(curatorItemCache)]; + ["onLoad", [displayNull], objNull] call compile preprocessFile "\a3\ui_f_curator\UI\RscCommon\RscAttributeInventory.sqf"; + _cba = RscAttributeInventory_list; + + TEST_TRUE(_vanilla isEqualTo _cba,QFUNC(preloadCurator)); + }; +}; diff --git a/addons/xeh/fnc_preInit.sqf b/addons/xeh/fnc_preInit.sqf index e42b45c9b..f685f6d0c 100644 --- a/addons/xeh/fnc_preInit.sqf +++ b/addons/xeh/fnc_preInit.sqf @@ -54,16 +54,20 @@ CBA_isHeadlessClient = !hasInterface && !isDedicated; // make case insensitive list of all supported events GVAR(EventsLowercase) = []; { + private _header = ""; + #ifndef SKIP_SCRIPT_NAME + _header = format ["scriptName 'XEH:%1';", _x]; + #endif // generate event functions if (_x isEqualTo "Init") then { - FUNC(Init) = compileFinal "(_this select 0) call CBA_fnc_initEvents; (_this select 0) call CBA_fnc_init"; + FUNC(Init) = compileFinal (_header + "(_this select 0) call CBA_fnc_initEvents; (_this select 0) call CBA_fnc_init"); } else { if (_x isEqualTo "HitPart") then { - FUNC(HitPart) = compileFinal format ['{call _x; nil} count ((_this select 0 select 0) getVariable QGVAR(%1))', _x]; + FUNC(HitPart) = compileFinal (_header + format ['{call _x; nil} count ((_this select 0 select 0) getVariable QGVAR(%1))', _x]); } else { missionNamespace setVariable [ format [QFUNC(%1), _x], - compileFinal format ['{call _x; nil} count ((_this select 0) getVariable QGVAR(%1))', _x] + compileFinal (_header + format ['{call _x; nil} count ((_this select 0) getVariable QGVAR(%1))', _x]) ]; }; }; diff --git a/addons/xeh/fnc_startFallbackLoop.sqf b/addons/xeh/fnc_startFallbackLoop.sqf index 4fadee6d1..3f9520606 100644 --- a/addons/xeh/fnc_startFallbackLoop.sqf +++ b/addons/xeh/fnc_startFallbackLoop.sqf @@ -34,6 +34,7 @@ GVAR(fallbackRunning) = true; GVAR(entities) = []; [{ + SCRIPT(fallbackLoopPFEH); private _entities = entities [[], [], true, true]; if !(_entities isEqualTo GVAR(entities)) then { diff --git a/tools/make.py b/tools/make.py index f120aa933..44494a4f0 100644 --- a/tools/make.py +++ b/tools/make.py @@ -74,7 +74,7 @@ pbo_name_prefix = "cba_" signature_blacklist = [] importantFiles = ["mod.cpp", "meta.cpp", "README.md", "LICENSE.md", "logo_cba_ca.paa"] -versionFiles = ["mod.cpp"] +versionFiles = ["mod.cpp","addons\main_a3\CfgMods.hpp"] ciBuild = False # Used for CI builds @@ -1504,4 +1504,4 @@ def main(argv): if ciBuild: sys.exit(0) - input("Press Enter to continue...") \ No newline at end of file + input("Press Enter to continue...")