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: Marker texts are now localized to client #430

Merged
merged 22 commits into from
Dec 12, 2017
Merged
Show file tree
Hide file tree
Changes from 21 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: 3 additions & 2 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/hd_cache.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ if (isNil {_cache getVariable "btc_hd_cache"} && {_explosive} && {_damage > 0.6}
deleteVehicle btc_cache_obj;
_marker = createmarker [format ["btc_cache_%1", btc_cache_n], btc_cache_pos];
_marker setmarkertype "hd_destroy";
_marker setMarkerText format ["Cached %1 destroyed", btc_cache_n];
[_marker,"STR_BTC_HAM_O_EH_HDCACHE_MRK",btc_cache_n] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Cached %1 destroyed
// Vehicle needs assistance
_marker setMarkerSize [1, 1];
_marker setMarkerColor "ColorRed";
if (btc_debug_log) then {
Expand All @@ -38,4 +39,4 @@ if (isNil {_cache getVariable "btc_hd_cache"} && {_explosive} && {_damage > 0.6}
[0] remoteExec ["btc_fnc_show_hint", 0];

[] spawn {[] call btc_fnc_cache_find_pos;};
} else {0};
} else {0};
4 changes: 3 additions & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/delete.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

{
deletemarker _x;
//remove JIP remoteExec
remoteExec ["", _x];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! So there was a third solution !

} foreach (_this select 0);

{
Expand Down Expand Up @@ -36,4 +38,4 @@
[_args] call btc_fnc_deletegroup;
};
} , 5, _group] call CBA_fnc_addPerFrameHandler;
} forEach (_this select 3);
} forEach (_this select 3);
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
params [
["_marker", ""],
["_text", ""],
["_arg", ""]
];

//check for localized text
_text = if (isLocalized _text) then {(localize _text)};

