From d7db2e159cb211d11062df7afb9dd40a98b36451 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 7 Aug 2015 19:11:27 +0200 Subject: [PATCH] Split up into activity and quick view logs --- addons/medical_menu/XEH_preInit.sqf | 1 + .../functions/fnc_updateQuickViewLog.sqf | 42 +++++++++++++++++++ .../functions/fnc_updateUIInfo.sqf | 5 ++- addons/medical_menu/ui/menu.hpp | 20 ++++----- 4 files changed, 57 insertions(+), 11 deletions(-) create mode 100644 addons/medical_menu/functions/fnc_updateQuickViewLog.sqf diff --git a/addons/medical_menu/XEH_preInit.sqf b/addons/medical_menu/XEH_preInit.sqf index 0aa4a7ecc6..5d67d4429f 100644 --- a/addons/medical_menu/XEH_preInit.sqf +++ b/addons/medical_menu/XEH_preInit.sqf @@ -11,6 +11,7 @@ PREP(handleUI_DisplayOptions); PREP(handleUI_dropDownTriageCard); PREP(getTreatmentOptions); PREP(updateActivityLog); +PREP(updateQuickViewLog); PREP(updateBodyImage); PREP(updateInformationLists); PREP(setTriageStatus); diff --git a/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf new file mode 100644 index 0000000000..8ca81f28ed --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Update the quick view log + * + * Arguments: + * 0: display + * 1: log collection + * + * Return Value: + * None + * + * Example: + * [some_display, log] call ace_medical_menu_updateQuickViewLog + * + * Public: No + */ +#include "script_component.hpp" + +private "_logCtrl"; + +params ["_display", "_logs"]; + +_logCtrl = _display displayCtrl 215; +lbClear _logCtrl; + +{ + _x params ["_message", "_moment", "_dummy", "_arguments"]; + + if (isLocalized _message) then { + _message = localize _message; + }; + + { + if (typeName _x == "STRING" && {isLocalized _x}) then { + _arguments set [_foreachIndex, localize _x]; + }; + } forEach _arguments; + + _message = format ([_message] + _arguments); + _logCtrl lbAdd format ["%1 %2", _moment, _message]; + nil +} count _logs; diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf index d5c3b9eed6..3810e262c8 100644 --- a/addons/medical_menu/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -133,9 +133,12 @@ if (EGVAR(medical,level) >= 2) then { [_selectionBloodLoss, _display] call FUNC(updateBodyImage); [_display, _genericMessages, _allInjuryTexts] call FUNC(updateInformationLists); -_logs = _target getVariable [QEGVAR(medical,logFile_Activity), []]; +_logs = _target getVariable [QEGVAR(medical,logFile_activity_view), []]; [_display, _logs] call FUNC(updateActivityLog); +_logs = _target getVariable [QEGVAR(medical,logFile_quick_view), []]; +[_display, _logs] call FUNC(updateQuickViewLog); + _triageStatus = [_target] call EFUNC(medical,getTriageStatus); (_display displayCtrl 2000) ctrlSetText (_triageStatus select 0); (_display displayCtrl 2000) ctrlSetBackgroundColor (_triageStatus select 2); diff --git a/addons/medical_menu/ui/menu.hpp b/addons/medical_menu/ui/menu.hpp index db7e2cc3bb..60c970da70 100644 --- a/addons/medical_menu/ui/menu.hpp +++ b/addons/medical_menu/ui/menu.hpp @@ -437,10 +437,10 @@ class GVAR(medicalMenu) { class QuikViewLog: InjuryList { idc = 215; - style = 16; - type = 102; - rows=1; - colorBackground[] = {0, 0, 0, 1}; + //style = 16; + //type = 102; + //rows=1; + colorBackground[] = {0, 0, 0, 0}; x = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; y = "(19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; @@ -449,13 +449,13 @@ class GVAR(medicalMenu) { colorSelectBackground[] = {0, 0, 0, 0.0}; colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; - columns[] = {0.0, 0.08}; - canDrag=true; - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + //columns[] = {0.0, 0.08}; + //canDrag=true; + //arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + // arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; drawSideArrows = 0; - idcLeft = -1; - idcRight = -1; + //idcLeft = -1; + //idcRight = -1; }; class selectTriageStatus: ACE_gui_buttonBase {