-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Changes from 14 commits
0db2117
6561054
37da641
9405052
247a598
50c3045
803880a
3456998
8e06700
a0da886
ce657c8
fba9e12
5b73cf4
8dd8457
524e8c3
e782220
3053a6c
ef9b484
ca32f3a
4d76c0b
a05272c
4135c3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
params [ | ||
["_marker", ""], | ||
["_text", ""], | ||
["_arg", ""] | ||
]; | ||
//only run on client | ||
if (isDedicated) exitWith {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is only compiled client side so there are no way this function could be executed on As I understand, Guillustio choosed to only compile function where there are supposed to works. By this way, the loading is faster because there are less function to compile (only usefull function are compiled) and you avoid this type of check in every function and call :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am Sorry. That's my fault: I used this function in another project some month ago. And the snippets are remnant. I will remove them. |
||
|
||
//check parameters | ||
if !((typeName _marker) isEqualTo "STRING") then {_marker = str _marker;}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. createMarker only return string, nop? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
|
||
//check marker | ||
if ((getMarkerPos _marker) isEqualTo [0,0,0]) exitWith {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This mean you can't create a marker at position [0,0,0]. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
|
||
//check text for localization code | ||
if ((typeName _text) isEqualTo "CODE") then { | ||
_text = call _text; | ||
}; | ||
|
||
//set markerText | ||
_marker setMarkerTextLocal format [_text, _arg]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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_markerText = compile preprocessFileLineNumbers "core\fnc\common\set_markerText.sqf"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea I will change this. |
||
|
||
//CIV | ||
btc_fnc_civ_add_leaflets = compile preprocessFileLineNumbers "core\fnc\civ\add_leaflets.sqf"; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +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,{localize "STR_BTC_HAM_O_EH_VEHKILLED_MRK"},(getText (configFile >> "cfgVehicles" >> typeof _vehicle >> "displayName"))] remoteExec ["btc_fnc_set_markerText",0,true]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not a simple Then in
Do it for all remoteexec with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done 😄 |
||
_vehicle setVariable ["marker",_marker]; | ||
|
||
if (isServer) then {btc_rep_malus_veh_killed spawn btc_fnc_rep_change} else {btc_rep_malus_veh_killed remoteExec ["btc_fnc_rep_change", 2];}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
[_marker,{localize "STR_BTC_HAM_SIDE_CONVOY_MRKSTART"}] remoteExec ["btc_fnc_set_markerText",0,true]; //Convoy Start | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The JIP should be removed at the end of side mission see exemple 7. You could handle this by two way :
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I´ve changed something. Please take a look. |
||
_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 | ||
[_marker,{localize "STR_BTC_HAM_SIDE_CONVOY_MRKEND"}] remoteExec ["btc_fnc_set_markerText",0,true]; //Convoy End | ||
_marker2 setMarkerSize [0.6, 0.6]; | ||
|
||
_area = createmarker [format ["sm_%1",_pos2],_pos2]; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,{localize "STR_BTC_HAM_SIDE_UNDERWATER_MRK"}] remoteExec ["btc_fnc_set_markerText",0,true]; //Generator | ||
_marker setMarkerSize [0.6, 0.6]; | ||
|
||
|
||
|
@@ -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]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 )}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remoteexec only client side (-2) not all (0).
Do it for all remoteexec :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the reason for the execution on all machines.
A possible solution is this (for example):
But so you have extra code.