-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Watch - Add KATMIN Exercise Watch (#578)
**When merged this pull request will:** - Adds watch which can monitor temperature, barometric pressure, heart rate, and SpO2 - [x] Add ability to switch between mmHg/hPA and F/C ### IMPORTANT - [Development Guidelines](https://ace3.acemod.org/wiki/development/) are read, understood and applied. - Title of this PR uses our standard template `Component - Add|Fix|Improve|Change|Make|Remove {changes}`. --------- Co-authored-by: MiszczuZPolski <[email protected]>
- Loading branch information
1 parent
e35ecb2
commit df80908
Showing
18 changed files
with
520 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
x\kat\addons\watch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; | ||
|
||
class Extended_PostInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_postInit)); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CfgWeapons { | ||
class ItemWatch; | ||
class KAT_Katmin: ItemWatch { | ||
ACE_hideItemType = "Watch"; | ||
author = "Mazinski"; | ||
descriptionShort = CSTRING(KatminDescription); | ||
displayName = CSTRING(KatminDisplayName); | ||
picture = QPATHTOF(UI\watch_katmin.paa); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
#define KAT_WATCH_GRID_WAbs (((safezoneW / safezoneH) min 0.7)) | ||
#define KAT_WATCH_GRID_HAbs ((((safezoneW / safezoneH) min 1.2) / 1.6)) | ||
#define KAT_WATCH_GRID_W ((((safeZoneW / safeZoneH) min 0.7) / 40)) | ||
#define KAT_WATCH_GRID_H (((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)) | ||
#define KAT_WATCH_GRID_X ((safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2)) / 11)) | ||
#define KAT_WATCH_GRID_Y ((safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2)) / 0.8)) | ||
|
||
#define KAT_POS_H(N) ((N) * KAT_WATCH_GRID_H) | ||
|
||
#define ST_LEFT 0 | ||
#define ST_CENTER 2 | ||
#define ST_RIGHT 1 | ||
|
||
class RscText; | ||
class RscPicture; | ||
class RscButton; | ||
class RscTitles | ||
{ | ||
class KAT_Katmin | ||
{ | ||
idd = 19935; | ||
enableSimulation = 1; | ||
movingEnable = 0; | ||
fadeIn=0; | ||
fadeOut=1; | ||
duration = 10e10; | ||
onLoad = "uiNamespace setVariable ['KAT_Katmin', _this select 0];"; | ||
class controls | ||
{ | ||
class KatminImage: RscPicture | ||
{ | ||
idc = 19800; | ||
text = "\x\kat\addons\watch\UI\watch_katmin.paa"; | ||
x = "0.0328437 * safezoneW + safezoneX"; | ||
y = "0.652 * safezoneH + safezoneY"; | ||
w = "0.225 * safezoneW"; | ||
h = "0.4 * safezoneH"; | ||
}; | ||
class KatminIcon: KatminImage | ||
{ | ||
idc = 19802; | ||
text = "\x\kat\addons\watch\UI\watch_icon.paa"; | ||
}; | ||
class KatminSun: KatminImage | ||
{ | ||
idc = 19803; | ||
text = "\x\kat\addons\watch\UI\watch_sun.paa"; | ||
show = 0; | ||
}; | ||
class KatminOvercast: KatminImage | ||
{ | ||
idc = 19804; | ||
text = "\x\kat\addons\watch\UI\watch_overcast.paa"; | ||
show = 0; | ||
}; | ||
class KatminRain: KatminImage | ||
{ | ||
idc = 19805; | ||
text = "\x\kat\addons\watch\UI\watch_rain.paa"; | ||
show = 0; | ||
}; | ||
class KatminCompass: KatminImage | ||
{ | ||
idc = 19806; | ||
text = "\x\kat\addons\watch\UI\watch_katmin_direction.paa"; | ||
}; | ||
class KatminTime: RscText | ||
{ | ||
idc = 22000; | ||
style = ST_CENTER; | ||
shadow = 0; | ||
font = "PuristaBold"; | ||
text = "12:00"; //--- ToDo: Localize; | ||
x = "0.104 * safezoneW + safezoneX"; | ||
y = "0.8328 * safezoneH + safezoneY"; | ||
w = "0.061875 * safezoneW"; | ||
h = "0.033 * safezoneH"; | ||
colorBackground[] = {0,0,0,0}; | ||
colorText[] = {1,1,1,1}; | ||
sizeEx = QUOTE(KAT_POS_H(2)); | ||
}; | ||
class KatminMonth: RscText | ||
{ | ||
idc = 22001; | ||
style = ST_RIGHT; | ||
valign = "middle"; | ||
shadow = 0; | ||
font = "PuristaBold"; | ||
text = "JAN"; //--- ToDo: Localize; | ||
x = "0.157316 * safezoneW + safezoneX"; | ||
y = "0.8394 * safezoneH + safezoneY"; | ||
w = "0.0257812 * safezoneW"; | ||
h = "0.013 * safezoneH"; | ||
colorBackground[] = {0,0,0,0}; | ||
colorText[] = {1,1,1,1}; | ||
sizeEx = QUOTE(KAT_POS_H(0.8)); | ||
}; | ||
class KatminDay: RscText | ||
{ | ||
idc = 22002; | ||
style = ST_RIGHT; | ||
valign = "middle"; | ||
shadow = 0; | ||
font = "PuristaBold"; | ||
text = "01"; //--- ToDo: Localize; | ||
x = "0.157316 * safezoneW + safezoneX"; | ||
y = "0.8525 * safezoneH + safezoneY"; | ||
w = "0.0257812 * safezoneW"; | ||
h = "0.013 * safezoneH"; | ||
colorBackground[] = {0,0,0,0}; | ||
colorText[] = {1,1,1,1}; | ||
sizeEx = QUOTE(KAT_POS_H(0.8)); | ||
}; | ||
class KatminBaro: RscText | ||
{ | ||
idc = 22003; | ||
style = ST_CENTER; | ||
valign = "middle"; | ||
shadow = 0; | ||
font = "PuristaBold"; | ||
text = "760"; //--- ToDo: Localize; | ||
x = "0.158625 * safezoneW + safezoneX"; | ||
y = "0.80844 * safezoneH + safezoneY"; | ||
w = "0.020625 * safezoneW"; | ||
h = "0.022 * safezoneH"; | ||
colorBackground[] = {0,0,0,0}; | ||
colorText[] = {1,1,1,1}; | ||
sizeEx = QUOTE(KAT_POS_H(0.95)); | ||
}; | ||
class KatminHR: RscText | ||
{ | ||
idc = 22004; | ||
style = ST_CENTER; | ||
valign = "middle"; | ||
shadow = 0; | ||
font = "PuristaBold"; | ||
text = "80"; //--- ToDo: Localize; | ||
x = "0.149375 * safezoneW + safezoneX"; | ||
y = "0.8732 * safezoneH + safezoneY"; | ||
w = "0.020625 * safezoneW"; | ||
h = "0.022 * safezoneH"; | ||
colorBackground[] = {0,0,0,0}; | ||
colorText[] = {1,1,1,1}; | ||
sizeEx = QUOTE(KAT_POS_H(1.2)); | ||
}; | ||
class KatminO2: RscText | ||
{ | ||
idc = 22005; | ||
style = ST_CENTER; | ||
valign = "middle"; | ||
shadow = 0; | ||
font = "PuristaBold"; | ||
text = "97"; //--- ToDo: Localize; | ||
x = "0.118469 * safezoneW + safezoneX"; | ||
y = "0.8732 * safezoneH + safezoneY"; | ||
w = "0.020625 * safezoneW"; | ||
h = "0.022 * safezoneH"; | ||
colorBackground[] = {0,0,0,0}; | ||
colorText[] = {1,1,1,1}; | ||
sizeEx = QUOTE(KAT_POS_H(1.2)); | ||
}; | ||
class KatminTemp: RscText | ||
{ | ||
idc = 22006; | ||
style = ST_CENTER; | ||
valign = "middle"; | ||
shadow = 0; | ||
font = "PuristaBold"; | ||
text = "76F"; //--- ToDo: Localize; | ||
x = "0.134937 * safezoneW + safezoneX"; | ||
y = "0.8094 * safezoneH + safezoneY"; | ||
w = "0.020625 * safezoneW"; | ||
h = "0.022 * safezoneH"; | ||
colorBackground[] = {0,0,0,0}; | ||
colorText[] = {1,1,1,1}; | ||
sizeEx = QUOTE(KAT_POS_H(1)); | ||
}; | ||
class KatminAltitude: RscText | ||
{ | ||
idc = 22007; | ||
style = ST_CENTER; | ||
valign = "middle"; | ||
shadow = 0; | ||
font = "PuristaBold"; | ||
text = "1000"; | ||
x = "0.111219 * safezoneW + safezoneX"; | ||
y = "0.80844 * safezoneH + safezoneY"; | ||
w = "0.020625 * safezoneW"; | ||
h = "0.022 * safezoneH"; | ||
sizeEx = QUOTE(KAT_POS_H(0.95)); | ||
}; | ||
}; | ||
}; | ||
}; |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PREP(hideKWatch); | ||
PREP(showKWatch); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "script_component.hpp" | ||
|
||
if (!hasInterface) exitWith {}; | ||
|
||
["KAT Watch", QGVAR(showKatmin), "Show Katmin", { | ||
// Conditions: canInteract | ||
if (!([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call ACEFUNC(common,canInteractWith)) || {!('KAT_Katmin' in assignedItems ACE_player)}) exitWith { false }; | ||
|
||
if !(GETMVAR(GVAR(KatminActive),false)) then { | ||
[ACE_player] call FUNC(showKWatch); | ||
} else { | ||
call FUNC(hideKWatch); | ||
}; | ||
|
||
true | ||
}, { false }, [24, [false, false, false]], false] call CBA_fnc_addKeybind; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
PREP_RECOMPILE_START; | ||
#include "XEH_PREP.hpp" | ||
PREP_RECOMPILE_END; | ||
|
||
ADDON = true; | ||
|
||
#define CBA_SETTINGS_CAT "KAT - ADV Medical: Watch" | ||
|
||
[ | ||
QGVAR(temperatureUnit), | ||
"LIST", | ||
[LLSTRING(SETTING_TemperatureForm), LLSTRING(SETTING_TemperatureForm_Desc)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[[0, 1], [LLSTRING(SETTING_TemperatureForm_Celcius), LLSTRING(SETTING_TemperatureForm_Fahrenheit)], 0], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(pressureUnit), | ||
"LIST", | ||
[LLSTRING(SETTING_PressureForm), LLSTRING(SETTING_PressureForm_Desc)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[[0, 1], [LLSTRING(SETTING_PressureForm_mmHg), LLSTRING(SETTING_PressureForm_hPa)], 0], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(altitudeUnit), | ||
"LIST", | ||
[LLSTRING(SETTING_AltitudeForm), LLSTRING(SETTING_AltitudeForm_Desc)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[[0, 1], [LLSTRING(SETTING_AltitudeForm_meters), LLSTRING(SETTING_AltitudeForm_feet)], 0], | ||
true | ||
] call CBA_Settings_fnc_init; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "script_component.hpp" | ||
|
||
class CfgPatches { | ||
class ADDON { | ||
name = COMPONENT_NAME; | ||
requiredVersion = REQUIRED_VERSION; | ||
units[] = { }; | ||
weapons[] = { | ||
"KAT_Katmin" | ||
}; | ||
magazines[] = { }; | ||
requiredAddons[] = { | ||
"kat_main", | ||
"ace_medical", | ||
"ace_medical_ai", | ||
"ace_medical_blood", | ||
"ace_medical_damage", | ||
"ace_medical_engine", | ||
"ace_medical_feedback", | ||
"ace_medical_gui", | ||
"ace_medical_statemachine", | ||
"ace_medical_status", | ||
"ace_medical_treatment", | ||
"ace_medical_vitals", | ||
"ace_dogtags", | ||
"cba_settings" | ||
}; | ||
author = "Mazinski"; | ||
authors[] = {"Mazinski"}; | ||
url = ECSTRING(main,URL); | ||
VERSION_CONFIG; | ||
}; | ||
}; | ||
|
||
#include "CfgEventHandlers.hpp" | ||
#include "CfgWeapons.hpp" | ||
#include "RscTitles.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Garth 'L-H' de Wet | ||
* Modified: Mazinski | ||
* Removes the KWatch from the screen. | ||
* | ||
* Arguments: | ||
* None | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* call kat_watch_fnc_hideKWatch | ||
* | ||
* Public: No | ||
*/ | ||
GVAR(KatminActive) = false; | ||
"KAT_Katmin" cutText ["","PLAIN",0,true]; |
Oops, something went wrong.