Skip to content

Commit

Permalink
Update localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
oiad committed Feb 26, 2018
1 parent d925f7e commit f15b4fc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
6 changes: 1 addition & 5 deletions scripts/servicePoints/init.sqf
Expand Up @@ -31,8 +31,6 @@

private ["_folder","_servicePointClasses","_maxDistance","_actionTitleFormat","_actionCostsFormat","_message","_messageShown","_refuel_enable","_refuel_costs","_refuel_updateInterval","_refuel_amount","_repair_enable","_repair_costs","_repair_repairTime","_rearm_enable","_rearm_defaultcost","_rearm_costs","_rearm_magazineCount","_lastVehicle","_lastRole","_fnc_removeActions","_fnc_getCostsWep","_fnc_getCostsWep","_fnc_actionTitle","_fnc_isArmed","_fnc_getWeapons","_rearm_ignore","_cycleTime","_servicePoints","_vehicle","_role","_costs","_actionTitle","_weapons","_weaponName","_disabledText","_freeText"];

// ---------------- CONFIG START ----------------

diag_log "Service Points: loading config...";

// general settings
Expand All @@ -41,7 +39,7 @@ _servicePointClasses = ["Map_A_FuelStation_Feed","Land_A_FuelStation_Feed","Fuel
_maxDistance = 50; // maximum distance from a service point for the options to be shown
_actionTitleFormat = "%1 (%2)"; // text of the vehicle menu, %1 = action name (Refuel, Repair, Rearm), %2 = costs (see format below)
_actionCostsFormat = "%2 %1"; // %1 = item name, %2 = item count
_message = localize "STR_SP_MESSAGE"; // This is translated from your stringtable.xml in your mission folder root. Set to "" to disable
_message = localize "STR_CL_SP_MESSAGE"; // This is translated from your stringtable.xml in your mission folder root. Set to "" to disable
_cycleTime = 5; // Time in sections for how often the action menu will be refreshed and how often it will search for a nearby fuel station (setting this too low can make a lot of lag)
_disabledText = (localize "str_temp_param_disabled");
_freeText = (localize "strwffree");
Expand Down Expand Up @@ -88,8 +86,6 @@ _rearm_costs = [
[(localize "str_dn_dshkm"),5000] // DSHKM
];

// ---------------- CONFIG END ----------------

_lastVehicle = objNull;
_lastRole = [];
_messageShown = false;
Expand Down
36 changes: 18 additions & 18 deletions scripts/servicePoints/servicePointActions.sqf
Expand Up @@ -2,7 +2,7 @@
// Rewritten for single currency, gems, briefcase support and 1.0.6 epoch compatibility by salival - https://github.com/oiad/
// Requires DayZ Epoch 1.0.6 for gem support.

private ["_vehicle","_costs","_fuel","_magazineCount","_weapon","_type","_name","_weaponType","_weaponName","_turret","_magazines","_ammo","_textMissing","_pos","_message","_action","_partName","_damage","_selection","_strH","_disabled","_amount","_enoughMoney","_moneyInfo","_wealth","_success","_reason"];
private ["_vehicle","_costs","_fuel","_magazineCount","_weapon","_type","_name","_weaponType","_weaponName","_turret","_magazines","_ammo","_textMissing","_pos","_message","_action","_damage","_selection","_strH","_disabled","_amount","_enoughMoney","_moneyInfo","_wealth","_success","_reason","_cmpt"];

_vehicle = _this select 0;

Expand All @@ -27,9 +27,9 @@ if (_action == "rearm") then {

if (typeName _amount == "STRING") then {
if (_amount == (localize "str_temp_param_disabled")) then {
if (_action == "rearm") then {_reason = format[localize "STR_SP_UNABLE_REARM",_weaponName]; _disabled = true};
if (_action == "repair") then {_reason = format[localize "STR_SP_UNABLE_REPAIR",_name]; _disabled = true};
if (_action == "refuel") then {_reason = format[localize "STR_SP_UNABLE_REFUEL",_name]; _disabled = true};
if (_action == "rearm") then {_reason = format[localize "STR_CL_SP_UNABLE_REARM",_weaponName]; _disabled = true};
if (_action == "repair") then {_reason = format[localize "STR_CL_SP_UNABLE_REPAIR",_name]; _disabled = true};
if (_action == "refuel") then {_reason = format[localize "STR_CL_SP_UNABLE_REFUEL",_name]; _disabled = true};
};
if (_amount == (localize "strwffree")) then {_amount = 0};
};
Expand Down Expand Up @@ -63,15 +63,15 @@ if (_enoughMoney) then {
if (_action == "refuel") then {
[player,50,true,getPosATL player] spawn player_alertZombies;
_vehicle engineOn false;
[format[localize "STR_SP_REFUELING",_name],1] call dayz_rollingMessages;
[format[localize "STR_CL_SP_REFUELING",_name],1] call dayz_rollingMessages;
[_vehicle,"refuel",0,false] call dayz_zombieSpeak;

while {vehicle player == _vehicle} do {
if ([0,0,0] distance (velocity _vehicle) > 1) exitWith {[format[localize "STR_SP_REFUELING_STOPPED",_name],1] call dayz_rollingMessages};
if ([0,0,0] distance (velocity _vehicle) > 1) exitWith {[format[localize "STR_CL_SP_REFUELING_STOPPED",_name],1] call dayz_rollingMessages};
_fuel = (fuel _vehicle) + ((_this select 3) select 3);
if (_fuel > 0.99) exitWith {
_vehicle setFuel 1;
[format[localize "STR_SP_REFUEL_OK",_name],1] call dayz_rollingMessages;
[format[localize "STR_CL_SP_REFUEL_OK",_name],1] call dayz_rollingMessages;
};
_vehicle setFuel _fuel;
uiSleep ((_this select 3) select 2);
Expand All @@ -86,16 +86,16 @@ if (_enoughMoney) then {
{
if ((vehicle player != _vehicle) || {[0,0,0] distance (velocity _vehicle) > 1}) exitWith {
_allRepaired = false;
[format[localize "STR_SP_REPAIRING_STOPPED",_name],1] call dayz_rollingMessages;
[format[localize "STR_CL_SP_REPAIRING_STOPPED",_name],1] call dayz_rollingMessages;
};
_damage = [_vehicle,_x] call object_getHit;
if (_damage > 0) then {
_partName = toArray _x;
_partName set [0,20];
_partName set [1,45];
_partName set [2,20];
_partName = toString _partName;
[format [localize "STR_SP_REPAIRING",_partName],1] call dayz_rollingMessages;
_cmpt = [];
{
if (_forEachIndex > 2) then {_cmpt set [count _cmpt,_x]};
} forEach toArray (_x);
_cmpt = toString _cmpt;
[format[localize "STR_CL_SP_REPAIRING",_cmpt],1] call dayz_rollingMessages;
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _x >> "name");
_strH = "hit_" + (_selection);
_vehicle setHit[_selection,0];
Expand All @@ -109,7 +109,7 @@ if (_enoughMoney) then {
if (_allRepaired) then {
_vehicle setDamage 0;
_vehicle setVelocity [0,0,1];
[format[localize "STR_SP_REPAIR_OK",_name],1] call dayz_rollingMessages;
[format[localize "STR_CL_SP_REPAIR_OK",_name],1] call dayz_rollingMessages;
};
};

Expand All @@ -120,7 +120,7 @@ if (_enoughMoney) then {

for "_i" from 1 to _magazineCount do {_vehicle addMagazineTurret [_ammo,_turret];};

[format[localize "STR_SP_REARMED",_weaponName,_name],1] call dayz_rollingMessages;
[format[localize "STR_CL_SP_REARMED",_weaponName,_name],1] call dayz_rollingMessages;
};
call player_forceSave;
} else {
Expand All @@ -129,8 +129,8 @@ if (_enoughMoney) then {
} else {
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[_amount,true] call z_calcCurrency};
if (Z_SingleCurrency) then {
systemChat format [localize "STR_SP_FAIL_COINS",[_amount] call BIS_fnc_numberText,_itemText,_action,_name];
systemChat format[localize "STR_CL_SP_FAIL_COINS",[_amount] call BIS_fnc_numberText,_itemText,_action,_name];
} else {
systemChat format [localize "STR_SP_FAIL_BRIEFCASES",_itemText,_action,_name];
systemChat format[localize "STR_CL_SP_FAIL_BRIEFCASES",_itemText,_action,_name];
};
};

0 comments on commit f15b4fc

Please sign in to comment.