From 624990786b30aa7651dce967c7836114d499652f Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 20 Feb 2019 19:55:44 +0100 Subject: [PATCH 01/19] cleanup help --- addons/help/CfgEventhandlers.hpp | 4 +- addons/help/XEH_postClientInit.sqf | 56 ---------- addons/help/XEH_postInit.sqf | 78 ++++++++++++++ ...{XEH_preClientInit.sqf => XEH_preInit.sqf} | 49 +-------- addons/help/XEH_preStart.sqf | 18 ++-- addons/help/config.cpp | 3 +- addons/help/fnc_setCreditsLine.sqf | 59 ----------- addons/help/fnc_setVersionLine.sqf | 100 ------------------ addons/help/gui.hpp | 78 -------------- addons/help/script_component.hpp | 18 ---- addons/help/stringtable.xml | 23 +--- addons/main/stringtable.xml | 32 ++++++ 12 files changed, 124 insertions(+), 394 deletions(-) delete mode 100644 addons/help/XEH_postClientInit.sqf create mode 100644 addons/help/XEH_postInit.sqf rename addons/help/{XEH_preClientInit.sqf => XEH_preInit.sqf} (67%) delete mode 100644 addons/help/fnc_setCreditsLine.sqf delete mode 100644 addons/help/fnc_setVersionLine.sqf delete mode 100644 addons/help/gui.hpp diff --git a/addons/help/CfgEventhandlers.hpp b/addons/help/CfgEventhandlers.hpp index 29fcde5e3..0d3301d6e 100644 --- a/addons/help/CfgEventhandlers.hpp +++ b/addons/help/CfgEventhandlers.hpp @@ -6,12 +6,12 @@ class Extended_PreStart_EventHandlers { class Extended_PreInit_EventHandlers { class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_preClientInit)); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_postClientInit)); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; diff --git a/addons/help/XEH_postClientInit.sqf b/addons/help/XEH_postClientInit.sqf deleted file mode 100644 index 8e53273cb..000000000 --- a/addons/help/XEH_postClientInit.sqf +++ /dev/null @@ -1,56 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" - -if (!hasInterface) exitWith {}; - -// create diary -player createDiarySubject ["CBA_docs", "CBA"]; - -//player createDiaryRecord ["CBA_docs", [localize "STR_DN_CBA_WEBSITE_WIKI", "http://dev-heaven.net/projects/cca"]]; - -private _creditsInfo = GVAR(credits) getVariable "CfgPatches"; -private _credits_CfgPatches = _creditsInfo call FUNC(process); - -if (!isNil "_credits_CfgPatches") then { - player createDiaryRecord ["CBA_docs", [localize "STR_DN_CBA_CREDITS_ADDONS", _credits_CfgPatches]]; -}; - -if (!isNil QGVAR(docs)) then { - player createDiaryRecord ["CBA_docs", ["Docs", GVAR(docs)]]; -}; - -if (!isNil QGVAR(keys)) then { - player createDiaryRecord ["CBA_docs", [localize "STR_DN_CBA_HELP_KEYS", GVAR(keys)]]; -}; - -//player createDiaryRecord ["CBA_docs", [localize "STR_DN_CBA_CREDITS", GVAR(credits_cba)]]; -//player createDiaryRecord ["CBA_docs", ["Credits - Vehicles", (_creditsInfo getVariable "CfgVehicles") call FUNC(process)]]; -//player createDiaryRecord ["CBA_docs", ["Credits - Weapons", (_creditsInfo getVariable "CfgWeapons") call FUNC(process)]]; -//player createDiaryRecord ["CBA_docs", [localize "STR_DN_CBA_WEBSITE", "http://dev-heaven.net/projects/cca"]]; - -// add diary for scripted keybinds -0 spawn { - private _text = GVAR(keys); - - private _activeMods = allVariables EGVAR(keybinding,addons); - _activeMods sort true; - - { - (EGVAR(keybinding,addons) getVariable _x) params ["_addonName", "_addonActions"]; - - _text = _text + format ["%1:
", _addonName]; - - { - (EGVAR(keybinding,actions) getVariable (_addonName + "$" + _x)) params ["_displayName", "", "_registryKeybinds"]; - if (isLocalized _displayName) then { _displayName = localize _displayName; }; - - private _keyName = (_registryKeybinds select {_x select 0 > DIK_ESCAPE} apply {_x call CBA_fnc_localizeKey}) joinString " "; - - _text = _text + format [" %1: %2
", _displayName, _keyName]; - } forEach _addonActions; - - _text = _text + "
"; - } forEach _activeMods; - - player createDiaryRecord ["CBA_docs", [localize "STR_DN_CBA_HELP_KEYS", _text]]; -}; diff --git a/addons/help/XEH_postInit.sqf b/addons/help/XEH_postInit.sqf new file mode 100644 index 000000000..6eb1669db --- /dev/null +++ b/addons/help/XEH_postInit.sqf @@ -0,0 +1,78 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +// create diary, entries added in reverse order +player createDiarySubject ["CBA_docs", "CBA"]; + +// add diary for scripted keybinds +{ + private _fnc_process = { + private _result = []; + + { + private _entry = _x; + + // addon name + private _name = configName _entry; + + if (isText (_entry >> "name")) then { + _name = getText (_entry >> "name"); + }; + + _name = format ["%1", _name]; + + // version if any + private _version = ""; + + if (isText (_entry >> "version")) then { + _version = format [" v%1", getText (_entry >> "version")]; + }; + + // author name + private _author = getText (_entry >> "author"); + + _result pushBack format ["%1%2 by %3", _name, _version, _author]; + } forEach (uiNamespace getVariable [QGVAR(creditsCache), []]); + + _result joinString "
"; + }; + + private _text = GVAR(keys); + + private _activeMods = allVariables EGVAR(keybinding,addons); + _activeMods sort true; + + { + (EGVAR(keybinding,addons) getVariable _x) params ["_addonName", "_addonActions"]; + + _text = _text + format ["%1:
", _addonName]; + + { + (EGVAR(keybinding,actions) getVariable (_addonName + "$" + _x)) params ["_displayName", "", "_registryKeybinds"]; + if (isLocalized _displayName) then { _displayName = localize _displayName; }; + + private _keyName = (_registryKeybinds select {_x select 0 > DIK_ESCAPE} apply {_x call CBA_fnc_localizeKey}) joinString " "; + + _text = _text + format [" %1: %2
", _displayName, _keyName]; + } forEach _addonActions; + + _text = _text + "
"; + } forEach _activeMods; + + // delete last line break + _text = _text select [0, count _text - 5]; + + player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Help_Keys", _text]]; + + if (!isNil QGVAR(docs)) then { + //player createDiaryRecord ["CBA_docs", ["Docs", GVAR(docs)]]; + }; + + // "ARMA 3" + player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Credits", call _fnc_process]]; + + player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Bugtracker", localize "STR_CBA_URL_Bugtracker"]]; + player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Wiki", localize "STR_CBA_URL_Wiki"]]; +} call CBA_fnc_execNextFrame; diff --git a/addons/help/XEH_preClientInit.sqf b/addons/help/XEH_preInit.sqf similarity index 67% rename from addons/help/XEH_preClientInit.sqf rename to addons/help/XEH_preInit.sqf index d6396050f..aa09d4741 100644 --- a/addons/help/XEH_preClientInit.sqf +++ b/addons/help/XEH_preInit.sqf @@ -1,32 +1,12 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -LOG(MSG_INIT); +if (!hasInterface) exitWith {}; ADDON = false; [QFUNC(help), {call BIS_fnc_help}] call CBA_fnc_compileFinal; -[QFUNC(process), { - params ["_hash1", "_hash2", "_hash3"]; - - private _result = []; - - { - private _entry = format [ - "%1, v%2, (%3)
Author: %4", - _x, - _hash3 getVariable _x, - _hash2 getVariable _x, - (_hash1 getVariable _x) joinString ", " - ]; - - _result pushBack _entry; - } forEach allVariables _hash1; - - _result joinString "

"; -}] call CBA_fnc_compileFinal; - // keys private _fnc_getKeyName = { private _shift = [0, DIK_LSHIFT] select (_shift > 0); @@ -106,33 +86,6 @@ private _config = configFile >> "CfgSettings" >> "CBA" >> "events"; GVAR(keys) = _text; -// credits -GVAR(credits) = call CBA_fnc_createNamespace; - -private _fnc_readCreditsFromConfig = { - params ["_type"]; - - private _config = configFile >> _type; - - private _hash1 = call CBA_fnc_createNamespace; - private _hash2 = call CBA_fnc_createNamespace; - private _hash3 = call CBA_fnc_createNamespace; - - { - private _entry = _x; - - _hash1 setVariable [configName _entry, getArray (_entry >> "author")]; - _hash2 setVariable [configName _entry, getText (_entry >> "authorUrl")]; - _hash3 setVariable [configName _entry, getText (_entry >> "version")]; - } forEach ("isArray (_x >> 'author')" configClasses _config); - - [_hash1, _hash2, _hash3] -}; - -{ - GVAR(credits) setVariable [_x, _x call _fnc_readCreditsFromConfig]; -} forEach ["CfgPatches"]; //, "CfgVehicles", "CfgWeapons"]; - // docs GVAR(docs) = ""; diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index e307f1748..bed986739 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -1,14 +1,8 @@ #include "script_component.hpp" -PREP(setVersionLine); -PREP(setCreditsLine); - -//Cache for CBA_help_fnc_setCreditsLine -if (!isClass (configFile >> "CfgPatches" >> "CBA_DisableCredits")) then { - uiNamespace setVariable [QGVAR(creditsCache), - "isText (_x >> 'author') && - {getText (_x >> 'author') != localize 'STR_A3_Bohemia_Interactive'} && - {getText (_x >> 'author') != ''} - " configClasses (configFile >> "CfgPatches") - ]; -}; +uiNamespace setVariable [ + QGVAR(creditsCache), " + isText (_x >> 'author') && + {!(getText (_x >> 'author') in [localize 'STR_A3_Bohemia_Interactive', 'CFGPATCHES_AUTHOR', ''])} + " configClasses (configFile >> "CfgPatches") +]; diff --git a/addons/help/config.cpp b/addons/help/config.cpp index f044a5f06..19292f3c0 100644 --- a/addons/help/config.cpp +++ b/addons/help/config.cpp @@ -8,11 +8,10 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"cba_common", "cba_hashes", "cba_keybinding"}; + requiredAddons[] = {"cba_common", "cba_keybinding"}; version = VERSION; authors[] = {"alef", "Rocko", "Sickboy"}; }; }; #include "CfgEventhandlers.hpp" -#include "gui.hpp" diff --git a/addons/help/fnc_setCreditsLine.sqf b/addons/help/fnc_setCreditsLine.sqf deleted file mode 100644 index f89340f09..000000000 --- a/addons/help/fnc_setCreditsLine.sqf +++ /dev/null @@ -1,59 +0,0 @@ -#include "script_component.hpp" -/* ---------------------------------------------------------------------------- -Function: CBA_help_fnc_setCreditsLine - -Description: - Picks a random CfgPatches entry with an "author" entry and displays author, - version and URL in the main menu and ingame in the pause menu. - -Parameters: - 0: _control - Credits line control - -Returns: - None ----------------------------------------------------------------------------- */ - -params ["_control"]; - -if !(ctrlText _control isEqualTo "") exitWith {}; - -// get settings -{ - if (isNil _x) then { - missionNamespace setVariable [_x, isClass (configFile >> "CfgPatches" >> _x)]; - }; -} forEach ["CBA_DisableCredits", "CBA_MonochromeCredits"]; - -if (CBA_DisableCredits) exitWith {}; - -// find random addon with author -private _entry = selectRandom (uiNamespace getVariable [QGVAR(creditsCache), []]); - -if (isNil "_entry") exitWith {}; - -// addon name -private _name = configName _entry; - -if (isText (_entry >> "name")) then { - _name = getText (_entry >> "name"); -}; - -if (!CBA_MonochromeCredits) then { - _name = format ["%1", _name]; -}; - -// author name -private _author = getText (_entry >> "author"); - -// version if any -private _version = ""; - -if (isText (_entry >> "version")) then { - _version = format [" v%1", getText (_entry >> "version")]; -}; - -// add single line -_control ctrlSetStructuredText parseText format ["%1%2 by %3", _name, _version, _author]; - -// make credits line not obstruct other controls -_control ctrlEnable false; diff --git a/addons/help/fnc_setVersionLine.sqf b/addons/help/fnc_setVersionLine.sqf deleted file mode 100644 index 42ae24f25..000000000 --- a/addons/help/fnc_setVersionLine.sqf +++ /dev/null @@ -1,100 +0,0 @@ -#include "script_component.hpp" -/* ---------------------------------------------------------------------------- -Function: CBA_help_fnc_setVersionLine - -Description: - Displays all CfgPatches with a "versionDesc" entry in the main menu. - - Mods are cycled automatically every 4 seconds or can be browsed using LMB and RMB. - Double clicking executes the script in "versionAct". - -Parameters: - 0: _control - Either version line or button control - 1: _key - 0: LMB - next mod, 1: RMB - previous mod (optional, default: 0) - -Returns: - None ----------------------------------------------------------------------------- */ - -params ["_control", ["_key", 0]]; - -private _display = ctrlParent _control; - -private _ctrlText = _display displayCtrl IDC_VERSION_TEXT; -private _ctrlButton = _display displayCtrl IDC_VERSION_BUTTON; - -// create addon list -if (isNil {uiNamespace getVariable QGVAR(VerList)}) then { - private _verList = []; - uiNamespace setVariable [QGVAR(VerList), _verList]; - - // gather version info - { - private _entry = _x; - - private _verLine = format ["%1 v%2", getText (_entry >> "versionDesc"), getText (_entry >> "version")]; - private _verAct = getText (_entry >> "versionAct"); - - _verList pushBack [_verLine, _verAct]; - } forEach ("isText (_x >> 'versionDesc')" configClasses (configFile >> "CfgPatches")); -}; - -// start loop that cycles through all addons -terminate (uiNamespace getVariable [QGVAR(VerScript), scriptNull]); - -private _verScript = [_control] spawn { // will terminate when main menu mission exits - uiSleep 4; - isNil (uiNamespace getVariable QFUNC(setVersionLine)); // execute unscheduled -}; - -uiNamespace setVariable [QGVAR(VerScript), _verScript]; - -// start loop with mouse moving event on main menu. this is used, because loops can't be used at that point -if (isNull (uiNamespace getVariable [QGVAR(VerScriptFlag), displayNull])) then { - uiNamespace setVariable [QGVAR(VerScriptFlag), _display]; - - _display displayAddEventHandler ["MouseMoving", { - params ["_display"]; - - if (!scriptDone (uiNamespace getVariable [QGVAR(VerScript), scriptNull])) exitWith {}; - - private _verScript = [allControls _display select 0] spawn { // will terminate when main menu mission exits - uiSleep 4; - isNil (uiNamespace getVariable QFUNC(setVersionLine)); // execute unscheduled - }; - - uiNamespace setVariable [QGVAR(VerScript), _verScript]; - }]; -}; - -// left click forward, other click back -if (isNil {uiNamespace getVariable QGVAR(VerNext)}) then { - uiNamespace setVariable [QGVAR(VerNext), -1]; -}; - -private _next = uiNamespace getVariable QGVAR(VerNext); - -if (_key isEqualTo 0) then { - _next = _next + 1; -} else { - _next = _next - 1; -}; - -// stay in bounds -_verList = uiNamespace getVariable QGVAR(VerList); - -if (_next >= count _verList) then { - _next = 0; -} else { - if (_next < 0) then { - _next = count _verList - 1; - }; -}; - -uiNamespace setVariable [QGVAR(VerNext), _next]; - -// add single line -(_verList select _next) params ["_verLine", "_verAct"]; - -_ctrlText ctrlSetText _verLine; // print version line -_ctrlButton ctrlSetEventHandler ["MouseButtonDblClick", _verAct]; // set double-click action if any diff --git a/addons/help/gui.hpp b/addons/help/gui.hpp deleted file mode 100644 index e024c0ea6..000000000 --- a/addons/help/gui.hpp +++ /dev/null @@ -1,78 +0,0 @@ -class RscText; -class RscButton; - -class RscStructuredText { - class Attributes; -}; - -class GVAR(credits_base): RscStructuredText { - onLoad = QUOTE(_this call (uiNamespace getVariable 'FUNC(setCreditsLine)')); - size = POS_H(0.8); - x = POS_X_CENTERED(7); - y = POS_Y(23.1); - w = POS_W(26); - h = POS_H(0.8); - shadow = 0; - - class Attributes: Attributes { - font = "RobotoCondensedLight"; - align = "center"; - valign = "middle"; - color = "#bdcc9c"; - }; -}; - -class RscStandardDisplay; -class RscDisplayMain: RscStandardDisplay { - class controls { - class GVAR(CreditsVersion): RscText { - onLoad = QUOTE(_this call (uiNamespace getVariable 'FUNC(setVersionLine)')); - idc = IDC_VERSION_TEXT; - font = "RobotoCondensedLight"; - shadow = 0; - style = ST_RIGHT; - sizeEx = POS_H(0.8); - x = POS_X_RIGHT(12); - y = POS_Y(24.1); - w = POS_W(10); - h = POS_H(0.8); - }; - - class GVAR(CreditsVersionButton): RscButton { - onMouseButtonClick = QUOTE(_this call (uiNamespace getVariable 'FUNC(setVersionLine)')); - idc = IDC_VERSION_BUTTON; - colorText[] = {1,1,1,0}; - colorDisabled[] = {1,1,1,0}; - colorBackground[] = {0,0,0,0}; - colorBackgroundDisabled[] = {0,0,0,0}; - colorBackgroundActive[] = {0,0,0,0}; - colorFocused[] = {0,0,0,0}; - soundClick[] = {"",1,1}; - - x = POS_X_RIGHT(12); - y = POS_Y(24.1); - w = POS_W(10); - h = POS_H(0.8); - }; - - class GVAR(credits): GVAR(credits_base) { - size = POS_H_MAIN_MENU(1); - x = POS_X_MAIN_MENU(0); - y = POS_Y_MAIN_MENU(2); - w = POS_W_MAIN_MENU(0); - h = POS_H_MAIN_MENU(1); - }; - }; -}; - -class RscDisplayInterrupt: RscStandardDisplay { - class controls { - class GVAR(credits): GVAR(credits_base) {}; - }; -}; - -class RscDisplayMPInterrupt: RscStandardDisplay { - class controls { - class GVAR(credits): GVAR(credits_base) {}; - }; -}; diff --git a/addons/help/script_component.hpp b/addons/help/script_component.hpp index e490c5e01..964446e78 100644 --- a/addons/help/script_component.hpp +++ b/addons/help/script_component.hpp @@ -11,22 +11,4 @@ #include "\x\cba\addons\main\script_macros.hpp" -#include "\a3\ui_f\hpp\defineCommonGrids.inc" #include "\a3\ui_f\hpp\defineDIKCodes.inc" -#include "\a3\ui_f\hpp\defineResincl.inc" - -#define POS_X(N) ((N) * GUI_GRID_W + GUI_GRID_X) -#define POS_Y(N) ((N) * GUI_GRID_H + GUI_GRID_Y) -#define POS_W(N) ((N) * GUI_GRID_W) -#define POS_H(N) ((N) * GUI_GRID_H) - -#define POS_X_CENTERED(N) ((N) * GUI_GRID_W + GUI_GRID_CENTER_X) -#define POS_X_RIGHT(N) (safezoneW - 1 * (N) * GUI_GRID_W + GUI_GRID_X) - -#define POS_X_MAIN_MENU(N) safezoneX -#define POS_Y_MAIN_MENU(N) (safezoneY + safezoneH - 1 * (N) * (pixelH * pixelGrid * 2)) -#define POS_W_MAIN_MENU(N) safezoneW -#define POS_H_MAIN_MENU(N) ((N) * (pixelH * pixelGrid * 2)) - -#define IDC_VERSION_TEXT 222712 -#define IDC_VERSION_BUTTON 222713 diff --git a/addons/help/stringtable.xml b/addons/help/stringtable.xml index 7bc7e8e73..986b820eb 100644 --- a/addons/help/stringtable.xml +++ b/addons/help/stringtable.xml @@ -13,7 +13,7 @@ Community Base Addons - Aide Community Base Addons - Yardım - + Keybindings Tastendruckzuweisung Keybindings @@ -28,7 +28,7 @@ 按键绑定 Klavye Tuşları - + Bugtracker Bugtracker Bugtracker @@ -43,7 +43,7 @@ 臭虫追踪器 Sorun Takibi - + Wiki (Documentation) Wiki (Documentation) Wiki (Documentation) @@ -58,7 +58,7 @@ 维基 (文件) Wiki (Dökümantasyon) - + Credits Credits Credits @@ -73,20 +73,5 @@ 制作组 Yapımcılar - - Credits - Addons - Credits - Addons - Credits - Addons - Credits - Addons - Кредиты - Дополнения - Credits - Addons - Twórcy - Addons - Credits - Addons - Credits - Addons - クレジット - アドオン - 製作組 - 模組 - 制作组 - 模组 - Yapımcılar - Modüller - diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index ecc93e688..273f99d1f 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -29,6 +29,38 @@ https://www.github.com/CBATeam/CBA_A3 https://www.github.com/CBATeam/CBA_A3 + + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + https://www.github.com/CBATeam/CBA_A3/issues + + + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + https://www.github.com/CBATeam/CBA_A3/wiki + Community Base Addons - Main Component Community Base Addons - Hauptkomponente From e9ecf21e438996336cf045c52c2fca705d35aaca Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 20 Feb 2019 20:17:48 +0100 Subject: [PATCH 02/19] cleanup help --- addons/help/XEH_postInit.sqf | 35 ++-------------------------------- addons/help/XEH_preStart.sqf | 37 ++++++++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 39 deletions(-) diff --git a/addons/help/XEH_postInit.sqf b/addons/help/XEH_postInit.sqf index 6eb1669db..e5a552ef9 100644 --- a/addons/help/XEH_postInit.sqf +++ b/addons/help/XEH_postInit.sqf @@ -8,37 +8,6 @@ player createDiarySubject ["CBA_docs", "CBA"]; // add diary for scripted keybinds { - private _fnc_process = { - private _result = []; - - { - private _entry = _x; - - // addon name - private _name = configName _entry; - - if (isText (_entry >> "name")) then { - _name = getText (_entry >> "name"); - }; - - _name = format ["%1", _name]; - - // version if any - private _version = ""; - - if (isText (_entry >> "version")) then { - _version = format [" v%1", getText (_entry >> "version")]; - }; - - // author name - private _author = getText (_entry >> "author"); - - _result pushBack format ["%1%2 by %3", _name, _version, _author]; - } forEach (uiNamespace getVariable [QGVAR(creditsCache), []]); - - _result joinString "
"; - }; - private _text = GVAR(keys); private _activeMods = allVariables EGVAR(keybinding,addons); @@ -67,11 +36,11 @@ player createDiarySubject ["CBA_docs", "CBA"]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Help_Keys", _text]]; if (!isNil QGVAR(docs)) then { - //player createDiaryRecord ["CBA_docs", ["Docs", GVAR(docs)]]; + player createDiaryRecord ["CBA_docs", ["Docs", GVAR(docs)]]; }; // "ARMA 3" - player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Credits", call _fnc_process]]; + player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Credits", call (uiNamespace getVariable QGVAR(credits))]]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Bugtracker", localize "STR_CBA_URL_Bugtracker"]]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Wiki", localize "STR_CBA_URL_Wiki"]]; diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index bed986739..f1cf68b24 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -1,8 +1,33 @@ #include "script_component.hpp" -uiNamespace setVariable [ - QGVAR(creditsCache), " - isText (_x >> 'author') && - {!(getText (_x >> 'author') in [localize 'STR_A3_Bohemia_Interactive', 'CFGPATCHES_AUTHOR', ''])} - " configClasses (configFile >> "CfgPatches") -]; +private _addons = "true" configClasses (configFile >> "CfgPatches") select { + isText (_x >> "author") && {!(getText (_x >> "author") in [localize "STR_A3_Bohemia_Interactive", "CFGPATCHES_AUTHOR", ""])} +}; + +private _credits = []; + +{ + private _entry = _x; + + private _name = configName _entry; + + if (isText (_entry >> "name")) then { + _name = getText (_entry >> "name"); + }; + + _name = format ["%1", _name]; + + private _version = ""; + + if (isText (_entry >> "version")) then { + _version = format [" v%1", getText (_entry >> "version")]; + }; + + private _author = getText (_entry >> "author"); + + _credits pushBack format ["%1%2 by %3", _name, _version, _author]; +} forEach _addons; + +_credits = _credits joinString "
"; + +uiNamespace setVariable [QGVAR(credits), compileFinal str _credits]; From b8389b42c7eae750dfb8b4215ed6360af13f3efc Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 20 Feb 2019 20:43:35 +0100 Subject: [PATCH 03/19] help docs --- addons/help/XEH_postInit.sqf | 10 ++-------- addons/help/XEH_preInit.sqf | 11 ----------- addons/help/XEH_preStart.sqf | 34 ++++++++++++++++++++++++++-------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/addons/help/XEH_postInit.sqf b/addons/help/XEH_postInit.sqf index e5a552ef9..32b8a6a1c 100644 --- a/addons/help/XEH_postInit.sqf +++ b/addons/help/XEH_postInit.sqf @@ -34,14 +34,8 @@ player createDiarySubject ["CBA_docs", "CBA"]; _text = _text select [0, count _text - 5]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Help_Keys", _text]]; - - if (!isNil QGVAR(docs)) then { - player createDiaryRecord ["CBA_docs", ["Docs", GVAR(docs)]]; - }; - - // "ARMA 3" + player createDiaryRecord ["CBA_docs", ["Docs", call (uiNamespace getVariable QGVAR(docs))]]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Credits", call (uiNamespace getVariable QGVAR(credits))]]; - - player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Bugtracker", localize "STR_CBA_URL_Bugtracker"]]; + player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Bugtracker", localize "STR_CBA_URL_Bugtracker"]]; //"ARMA 3" player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Wiki", localize "STR_CBA_URL_Wiki"]]; } call CBA_fnc_execNextFrame; diff --git a/addons/help/XEH_preInit.sqf b/addons/help/XEH_preInit.sqf index aa09d4741..fe5537e31 100644 --- a/addons/help/XEH_preInit.sqf +++ b/addons/help/XEH_preInit.sqf @@ -86,15 +86,4 @@ private _config = configFile >> "CfgSettings" >> "CBA" >> "events"; GVAR(keys) = _text; -// docs -GVAR(docs) = ""; - -private _config = configFile >> "CfgMods"; - -{ - private _entry = format ["* %1 - %2
%3

", configName _x, getText (_x >> "name"), getText (_x >> "description")]; - - GVAR(docs) + _entry; -} forEach ("isText (_x >> 'description')" configClasses _config); - ADDON = true; diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index f1cf68b24..78b8e5080 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -1,5 +1,9 @@ +//#define DEBUG_MODE_FULL #include "script_component.hpp" +if (!hasInterface) exitWith {}; + +// credits private _addons = "true" configClasses (configFile >> "CfgPatches") select { isText (_x >> "author") && {!(getText (_x >> "author") in [localize "STR_A3_Bohemia_Interactive", "CFGPATCHES_AUTHOR", ""])} }; @@ -7,23 +11,21 @@ private _addons = "true" configClasses (configFile >> "CfgPatches") select { private _credits = []; { - private _entry = _x; - - private _name = configName _entry; + private _name = configName _x; - if (isText (_entry >> "name")) then { - _name = getText (_entry >> "name"); + if (isText (_x >> "name")) then { + _name = getText (_x >> "name"); }; _name = format ["%1", _name]; private _version = ""; - if (isText (_entry >> "version")) then { - _version = format [" v%1", getText (_entry >> "version")]; + if (isText (_x >> "version")) then { + _version = format [" v%1", getText (_x >> "version")]; }; - private _author = getText (_entry >> "author"); + private _author = getText (_x >> "author"); _credits pushBack format ["%1%2 by %3", _name, _version, _author]; } forEach _addons; @@ -31,3 +33,19 @@ private _credits = []; _credits = _credits joinString "
"; uiNamespace setVariable [QGVAR(credits), compileFinal str _credits]; + +// docs +private _mods = "true" configClasses (configFile >> "CfgMods");// select {isText (_x >> "description")}; + +private _docs = []; + +{ + private _name = getText (_x >> "name"); + private _description = getText (_x >> "description"); + + _docs pushBack format ["* %1 - %2
%3

", configName _x, _name, _description]; +} forEach _mods; + +_docs = _docs joinString "
"; + +uiNamespace setVariable [QGVAR(docs), compileFinal str _docs]; From 756a45509c6ed97cbed6165460dc73ab11e39629 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 20 Feb 2019 20:44:13 +0100 Subject: [PATCH 04/19] delete help docs --- addons/help/XEH_postInit.sqf | 1 - addons/help/XEH_preStart.sqf | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/addons/help/XEH_postInit.sqf b/addons/help/XEH_postInit.sqf index 32b8a6a1c..804c12d83 100644 --- a/addons/help/XEH_postInit.sqf +++ b/addons/help/XEH_postInit.sqf @@ -34,7 +34,6 @@ player createDiarySubject ["CBA_docs", "CBA"]; _text = _text select [0, count _text - 5]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Help_Keys", _text]]; - player createDiaryRecord ["CBA_docs", ["Docs", call (uiNamespace getVariable QGVAR(docs))]]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Credits", call (uiNamespace getVariable QGVAR(credits))]]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Bugtracker", localize "STR_CBA_URL_Bugtracker"]]; //"ARMA 3" player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Wiki", localize "STR_CBA_URL_Wiki"]]; diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index 78b8e5080..f783468aa 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -33,19 +33,3 @@ private _credits = []; _credits = _credits joinString "
"; uiNamespace setVariable [QGVAR(credits), compileFinal str _credits]; - -// docs -private _mods = "true" configClasses (configFile >> "CfgMods");// select {isText (_x >> "description")}; - -private _docs = []; - -{ - private _name = getText (_x >> "name"); - private _description = getText (_x >> "description"); - - _docs pushBack format ["* %1 - %2
%3

