diff --git a/BaseMarker_ExAd/BaseMarker/BaseMarker.paa b/BaseMarker_ExAd/BaseMarker/BaseMarker.paa new file mode 100644 index 0000000..6ccb158 Binary files /dev/null and b/BaseMarker_ExAd/BaseMarker/BaseMarker.paa differ diff --git a/BaseMarker_ExAd/BaseMarker/onLoad.sqf b/BaseMarker_ExAd/BaseMarker/onLoad.sqf new file mode 100644 index 0000000..385cb89 --- /dev/null +++ b/BaseMarker_ExAd/BaseMarker/onLoad.sqf @@ -0,0 +1,69 @@ +params["_display","_slide","_idc"]; +private ["_baseMarker","_backbtn","_basePic","_Instruction","_OffBtn","_OnBtn","_newParent"]; +disableSerialization; + +_slideClass = "BaseMarker"; + +_newParent = [_display,_slide,([_slideClass,"ctrlGrp"] call ExAd_fnc_getNextIDC),[0, -0.03, 34 * _pW, 0.76]] call ExAd_fnc_createCtrlGrp; +_newParent ctrlEnable true; + +_OnBtn = _display ctrlCreate ["RscButtonMenu", 15002,_newParent]; +_OnBtn ctrlSetPosition [(32 - 20) * (0.025),(20 - 10) * (0.04),6 * (0.025),1 * (0.04)]; +_OnBtn ctrlCommit 0; +_OnBtn ctrlSetText "On"; +_OnBtn ctrlSetEventHandler ["ButtonClick", "call fnc_markerOn"]; + +_OffBtn = _display ctrlCreate ["RscButtonMenu", 15003,_newParent]; +_OffBtn ctrlSetPosition [(32 - 10) * (0.025),(20 - 10) * (0.04),6 * (0.025),1 * (0.04)]; +_OffBtn ctrlCommit 0; +_OffBtn ctrlSetText "Off"; +_OffBtn ctrlSetEventHandler ["ButtonClick", "call fnc_markerOff"]; + +_backbtn = _display ctrlCreate ["RscButtonMenu", 15004,_newParent]; +_backbtn ctrlSetPosition [0.62,0.1,0.20,0.04]; +_backbtn ctrlCommit 0; +_backbtn ctrlSetText "Go Back"; +_backbtn ctrlSetEventHandler ["ButtonClick", "['extraApps', 1] call ExileClient_gui_xm8_slide"]; + +_Instruction = _display ctrlCreate ["RscStructuredText", 15005,_newParent]; +_Instruction ctrlSetPosition [(5.8 - 3) * (0.025), (20 - 12) * (0.04), 7.2 * (0.12), 3.75 * (0.02)]; +_Instruction ctrlCommit 0; +_Instruction ctrlSetStructuredText parseText "Toggle your base markers (Only viewable by you):"; + +fnc_markerOn = { + + _playerUID = getPlayerUID player; + { + _flag = _x; + _buildRights = _flag getVariable ["ExileTerritoryBuildRights", []]; + if (_playerUID in _buildRights) then + { + _name = _flag getVariable ["ExileTerritoryName", ""]; + _pos = getPos _flag; + _marker = createMarkerLocal [_name, _pos]; + _marker setMarkerTextLocal _name; + _marker setMarkerTypeLocal "mil_flag"; + _marker setMarkerColorLocal "ColorYellow" + }; + } + forEach (allMissionObjects "Exile_Construction_Flag_Static"); + ["Success",["Base Markers toggled on."]] call BIS_fnc_showNotification; +}; + +fnc_markerOff = { + + _playerUID = getPlayerUID player; + { + _flag = _x; + _buildRights = _flag getVariable ["ExileTerritoryBuildRights", []]; + if (_playerUID in _buildRights) then + { + _name = _flag getVariable ["ExileTerritoryName", ""]; + _pos = getPos _flag; + deleteMarkerLocal _name; + + }; + } + forEach (allMissionObjects "Exile_Construction_Flag_Static"); + ["Whoops",["Base Markers toggled off."]] call BIS_fnc_showNotification; +}; \ No newline at end of file diff --git a/BaseMarker_ExAd/Installation.txt b/BaseMarker_ExAd/Installation.txt new file mode 100644 index 0000000..017c0f6 --- /dev/null +++ b/BaseMarker_ExAd/Installation.txt @@ -0,0 +1,21 @@ +/////////////// +//Installation +////////////// + +Add BaseMarker folder to your ExAd XM8 Apps folder +Exile.Mission > ExAdClient > XM8 > Apps > Place_Folder + +Open your config.cpp file +Locate class CfgXM8 +Add "BaseMarker" to the extraApps line +Add the folowing line in the CfgXM8 class + +class BaseMarker + { + controlID = 50500; + title = "Base Marker"; + logo = "ExAdClient\XM8\Apps\BaseMarker\BaseMarker.paa"; + onLoad = "ExAdClient\XM8\Apps\BaseMarker\onLoad.sqf"; + }; + +You're Done! \ No newline at end of file diff --git a/BaseMarker_ExAd/config.cpp b/BaseMarker_ExAd/config.cpp new file mode 100644 index 0000000..a2cbd61 --- /dev/null +++ b/BaseMarker_ExAd/config.cpp @@ -0,0 +1,12 @@ +class CfgXM8 +{ + extraApps[] = {"BaseMarker"}; + + class BaseMarker + { + controlID = 50500; + title = "Base Marker"; + logo = "ExAdClient\XM8\Apps\BaseMarker\BaseMarker.paa"; + onLoad = "ExAdClient\XM8\Apps\BaseMarker\onLoad.sqf"; + }; +}; \ No newline at end of file