E-Pad + Earplugs (WIP)

First Test of the E-Pad.
Current Apps are only examples
Everybody is welcome to add suggestions for Scripts / Apps.
This commit is contained in:
He-Man 2018-06-21 21:59:37 +02:00
parent 9915cb1939
commit 2f1ba9a20d
33 changed files with 1637 additions and 2 deletions

View File

@ -23,13 +23,13 @@
5 createVehicleLocal !="\"Sign_Arrow_Direction_Yellow_F\" createVehicleLocal" !="\"#particlesource\" createVehicleLocal" !="\"#lightpoint\" createVehicleLocal" !="\"BloodSplat\" createVehicleLocal" !="[\"lightning1_F\", \"lightning2_F\"] call BIS_fnc_selectRandom;\n_lighting = _class createVehicleLocal" !="SLX_XEH_DUMMY createVehicleLocal [0, 0, 0];" !="CBA_eventHandlers = \"Logic\" createVehicleLocal [0, 0];"
5 createUnit !="_driver = _grp createUnit[\"I_UAV_AI\", position _unit, [], 0, \"CAN_COLLIDE\"];" !="axeGeneral = grpVIPGeneral createUnit [\"I_officer_F\", axeGeneralPos, [], 1, \"CAN_COLLIDE\"];" !="bis_functions_mainscope = _grpLogic createunit [\"Logic\",[9,9,9],[],0,\"none\"];" !="_unit = _grp createUnit[selectRandom _arrUnits, _pos, [], 0, \"FORM\"];" !="_driver = (group player) createUnit[\"I_UAV_AI\", position axeUAV, [], 0, \"CAN_COLLIDE\"];"
5 createAgent !="bis_revive_ratioLethal = createAgent [\"Logic\", [10,10,0], [], 0, \"CAN_COLLIDE\"];" !="_unit = createAgent[_unitClass, _targetPos, [], 256, \"FORM\"];" !="_unit = createAgent [_unitClass, _targetPos, [], 120, \"FORM\"];" !="_animal = createAgent[_randomAIClass, _animalPos, [], 5, \"NONE\"];" !="_unit = createAgent [\"Epoch_Cloak_F\", _pos, [], 0, \"CAN_COLLIDE\"];" !="_unit = createAgent [\"Epoch_Sapper_F\", _targetPos, [], 180, \"FORM\"];" !="_sapper = createAgent [\"Epoch_Sapper_F\", getPos _cage2, [], 0, \"FORM\"];" !="_unit = createAgent[_unitClass, position player, [], _zRange, \"FORM\"];" !="_animal = createAgent[_randomAIClass, _animalPos, [], 0, \"CAN_COLLIDE\"];" !="_axeSapper = createAgent [\"Epoch_Sapper_F\", _pos, [], 12, \"FORM\"];" !="_nestMate = createAgent [\"Epoch_Sapper_F\", _garrPos, [], 0, \"FORM\"];"
5 createDialog !="createdialog 'Epoch_CamDialog'" !="createDialog \"rmx_dynamenu\";" !="createDialog \"rmx_craftingUI\";" !="createDialog \"QuickUpgrade\";" !="createDialog \"QuickTake\";" !="createDialog \"InteractBank\";" !="createdialog \"SelectGender\";" !="_handled = createdialog _dialog;" !="if !(createdialog \"InteractItem\") exitWith {};" !="createDialog _tapDiag;" !="if !(createdialog \"Trade\") exitWith {};" !="_ok = createdialog \"Interact\";" !="_ok = createdialog \"TradeNPCMenu\";" !="createDialog \"Epoch_myGroup\";" !="createDialog (if ((Epoch_my_GroupUID == \"\") && (Epoch_my_Group isEqualTo [])) then {\"EPOCH_createGrp\"} else {\"Epoch_myGroup\"});" !="createDialog \"GroupRequests\";" !="_ok = createdialog \"MissionSelect\";" !="createDialog 'Skaronator_AdminMenu';" !="createDialog \"Epoch_myTempGroup\";" !="createDialog (if ((Epoch_my_tempGroupUID == \"\") && (Epoch_my_tempGroup isEqualTo [])) then {\"EPOCH_createTempGrp\"} else {\"Epoch_myTempGroup\"});" !="createDialog \"tempGroupRequests\";"
5 createDialog !="createDialog 'server_info_picture'" !="createdialog 'epoch_tablet_gui'" !="createdialog 'Epoch_CamDialog'" !="createDialog \"rmx_dynamenu\";" !="createDialog \"rmx_craftingUI\";" !="createDialog \"QuickUpgrade\";" !="createDialog \"QuickTake\";" !="createDialog \"InteractBank\";" !="createdialog \"SelectGender\";" !="_handled = createdialog _dialog;" !="if !(createdialog \"InteractItem\") exitWith {};" !="createDialog _tapDiag;" !="if !(createdialog \"Trade\") exitWith {};" !="_ok = createdialog \"Interact\";" !="_ok = createdialog \"TradeNPCMenu\";" !="createDialog \"Epoch_myGroup\";" !="createDialog (if ((Epoch_my_GroupUID == \"\") && (Epoch_my_Group isEqualTo [])) then {\"EPOCH_createGrp\"} else {\"Epoch_myGroup\"});" !="createDialog \"GroupRequests\";" !="_ok = createdialog \"MissionSelect\";" !="createDialog 'Skaronator_AdminMenu';" !="createDialog \"Epoch_myTempGroup\";" !="createDialog (if ((Epoch_my_tempGroupUID == \"\") && (Epoch_my_tempGroup isEqualTo [])) then {\"EPOCH_createTempGrp\"} else {\"Epoch_myTempGroup\"});" !="createDialog \"tempGroupRequests\";"
5 createDisplay !="createDisplay \"rmx_dynamenu\";" !="createDisplay \"rmx_moveDynamicHUD\";" !="_parent createdisplay _displayClass;" !="finddisplay 151 createdisplay 'RscDisplayOptionsLayout'" !="_display createdisplay \"RscDisplayDLCPreview\";"
5 deleteMarker !="deleteMarkerLocal _mName;"
5 setMarker !="CBA_fnc_setMarkerPersistent\"" !="\\fnc_setMarkerPersistent" !="\"setMarkerPersistent" !="_mName setMarkerShapeLocal _mShape;" !="_mName setMarkerTypeLocal _mType;" !="(_x select 0) setMarkerPosLocal (position player);" !="_zoomMarker setMarkerSizeLocal"
5 createMarker !="CBA_fnc_createMarker\"" !="\\fnc_createMarker" !="\"createMarker" !="cba_fCreateMarker" !="createMarkerLocal [_mName, _mPos];"
5 assignItem !="axeVIP assignItem _item;" !="unassignItem"
5 ctrlSetEventHandler !="_ctrlButtonOK ctrlseteventhandler [\"buttonclick\"," !="ctrlSetEventHandler ['LBDblClick', '_this call" !="_buttonRespawn ctrlseteventhandler [\"buttonclick\",\"with uinamespace do {['buttonRespawn'," !="_ctrl ctrlSetEventHandler [\"mouseEnter\"" !="_ctrlBtn ctrlSetEventHandler [\"MouseButtonDblClick\", _verAct];" !="_button_gen ctrlSetEventHandler [\"ButtonClick\",_btn_code + \"(uiNamespace getVariable [\"" !="t \"#(rgb,8,8,3)color(1,1,1,0.1)\";\n_c ctrlCommit 0;\n_c ctrlSetEventHandler [\"MouseButtonUp\",format[\"['remove',%1,(_this select 1)"
5 ctrlSetEventHandler !="ctrlSetEventHandler [\"mouseButtonDown\", _action];" !="_ctrlButtonOK ctrlseteventhandler [\"buttonclick\"," !="ctrlSetEventHandler ['LBDblClick', '_this call" !="_buttonRespawn ctrlseteventhandler [\"buttonclick\",\"with uinamespace do {['buttonRespawn'," !="_ctrl ctrlSetEventHandler [\"mouseEnter\"" !="_ctrlBtn ctrlSetEventHandler [\"MouseButtonDblClick\", _verAct];" !="_button_gen ctrlSetEventHandler [\"ButtonClick\",_btn_code + \"(uiNamespace getVariable [\"" !="t \"#(rgb,8,8,3)color(1,1,1,0.1)\";\n_c ctrlCommit 0;\n_c ctrlSetEventHandler [\"MouseButtonUp\",format[\"['remove',%1,(_this select 1)"
5 addEventHandler !"displayAddEventHandler" !"ctrlAddEventHandler" !="player addeventhandler [\"PostReset\",{BIS_EnginePPReset = true;} ];" !="player addEventHandler [_x,([\"CfgEpochClient\", _x, \"\"] call EPOCH_fnc_returnConfigEntryV2)];" !="\"CBA_fnc_addEventHandler\"" !="\\fnc_addEventHandler" !="\"addEventHandler" !="_eventFunc = _eventFunc + \"(_this select 0) addEventHandler ['Respawn', \" + str _eventFunc + \"];\";" !="_unit addEventHandler [\"hitpart\"," !="CBA_fnc_addEventHandler" !="_unit addEventHandler [_x, format ['call cba_xeh_fnc_%1', _x]];" !="_ship addEventHandler [\"AttributesChanged3DEN\"" !="addEventHandler [\"HandleDamage\",bis_fnc_reviveOnPlayerHandleDamage];" !="_unit addEventHandler [\"FiredNear\"" !="_smokeEH = _plyr addEventHandler [\"FiredNear\", \"airDropHandle setFSMVariable" !="_onContactEH = _currentTarget addEventHandler[\"EpeContactStart"" !="_object addeventhandler [\"local\",{[[_this select 0],\"bis_fnc_objectVar\""
5 displayAddEventHandler !="(findDisplay 46) displayAddEventHandler [\"KeyDown\",\"true\"];" !="displayAddEventHandler [_x,([\"CfgEpochClient\", _x, \"\"] call EPOCH_fnc_returnConfigEntryV2)];" !="displayaddeventhandler [\"mousemoving\"," !="_display displayaddeventhandler [\"unload\",\"uinamespace setvariable ['BIS_fnc_guiMess" !="findDisplay -1337 displayAddEventHandler ['Unload'" !="_display displayaddeventhandler [\"keydown\",\"with uinamespace do {['keyDown'" !="_display displayaddeventhandler [_x,_fnc_animate];" !="Development\") then\n{\n_display displayaddeventhandler [\n\"keydown\"" !="CBA_fnc_addDisplayHandler" !="_display displayAddEventHandler [\"MouseMoving" !="private _handler = _display displayAddEventHandler [_key, _code];" !="_display displayAddEventHandler [\"KeyDown\", \"_this call cba_keybinding_fnc_onKeyDown\"" !="isplay 602};\n\n_display = (findDisplay 602);\n_display displayAddEventHandler [\"MouseButtonUp\",\"[] spawn {rmx_var_fav_selected = f" !="displayaddeventhandler\n[\n\"mousemoving\""
5 ctrlAddEventHandler !="_control = _display displayctrl 37305; \n_control ctrladdeventhandler" !="_ctrlMap = _display displayctrl 101;\n_ctrlMap ctrladdeventhandler" !="_display displayctrl 21995;\n_assetsButton ctrladdeventhandler [\"buttonclick\"," !="_display displayctrl 2406; \n_control ctrladdeventhandler [\"buttonclick\"," !="_display displayctrl 2400;\n_control ctrladdeventhandler [\"buttonclick\"," !="ctrladdeventhandler [\"lbselchanged\"," !="ctrladdeventhandler [\n\"lbselchanged\"," !="_ButtonGeneral ctrladdeventhandler [\"buttonclick\"," !="_ctrlExecuteLocal ctrladdeventhandler [\"buttonclick\"," !="_bg ctrlAddEventHandler [\"MouseEnter\"," !="_container ctrlAddEventHandler [\"LBDblClick\",\"_this call EPOCH_itemInteractClick\"];" !="(uiNamespace getVariable 'ESP_map') ctrlAddEventHandler['Draw', '_esp_targets = EPOCH_ESPMAP_TARGETS;" !="ctrlAddEventHandler ['MouseButtonDown'" !="_ctrl ctrlSetEventHandler [\"mouseEnter\", (format [\"_c = _this select 0;" !="_ctrl ctrlSetEventHandler [\"mouseExit\", (format [\"_c = _this select 0;" !="_ctrl ctrlSetEventHandler [\"mouseButtonDown\", (format [\"call %1;\",(_buttonSettings select _e select 2)])];" !="_prevButton ctrlAddEventHandler [\"MouseButtonUp\", {_this call cba_diagnostic_fnc_debug" !="BIS_RscRespawnControlsMap_ctrlHeaderRespawnButton ctrlAddEventhandler [\"ButtonDown\"" !="_control = _display displayctrl 105;\n_control ctrladdeventhandler [\"MouseButtonUp\"" !="ctrlHeaderRespawnButton\", controlNull]) ctrlAddEventhandler [\"ButtonDown\"" !="_selected = false;\n{\n_c = _display displayCtrl _x;\n_c ctrlAddEventHandler [\"LBDrag\",\"rmx_var_favBar_Item = (_this call epoch_fav" !="_ctrlMouseArea ctrladdeventhandler [\"setfocus\",{with uinamespace do {[\"dlcClear\",[ctrlpar" !="13484 ctrlAddEventHandler [\"ButtonClick\", {[\"executeButton\","

View File

@ -22,4 +22,9 @@ if (_unit == player) then {
["BUILD MODE: DISABLED", 5] call Epoch_message;
EPOCH_Target = objNull;
};
if (missionnamespace getvariable ["EPOCH_AutoEarplug",false]) then {
systemchat 'Earplugs have been auto-inserted...';
EPOCH_Earplugsin = true;
1 fadeSound 0.15;
};
};