", configName _x, _name, _description]; -} forEach _mods; - -_docs = _docs joinString "
"; - -uiNamespace setVariable [QGVAR(docs), compileFinal str _docs]; From a80805d28d44b705d8d44691308e99810be02a1b Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 20 Feb 2019 20:51:28 +0100 Subject: [PATCH 05/19] cleanup help --- addons/help/XEH_postInit.sqf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/help/XEH_postInit.sqf b/addons/help/XEH_postInit.sqf index 804c12d83..2c77f081e 100644 --- a/addons/help/XEH_postInit.sqf +++ b/addons/help/XEH_postInit.sqf @@ -3,11 +3,11 @@ if (!hasInterface) exitWith {}; -// create diary, entries added in reverse order -player createDiarySubject ["CBA_docs", "CBA"]; - -// add diary for scripted keybinds { + // create diary, entries added in reverse order + player createDiarySubject ["CBA_docs", "CBA"]; + + // add diary for scripted keybinds private _text = GVAR(keys); private _activeMods = allVariables EGVAR(keybinding,addons); @@ -20,7 +20,10 @@ player createDiarySubject ["CBA_docs", "CBA"]; { (EGVAR(keybinding,actions) getVariable (_addonName + "$" + _x)) params ["_displayName", "", "_registryKeybinds"]; - if (isLocalized _displayName) then { _displayName = localize _displayName; }; + + if (isLocalized _displayName) then { + _displayName = localize _displayName; + }; private _keyName = (_registryKeybinds select {_x select 0 > DIK_ESCAPE} apply {_x call CBA_fnc_localizeKey}) joinString " "; @@ -31,7 +34,7 @@ player createDiarySubject ["CBA_docs", "CBA"]; } forEach _activeMods; // delete last line break - _text = _text select [0, count _text - 5]; + _text = _text select [0, count _text - 10]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Help_Keys", _text]]; player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Credits", call (uiNamespace getVariable QGVAR(credits))]]; From 4a5809899074368930d056b603eb65e6a59681c2 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 21 Feb 2019 06:37:03 +0100 Subject: [PATCH 06/19] cleanup help --- addons/help/XEH_postInit.sqf | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/addons/help/XEH_postInit.sqf b/addons/help/XEH_postInit.sqf index 2c77f081e..a0d0536dc 100644 --- a/addons/help/XEH_postInit.sqf +++ b/addons/help/XEH_postInit.sqf @@ -5,39 +5,40 @@ if (!hasInterface) exitWith {}; { // create diary, entries added in reverse order - player createDiarySubject ["CBA_docs", "CBA"]; + private _unit = player; + _unit createDiarySubject [QGVAR(docs), "CBA"]; // add diary for scripted keybinds - private _text = GVAR(keys); + private _keys = GVAR(keys); - private _activeMods = allVariables EGVAR(keybinding,addons); - _activeMods sort true; + private _addons = allVariables EGVAR(keybinding,addons); + _addons sort true; { - (EGVAR(keybinding,addons) getVariable _x) params ["_addonName", "_addonActions"]; + (EGVAR(keybinding,addons) getVariable _x) params ["_addon", "_addonActions"]; - _text = _text + format ["%1:
", _addonName]; + _keys = _keys + format ["%1:
", _addon]; { - (EGVAR(keybinding,actions) getVariable (_addonName + "$" + _x)) params ["_displayName", "", "_registryKeybinds"]; + (EGVAR(keybinding,actions) getVariable (_addon + "$" + _x)) params ["_displayName", "", "_keybinds"]; if (isLocalized _displayName) then { _displayName = localize _displayName; }; - private _keyName = (_registryKeybinds select {_x select 0 > DIK_ESCAPE} apply {_x call CBA_fnc_localizeKey}) joinString " "; + private _keyName = _keybinds select {_x select 0 > DIK_ESCAPE} apply {_x call CBA_fnc_localizeKey} joinString " "; - _text = _text + format [" %1: %2
", _displayName, _keyName]; + _keys = _keys + format [" %1: %2
", _displayName, _keyName]; } forEach _addonActions; - _text = _text + "
"; - } forEach _activeMods; + _keys = _keys + "
"; + } forEach _addons; - // delete last line break - _text = _text select [0, count _text - 10]; + // delete last line breaks + _keys = _keys select [0, count _keys - 10]; - player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Help_Keys", _text]]; - player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Credits", call (uiNamespace getVariable QGVAR(credits))]]; - player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Bugtracker", localize "STR_CBA_URL_Bugtracker"]]; //"ARMA 3" - player createDiaryRecord ["CBA_docs", [localize "STR_CBA_Wiki", localize "STR_CBA_URL_Wiki"]]; + _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Help_Keys", _keys]]; + _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Credits", call (uiNamespace getVariable QGVAR(credits))]]; + _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Bugtracker", localize "STR_CBA_URL_Bugtracker"]]; //"ARMA 3" + _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Wiki", localize "STR_CBA_URL_Wiki"]]; } call CBA_fnc_execNextFrame; From 388abe8fb18a33400c773d3f4939248e20272dc0 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 21 Feb 2019 15:00:53 +0100 Subject: [PATCH 07/19] cleanup help --- addons/help/XEH_preInit.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/help/XEH_preInit.sqf b/addons/help/XEH_preInit.sqf index fe5537e31..be60063bb 100644 --- a/addons/help/XEH_preInit.sqf +++ b/addons/help/XEH_preInit.sqf @@ -5,7 +5,8 @@ if (!hasInterface) exitWith {}; ADDON = false; -[QFUNC(help), {call BIS_fnc_help}] call CBA_fnc_compileFinal; +// bwc +QFUNC(help) = BIS_fnc_help; // keys private _fnc_getKeyName = { From cf55c576866a5d553c2b8adad961ecae950d4cad Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 21 Feb 2019 16:24:54 +0100 Subject: [PATCH 08/19] travis --- addons/help/XEH_postInit.sqf | 2 +- addons/help/config.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/help/XEH_postInit.sqf b/addons/help/XEH_postInit.sqf index a0d0536dc..860dde993 100644 --- a/addons/help/XEH_postInit.sqf +++ b/addons/help/XEH_postInit.sqf @@ -26,7 +26,7 @@ if (!hasInterface) exitWith {}; _displayName = localize _displayName; }; - private _keyName = _keybinds select {_x select 0 > DIK_ESCAPE} apply {_x call CBA_fnc_localizeKey} joinString " "; + private _keyName = (_keybinds select {_x select 0 > DIK_ESCAPE} apply {_x call CBA_fnc_localizeKey}) joinString " "; _keys = _keys + format [" %1: %2
", _displayName, _keyName]; } forEach _addonActions; diff --git a/addons/help/config.cpp b/addons/help/config.cpp index 19292f3c0..a5d3b2e30 100644 --- a/addons/help/config.cpp +++ b/addons/help/config.cpp @@ -8,9 +8,9 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"cba_common", "cba_keybinding"}; + requiredAddons[] = {"cba_common","cba_keybinding"}; version = VERSION; - authors[] = {"alef", "Rocko", "Sickboy"}; + authors[] = {"alef","Rocko","Sickboy"}; }; }; From d1bdc4c9cb1da0b5bba06d71acf0225fa48f0740 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 21 Feb 2019 16:42:07 +0100 Subject: [PATCH 09/19] fix a script error --- addons/help/XEH_preInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/help/XEH_preInit.sqf b/addons/help/XEH_preInit.sqf index be60063bb..c56877ace 100644 --- a/addons/help/XEH_preInit.sqf +++ b/addons/help/XEH_preInit.sqf @@ -6,7 +6,7 @@ if (!hasInterface) exitWith {}; ADDON = false; // bwc -QFUNC(help) = BIS_fnc_help; +FUNC(help) = BIS_fnc_help; // keys private _fnc_getKeyName = { From 7ad21d6237d76b10603558245befd99c16e4c2d6 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 21 Feb 2019 21:52:18 +0100 Subject: [PATCH 10/19] addons diary --- addons/help/XEH_postInit.sqf | 1 + addons/help/XEH_preStart.sqf | 16 ++++++++++++++++ addons/help/stringtable.xml | 15 +++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/addons/help/XEH_postInit.sqf b/addons/help/XEH_postInit.sqf index 860dde993..23bb984a4 100644 --- a/addons/help/XEH_postInit.sqf +++ b/addons/help/XEH_postInit.sqf @@ -39,6 +39,7 @@ if (!hasInterface) exitWith {}; _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Help_Keys", _keys]]; _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Credits", call (uiNamespace getVariable QGVAR(credits))]]; + _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Addons", call (uiNamespace getVariable QGVAR(mods))]]; _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Bugtracker", localize "STR_CBA_URL_Bugtracker"]]; //"ARMA 3" _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Wiki", localize "STR_CBA_URL_Wiki"]]; } call CBA_fnc_execNextFrame; diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index f783468aa..7d31af757 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -33,3 +33,19 @@ private _credits = []; _credits = _credits joinString "
"; uiNamespace setVariable [QGVAR(credits), compileFinal str _credits]; + +// mods +private _mods = "true" configClasses (configFile >> "CfgPatches") apply {configSourceMod _x}; +_mods = (_mods arrayIntersect _mods select {!isNumber (configfile >> "CfgMods" >> _x >> "appId")}) - [""]; + +_mods = _mods apply { + private _entry = configfile >> "CfgMods" >> _x; + + if (isClass _entry) then { + _x = format ["* %1 - %2
%3", configName _entry, getText (_entry >> "name"), getText (_entry >> "description")]; + } else {_x}; +}; + +_mods = _mods joinString "
"; + +uiNamespace setVariable [QGVAR(mods), compileFinal str _mods]; diff --git a/addons/help/stringtable.xml b/addons/help/stringtable.xml index 986b820eb..2952d941d 100644 --- a/addons/help/stringtable.xml +++ b/addons/help/stringtable.xml @@ -73,5 +73,20 @@ 制作组 Yapımcılar
+ + Addons + Addons + Addons + Addons + Дополнения + Addons + Addons + Addons + Addons + アドオン + 模組 + 模组 + Modüller + From b09756596a155c44aaee5867bedf86b304246fae Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Feb 2019 09:21:08 +0100 Subject: [PATCH 11/19] mods help --- addons/help/XEH_preStart.sqf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index 7d31af757..a1629dcc8 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -42,8 +42,14 @@ _mods = _mods apply { private _entry = configfile >> "CfgMods" >> _x; if (isClass _entry) then { - _x = format ["* %1 - %2
%3", configName _entry, getText (_entry >> "name"), getText (_entry >> "description")]; - } else {_x}; + _x = format ["%1 - %2", configName _entry, getText (_entry >> "name")]; + + if (isText (_entry >> "description")) then { + _x = _x + format ["
%1", getText (_entry >> "description")]; + }; + }; + + _x }; _mods = _mods joinString "
"; From 732a41232ece842014ae0ec63c97cf83971a466c Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Feb 2019 09:23:54 +0100 Subject: [PATCH 12/19] remove bugtracker, wiki diary entries --- addons/help/XEH_postInit.sqf | 2 -- addons/help/stringtable.xml | 30 ------------------------------ addons/main/stringtable.xml | 32 -------------------------------- 3 files changed, 64 deletions(-) diff --git a/addons/help/XEH_postInit.sqf b/addons/help/XEH_postInit.sqf index 23bb984a4..a2854aaf1 100644 --- a/addons/help/XEH_postInit.sqf +++ b/addons/help/XEH_postInit.sqf @@ -40,6 +40,4 @@ if (!hasInterface) exitWith {}; _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Help_Keys", _keys]]; _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Credits", call (uiNamespace getVariable QGVAR(credits))]]; _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Addons", call (uiNamespace getVariable QGVAR(mods))]]; - _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Bugtracker", localize "STR_CBA_URL_Bugtracker"]]; //"ARMA 3" - _unit createDiaryRecord [QGVAR(docs), [localize "STR_CBA_Wiki", localize "STR_CBA_URL_Wiki"]]; } call CBA_fnc_execNextFrame; diff --git a/addons/help/stringtable.xml b/addons/help/stringtable.xml index 2952d941d..8268d475a 100644 --- a/addons/help/stringtable.xml +++ b/addons/help/stringtable.xml @@ -28,36 +28,6 @@ 按键绑定 Klavye Tuşları
- - Bugtracker - Bugtracker - Bugtracker - Bugtracker - Баг трэкер - Bugtracker - Zgłaszanie błędów - traqueur de bugs - Bugtracker - バグトラッカー - 臭蟲追蹤器 - 臭虫追踪器 - Sorun Takibi - - - Wiki (Documentation) - Wiki (Documentation) - Wiki (Documentation) - Wiki (Documentation) - Wiki (Документация) - Wiki (Documentation) - Wiki (dokumentacja) - Wiki (Documentation) - Wiki (Documentation) - ウィキ (ドキュメント) - 維基 (文件) - 维基 (文件) - Wiki (Dökümantasyon) - Credits Credits diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index 273f99d1f..ecc93e688 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -29,38 +29,6 @@ https://www.github.com/CBATeam/CBA_A3 https://www.github.com/CBATeam/CBA_A3 - - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - https://www.github.com/CBATeam/CBA_A3/issues - - - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - https://www.github.com/CBATeam/CBA_A3/wiki - Community Base Addons - Main Component Community Base Addons - Hauptkomponente From bdc81df40dd7e8790d26a412e6bc1b28b9356cc1 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Feb 2019 11:20:13 +0100 Subject: [PATCH 13/19] formatting --- addons/help/XEH_preStart.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index a1629dcc8..fcac09b9c 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -45,13 +45,13 @@ _mods = _mods apply { _x = format ["%1 - %2", configName _entry, getText (_entry >> "name")]; if (isText (_entry >> "description")) then { - _x = _x + format ["
%1", getText (_entry >> "description")]; + _x = _x + format ["
%1", getText (_entry >> "description")]; }; }; _x }; -_mods = _mods joinString "
"; +_mods = _mods joinString "

