Commit 9923d7af authored by Jan Speichert's avatar Jan Speichert
Browse files

Ability to hide/show stamina bar and stance indicator

parent 9fb06da7
......@@ -13,6 +13,18 @@
};
#endif
#ifdef DISABLE_COMPILE_CACHE
#define PREP(fncName) FUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf))
#else
#define PREP(fncName) FUNC(fncName) = QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) call SLX_XEH_COMPILE
#endif
/// PFH ////
////////////
#define KILLPFH [_this select 1] call CBA_fnc_removePerFrameHandler
// local event handler naming macro
#define NO_DEDICATED if(isDedicated) exitWith { }
......
#define MAJOR 1
#define MINOR 0
#define PATCHLVL 1
#define BUILD 3
#define BUILDDATE 2016-01-28 15:39:38.822000
\ No newline at end of file
#define BUILD 20
#define BUILDDATE 2016-02-09 12:28:06.033000
\ No newline at end of file
sol\clearhud\addons\stancina
class CfgDifficulties {
class Mercenary {
class Flags {
armor[] = {0,0};
friendlyTag[] = {0,0};
enemyTag[] = {0,0};
mineTag[] = {0,0};
hud[] = {0,1};//{1,1};
hudPerm[] = {0,0};
hudWp[] = {0,0};
hudWpPerm[] = {0,0};
stanceIndicator[] = {1,0};
staminaBar[] = {1,0};
autoSpot[] = {0,1};
map[] = {0,0};
weaponCursor[] = {0,1};//{1,1};
autoGuideAT[] = {0,0};
clockIndicator[] = {0,0};
3rdPersonView[] = {0,0};
autoAim[] = {0,0};
unlimitedSaves[] = {0,0};
deathMessages[] = {0,1};//{1,1};
netStats[] = {0,1};//{1,1};
vonID[] = {0,1};
cameraShake[] = {1,0};
hudGroupInfo[] = {0,0};
extendetInfoType[] = {0,0};
roughLanding[] = {0,0};
windEnabled[] = {1,0};
autoTrimEnabled[] = {0,0};
stressDamageEnabled[] = {1,0};
};
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_pre_init));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_post_init));
};
};
\ No newline at end of file
#include "script_component.hpp"
//For each client, register the keybind
[] call FUNC(registerKeybind);
GVAR(stanceShown) = profileNamespace getVariable [QUOTE(clearhud_stancina_stanceShown),false];
GVAR(staminaShown) = profileNamespace getVariable [QUOTE(clearhud_stancina_staminaShown),false];
[{
if!(isNull (findDisplay 46)) then {
if(time > 0) then {
if!(GVAR(stanceShown)) then {
[false] call FUNC(toggleStanceIndicator);
};
if!(GVAR(staminaShown)) then {
[false] call FUNC(toggleStaminaBar);
};
KILLPFH;
};
};
},0,[]] call cba_fnc_addPerFrameHandler
#include "script_component.hpp"
ADDON = false;
//Prepare all functions
PREP(registerKeybind);
PREP(handleStanceIndicator);
PREP(handleStaminaBar);
PREP(toggleStanceIndicator);
PREP(toggleStaminaBar);
GVAR(stanceShown) = false;
GVAR(staminaShown) = false;
//Dedicated Servers shall not pass!
NO_DEDICATED;
//Define a global variable, chat deactivated by default
//if(isNil QGVAR(activated)) then {
//GVAR(activated) = true;
//};
ADDON = true;
\ No newline at end of file
#include "script_component.hpp"
class CfgPatches
{
class ADDON
{
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"clearhud_main"};
version = VERSION;
author[] = {"Soldia"};
authorUrl = URL;
};
};
PRELOAD_ADDONS;
#include "CfgEventHandlers.hpp"
#include "CfgDifficulties.hpp"
\ No newline at end of file
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
private ["_status","_ret"];
PARAMS_5(_display,_dikCode,_shift,_ctrl,_alt);
_status = GVAR(staminaShown);
_ret = false;
//Handle toggling of the ui element
if (_status) then {
_ret = [false] call FUNC(toggleStaminaBar);
_status = false;
} else {
_ret = [true] call FUNC(toggleStaminaBar);
_status = true;
};
GVAR(staminaShown) = _status;
profileNamespace setVariable [QUOTE(clearhud_stancina_staminaShown),GVAR(staminaShown)];
_ret
\ No newline at end of file
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
private ["_status","_ret"];
PARAMS_5(_display,_dikCode,_shift,_ctrl,_alt);
_status = GVAR(stanceShown);
_ret = false;
//Handle toggling of the ui element
if (_status) then {
_ret = [false] call FUNC(toggleStanceIndicator);
_status = false;
} else {
_ret = [true] call FUNC(toggleStanceIndicator);
_status = true;
};
GVAR(stanceShown) = _status;
profileNamespace setVariable [QUOTE(clearhud_stancina_stanceShown),GVAR(stanceShown)];
_ret
\ No newline at end of file
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
private ["_addon", "_actionid", "_tooltip", "_description", "_key", "_modifier", "_keybind"];
//define all parameters for the cba keybinding
_addon = "Soldias Clearhud";
_actionid = "ToggleStamina";
_actionname = "Hide / Show Stamina Bar";
_tooltip = "Press to toggle the stamina bar visibility";
_key = DIK_COMMA;
_modifier = [false, true, false];
//initiate the cba keybind, will return the current keybind
_keybind = [_addon, _actionid,[_actionname,_tooltip], {_this call FUNC(handleStaminaBar)}, "", [_key, _modifier]] call CBA_fnc_addKeybind;
// ----------------------------------------------
// ----------------------------------------------
//define all parameters for the cba keybinding
_actionid = "ToggleStance";
_actionname = "Hide / Show Stance Indicator";
_tooltip = "Press to toggle the stance indicator visibility";
//_key = DIK_COMMA;
_modifier = [false, false, true];
//initiate the cba keybind, will return the current keybind
_keybind = [_addon, _actionid,[_actionname,_tooltip], {_this call FUNC(handleStanceIndicator)}, "", [_key, _modifier]] call CBA_fnc_addKeybind;
true
\ No newline at end of file
#include "script_component.hpp"
PARAMS_1(_action);
private ["_x","_y","_w","_h"];
private _staminaCTRL = ((uiNamespace getVariable "RscStaminaBar") displayCtrl 193);
if(_action) then {
_x = profilenamespace getvariable ["IGUI_GRID_STAMINA_X",((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 *(((safezoneW / safezoneH) min 1.2) / 40))];
_y = (profilenamespace getvariable ["IGUI_GRID_STAMINA_Y",(safezoneY + 4.05 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]);
_w = 10 * (((safezoneW / safezoneH) min 1.2) / 40);
_h = 1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25);
} else {
_x = 0;
_y = 0;
_w = 0;
_h = 0;
};
_staminaCTRL ctrlSetPosition [_x,_y,_w,_h];
_staminaCTRL ctrlCommit 0;
true
\ No newline at end of file
#include "script_component.hpp"
PARAMS_1(_action);
//params ["_action"];
{
private ["_xPos","_yPos","_wPos","_hPos"];
private _stanceCTRL = ((uiNamespace getVariable "RscStanceInfo") displayCtrl _x);
if(_action) then {
_xPos = profilenamespace getvariable ["IGUI_GRID_STANCE_X",((safezoneX + safezoneW) - (3.7 *(((safezoneW / safezoneH) min 1.2) / 40)) - 0.5 *(((safezoneW / safezoneH) min 1.2) / 40))];
_yPos = (profilenamespace getvariable ["IGUI_GRID_STANCE_Y",(safezoneY + 0.5 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]);
_wPos = 3.7 * (((safezoneW / safezoneH) min 1.2) / 40);
_hPos = 3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25);
} else {
_xPos = 0;
_yPos = 0;
_wPos = 0;
_hPos = 0;
};
_stanceCTRL ctrlSetPosition [_xPos,_yPos,_wPos,_hPos];
_stanceCTRL ctrlCommit 0;
} forEach [188,1201];
true
\ No newline at end of file
#include "..\script_component.hpp"
\ No newline at end of file
#define COMPONENT stancina
#include "\sol\clearhud\addons\main\script_mod.hpp"
//#define DEBUG_MODE_FULL
#include "\sol\clearhud\addons\main\script_macros.hpp"
\ No newline at end of file
......@@ -4,7 +4,7 @@
private ["_addon", "_actionid", "_tooltip", "_description", "_key", "_modifier", "_keybind"];
//define all parameters for the cba keybinding
_addon = "Soldias Chat Disabler";
_addon = "Soldias Clearhud";
_actionid = "SwitchChat";
_actionname = "Disable / Enable Chat";
_tooltip = "Press to toggle the chat suppression";
......@@ -12,6 +12,6 @@ _key = DIK_COMMA;
_modifier = [true, false, false];
//initiate the cba keybind, will return the current keybind
_keybind = [_addon, _actionid,[_actionname,_tooltip], {_this call clearhud_suppress_fnc_suppressChat}, "", [_key, _modifier]] call CBA_fnc_addKeybind;
_keybind = [_addon, _actionid,[_actionname,_tooltip], {_this call FUNC(suppressChat)}, "", [_key, _modifier]] call CBA_fnc_addKeybind;
true
\ No newline at end of file
#include "..\script_component.hpp"
\ No newline at end of file
3
\ No newline at end of file
20
\ No newline at end of file
1.0.1.3
\ No newline at end of file
1.0.1.20
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment