summaryrefslogtreecommitdiffstats
path: root/Client/GUI/GUI_MissionTasks.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:57:23 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:57:23 +0300
commit3533c3aa9393fc6350178b196c813dc636ec9cf6 (patch)
tree2f96a879c3935dea18e73410926b03c7eef1a751 /Client/GUI/GUI_MissionTasks.sqf
downloada2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.gz
a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.bz2
a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.zip
init
Diffstat (limited to '')
-rw-r--r--Client/GUI/GUI_MissionTasks.sqf65
1 files changed, 65 insertions, 0 deletions
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