"; uiNamespace setVariable [QGVAR(mods), compileFinal str _mods]; From 26a43e91a0fbfad260851ba7b750b3d31874c745 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Feb 2019 11:45:39 +0100 Subject: [PATCH 14/19] display addons, cba CfgMods --- addons/help/XEH_preStart.sqf | 6 +++--- addons/main_a3/CfgMods.hpp | 18 ++++++++++++++++++ addons/main_a3/CfgSettings.hpp | 11 +++++++++++ addons/main_a3/config.cpp | 25 ++----------------------- 4 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 addons/main_a3/CfgMods.hpp create mode 100644 addons/main_a3/CfgSettings.hpp diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index fcac09b9c..58042db3d 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -30,7 +30,7 @@ private _credits = []; _credits pushBack format ["%1%2 by %3", _name, _version, _author]; } forEach _addons; -_credits = _credits joinString "
"; +_credits = (_credits arrayIntersect _credits) joinString "
"; uiNamespace setVariable [QGVAR(credits), compileFinal str _credits]; @@ -42,10 +42,10 @@ _mods = _mods apply { private _entry = configfile >> "CfgMods" >> _x; if (isClass _entry) then { - _x = format ["%1 - %2", configName _entry, getText (_entry >> "name")]; + _x = format [" %1 - %2", configName _entry, getText (_entry >> "name")]; if (isText (_entry >> "description")) then { - _x = _x + format ["
%1", getText (_entry >> "description")]; + _x = _x + format ["
%1", getText (_entry >> "description")]; }; }; diff --git a/addons/main_a3/CfgMods.hpp b/addons/main_a3/CfgMods.hpp new file mode 100644 index 000000000..0d4474778 --- /dev/null +++ b/addons/main_a3/CfgMods.hpp @@ -0,0 +1,18 @@ +class CfgMods { + class PREFIX { + author = "$STR_CBA_Author"; + dir = "@CBA_A3"; + name = "Community Base Addons v3.9.1"; + 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/main_a3/CfgSettings.hpp b/addons/main_a3/CfgSettings.hpp new file mode 100644 index 000000000..1dde5bb30 --- /dev/null +++ b/addons/main_a3/CfgSettings.hpp @@ -0,0 +1,11 @@ +class CfgSettings { + class CBA { + class Versioning { + class PREFIX { + class Dependencies { + CBA[] = {"cba_main", {1,0,0}, "(true)"}; + }; + }; + }; + }; +}; diff --git a/addons/main_a3/config.cpp b/addons/main_a3/config.cpp index 261bbf347..84fea97ca 100644 --- a/addons/main_a3/config.cpp +++ b/addons/main_a3/config.cpp @@ -14,26 +14,5 @@ class CfgPatches { }; }; -class CfgSettings { - class CBA { - class Versioning { - class PREFIX { - class Dependencies { - CBA[] = {"cba_main", {1, 0, 0}, "(true)"}; - }; - }; - }; - }; -}; - -class CfgMods { - class PREFIX { - dir = "@CBA_A3"; - name = "Community Base Addons (Arma III)"; - picture = "x\cba\addons\main\logo_cba_ca.paa"; - hidePicture = "true"; - hideName = "true"; - actionName = "Website"; - action = "$STR_CBA_URL"; - }; -}; +#include "CfgMods.hpp" +#include "CfgSettings.hpp" From 0a5cedd96bda5d9c02a019cc4aafe63d3ae28889 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Feb 2019 12:54:59 +0100 Subject: [PATCH 15/19] rewrite part about config key handlers --- addons/events/config.cpp | 29 ++++++++++++++ addons/help/XEH_preInit.sqf | 75 ++++++++----------------------------- 2 files changed, 44 insertions(+), 60 deletions(-) diff --git a/addons/events/config.cpp b/addons/events/config.cpp index 7b3ea0226..8ed11c1ac 100644 --- a/addons/events/config.cpp +++ b/addons/events/config.cpp @@ -46,3 +46,32 @@ class CfgWeapons { }; }; #endif + +//["testcomponent1", "test1", {systemChat str 11}] call CBA_fnc_addKeyHandlerFromConfig; +//["testcomponent1", "test2", {systemChat str 12}] call CBA_fnc_addKeyHandlerFromConfig; +//["testcomponent2", "test1", {systemChat str 21}] call CBA_fnc_addKeyHandlerFromConfig; +//["testcomponent2", "test2", {systemChat str 22}] call CBA_fnc_addKeyHandlerFromConfig; + +/*class CfgSettings { + class CBA { + class events { + class testcomponent1 { + test1 = 15; + + class test2 { + key = 15; + shift = 1; + }; + }; + + class testcomponent2 { + test1 = 19; + + class test2 { + key = 19; + ctrl = 1; + }; + }; + }; + }; +};*/ diff --git a/addons/help/XEH_preInit.sqf b/addons/help/XEH_preInit.sqf index c56877ace..7130d8ddb 100644 --- a/addons/help/XEH_preInit.sqf +++ b/addons/help/XEH_preInit.sqf @@ -9,82 +9,37 @@ ADDON = false; FUNC(help) = BIS_fnc_help; // keys -private _fnc_getKeyName = { - private _shift = [0, DIK_LSHIFT] select (_shift > 0); - private _ctrl = [0, DIK_LCONTROL] select (_ctrl > 0); - private _alt = [0, DIK_LMENU] select (_alt > 0); - - private _keys = [_shift, _ctrl, _alt, _key]; - - private _result = "^"; - - { - private _keyName = call compile format ["format ['%1', %2]", "%1", keyName _x]; - _keyName = [_keyName, " "] call CBA_fnc_split; - - private _keyText = "^"; - - { - _keyText = _keyText + " " + _x; - } forEach _keyName; - - _keyText = [_keyText, "^ ", ""] call CBA_fnc_replace; - _result = _result + "-" + _keyText; - } forEach _keys; - - _result = [_result, "^ ", ""] call CBA_fnc_replace; - _result = [_result, "^-", ""] call CBA_fnc_replace; - _result = [_result, "^", "None"] call CBA_fnc_replace; - _result -}; - -private _text = ""; +private _keys = ""; private _config = configFile >> "CfgSettings" >> "CBA" >> "events"; { - private _addonConfig = _x; - private _addonName = configName _addonConfig; + private _addon = configName _x; - private _addonNameArr = [_addonName, "_"] call CBA_fnc_split; - private _addonText = "^"; + _keys = _keys + format ["%1:
", _addon]; { - if (_x != "sys") then { - _addonText = format ["%1 %2", _addonText, _x]; - }; - } forEach _addonNameArr; + private _action = configName _x; - _addonText = [_addonText, "^ ", ""] call CBA_fnc_replace; - _addonText = format ["%1:", _addonText]; - - { - private _entry = _x; - private _actionName = configName _entry; - - _actionName = [_actionName, "_", " "] call CBA_fnc_replace; - - private _keyState = if (isNumber _entry) then { - [getNumber _entry, 0, 0, 0 ] + private _keybind = if (isNumber _x) then { + [getNumber _x, false, false, false] } else { [ - getNumber (_entry >> "key"), - getNumber (_entry >> "shift"), - getNumber (_entry >> "ctrl"), - getNumber (_entry >> "alt") + getNumber (_x >> "key"), + getNumber (_x >> "shift") > 0, + getNumber (_x >> "ctrl") > 0, + getNumber (_x >> "alt") > 0 ] }; - private _keyName = _keyState call _fnc_getKeyName; - - _actionName = format [" %1: %2", _actionName, _keyName]; + private _keyName = _keybind call CBA_fnc_localizeKey; - _text = _text + _actionName + "
"; - } forEach configProperties [_addonConfig, "isNumber _x || isClass _x", true]; + _keys = _keys + format [" %1: %2
", _action, _keyName]; + } forEach configProperties [_x, "isNumber _x || isClass _x"]; - _text = _text + "
"; + _keys = _keys + "
"; } forEach ("true" configClasses _config); -GVAR(keys) = _text; +GVAR(keys) = _keys; ADDON = true; From a84ccf6586f89f49be4a2415c09fdf8145f880b6 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Feb 2019 22:17:33 +0100 Subject: [PATCH 16/19] html sanitize --- addons/help/XEH_preStart.sqf | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index 58042db3d..9773237de 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -41,11 +41,21 @@ _mods = (_mods arrayIntersect _mods select {!isNumber (configfile >> "CfgMods" > _mods = _mods apply { private _entry = configfile >> "CfgMods" >> _x; + private _name = getText (_entry >> "name"); + _name = [_name, "<", "<"] call CBA_fnc_replace; + _name = [_name, ">", ">"] call CBA_fnc_replace; + _name = [_name, "&", "&"] call CBA_fnc_replace; + if (isClass _entry) then { - _x = format [" %1 - %2", configName _entry, getText (_entry >> "name")]; + _x = format [" %1 - %2", configName _entry, _name]; if (isText (_entry >> "description")) then { - _x = _x + format ["
%1", getText (_entry >> "description")]; + private _description = getText (_entry >> "description"); + _description = [_description, "<", "<"] call CBA_fnc_replace; + _description = [_description, ">", ">"] call CBA_fnc_replace; + _description = [_description, "&", "&"] call CBA_fnc_replace; + + _x = _x + format ["
%1", _description]; }; }; From d7031945c82f01c55ec0266d14e176836478d90a Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Feb 2019 22:25:41 +0100 Subject: [PATCH 17/19] html sanitize --- addons/help/XEH_preStart.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index 9773237de..cf679bf09 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -15,6 +15,9 @@ private _credits = []; if (isText (_x >> "name")) then { _name = getText (_x >> "name"); + _name = [_name, "<", "<"] call CBA_fnc_replace; + _name = [_name, ">", ">"] call CBA_fnc_replace; + _name = [_name, "&", "&"] call CBA_fnc_replace; }; _name = format ["%1", _name]; From 7cd9f194f6ac5c697467b6963622992a1491eaa0 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Feb 2019 22:27:40 +0100 Subject: [PATCH 18/19] html sanitize --- addons/help/XEH_preStart.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index cf679bf09..56b1019a7 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -29,6 +29,9 @@ private _credits = []; }; private _author = getText (_x >> "author"); + _author = [_author, "<", "<"] call CBA_fnc_replace; + _author = [_author, ">", ">"] call CBA_fnc_replace; + _author = [_author, "&", "&"] call CBA_fnc_replace; _credits pushBack format ["%1%2 by %3", _name, _version, _author]; } forEach _addons; From 17a6dc8d912a3d6f0a2b23093860b30638283e64 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Feb 2019 22:56:13 +0100 Subject: [PATCH 19/19] CBA_fnc_sanitizeHTML --- addons/help/XEH_preStart.sqf | 20 ++++---------------- addons/main_a3/CfgMods.hpp | 2 +- addons/strings/CfgFunctions.hpp | 1 + addons/strings/fnc_sanitizeHTML.sqf | 29 +++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 addons/strings/fnc_sanitizeHTML.sqf diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index 56b1019a7..1148c245c 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -14,10 +14,7 @@ private _credits = []; private _name = configName _x; if (isText (_x >> "name")) then { - _name = getText (_x >> "name"); - _name = [_name, "<", "<"] call CBA_fnc_replace; - _name = [_name, ">", ">"] call CBA_fnc_replace; - _name = [_name, "&", "&"] call CBA_fnc_replace; + _name = getText (_x >> "name") call CBA_fnc_sanitizeHTML; }; _name = format ["%1", _name]; @@ -28,10 +25,7 @@ private _credits = []; _version = format [" v%1", getText (_x >> "version")]; }; - private _author = getText (_x >> "author"); - _author = [_author, "<", "<"] call CBA_fnc_replace; - _author = [_author, ">", ">"] call CBA_fnc_replace; - _author = [_author, "&", "&"] call CBA_fnc_replace; + private _author = getText (_x >> "author") call CBA_fnc_sanitizeHTML; _credits pushBack format ["%1%2 by %3", _name, _version, _author]; } forEach _addons; @@ -47,19 +41,13 @@ _mods = (_mods arrayIntersect _mods select {!isNumber (configfile >> "CfgMods" > _mods = _mods apply { private _entry = configfile >> "CfgMods" >> _x; - private _name = getText (_entry >> "name"); - _name = [_name, "<", "<"] call CBA_fnc_replace; - _name = [_name, ">", ">"] call CBA_fnc_replace; - _name = [_name, "&", "&"] call CBA_fnc_replace; + private _name = getText (_entry >> "name") call CBA_fnc_sanitizeHTML; if (isClass _entry) then { _x = format [" %1 - %2", configName _entry, _name]; if (isText (_entry >> "description")) then { - private _description = getText (_entry >> "description"); - _description = [_description, "<", "<"] call CBA_fnc_replace; - _description = [_description, ">", ">"] call CBA_fnc_replace; - _description = [_description, "&", "&"] call CBA_fnc_replace; + private _description = getText (_entry >> "description") call CBA_fnc_sanitizeHTML; _x = _x + format ["
%1", _description]; }; diff --git a/addons/main_a3/CfgMods.hpp b/addons/main_a3/CfgMods.hpp index 0d4474778..ce808b1e5 100644 --- a/addons/main_a3/CfgMods.hpp +++ b/addons/main_a3/CfgMods.hpp @@ -8,7 +8,7 @@ class CfgMods { 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"; + 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"; diff --git a/addons/strings/CfgFunctions.hpp b/addons/strings/CfgFunctions.hpp index 2e4dfae66..b48fac451 100644 --- a/addons/strings/CfgFunctions.hpp +++ b/addons/strings/CfgFunctions.hpp @@ -15,6 +15,7 @@ class CfgFunctions { PATHTO_FNC(split); PATHTO_FNC(strLen); PATHTO_FNC(trim); + PATHTO_FNC(sanitizeHTML); }; }; }; diff --git a/addons/strings/fnc_sanitizeHTML.sqf b/addons/strings/fnc_sanitizeHTML.sqf new file mode 100644 index 000000000..8aa90d89c --- /dev/null +++ b/addons/strings/fnc_sanitizeHTML.sqf @@ -0,0 +1,29 @@ +#include "script_component.hpp" +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_sanitizeHTML + +Description: + Replaces all < > and & with HTML character codes. + +Parameters: + _string - String to sanitize + +Returns: + Sanitized string + +Example: + (begin example) + "&
abc" call CBA_fnc_sanitizeHTML; // "<&>
abc" + (end) + +Author: + commy2 +--------------------------------------------------------------------------- */ + +params ["_string"]; + +_string = [_string, "&", "&"] call CBA_fnc_replace; +_string = [_string, "<", "<"] call CBA_fnc_replace; +_string = [_string, ">", ">"] call CBA_fnc_replace; + +[_string, "<br/>", "
"] call CBA_fnc_replace // return