From b06990293397d4b6d0374097f09d1cc5679216e3 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:55:04 +0300 Subject: init --- Client/GUI/GUI_MissionTasks.sqf | 65 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Client/GUI/GUI_MissionTasks.sqf (limited to 'Client/GUI/GUI_MissionTasks.sqf') diff --git a/Client/GUI/GUI_MissionTasks.sqf b/Client/GUI/GUI_MissionTasks.sqf new file mode 100644 index 0000000..e5700b6 --- /dev/null +++ b/Client/GUI/GUI_MissionTasks.sqf @@ -0,0 +1,65 @@ + +private ["_locations","_sideID","_names","_skip","_curSel","_display","_map","_sorted"]; +disableSerialization; + +MenuAction = -1; +mouseButtonUp = -1; + +_display = _this select 0; +_map = _display DisplayCtrl 19002; + +if (isNull currentMission) then {ctrlSetText [19007,Format [localize "STR_WF_CurrentMission","N/A"]]} else {ctrlSetText [19007,Format [localize "STR_WF_CurrentMission",currentMission getVariable "name"]];}; + +_names = []; +_locations = []; +{_sideID = _x getVariable "sideID"; if (_sideID != sideID) then {_locations = _locations + [_x]}} forEach towns; +_sorted = [player,_locations] Call SortByDistance; +{_names = _names + [_x getVariable "name"]} forEach _sorted; + +{lbAdd[19005,_x]} forEach _names; +if (count _sorted > 0) then { + lbSetCurSel[19005,0]; + _map CtrlMapAnimAdd [2,.140,GetPos (_sorted select 0)]; + CtrlMapAnimCommit _map; +}; + +while {alive player && dialog} do { + sleep 0.1; + if (Side player != sideJoined) exitWith {closeDialog 0}; + if (!dialog) exitWith {}; + + //--- Accept Mision. + if (MenuAction == 1) then { + MenuAction = -1; + _skip = false; + if (!isNil "townTask") then {if (taskState townTask == "Succeeded") then {["TownRemove",currentMission] Call TaskSystem;currentMission = objNull}} ; + if (!isNull currentMission) then {hint (localize "STR_WF_Mission_Running");_skip = true}; + if (!_skip) then { + _curSel = lbCurSel (19005); + currentMission = _sorted select _curSel; + ctrlSetText [19007,Format [localize "STR_WF_CurrentMission",currentMission getVariable "name"]]; + //--- Task System. + ["TownAdd",currentMission] Spawn TaskSystem; + }; + }; + + //--- Abort Mision. + if (MenuAction == 2) then { + MenuAction = -1; + if (!isNull currentMission) then { + ["TownRemove",currentMission] Call TaskSystem; + ctrlSetText [19007,Format [localize "STR_WF_CurrentMission","N/A"]]; + currentMission = objNull; + hint (localize "STR_WF_Mission_Abort"); + }; + }; + + //--- Other Town selected. + if (MenuAction == 101) then { + MenuAction = -1; + _curSel = lbCurSel (19005); + CtrlMapAnimClear _map; + _map CtrlMapAnimAdd [2,.140,GetPos (_sorted select _curSel)]; + CtrlMapAnimCommit _map; + }; +}; \ No newline at end of file -- cgit v1.3.1