View File

@ -36,4 +36,9 @@ if (_unit == player) then {
};
} forEach lineintersectsobjs [_start, _end, player, _vehicle, true, 2];
};
if (missionnamespace getvariable ["EPOCH_AutoEarplug",false]) then {
systemchat 'Earplugs have been auto-removed...';
EPOCH_Earplugsin = false;
1 fadeSound 1;
};
};

View File

@ -99,6 +99,13 @@ if (_dikCode == EPOCH_keysDebugMon) then {
_handled = true;
};
// E-Pad
if (_dikCode == EPOCH_keysEPad) then {
if (isnull (finddisplay 9898)) then {
createdialog 'epoch_tablet_gui';
};
};
//Action Menu
if (_dikCode == EPOCH_keysAction) then {
//_handled = true;
@ -248,6 +255,16 @@ if (vehicle player == player) then {
player switchMove "";
};
};
if (_dikCode == EPOCH_Earplugs) then {
if (EPOCH_Earplugsin) then {
EPOCH_Earplugsin = false;
1 fadeSound 1;
}
else {
EPOCH_Earplugsin = true;
1 fadeSound 0.15;
};
};
}; // end player only code
EPOCH_favBar_itemConsumed = false;

View File

@ -69,3 +69,42 @@ if (_r3fON || _advSling)then{
inGameUISetEventHandler ["Action", "if(!(_this isEqualTo []) && !(_this select 10 in ['PrevAction','NextAction']))then{_this call EPOCH_handleUIActions}"];
//inGameUISetEventHandler ["NextAction", "_this call EPOCH_handleUIActions"];
//inGameUISetEventHandler ["PrevAction", "_this call EPOCH_handleUIActions"];
// Load / Overwrite Vars from ProfileNamespace
_cfg = "e_pad_config" call EPOCH_returnConfig;
_startvars = getarray (_cfg >> "LoadVarsFromProfile");
_arr = profilenamespace getvariable ["Epoch_ToggleVars",[[],[]]];
_todelete = [];
{
_x params ["_varname",["_default","false",[""]]];
if (_varname isequaltype "" && !(_varname isequalto "")) then {
_value = if ((tolower _default) isequalto "true") then {true} else {false};
_find = (_arr select 0) find _varname;
if (_find > -1) then {
_tmpvalue = (_arr select 1 select _find);
if (_tmpvalue isequaltype true) then {
_value = _tmpvalue;
}
else {
_todelete pushback _x;
};
}
else {
(_arr select 0) pushback _varname;
(_arr select 1) pushback _default;
};
missionnamespace setvariable [_varname,_value];
};
} foreach _startvars;
{
_find = (_arr select 0) find _x ;
if (_find > -1) then {
(_arr select 0) deleteat _find;
(_arr select 1) deleteat _find;
};
} foreach _todelete;
if !(_arr isequalto (profilenamespace getvariable ["Epoch_ToggleVars",[[],[]]])) then {
profilenamespace setvariable ["Epoch_ToggleVars",_arr];
saveprofilenamespace;
};

View File

@ -32,7 +32,9 @@ _keyMap =
["Action","EPOCH_keysAction",0x39],
["Holster Weapon", "EPOCH_keysHolster", 35],
["Debug Monitor", "EPOCH_keysDebugMon", 41],
["E-Pad", "EPOCH_keysEPad", 0x44],
["AutoRun", "EPOCH_keysAutoRun", 0x11],
["Earplugs", "EPOCH_Earplugs", 0x3E],
["Volume + (ctrl)","EPOCH_keysVolumeUp",0x0D],
["Volume - (ctrl)","EPOCH_keysVolumeDown",0x0C],

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,40 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta charset="UTF-8">
<title>E_Pad</title>
<meta name="robots" content="noindex">
<style type="text/css">
a {
color: #FFCC00;
}
a:visited {
color: #FFCC00;
}
.auto-style1 {
color: #FF0000;
font-weight: bold;
}
.auto-style2 {
color: #FF0000;
}
.auto-style3 {
color: #FF0000;
font-weight: bold;
font-size: large;
}
</style>
</head>
<body style="color: #FFFF00)">
<p>
<span class="auto-style2"><b>Our Servers:</b></span><br>
Homepage: <a href="http://epochmod.com" target="_blank">EpochMod.com</a><br>
Discord: <a href="https://discord.gg/0k4ynDDCsnMzkxk7" target="_blank">EpochMod Discord</a><br>
FaceBook: <a href="https://www.facebook.com/EpochMod/" target="_blank">https://www.facebook.com/EpochMod/</a><br>
</p>
<p>
<span class="auto-style2"><b>News</b></span><br>
- Added E-Pad<br>
</p>
</body>
</html>

View File

@ -0,0 +1,14 @@
//[[[cog import generate_private_arrays ]]]
private ["_plyr","_plyrs","_trdrMsg"];
//[[[end]]]
_trdrMsg = "Do I look like the local Neighbourhood Watch..? No, I do not !";
_plyrs = [];
_plyrs = player nearEntities [["Epoch_Man_base_F","Epoch_Female_base_F"], 250];
if (count _plyrs < 2) then {
_trdrMsg = format["Apart from you %1. %2",name player, selectRandom ["I haven't seen any round these parts for a long while.","It has been very quiet around here,","There is not much to report !"]];
} else {
_plyrs deleteAt 0;
_plyr = selectRandom _plyrs;
_trdrMsg = format["%2 %1.",name _plyr, selectRandom ["The last person picked up by the UAV was","I did spot someone earlier, their name was","I heard there was somebody new in the area, "]];
};
[_trdrMsg, 5,[[0,0,0,0.5],[1,0.5,0,1]]] call Epoch_message;

View File

@ -0,0 +1,15 @@
//[[[cog import generate_private_arrays ]]]
private ["_dist","_plyr","_trdrMsg","_veh","_vehs"];
//[[[end]]]
_trdrMsg = "Hey, there is a garage down the road.. Well, there used to be.";
_vehs = [];
_plyr = player;
_vehs = nearestObjects [_plyr, ["CAR","AIR"], 1000];
if (count _vehs < 1) then {
_trdrMsg = format["%2 %1.",name _plyr,selectRandom["I haven't seen anything lately","There is nothing around here","The last time the UAV went out it found nothing"]];
} else {
_veh = _vehs select (floor (random count _vehs));
_dist = _veh distance _plyr;
_trdrMsg = format["I know of at least one vehicle within about %1m. It looks like a %2.",round (_dist/2 + (random _dist)) , (typeof _veh) call EPOCH_itemDisplayName];
};
[_trdrMsg, 5,[[0,0,0,0.5],[1,0.5,0,1]]] call Epoch_message;

View File

@ -0,0 +1,17 @@
private _newsArr = [
"My dog was shot. That made me sad.",
"Business has been quiet since word got out that sappers are in the area.",
"Looters are expecting too much crypto for all the junk they bring in.",
"What do I look like ? A newspaper vendor. Go Away.",
"The sun came up again this morning.. That's good news I suppose.",
"Keep your dog fed with raw or cooked carcasses.",
"Sappers are known to be good for their pelts. Just don't get too close to one",
"Some strange rumours that a Construct was seen in the mountains. Those are just bedtime stories to scare kids with.",
"UAVs are a good source of components.",
"Some say the nearby town is haunted by malevolent spirits.",
"I hear the military are helping survivors with air drops. Your loot is always welcome here if you find one.",
"Dogs can help you find pelts and animal carcasses",
"I heard that a new vehicle has been seen, some kind of board that you stand on. I personally don't believe it."
];
[selectRandom _newsArr, 5,[[0,0,0,0.5],[1,0.5,0,1]]] call Epoch_message;

View File

@ -0,0 +1,7 @@
disableserialization;
_display = finddisplay 9898;
call EPOCH_EPad_clearscreen;
_htmlctrl = (_display displayctrl 1901);
_htmlctrl ctrlshow true;
_html = "epoch_code\gui\scripts\e_pad\Apps\E_Pad.html";
_htmlctrl htmlLoad _html;

View File

@ -0,0 +1,13 @@
_cfg = "e_pad_config" call EPOCH_returnConfig;
_startvars = getarray (_cfg >> "LoadVarsFromProfile");
{
_x params ["_varname",["_default","false",[""]]];
if (_varname isequaltype "" && !(_varname isequalto "")) then {
_value = if ((tolower _default) isequalto "true") then {true} else {false};
missionnamespace setvariable [_varname,_value];
};
} foreach _startvars;
profilenamespace setvariable ["Epoch_ToggleVars",nil];
saveprofilenamespace;
hintsilent "";
["E-Pad settings resetted",5] call epoch_message;

View File

@ -0,0 +1,5 @@
disableSerialization;
_display = finddisplay 9898;
{
(_display displayctrl _x) ctrlshow false;
} foreach [1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1814,1901,1902,1903];

View File

@ -0,0 +1,160 @@
disableSerialization;
if (isnull (finddisplay 9898)) exitwith {};
_display = finddisplay 9898;
call EPOCH_EPad_clearscreen;
params [["_in",""],["_animate",false]];
_cfg = "e_pad_config" call EPOCH_returnConfig;
_arr = [];
_buttonSettings = [];
_config = switch (_in) do {
case "":
{
(_cfg >> "Apps")
};
default
{
_c = format ["_cfg >> '%1'","Apps"];
_arr = _in;
{
_c = _c + (format [" >> '%1'",_x]);
} forEach _arr;
(call compile _c)
};
};
_configs = "true" configClasses _config;
for "_i" from ((Epoch_E_Pad_Page-1)*13) to (((count _configs)-1) min (((Epoch_E_Pad_Page-1)*13)+12)) do {
_configx = _configs select _i;
_subclasses = configProperties [_configx, "isClass _x",true];
_action = format ["%1;",getText(_configx >> "action")];
_togglevar = getText(_configx >> "ToggleVar");
if !(_subclasses isEqualTo []) then {
_action = _action + format ["Epoch_E_Pad_Page = 1; [%1] call EPOCH_EPad_dialog", _arr + [(configName _configx)]];
}
else {
if (tolower (getText(_configx >> "ToggleAble")) isequalto "true") then {
if !(_togglevar isequalto "") then {
_action = _action + format ["%1 = %2; ['Epoch_ToggleVars','%1',%2] call Epoch_SaveVarsToProfile; [%3] call EPOCH_EPad_dialog",_togglevar,!(missionnamespace getvariable [format ["%1",_togglevar],false]),_arr];
};
};
};
_ButtonText = "";
_ButtonTextcode = getText(_configx >> "ButtonTextCode");
if (_ButtonTextcode != "") then {_ButtonText = call compile _ButtonTextcode;} else {_ButtonText = getText(_configx >> "ButtonText");};
if !(_ButtonText isequaltype "") then {_ButtonText = ""};
_Description = "";
_DescriptionCode = getText(_configx >> "DescriptionCode");
if (_DescriptionCode != "") then {_Description = call compile _DescriptionCode;} else { _Description = getText(_configx >> "Description");};
if !(_Description isequaltype "") then {_Description = ""};
_tooltip = "";
_tooltipcode = getText(_configx >> "tooltipcode");
if (_tooltipcode != "") then {_tooltip = call compile _tooltipcode;} else {_tooltip = getText(_configx >> "tooltip");};
if !(_tooltip isequaltype "") then {_tooltip = ""};
_icon = "";
_iconcode = getText(_configx >> "iconcode");
if (_iconcode != "") then {_icon = call compile _iconcode;} else {_icon = getText(_configx >> "icon");};
if !(_icon isequaltype "") then {_icon = ""};
_color = [1,1,1,1];
_cfgcolor = getarray(_configx >> "color");
if (!(_cfgcolor isequalto []) && count _cfgcolor == 4) then {_color = _cfgcolor;};
_colortoggled = [0,1,0,1];
_cfgcolortoggled = getarray(_configx >> "colortoggled");
if (!(_cfgcolortoggled isequalto []) && count _cfgcolortoggled == 4) then {_colortoggled = _cfgcolortoggled;};
_buttonSettings pushBack [
_ButtonText,
_tooltip,
_action,
_togglevar,
_icon,
_color,
_colortoggled,
_Description
];
};
_entries = count _buttonSettings;
if (_entries <= 0) exitwith {};
for "_i" from 0 to (_entries - 1) do {
(_buttonSettings select _i) params ["_ButtonText","_tooltip","_action","_togglevar","_icon","_color","_colortoggled","_Description"];
private ["_ctrl","_ctrl2"];
_ctrl = _display displayctrl (_i+1601);
_ctrl2 = _display displayctrl (_i+1701);
_ctrl3 = _display displayctrl (_i+1801);
_ctrl ctrlShow true;
_ctrl ctrlSetText _ButtonText;
_ctrl ctrlSetEventHandler ["mouseButtonDown", _action];
_ctrl ctrlEnable !(_action isequalto ";");
if !(_togglevar isequalto "") then {
_toggled = missionnamespace getvariable [format ["%1",_togglevar],false];
if (_toggled) then {
_ctrl ctrlsettextcolor _colortoggled;
_ctrl2 ctrlsettextcolor _colortoggled;
}
else {
_ctrl ctrlsettextcolor _color;
_ctrl2 ctrlsettextcolor _color;
};
}
else {
_ctrl ctrlsettextcolor _color;
_ctrl2 ctrlsettextcolor _color;
};
if !(_icon isequalto "") then {
_ctrl2 ctrlShow true;
_ctrl2 ctrlSetText _icon;
};
_ctrl ctrlSetTooltip _tooltip;
_ctrl2 ctrlSetTooltip _tooltip;
_ctrl3 ctrlShow true;
_ctrl3 ctrlSetText _Description;
if (_animate) then {
{
_pos = ctrlposition (_display displayCtrl _x);
_display displayCtrl _x ctrlSetposition [0.5 * safezoneW + safezoneX, 0.599027 * safezoneH + safezoneY, 0, 0];
_display displayCtrl _x ctrlcommit 0;
_display displayCtrl _x ctrlSetposition _pos;
_display displayCtrl _x ctrlcommit 0.5;
} foreach [_i+1601,_i+1701,_i+1801];
};
};
{
(_display displayctrl _x) ctrlshow true;
} foreach [1614,1615,1714,1715];
if (Epoch_E_Pad_Page > 1) then {
(_display displayctrl 1614) ctrlenable true;
(_display displayctrl 1614) ctrlSetEventHandler ["mouseButtonDown",format ["Epoch_E_Pad_Page = Epoch_E_Pad_Page - 1; [%1] call EPOCH_EPad_dialog",_arr]];
(_display displayctrl 1714) ctrlsettextcolor [1,1,1,1];
}
else {
(_display displayctrl 1614) ctrlenable false;
(_display displayctrl 1714) ctrlsettextcolor [1,1,1,0.5];
};
if ((count _configs) > (((Epoch_E_Pad_Page-1)*13)+12)) then {
(_display displayctrl 1615) ctrlenable true;
(_display displayctrl 1615) ctrlSetEventHandler ["mouseButtonDown",format ["Epoch_E_Pad_Page = Epoch_E_Pad_Page + 1; [%1] call EPOCH_EPad_dialog",_arr]];
(_display displayctrl 1715) ctrlsettextcolor [1,1,1,1];
}
else {
(_display displayctrl 1615) ctrlenable false;
(_display displayctrl 1715) ctrlsettextcolor [1,1,1,0.5];
};
if (_animate) then {
{
_pos = ctrlposition (_display displayCtrl _x);
_display displayCtrl _x ctrlSetposition [0.5 * safezoneW + safezoneX, 0.599027 * safezoneH + safezoneY, 0, 0];
_display displayCtrl _x ctrlcommit 0;
_display displayCtrl _x ctrlSetposition _pos;
_display displayCtrl _x ctrlcommit 0.5;
} foreach [1614,1615,1714,1715];
};
ctrlSetFocus (_display displayctrl 1600);

View File

@ -0,0 +1,12 @@
params ["_type","_var","_value"];
_arr = profilenamespace getvariable [_type,[[],[]]];
_find = (_arr select 0) find _var;
if (_find > -1) then {
(_arr select 1) set [_find, _value];
}
else {
(_arr select 0) pushback _var;
(_arr select 1) pushback _value;
};
profilenamespace setvariable [_type,_arr];
saveprofilenamespace;

View File

@ -58,6 +58,7 @@ EPOCH_buildOption = 0;
EPOCH_nearestLocations = [];
EPOCH_lastFiredLocation = [];
EPOCH_IsAutoRunning = false;
EPOCH_Earplugsin = false;
EPOCH_LastAutoRunKeyPressed = diag_ticktime;
EPOCH_PlayerMarkerOn = false;
EPOCH_DeathMarkerOn = false;

View File

@ -315,6 +315,14 @@ class CfgClientFunctions
class crafting_LB_doubleClick {};
class crafting_colorScheme {};
};
class e_pad
{
file = "epoch_code\gui\scripts\e_pad";
class EPad_clearscreen {};
class EPad_dialog {};
class EPad_Reset {};
class SaveVarsToProfile {};
};
class group
{
file = "epoch_code\gui\scripts\group";

View File

@ -0,0 +1,198 @@
class e_pad_config
{
LoadVarsFromProfile[] = { // Variables, that will be loaded from profile on connect
{"EPOCH_AutoEarplug","true"},
{"EPOCH_debugMode","false"},
{"EPOCH_PlayerMarkerOn","false"},
{"EPOCH_DeathMarkerOn","false"}
};
class Apps
{
/*
class FullExample
{
ButtonText = "app10"; // Static Button Text
ButtonTextCode = "if (true) then {'Text'} else {''}"; // Variable Button Text - will overwrite static Button Text, if defined
Description = ""; // Static Description Text
DescriptionCode = "if (true) then {'Desctription'} else {''}"; // Variable Description Text - will overwrite static Description Text, if defined
Icon = ""; // Static Icon on Button
IconCode = "if (true) then {'addons\MyIcon.paa'} else {''}"; // Variable Icon - will overwrite static Icon, if defined
color[] = {1,1,1,1}; // default color for Icon / Button text
colortoggled[] = {0,1,0,1}; // Icon / Button color if toggleable and variable is toggled (true)
action = ""; // code to run on button click
Tooltip = "PLACE-HOLDER"; // Static Tooltip
TooltipCode = "if (true) then {'My ToolTip'} else {''}"; // Variable Tooltip - will overwrite static Tooltip, if defined
ToggleVar = ""; // Script will check this variable. If true, Button is toggled and color change to "colortoggled"
ToggleAble = "false"; // if "true", the defined variable will be toggled (and saved to profile) on buttonclick
class SubMenu { // On Buttonclick, a new submenu will be opened with defined classes here
...
...
}
};
*/
class settings
{
ButtonText = "";
Description = "Settings";
Icon = "epoch_code\customs\images\settings_ca.paa";
color[] = {1,1,0,1};
colortoggled[] = {0,1,0,1};
action = "";
Tooltip = "Settings";
ToggleVar = "";
ToggleAble = "false";
class Reset {
ButtonText = "Reset";
Description = "Reset Settings";
Icon = "";
color[] = {1,1,0,1};
colortoggled[] = {0,1,0,1};
action = "[] spawn {_confirm = ['Reset all E-Pad Settings? Sure?','WARNING!',true,true] call BIS_fnc_guiMessage; if (_confirm) then {call Epoch_EPad_Reset; [] call EPOCH_EPad_dialog}}";
Tooltip = "Reset all settings";
ToggleVar = "";
ToggleAble = "false";
};
class playerMarker
{
ButtonText = "";
Description = "Playermarker";
icon = "epoch_code\customs\images\gps.paa";
color[] = {1,0,0,1};
colortoggled[] = {0,1,0,1};
action = "if (!EPOCH_PlayerMarkerOn) then {if !('ItemGPS' in (assignedItems player)) then {['You need a GPS to see your Position',5] call epoch_message}}";
tooltip = "Toggle player marker";
ToggleVar = "EPOCH_PlayerMarkerOn";
ToggleAble = "true";
};
class deathMarker
{
ButtonText = "";
Description = "DeathMarker";
icon = "epoch_code\customs\images\skull.paa";
color[] = {1,0,0,1};
colortoggled[] = {0,1,0,1};
action = "if (!EPOCH_DeathMarkerOn) then {if ((profileNameSpace getVariable ['EPOCHLastKnownDeath',[]]) isequalto []) then {['You had no GPS on last death',5] call epoch_message}}";
tooltip = "Toggle death marker";
ToggleVar = "EPOCH_DeathMarkerOn";
ToggleAble = "true";
};
class Earplug {
ButtonText = "";
Description = "Auto-Earplugs";
icon = "epoch_code\customs\images\Earplugs.paa";
color[] = {1,0,0,1};
colortoggled[] = {0,1,0,1};
action = "";
Tooltip = "Toggle Auto-Earplugs";
ToggleVar = "EPOCH_AutoEarplug";
ToggleAble = "true";
};
class SubSub {
ButtonText = "SubMenu";
Description = "Sub Menu";
Icon = "";
color[] = {1,1,1,1};
colortoggled[] = {0,1,0,1};
action = "";
Tooltip = "Open Sub-Sub Menu";
ToggleVar = "";
ToggleAble = "false";
class SubSub1 {
ButtonText = "SubSub1";
Description = "Sub Sub Menu";
Icon = "";
color[] = {1,1,1,1};
colortoggled[] = {0,1,0,1};
action = "";
Tooltip = "App in SubSub Menu";
ToggleVar = "";
ToggleAble = "false";
};
};
};
class info
{
ButtonText = "";
Description = "Server Info";
Icon = "epoch_code\customs\images\server_info_icon_ca.paa";
color[] = {1,1,1,1};
colortoggled[] = {0,1,0,1};
action = "createDialog 'server_info_picture'";
Tooltip = "Display server Info";
ToggleVar = "";
ToggleAble = "false";
};
class debug
{
ButtonText = "";
Description = "Debug";
Icon = "epoch_code\customs\images\debug_ca.paa";
color[] = {1,0,0,1};
colortoggled[] = {0,1,0,1};
action = "if !(EPOCH_debugMode) then {['Debug Mode Enabled', 5,[[0,0,0,0.5],[1,1,0,1]]] call Epoch_message;} else {['Debug Mode Disabled', 5,[[0,0,0,0.5],[1,1,0,1]]] call Epoch_message;hintSilent ''};";
Tooltip = "DebugMonitor";
ToggleVar = "EPOCH_debugMode";
ToggleAble = "true";
};
class reviveable
{
ButtonText = "";
Description = "Reviveable?";
Icon = "epoch_code\customs\images\Reviveable.paa";
color[] = {1,0,0,1};
colortoggled[] = {0,1,0,1};
action = "";
Tooltipcode = "if (Epoch_canBeRevived) then {'Reviveable: true'} else {'Reviveable: false'}";
ToggleVar = "Epoch_canBeRevived";
ToggleAble = "false";
};
class news
{
ButtonText = "News";
Description = "Tips";
Icon = "";
color[] = {1,1,1,1};
colortoggled[] = {0,1,0,1};
action = "call compile preprocessfilelinenumbers ""epoch_code\gui\scripts\e_pad\Apps\traderDiag_news.sqf""";
Tooltip = "News";
ToggleVar = "";
ToggleAble = "false";
};
class web
{
ButtonText = "WEB";
Description = "Web links";
Icon = "";
color[] = {1,1,1,1};
colortoggled[] = {0,1,0,1};
action = "call compile preprocessfilelinenumbers ""epoch_code\gui\scripts\e_pad\Apps\web.sqf""";
Tooltip = "WEB LINK";
ToggleVar = "";
ToggleAble = "false";
};
class vehs
{
ButtonText = "Vehicle";
Description = "Near Vehicle";
Icon = "";
color[] = {1,1,1,1};
colortoggled[] = {0,1,0,1};
action = "call compile preprocessfilelinenumbers ""epoch_code\gui\scripts\e_pad\Apps\traderDiag_nearVehicles.sqf""";
Tooltip = "Vehicles Nearby?";
ToggleVar = "";
ToggleAble = "false";
};
class players
{
ButtonText = "Player";
Description = "Near Player";
Icon = "";
color[] = {1,1,1,1};
colortoggled[] = {0,1,0,1};
action = "call compile preprocessfilelinenumbers ""epoch_code\gui\scripts\e_pad\Apps\traderDiag_nearPlayers.sqf""";
Tooltip = "Players Nearby?";
ToggleVar = "";
ToggleAble = "false";
};
};
};

File diff suppressed because it is too large Load Diff

View File

@ -72,6 +72,8 @@ showHUD[] =
#include "Configs\cfgCrafting.hpp"
#include "Configs\cfgPricing.hpp"
#include "Configs\CfgDynamicHUD.hpp"
#include "Configs\CfgEPad.hpp"
#include "Configs\CfgEPad_dialogs.hpp" // Do be moved to client files on update
#include "Configs\CfgEpochClient.hpp"