Jump to content
Webbzyjr2

Looking to disabled the Task and Briefing GUIs in the map

Recommended Posts

I've been experimenting with GUIs recently and have discovered a way to disable the map entirely. This got me curious about the various GUI elements within the map itself (such as the top bar and the drop down menu that contains the task list, briefing, and diary) and whether they could be disabled individually to achieve an effect like the map in the Contact DLC. I've been searching around the Display IDD list on the Wiki for any hints and have yet to find anything yet. I was wondering if anyone had any clues or could point me in the right direction with this.

Share this post


Link to post
Share on other sites

Hey @Webbzyjr2!

I am afraid I am not familiar with GUI editing. But I am VERY curious how you disabled the map. Seems the solution to a problem of mine: how to make players who have teleported "inside" buildings not have a GPS signal. 

What script command did you use?

Share this post


Link to post
Share on other sites
On 5/29/2021 at 9:31 PM, Webbzyjr2 said:

This got me curious about the various GUI elements within the map itself (such as the top bar and the drop down menu that contains the task list, briefing, and diary) and whether they could be disabled individually to achieve an effect like the map in the Contact DLC.

Yes it is possible to hide controls. The map is a bit special so instead of using the usual commands such as ctrlDelete or ctrlShow we have to rely on giving the control a zero width:

_control ctrlSetPositionW 0;
_control ctrlCommit 0;

To get the the correct control we use

findDisplay 12 displayCtrl _idc;

The IDCs are defined in the config under configFile >> "RscDisplayMainMap" or if you have the data unpacked: \a3\ui_f\config.cpp (search for the class name). You can also open the map in the GUI Editor by pressing CTRL+I and enter configFile >> "RscDisplayMainMap" to import the map. You need to delete some overlaying controls to show the underlying controls. I moved my mouse near the edge of the screen and spammed the DEL key.

Here is a script that hides the left listbox (containing stuff like Map, Briefing, Team...) and the top bar:

#include "\a3\ui_f\hpp\defineResincl.inc"
_displayMap = findDisplay 12;
_fncHideControls = {
    _this apply {
        _c = _displayMap displayCtrl _x;
        _c ctrlSetPositionW 0;
        _c ctrlCommit 0;
    };
//--- Hide left hand diary list
_idcsHide = [IDC_DIARY_TOPIC_LIST, IDC_DIARY_TOPIC_BACKGROUND];
_idcsHide call _fncHideControls;

//--- Top bar
#define IDC_DIARY_MAINBACKGROUND 1020
#define IDC_DIARY_MAINBACKGROUNDGRADIENT 1200
#define IDC_DIARY_TOPRIGHT 2302
_idcsHide = [IDC_DIARY_MAINBACKGROUND, IDC_DIARY_MAINBACKGROUNDGRADIENT, IDC_CANCEL, IDC_DIARY_TOPRIGHT, IDC_DIARY_MISSION_NAME];
_idcsHide call _fncHideControls;
_ctrlMap = _displayMap displayCtrl 51;
_ctrlMap ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH]; // resize map control to full screen
_ctrlMap ctrlCommit 0;

 

Edited by 7erra
fixed code
  • Like 2

Share this post


Link to post
Share on other sites

@Melody_Mike, I'm currently out of town and don’t have my computer with me so give me a couple of days and I’ll get back to you with the script.

 

@7erra, thank you for breaking this down so well. I’m definitely eager to get back and work on this project again. Let you know how it goes.

Share this post


Link to post
Share on other sites

@Melody_Mike, this should be a perfect solution for you. I built this off a script I saw on another post some time ago so the credit doesn't belong to me fully, I just modified it to my needs.

 

(findDisplay 46) displayAddEventHandler ["KeyDown",
{
	params ["_display", "_key", "_shift", "_ctrl", "_alt"];
	if (_key in actionKeys "showMap") then
	{
		true;
	};
}]

I used this in one scenario by creating an SQF file with this code and calling it via a trigger when needed. Sounds exactly like what you need, hope it serves you well.

  • Like 1

Share this post


Link to post
Share on other sites

note above quote from Terra has an encoding issue with invisible characters bugging out the engine - use this instead

 

#include "\a3\ui_f\hpp\defineResincl.inc"

_displayMap = findDisplay 12;

_fncHideControls = {
	_this apply {
		_control = _displayMap displayCtrl _x;
		_control ctrlSetPositionW 0;
		_control ctrlCommit 0;
	};
};

//--- Hide left hand diary list
_idcsHide = [IDC_DIARY_TOPIC_LIST, IDC_DIARY_TOPIC_BACKGROUND];
_idcsHide call _fncHideControls;

//--- Top bar
#define IDC_DIARY_MAINBACKGROUND 1020
#define IDC_DIARY_MAINBACKGROUNDGRADIENT 1200
#define IDC_DIARY_TOPRIGHT 2302

_idcsHide = [IDC_DIARY_MAINBACKGROUND, IDC_DIARY_MAINBACKGROUNDGRADIENT, IDC_CANCEL, IDC_DIARY_TOPRIGHT, IDC_DIARY_MISSION_NAME];
_idcsHide call _fncHideControls;

_ctrlMap = _displayMap displayCtrl 51;
_ctrlMap ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH]; // resize map control to full screen
_ctrlMap ctrlCommit 0;

PS: plus a missing closing bracket for the _fncHideControls function

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×