Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: Task description is now localize client side #427

Merged
merged 5 commits into from
Dec 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,6 @@ if (!isDedicated) then {
btc_fnc_log_hitch_points = compile preprocessFileLineNumbers "core\fnc\log\hitch_points.sqf";
btc_fnc_log_get_corner_points = compile preprocessFileLineNumbers "core\fnc\log\get_corner_points.sqf";

//TASK
btc_fnc_task_create = compile preprocessFileLineNumbers "core\fnc\task\create.sqf";
btc_fnc_task_fail = compile preprocessFileLineNumbers "core\fnc\task\fail.sqf";
btc_fnc_task_set_done = compile preprocessFileLineNumbers "core\fnc\task\set_done.sqf";

//SIDE
btc_fnc_side_request = compile preprocessFileLineNumbers "core\fnc\side\request.sqf";
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[14,_pos2,_city2 getVariable "name"] call btc_fnc_task_create;
[14,_pos2,_city2 getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [14,getPos _city1,_city1 getVariable "name"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[9,_pos,_city getVariable "name"] call btc_fnc_task_create;
[9,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [9,_pos,_city getVariable "name"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[8,_pos,_city getVariable "name"] call btc_fnc_task_create;
[8,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [8,_pos,_city getVariable "name"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[10,_pos,_city getVariable "name"] call btc_fnc_task_create;
[10,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [10,_vehpos,_city getVariable "name"];

Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/convoy.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[12,_pos2,_city2 getVariable "name"] call btc_fnc_task_create;
[12,_pos2,_city2 getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [12,_pos1,_city1 getVariable "name"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[6,_pos,_city getVariable "name"] call btc_fnc_task_create;
[6,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [6,_pos,_city getVariable "name"];

Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/hack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[16,_pos,_city getVariable "name"] call btc_fnc_task_create;
[16,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [16,_pos,_city getVariable "name"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[15,_pos,_city getVariable "name"] call btc_fnc_task_create;
[15,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [15,getPos _city,_city getVariable "name"];

Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[4,_pos,_city getVariable "name"] call btc_fnc_task_create;
[4,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [4,_pos,_city getVariable "name"];

Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/rescue.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[13,_pos,_city getVariable "name"] call btc_fnc_task_create;
[13,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [13,getPos _city,_city getVariable "name"];

Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[3,_pos,_city getVariable "name"] call btc_fnc_task_create;
[3,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [3,_pos,_city getVariable "name"];

Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[7,_pos,_city getVariable "name"] call btc_fnc_task_create;
[7,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [7,_pos,_city getVariable "name"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[11,_pos,_city getVariable "name"] call btc_fnc_task_create;
[11,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [11,_pos,_city getVariable "name"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ btc_side_done = false;
btc_side_failed = false;
btc_side_assigned = true;publicVariable "btc_side_assigned";

[5,_pos,_city getVariable "name"] call btc_fnc_task_create;
[5,_pos,_city getVariable "name"] remoteExec ["btc_fnc_task_create", 0];

btc_side_jip_data = [5,_pos,_city getVariable "name"];

Expand Down
61 changes: 31 additions & 30 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/task/create.sqf
Original file line number Diff line number Diff line change
@@ -1,87 +1,88 @@

if (!isServer) exitWith {["task" + ([_this select 0] call BIS_fnc_taskState) + "Icon",[[[_this select 0] call BIS_fnc_taskType] call bis_fnc_taskTypeIcon, ([_this select 0] call BIS_fnc_taskDescription) select 1 select 0]] call bis_fnc_showNotification;};
params ["_task_id", ["_destination", objNull], ["_location", ""]];

private ["_location","_destination","_description","_type"];
if !( _task_id isEqualType "") then {_task_id = str(_task_id);};

if ((typeName (_this select 0)) isEqualTo "STRING") exitWith {};
private ["_description","_type"];

if (count _this > 1) then {
_destination = _this select 1;
_location = _this select 2;
} else {
_destination = objNull;
_location = "";
};

switch (_this select 0) do {
case 0 : {
switch (_task_id) do {
case "0" : {
_description = [(localize "STR_BTC_HAM_MISSION_DEFEAT_DESC"),(localize "STR_BTC_HAM_MISSION_DEFEAT_TITLE"),(localize "STR_BTC_HAM_MISSION_DEFEAT_TITLE")]; //"Defeat the Oplitas once and for all","Defeat the Oplitas","Defeat the Oplitas"
_type = "kill";
};
case 1 : {
case "1" : {
_description = [(localize "STR_BTC_HAM_MISSION_DESTORY_DESC"),(localize "STR_BTC_HAM_MISSION_DESTORY_TITLE"),(localize "STR_BTC_HAM_MISSION_DESTORY_TITLE")]; //"Destroy all the hideouts of the Oplitas","Destroy all the hideouts","Destroy all the hideouts"
_type = "destroy";
};
case 2 : {
case "2" : {
_description = [(localize "STR_BTC_HAM_MISSION_SEIZE_DESC"),(localize "STR_BTC_HAM_MISSION_SEIZE_TITLE"),(localize "STR_BTC_HAM_MISSION_SEIZE_MRK")]; //"Seize the last positions held by Oplitas fighters","Seize the last Oplitas positions","Seize the last Oplitas fighters positions"
_type = "move";
};
case 3 : {
case "3" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_SUPPLIES_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_SUPPLIES_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_SUPPLIES_TITLE"),_location])]; //The citizens of %1 are on the brink starving to death, bring them some supplies present at the logisitic point!",_location],("Supply " + _location),("Supply " + _location)
_type = "move";
};
case 4 : {
case "4" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_MINES_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_MINES_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_MINES_TITLE"),_location])]; //There is a minefield near %1, clear it!",_location],("Minefield near " + _location),("Minefield near " + _location)
_type = "search";
};
case 5 : {
case "5" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_VEHICLE_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_VEHICLE_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_VEHICLE_TITLE"),_location])]; //"A vehicle damaged by an IED needs assistance near %1! Repair it!",_location],("Vehicle needs assistance near " + _location),("Vehicle needs assistance near " + _location)
_type = "repair";
};
case 6 : {
case "6" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_CONQUER_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_CONQUER_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_CONQUER_TITLE"),_location])]; //"%1 has been conquered by the Oplitas! Local population is being terrorized, they are asking for help!",_location],("Free " + _location),("Free " + _location)
_type = "attack";
};
case 7 : {
case "7" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_TOWER_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_TOWER_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_TOWER_TITLE"),_location])]; //"A Oplitas communications tower has been located in %1. Local population is asking for your help to destroy it! (Use one M183 explosive satchel)",_location],("Destroy tower in " + _location),("Destroy tower in " + _location)
_type = "destroy";
};
case 8 : {
case "8" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_CIVTREAT_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_CIVTREAT_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_CIVTREAT_TITLE"),_location])]; //format ["A civilian is calling for a medic in %1, treat and wait for patient stabilization ",_location],("Medical emergency call in " + _location),("Medical emergency call in " + _location)
_type = "heal";
};
case 9 : {
case "9" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_CHECKPOINT_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_CHECKPOINT_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_CHECKPOINT_TITLE"),_location])]; //"Checkpoints have been located in %1. Local population is asking for your help to destroy ammo box in all checkpoints!",_location],("Destroy checkpoints in " + _location),("Destroy checkpoints in " + _location)
_type = "destroy";
};
case 10 : {
case "10" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_CIVTREATBOAT_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_CIVTREATBOAT_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_CIVTREATBOAT_TITLE"),_location])]; //"A civilian is calling for a medic in %1, treat and wait for patient stabilization ",_location],("Medical emergency call in " + _location),("Medical emergency call in " + _location)
_type = "heal";
};
case 11 : {
case "11" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_UNDERWATER_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_UNDERWATER_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_UNDERWATER_TITLE"),_location])]; //"Underwater generator has been located in %1. Local population is asking for your help to destroy it!",_location],("Destroy underwater generator in " + _location),("Destroy underwater generator in " + _location)
_type = "destroy";
};
case 12 : {
case "12" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_CONVOY_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_CONVOY_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_CONVOY_TITLE"),_location])]; //"An armed Oplitas convoy is going to attack %1. Local population is asking for your help to destroy it before it gets there!",_location],("Destroy Oplitas convoy attacking " + _location),("Destroy Oplitas convoy attacking " + _location)
_type = "attack";
};
case 13 : {
case "13" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_RESC_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_RESC_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_RESC_TITLE"),_location])]; //"MAYDAY-MAYDAY, a pilot crashed his helicopter near %1. Command is asking for your help to rescue and bring him back to base!",_location],("Rescue downed pilot near " + _location),("Rescue downed pilot near " + _location)
_type = "navigate";
};
case 14 : {
case "14" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_CAPOFF_DESC"),_location],((localize "STR_BTC_HAM_SIDE_CAPOFF_TITLE")),((localize "STR_BTC_HAM_SIDE_CAPOFF_TITLE"))]; //"Capture an officer travelling in a concealed convoy, then bring him at base for interrogation. He is his responsible for terrorizing local population!",_location],("Capture commander in concealed convoy"),("Capture commander in concealed convoy")
_type = "run";
};
case 15 : {
case "15" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_HOSTAGE_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_HOSTAGE_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_HOSTAGE_TITLE"),_location])]; //"Liberate a civilian hostage in %1. Local population is asking for your help!",_location],("Liberate hostage near " + _location),("Liberate hostage near " + _location)
_type = "exit";
};
case 16 : {
case "16" : {
_description = [format [(localize "STR_BTC_HAM_SIDE_HACK_DESC"),_location],(format [(localize "STR_BTC_HAM_SIDE_HACK_TITLE"),_location]),(format [(localize "STR_BTC_HAM_SIDE_HACK_TITLE"),_location])]; //"Hack a prototype missile with a terminal available in %1. Defend your position until the process is done!",_location],("Hack missile near " + _location),("Hack missile near " + _location)
_type = "intel";
};
};

[btc_player_side,[str(_this select 0)],_description,_destination,true,2,true,_type,true] call BIS_fnc_taskCreate;
if (!isServer) exitWith {
[[_task_id], btc_player_side, _description, _destination, true, 2, false, false] spawn {

waitUntil {(_this select 0) call BIS_fnc_taskState isEqualTo "ASSIGNED";};
_this call BIS_fnc_setTask;
(_this select 0) call BIS_fnc_taskHint;
};
};

[btc_player_side,[_task_id],_description,_destination,true,2,false,_type,false] call BIS_fnc_taskCreate;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

if (isServer) exitWith {
[str(_this), "SUCCEEDED",false] spawn BIS_fnc_taskSetState;
if (_this isEqualTo 1) then {[2] call btc_fnc_task_create};
if (_this isEqualTo 1) then {[2] remoteExec ["btc_fnc_task_create", 0]};
};

private ["_description"];
Expand Down