From 993ce14da63501ddc01cf3062a9c659ed1aeca9e Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Fri, 15 Apr 2016 20:16:13 -0400 Subject: [PATCH] Remove unnecessary key event handler reset No need to reset the key event handler again in player_monitor.fsm, it is already done onPreloadFinished. --- .../CfgServerTrader/Category/FriendlyMedicalSupplies.hpp | 5 +++++ SQF/dayz_code/compile/keyboard.sqf | 1 + SQF/dayz_code/compile/ui_selectSlot.sqf | 7 ++----- SQF/dayz_code/medical/selfbloodbag.sqf | 3 --- SQF/dayz_code/system/player_monitor.fsm | 3 --- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/SQF/dayz_code/Configs/CfgServerTrader/Category/FriendlyMedicalSupplies.hpp b/SQF/dayz_code/Configs/CfgServerTrader/Category/FriendlyMedicalSupplies.hpp index e9e373ded..1b9c32362 100644 --- a/SQF/dayz_code/Configs/CfgServerTrader/Category/FriendlyMedicalSupplies.hpp +++ b/SQF/dayz_code/Configs/CfgServerTrader/Category/FriendlyMedicalSupplies.hpp @@ -65,6 +65,11 @@ class Category_541 { buy[] = {2,"ItemSilverBar"}; sell[] = {1,"ItemSilverBar"}; }; + class emptyBloodBag { + type = "trade_items"; + buy[] = {2,"ItemSilverBar"}; + sell[] = {1,"ItemSilverBar"}; + }; class ItemEpinephrine { type = "trade_items"; buy[] = {2,"ItemSilverBar"}; diff --git a/SQF/dayz_code/compile/keyboard.sqf b/SQF/dayz_code/compile/keyboard.sqf index 32c0ffcf3..b756f32b0 100644 --- a/SQF/dayz_code/compile/keyboard.sqf +++ b/SQF/dayz_code/compile/keyboard.sqf @@ -349,6 +349,7 @@ if (isNil "keyboard_keys") then { (findDisplay 46) displayRemoveAllEventHandlers "KeyUp"; (findDisplay 46) displayRemoveAllEventHandlers "KeyDown"; (findDisplay 46) displayAddEventHandler ["KeyDown", preprocessFileLineNumbers (MISSION_ROOT+'keyboard.sqf')]; + if (!isNil "bis_fnc_halo_para_keydown_eh") then {bis_fnc_halo_para_keydown_eh = (finddisplay 46) displayAddEventHandler ["keydown","_this call bis_fnc_halo_keydown;"];}; // halo in progress //diag_log [diag_ticktime, __FILE__, "eh reset" ]; }; diff --git a/SQF/dayz_code/compile/ui_selectSlot.sqf b/SQF/dayz_code/compile/ui_selectSlot.sqf index 08738e8e8..222563150 100644 --- a/SQF/dayz_code/compile/ui_selectSlot.sqf +++ b/SQF/dayz_code/compile/ui_selectSlot.sqf @@ -3,20 +3,17 @@ disableSerialization; _control = _this select 0; _button = _this select 1; _parent = findDisplay 106; -_itemData = gearSlotData _control; if (carryClick) then {carryClick = false;}; -// No right click option on bloodbags if DZE_SelfTransfuse = false; -if (!DZE_SelfTransfuse && {(_itemData == "ItemBloodbag") or (_itemData in dayz_typedBags)}) exitWith {}; - if (_button == 1) then { private ["_conf","_name","_compile","_height","_item"]; _group = _parent displayCtrl 6902; _pos = ctrlPosition _group; - _item = gearSlotData _control; + _item = gearSlotData _control; + if (!DZE_SelfTransfuse && {_item == "ItemBloodbag" or _item in ["wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]}) exitWith {}; // No right click option on bloodbags if DZE_SelfTransfuse = false; if (mouseOverCarry) then { _item = DayZ_onBack; carryClick = true; diff --git a/SQF/dayz_code/medical/selfbloodbag.sqf b/SQF/dayz_code/medical/selfbloodbag.sqf index 10f19fed8..bc2c82ea6 100644 --- a/SQF/dayz_code/medical/selfbloodbag.sqf +++ b/SQF/dayz_code/medical/selfbloodbag.sqf @@ -87,7 +87,6 @@ while {r_doLoop and (_i < 12)} do { }; if (!_bagFound) then {_forceClose = true;} else { player removeMagazine _bagToRemove;}; cutText [localize "str_actions_medical_transfusion_start", "PLAIN DOWN"]; - [player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_start","PLAIN DOWN"] call RE; _started = true; }; @@ -132,7 +131,6 @@ while {r_doLoop and (_i < 12)} do { _unit setVariable ["LastTransfusion",time]; if (_TransfusionInfection) then {r_player_infected = true; player setVariable["USEC_infected",true,true];}; cutText [localize "str_actions_medical_transfusion_successful", "PLAIN DOWN"]; - [player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_successful","PLAIN DOWN"] call RE; r_doLoop = false; }; @@ -141,7 +139,6 @@ while {r_doLoop and (_i < 12)} do { if (r_interrupt or !_isClose or _forceClose) then { diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 (%3) | _i = %4)", r_interrupt, player distance _unit, _isClose, _i]; cutText [localize "str_actions_medical_transfusion_interrupted", "PLAIN DOWN"]; - [player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_interrupted","PLAIN DOWN"] call RE; r_doLoop = false; }; diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index 13a78262e..13339592c 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -988,9 +988,6 @@ class FSM " };" \n "} count allMissionObjects ""SpawnableWreck"";" \n "{deleteVehicle _x} count (_setPos nearEntities [""zZombie_Base"",30]);" \n - "diag_log [ 'resetting keyboard events',(MISSION_ROOT+'keyboard.sqf')];" \n - "keyboard_keys = nil;" \n - "[controlNull, 1, false,false,false] call compile preprocessFileLineNumbers (MISSION_ROOT+'keyboard.sqf');" \n "" \n "if(dayz_paraSpawn && (freshSpawn == 2)) then {" \n " player setDir _setDir;" \n