//set markerText
_marker setMarkerTextLocal format [_text, _arg];
1 change: 1 addition & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ if (!isDedicated) then {
btc_fnc_systemchat_debug = compile preprocessFileLineNumbers "core\fnc\common\systemchat_debug.sqf";
btc_fnc_show_hint = compile preprocessFileLineNumbers "core\fnc\common\show_hint.sqf";
btc_fnc_intro = compile preprocessFileLineNumbers "core\fnc\common\intro.sqf";
btc_fnc_set_markerTextLocal = compile preprocessFileLineNumbers "core\fnc\common\set_markerTextLocal.sqf";

//CIV
btc_fnc_civ_add_leaflets = compile preprocessFileLineNumbers "core\fnc\civ\add_leaflets.sqf";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _vehicle = _this select 0;
_marker = createmarker [format ["m_%1",_vehicle],getPos _vehicle];
_marker setMarkerType "mil_box";
_marker setMarkerColor "ColorRed";
_marker setMarkerText format [(localize "STR_BTC_HAM_O_EH_VEHKILLED_MRK"),getText (configFile >> "cfgVehicles" >> typeof _vehicle >> "displayName")]; // %1 wreck
[_marker,"STR_BTC_HAM_O_EH_VEHKILLED_MRK",(getText (configFile >> "cfgVehicles" >> typeof _vehicle >> "displayName"))] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; // %1 wreck
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the JIP when this marker is deleted ?
Add: remoteExec [_marker, _x]; in /core/fnc/log/server_repair_wreck.sqf#L13)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

done 😄


_vehicle setVariable ["marker",_marker];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ _marker = _veh getVariable ["marker",""];

btc_vehicles = btc_vehicles - [_veh];

if (_marker != "") then {deleteMarker _marker;};
if (_marker != "") then {deleteMarker _marker; remoteExec ["", _marker];};
deleteVehicle _veh;
sleep 1;
_veh = [_type,[_pos select 0, _pos select 1, 0.5 + (_pos select 2)],_dir,_textures] call btc_fnc_log_createVehicle;

_veh
_veh
4 changes: 2 additions & 2 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/hd_hideout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (_explosive && {_damage > 0.6}) then {

_marker = createmarker [format ["btc_hideout_%1_destroyed", _id], getpos _hideout];
_marker setmarkertype "hd_destroy";
_marker setMarkerText format ["Hideout %1 destroyed", _id];
[_marker,"STR_BTC_HAM_O_EH_HDHIDEOUT_MRK",_id] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Cached %1 destroyed
_marker setMarkerSize [1, 1];
_marker setMarkerColor "ColorRed";

Expand All @@ -42,4 +42,4 @@ if (_explosive && {_damage > 0.6}) then {
//Notification
[2,count btc_hideouts] remoteExec ["btc_fnc_show_hint", 0];
if (btc_debug_log) then {diag_log format ["btc_fnc_mil_hd_hideout: _this = %1 ; POS %2 ID %3",_this,getpos _hideout,_id];};
} else {0};
} else {0};
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ btc_side_jip_data = [14,getPos _city1,_city1 getVariable "name"];
//// Create markers \\\\
_marker1 = createmarker [format ["sm_2_%1",getPos _city1],getPos _city1];
_marker1 setmarkertype "hd_flag";
_marker1 setmarkertext (localize "STR_BTC_HAM_SIDE_CONVOY_MRKSTART"); //Convoy Start
[_marker1,"STR_BTC_HAM_SIDE_CONVOY_MRKSTART"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker1]; //Convoy Start
_marker1 setMarkerSize [0.6, 0.6];

_marker2 = createmarker [format ["sm_2_%1",_pos2],_pos2];
_marker2 setmarkertype "hd_flag";
_marker2 setmarkertext (localize "STR_BTC_HAM_SIDE_CONVOY_MRKEND"); //Convoy End
[_marker2,"STR_BTC_HAM_SIDE_CONVOY_MRKEND"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker2]; //Convoy End
_marker2 setMarkerSize [0.6, 0.6];

_area = createmarker [format ["sm_%1",_pos2],_pos2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ for "_i" from 1 to (1 + round random 2) do {
//// Create marker \\\\
_marker = createmarker [format ["sm_2_%1",_pos],_pos];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_CHECKPOINT_MRK"); //Checkpoint
[_marker,"STR_BTC_HAM_SIDE_CHECKPOINT_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Checkpoint
_marker setMarkerColor "ColorRed";
_marker setMarkerSize [0.6, 0.6];
_markers pushback _marker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ btc_side_jip_data = [8,_pos,_city getVariable "name"];
//// Create marker \\\\
_marker = createmarker [format ["sm_2_%1",_pos],_pos];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_CIVTREAT_MRK"); // Civil need help
[_marker,"STR_BTC_HAM_SIDE_CIVTREAT_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Civil need help
_marker setMarkerSize [0.6, 0.6];

//// Create civ on _pos \\\\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ btc_side_jip_data = [10,_vehpos,_city getVariable "name"];
//// Create marker \\\\
_marker = createmarker [format ["sm_2_%1",_vehpos],_vehpos];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_CIVTREAT_MRK"); //Civil need help
[_marker,"STR_BTC_HAM_SIDE_CIVTREAT_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Civil need help
_marker setMarkerSize [0.6, 0.6];

//// Create civ on _vehpos \\\\
Expand Down
4 changes: 2 additions & 2 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/convoy.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ btc_side_jip_data = [12,_pos1,_city1 getVariable "name"];
//// Create markers \\\\
_marker1 = createmarker [format ["sm_2_%1",_pos1],_pos1];
_marker1 setmarkertype "hd_flag";
_marker1 setmarkertext (localize "STR_BTC_HAM_SIDE_CONVOY_MRKSTART"); //Convoy start
[_marker1,"STR_BTC_HAM_SIDE_CONVOY_MRKSTART"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker1]; //Convoy start
_marker1 setMarkerSize [0.6, 0.6];

_marker2 = createmarker [format ["sm_2_%1",_pos2],_pos2];
_marker2 setmarkertype "hd_flag";
_marker2 setmarkertext (localize "STR_BTC_HAM_SIDE_CONVOY_MRKEND"); //Convoy end
[_marker2,"STR_BTC_HAM_SIDE_CONVOY_MRKEND"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker2]; //Convoy end
_marker2 setMarkerSize [0.6, 0.6];

_area = createmarker [format ["sm_%1",_pos2],_pos2];
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 @@ -26,7 +26,7 @@ _city setVariable ["spawn_more",true];

private _marker = createmarker [format ["sm_2_%1",_pos],_pos];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_HACK_MRK"); //Terminal
[_marker,"STR_BTC_HAM_SIDE_HACK_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Terminal
_marker setMarkerSize [0.6, 0.6];

//// Create terminal \\\\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ btc_side_jip_data = [15,getPos _city,_city getVariable "name"];
//// Marker
_marker = createmarker [format ["sm_2_%1",getPos _house],getPos _house];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_HOSTAGE_MRK"); //Hostage
[_marker,"STR_BTC_HAM_SIDE_HOSTAGE_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Hostage
_marker setMarkerSize [0.6, 0.6];

_city setVariable ["spawn_more",true];
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 @@ -28,7 +28,7 @@ _area setmarkercolor "colorBlue";

_marker = createmarker [format ["sm_2_%1",_pos],_pos];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_MINES_MRK"); //Mines
[_marker,"STR_BTC_HAM_SIDE_MINES_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Mines
_marker setMarkerSize [0.6, 0.6];

_mines = [];
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 @@ -28,7 +28,7 @@ _area setmarkercolor "colorBlue";

_marker = createmarker [format ["sm_2_%1",_pos],_pos];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_SUPPLIES_MRK"); //Supplies
[_marker,"STR_BTC_HAM_SIDE_SUPPLIES_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Supplies
_marker setMarkerSize [0.6, 0.6];

waitUntil {sleep 5; (btc_side_aborted || btc_side_failed || count (nearestObjects [_pos, [btc_supplies_mat], 30]) > 0)};
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 @@ -36,7 +36,7 @@ _area setmarkercolor "colorBlue";

_marker = createmarker [format ["sm_2_%1",_pos],_pos];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_TOWER_MRK"); //Radio Tower
[_marker,"STR_BTC_HAM_SIDE_TOWER_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Radio Tower
_marker setMarkerSize [0.6, 0.6];

//// Randomise composition \\\\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ _area setmarkercolor "colorBlue";

_marker = createmarker [format ["sm_2_%1",_pos],_pos];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_UNDERWATER_MRK"); //Generator
[_marker,"STR_BTC_HAM_SIDE_UNDERWATER_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Generator
_marker setMarkerSize [0.6, 0.6];


Expand All @@ -58,7 +58,7 @@ _group = [_pos,8, 1 + round random 5,0.8] call btc_fnc_mil_create_group;
[_pos,20, 2 + round random 4,0.5] call btc_fnc_mil_create_group;

_pos = getPosASL _generator;
leader _group setPosASL [_pos select 0, _pos select 1, (_pos select 2) + 1 + random 1];
(leader (_group select 0)) setPosASL [_pos select 0, _pos select 1, (_pos select 2) + 1 + random 1];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be here, may be you based your branch on your last PR, doesn't matter :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake, sorry.


waitUntil {sleep 5; (btc_side_aborted || btc_side_failed || !Alive _generator )};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ _area setmarkercolor "colorBlue";

_marker = createmarker [format ["sm_2_%1",_pos],_pos];
_marker setmarkertype "hd_flag";
_marker setmarkertext (localize "STR_BTC_HAM_SIDE_VEHICLE_MRK"); // Vehicle needs assistance
[_marker,"STR_BTC_HAM_SIDE_VEHICLE_MRK"] remoteExec ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; // Vehicle needs assistance
_marker setMarkerSize [0.6, 0.6];

_veh_type = selectRandom btc_civ_type_veh;
Expand Down
12 changes: 11 additions & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1555,12 +1555,22 @@
<German>Alle Verstecke sind zerstört, nun sind die Oplitas besiegt! Mission erfüllt</German>
</Key>
</Container>
<Container name="Other: Wreck Marker ">
<Container name="Other: Markers ">
<Key ID="STR_BTC_HAM_O_EH_VEHKILLED_MRK">
<Original>%1 wreck</Original>
<English>%1 wreck</English>
<German>%1 Wrack</German>
</Key>
<Key ID="STR_BTC_HAM_O_EH_HDHIDEOUT_MRK">
<Original>Hideout %1 destroyed</Original>
<English>Hideout %1 destroyed</English>
<German>Versteck %1 wurde zerstört</German>
</Key>
<Key ID="STR_BTC_HAM_O_EH_HDCACHE_MRK">
<Original>Cached %1 destroyed</Original>
<English>Cached %1 destroyed</English>
<German>Waffenlager %1 wurde zerstört</German>
</Key>
</Container>
<Container name="Other: Basics">
<Key ID="STR_BTC_HAM_O_BASIC_DEFAULT">
Expand Down