Skip to content

Commit

Permalink
Final watch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mazinskihenry committed Oct 14, 2024
1 parent acd85e3 commit d635ead
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 52 deletions.
24 changes: 24 additions & 0 deletions addons/vitals/functions/fnc_updateOpioidRelief.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "..\script_component.hpp"
/*
* Author: Glowbal, modified by Cplhardcore
* Update the opioid relief effect
*
* Arguments:
* 0: The Unit <OBJECT>
* 1: Opioid Relief Adjustments <NUMBER>
* 2: Time since last update <NUMBER>
* 3: Sync value? <BOOL>
*
* Return Value:
* None
*
* Example:
* [player, 0, 1, false] call kat_vitals_fnc_updateOpioidRelief
*
* Public: No
*/

params ["_unit", "_opioidAdjustment", "_deltaT", "_syncValue"];
_unit setVariable [QEGVAR(pharma,opioidFactor), _opioidAdjustment, _syncValue];


101 changes: 50 additions & 51 deletions addons/watch/RscTitles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@
// pixel grids macros
#define UI_GRID_W (pixelW * pixelGridBase)
#define UI_GRID_H (pixelH * pixelGridBase)
#define UI_GUTTER_W (pixelW * 2)
#define UI_GUTTER_H (pixelH * 2)

// sizes for our control
#define BOX_W (UI_GRID_W * 24)
#define BOX_H (UI_GRID_H * 24)
#define SAFEZONE_X_RIGHTEDGE ((safeZoneX - 1) * -1)
#define SAFEZONE_Y_LOWEDGE ((safeZoneY - 1) * -1)

#define KAT_WATCH_RESOLUTION_W (getResolution select 0)
#define KAT_WATCH_RESOLUTION_H (getResolution select 1)
#define FRAME_W(N) ((UI_GRID_W * (N)) * (1.7777 / (getResolution select 4)))
#define FRAME_H(N) ((UI_GRID_H * (N)))

