• Announcements

    • Graim

      Web Archive of exilemod.com   07/30/2019

      Archived content is available at the link:
      http://web.archive.org/web/20190717131018/https://www.exilemod.com/ You can copy the contents of this address and add them to exilemod.net. This provides interactive support.
TomK

Enable/Disable GPS Marker Function

2 posts in this topic

Hello,

I would like to disable the gps Function by proofing if the Player has "ItemGPS" equipped or not.

What i already got running is the code below. It disables the Marker of the Player itself, and the option in the right corner to zoom in the area where the player is.

like so:

  • if player got "ItemGPS" equipped -> shows player location on the map exactly with a blue marker, can place gps markers (shift + lmb) and those are visible on the map and in normal gameplay like 3d markes (those with the white circle and a white dot in the middle)
  • but if player has no "ItemGPS" equipped -> player location is not visible (thats fine) but i can still place a gps marker which is still visible in normal gameplay but not on the map (on map they get visible again when i equip a GPS)

i have overwritten the "ExileClient_gui_map_event_onDraw.sqf" which is located at "\@exile\addons\exile_client\code\ExileClient_gui_map_event_onDraw.sqf" in the config (Exile Custom Code Section)

Does somebody has a solution for this?

Thanks, TomK

 

ExileClient_gui_map_event_onDraw.sqf

/**
 * ExileClient_gui_map_event_onDraw
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 *
 * GPS Check by Wyqer - 16.12.2015
 *
 */

private["_marker"];

_showGroup = false; // true = Group markers shown if the members have GPS | false = Only player marker if he has a GPS

/* DO NOT EDIT BELOW */

_display = uiNamespace getVariable "RSCDiary";
_ctrl = _display displayCtrl 1202;
_ctrl ctrlEnable false;
_ctrl ctrlsettextcolor [0,0,0,0];
_ctrl ctrlSetTooltip "";
_ctrl ctrlCommit 0;

if (_showgroup) then
{
	{
		deleteMarkerLocal _x;
	}
	forEach ExileClientPartyMapMarkers;
	{
		if ("ItemGPS" in (assignedItems _x) AND "ItemGPS" in (assignedItems player)) then
		{
			_marker = createMarkerLocal [format ["ExilePartyMarker%1", _forEachIndex], getPosVisual _x];
			_marker setMarkerShapeLocal "ICON";
			_marker setMarkerTypeLocal "ExilePlayer";
			_marker setMarkerDirLocal (getDirVisual _x);
			_marker setMarkerAlphaLocal 0.75;
			if (_x isEqualTo player) then 
			{
				_marker setMarkerColorLocal "ColorBlue";
			}
			else 
			{
				_marker setMarkerColorLocal "ColorGreen";
				_marker setMarkerTextLocal (name _x);
			};
		};
		ExileClientPartyMapMarkers pushBack _marker;
	}
	forEach units (group player);
}
else
{
	if ("ownMapPosition" in allMapMarkers) then
	{
		deleteMarkerLocal "ownMapPosition";
	};
	
	if ("ItemGPS" in (assignedItems player)) then
	{
		_marker = createMarkerLocal ["ownMapPosition", getPosVisual player];
		_marker setMarkerShapeLocal "ICON";
		_marker setMarkerTypeLocal "ExilePlayer";
		_marker setMarkerDirLocal (getDirVisual player);
		_marker setMarkerAlphaLocal 0.75;
		_marker setMarkerColorLocal "ColorBlue";
		
		
		if!(ExileClientWaypoints isEqualTo [])then
			{
				_control = _this select 0;
			{
					_control drawIcon 
					[
						"\a3\ui_f\data\Map\MapControl\custommark_CA.paa",
						[1, 1, 1, 1],
						ExileClientWaypoints select _forEachIndex,
						16,
						16,
						0,
						"",
						0,
						0,
						"PuristaMedium"
					];
				}
				forEach ExileClientWaypoints;
			};		
	};
};

 

ExileClient_gui_map_event_onDraw.sqf

1 person likes this

Share this post


Link to post
Share on other sites

To fix this, just create a file named "ExileClient_gui_hud_renderWaypoints.sqf" and put this there:
Also overwrite it on config.cpp
 

Spoiler

/**
 * ExileClient_gui_hud_renderWaypoints
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_distance"];
if !(ExileClientWaypoints isEqualTo []) then
{
    if ("ItemGPS" in assigneditems Player) then 
    {
        {
            _distance = player distance2D _x;
            drawIcon3D 
            [
                "\a3\ui_f\data\Map\MapControl\custommark_CA.paa",
                [1, 1, 1, linearConversion [0, 200, _distance, 0.25, 1, true]],
                _x,
                0.65,
                0.65,
                0,
                format ["%1m", floor _distance],
                0,
                0.03,
                "PuristaMedium",
                "center",
                true
            ];
        }
        forEach ExileClientWaypoints;
    }
};


Should work, let me know! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now