Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*--------------------------------------------------------------------
- file: initAddon.sqf
- ==============
- Author: Liquid <wogames.info>
- Description: Init
- --------------------------------------------------------------------*/
- #define IDD_VIEWDISTMUTING 555000
- #define DIK_F1 0x3B
- #define DIK_F2 0x3C
- #define DIK_F3 0x3D
- #define DIK_F4 0x3E
- #define DIK_HOME 0xC7
- if (isDedicated) exitWith {};
- handler = compile preprocessFileLineNumbers "wog_volumeVDPresets\handler.sqf";
- sleep 1;
- waituntil {!isnull (finddisplay 46)};
- if (isNil "WOG_muted") then {
- missionNamespace setVariable ["WOG_muted", false];
- };
- if (isNil "WOG_initViewDistance") then {
- missionNamespace setVariable ["WOG_initViewDistance", round (viewDistance)];
- };
- _vdl = missionNamespace getVariable [ "ace_viewdistance_limit",(missionNamespace getVariable "WOG_initViewDistance") ];
- wog_limitvd = (_vdl min 10000) max 200;
- (findDisplay 46) displayAddEventHandler ["KeyDown", "[_this, wog_limitvd] call preset_hotkeys"];
- preset_hotkeys = {
- private ["_dik", "_shiftState", "_ctrlState", "_altState", "_return", "_lvd"];
- _return = false;
- _dik = (_this select 0) select 1;
- _shiftState = (_this select 0) select 2;
- _ctrlState = (_this select 0) select 3;
- _altState = (_this select 0) select 4;
- _lvd = _this select 1;
- if (!_shiftState && !_ctrlState && !_altState) then
- {
- switch (_dik) do
- {
- case DIK_F1:
- {
- ["changeViewDistance", missionNamespace getVariable ["WOG_vdPreset1", _lvd] ] spawn handler;
- _return = true;
- };
- case DIK_F2:
- {
- ["changeViewDistance", missionNamespace getVariable ["WOG_vdPreset2", round (_lvd/2)] ] spawn handler;
- _return = true;
- };
- case DIK_F3:
- {
- ["changeViewDistance", missionNamespace getVariable ["WOG_vdPreset3", round (_lvd/4)] ] spawn handler;
- _return = true;
- };
- case DIK_F4:
- {
- if (missionNamespace getVariable "WOG_muted") then
- {
- ["unmute", (profileNamespace getVariable ["WOG_mutelevel", 1]) ] spawn handler;
- }
- else
- {
- ["mute", (profileNamespace getVariable ["WOG_mutelevel", 0.5]) ] spawn handler;
- };
- _return = true;
- };
- };
- } else {
- if (!_shiftState && _ctrlState && !_altState) then
- {
- switch (_dik) do
- {
- case DIK_HOME:
- {
- if (isNull (findDisplay IDD_VIEWDISTMUTING)) then {
- _ok = createDialog "WOG_volumeVDPresetsDialog";
- _return = _ok;
- };
- };
- };
- };
- };
- _return;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement