mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Localize and clean up trade_items_wo_db
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
private ["_part_out","_part_in","_qty_out","_qty_in","_textPartIn","_textPartOut","_qty","_needed","_started","_finished","_animState","_isMedic","_abort","_removed","_tradeCounter","_total_trades","_humanityGain","_humanity"];
|
||||
// [part_out,part_in, qty_out, qty_in,];
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
private ["_part_out","_part_in","_qty_out","_qty_in","_textPartIn","_textPartOut","_qty","_needed","_finished","_abort","_removed","_tradeCounter","_total_trades","_humanityGain","_humanity"];
|
||||
// [part_out,part_in, qty_out, qty_in,];
|
||||
|
||||
_part_out = (_this select 3) select 0;
|
||||
_part_in = (_this select 3) select 1;
|
||||
_qty_out = (_this select 3) select 2;
|
||||
_qty_in = (_this select 3) select 3;
|
||||
// _buy_o_sell = (_this select 3) select 4;
|
||||
_textPartIn = (_this select 3) select 5;
|
||||
_textPartOut = (_this select 3) select 6;
|
||||
//_traderID = (_this select 3) select 7;
|
||||
_textPartIn = getText (configFile >> "CfgMagazines" >> _part_in >> "displayName");
|
||||
_textPartOut = getText (configFile >> "CfgMagazines" >> _part_out >> "displayName");
|
||||
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
|
||||
@@ -40,37 +38,9 @@ for "_x" from 1 to _total_trades do {
|
||||
format[localize "str_epoch_player_187",_tradeCounter,_total_trades] call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started && !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
uiSleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
localize "str_epoch_player_106" call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
@@ -116,5 +86,4 @@ for "_x" from 1 to _total_trades do {
|
||||
if(_abort) exitWith {};
|
||||
};
|
||||
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
@@ -948,9 +948,12 @@ if (!isNull _cursorTarget && {!_inVehicle} && {!_isPZombie} && {player distance
|
||||
_cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false];
|
||||
s_player_parts set [count s_player_parts,_cancel];
|
||||
} else {
|
||||
private ["_itemName1","_itemName2"];
|
||||
// Static Menu
|
||||
{
|
||||
_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true];
|
||||
_itemName1 = getText (configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
|
||||
_itemName2 = getText (configFile >> "CfgMagazines" >> (_x select 1) >> "displayName");
|
||||
_buy = player addAction [format[localize "STR_EPOCH_TRADER_CATEGORY_TRADE_ITEMS",(_x select 3),_itemName2,(_x select 2),_itemName1], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3)],1, true, true];
|
||||
s_player_parts set [count s_player_parts,_buy];
|
||||
} count (_traderMenu select 1);
|
||||
_buyV = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\AdvancedTrading\init.sqf",(_traderMenu select 0), 999, true, false];
|
||||
|
||||
Reference in New Issue
Block a user