class RscText;
class RscPicture;
Expand All @@ -49,10 +46,10 @@ class RscTitles
{
idc = 19800;
text = "\x\kat\addons\watch\UI\watch_katmin.paa";
x = QUOTE((KAT_WATCH_RESOLUTION_W - 300) / KAT_WATCH_RESOLUTION_W);
y = QUOTE((KAT_WATCH_RESOLUTION_H - 300) / KAT_WATCH_RESOLUTION_H);
w = QUOTE(BOX_W * (1.7777 / (getResolution select 4)));
h = QUOTE(BOX_H);
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(15));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(18.5));
w = QUOTE(FRAME_W(25));
h = QUOTE(FRAME_H(25));
};
class KatminIcon: KatminImage
{
Expand Down Expand Up @@ -89,13 +86,13 @@ class RscTitles
shadow = 0;
font = "PuristaBold";
text = "12:00"; //--- ToDo: Localize;
x = QUOTE((KAT_WATCH_RESOLUTION_W + 28) / KAT_WATCH_RESOLUTION_W);
y = QUOTE((KAT_WATCH_RESOLUTION_H + 58) / KAT_WATCH_RESOLUTION_H);
w = QUOTE((UI_GRID_W * 7) * (1.7777 / (getResolution select 4)));
h = QUOTE(UI_GRID_W * 2.5);
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(7.5));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(8.1));
w = QUOTE(FRAME_W(7.5));
h = QUOTE(FRAME_H(4));
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
sizeEx = QUOTE((UI_GRID_W * 4) * (1.7777 / (getResolution select 4)));
sizeEx = QUOTE(FRAME_H(3.1));
};
class KatminMonth: RscText
{
Expand All @@ -105,13 +102,13 @@ class RscTitles
shadow = 0;
font = "PuristaBold";
text = "JAN"; //--- ToDo: Localize;
x = QUOTE((KAT_WATCH_RESOLUTION_W + 274.8) / KAT_WATCH_RESOLUTION_W);
y = QUOTE((KAT_WATCH_RESOLUTION_H + 65.2) / KAT_WATCH_RESOLUTION_H);
w = "0.0257812 * safezoneW / ((getResolution select 5) * 1.7777)";
h = "0.013 * safezoneH / ((getResolution select 5) * 1.7777)";
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(0.8));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(7.3));
w = QUOTE(FRAME_W(2.5));
h = QUOTE(FRAME_H(1.5));
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
sizeEx = QUOTE(KAT_POS_H(0.8));
sizeEx = QUOTE(FRAME_H(1.3));
};
class KatminDay: RscText
{
Expand All @@ -121,13 +118,13 @@ class RscTitles
shadow = 0;
font = "PuristaBold";
text = "01"; //--- ToDo: Localize;
x = QUOTE((KAT_WATCH_RESOLUTION_W + 274.8) / KAT_WATCH_RESOLUTION_W);
y = QUOTE((KAT_WATCH_RESOLUTION_H + 97.84) / KAT_WATCH_RESOLUTION_H);
w = "0.0257812 * safezoneW / ((getResolution select 5) * 1.7777)";
h = "0.013 * safezoneH / ((getResolution select 5) * 1.7777)";
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(2));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(6.3));
w = QUOTE(FRAME_W(2.5));
h = QUOTE(FRAME_H(1.5));
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
sizeEx = QUOTE(KAT_POS_H(0.8));
sizeEx = QUOTE(FRAME_H(1.3));
};
class KatminBaro: RscText
{
Expand All @@ -137,13 +134,13 @@ class RscTitles
shadow = 0;
font = "PuristaBold";
text = "760"; //--- ToDo: Localize;
x = QUOTE((KAT_WATCH_RESOLUTION_W + 283.2) / KAT_WATCH_RESOLUTION_W);
y = QUOTE((KAT_WATCH_RESOLUTION_H + 10.4) / KAT_WATCH_RESOLUTION_H);
w = "0.020625 * safezoneW / ((getResolution select 5) * 1.7777)";
h = "0.022 * safezoneH / ((getResolution select 5) * 1.7777)";
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(1.2));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(8.8));
w = QUOTE(FRAME_W(2.5));
h = QUOTE(FRAME_H(1.5));
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
sizeEx = QUOTE(KAT_POS_H(0.95));
sizeEx = QUOTE(FRAME_H(1.4));
};
class KatminHR: RscText
{
Expand All @@ -153,13 +150,13 @@ class RscTitles
shadow = 0;
font = "PuristaBold";
text = "80"; //--- ToDo: Localize;
x = QUOTE((KAT_WATCH_RESOLUTION_W + 240.8) / KAT_WATCH_RESOLUTION_W);
y = QUOTE((KAT_WATCH_RESOLUTION_H + 131.8) / KAT_WATCH_RESOLUTION_H);
w = "0.020625 * safezoneW / ((getResolution select 5) * 1.7777)";
h = "0.022 * safezoneH / ((getResolution select 5) * 1.7777)";
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(2.2));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(4.7));
w = QUOTE(FRAME_W(2.5));
h = QUOTE(FRAME_H(1.5));
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
sizeEx = QUOTE(KAT_POS_H(1.2));
sizeEx = QUOTE(FRAME_H(1.8));
};
class KatminO2: RscText
{
Expand All @@ -169,13 +166,13 @@ class RscTitles
shadow = 0;
font = "PuristaBold";
text = "97"; //--- ToDo: Localize;
x = QUOTE((KAT_WATCH_RESOLUTION_W + 100.2) / KAT_WATCH_RESOLUTION_W);
y = QUOTE((KAT_WATCH_RESOLUTION_H + 131.8) / KAT_WATCH_RESOLUTION_H);
w = "0.020625 * safezoneW / ((getResolution select 5) * 1.7777)";
h = "0.022 * safezoneH / ((getResolution select 5) * 1.7777)";
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(5.5));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(4.7));
w = QUOTE(FRAME_W(2.5));
h = QUOTE(FRAME_H(1.5));
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
sizeEx = QUOTE(KAT_POS_H(1.2));
sizeEx = QUOTE(FRAME_H(1.8));
};
class KatminTemp: RscText
{
Expand All @@ -185,13 +182,13 @@ class RscTitles
shadow = 0;
font = "PuristaBold";
text = "76F"; //--- ToDo: Localize;
x = QUOTE((KAT_WATCH_RESOLUTION_W + 174.2) / KAT_WATCH_RESOLUTION_W);
y = QUOTE((KAT_WATCH_RESOLUTION_H + 10.4) / KAT_WATCH_RESOLUTION_H);
w = "0.020625 * safezoneW / ((getResolution select 5) * 1.7777)";
h = "0.022 * safezoneH / ((getResolution select 5) * 1.7777)";
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(3.7));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(8.8));
w = QUOTE(FRAME_W(2.5));
h = QUOTE(FRAME_H(1.5));
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
sizeEx = QUOTE(KAT_POS_H(1));
sizeEx = QUOTE(FRAME_H(1.4));
};
class KatminAltitude: RscText
{
Expand All @@ -201,11 +198,13 @@ class RscTitles
shadow = 0;
font = "PuristaBold";
text = "1000";
x = QUOTE((KAT_WATCH_RESOLUTION_W + 67.2) / KAT_WATCH_RESOLUTION_W);
y = QUOTE((KAT_WATCH_RESOLUTION_H + 10.4) / KAT_WATCH_RESOLUTION_H);
w = "0.020625 * safezoneW / ((getResolution select 5) * 1.7777)";
h = "0.022 * safezoneH / ((getResolution select 5) * 1.7777)";
sizeEx = QUOTE(KAT_POS_H(0.95));
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(6.4));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(8.8));
w = QUOTE(FRAME_W(2.5));
h = QUOTE(FRAME_H(1.5));
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
sizeEx = QUOTE(FRAME_H(1.4));
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion addons/watch/functions/fnc_showKWatch.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private _altitude = _display displayCtrl 22007;
_pfhID call CBA_fnc_removePerFrameHandler;
};

_compass ctrlSetAngle [(getDirVisual _unit), 0.5, 0.5, true];
_compass ctrlSetAngle [(linearConversion[0,360,(getDirVisual _unit),360,0]), 0.5, 0.5, true];
_compass ctrlCommit 0.1;
}, 0.05, [
_unit,
Expand Down

0 comments on commit d635ead

Please sign in to comment.