#include "..\..\script_macros.hpp"
/*
File: fn_civInteractionMenu.sqf
Author: Maxence for The-Programmer Forum
*/
#define Btn1 37450
#define Btn2 37451
#define Btn3 37452
#define Btn4 37453
#define Btn5 37454
#define Btn6 37455
#define Title 37401
disableSerialization;
_curTarget = param [0,objNull,[objNull]];
if (isNull _curTarget) exitWith {closeDialog 0;};
if (!isPlayer _curTarget && side _curTarget isEqualTo civilian) exitWith {closeDialog 0;};
if (player distance _curTarget > 4 ) exitWith {closeDialog 0;};
if (!dialog) then {
createDialog "pInteraction_Menu";
};
_display = findDisplay 37400;
_Btn1 = _display displayCtrl Btn1;
_Btn2 = _display displayCtrl Btn2;
_Btn3 = _display displayCtrl Btn3;
_Btn4 = _display displayCtrl Btn4;
_Btn5 = _display displayCtrl Btn5;
_Btn6 = _display displayCtrl Btn6;
life_pInact_curTarget = _curTarget;
if (player getVariable ["isEscorting",false]) then {
_Btn1 ctrlSetText localize "STR_pInAct_StopEscort";
_Btn1 buttonSetAction "[] call life_fnc_stopEscorting; closeDialog 0;";
} else {
_Btn1 ctrlSetText localize "STR_pInAct_Escort";
_Btn1 buttonSetAction "[life_pInact_curTarget] call life_fnc_escortAction; closeDialog 0;";
};
_Btn2 ctrlSetText localize "STR_pInAct_PutInCar";
_Btn2 buttonSetAction "[life_pInact_curTarget] call life_fnc_putInCar; closeDialog 0;";
_Btn3 ctrlShow false;
_Btn4 ctrlShow false;
_Btn5 ctrlShow false;
_Btn6 ctrlShow false;