From be32981b6bd91292e777bb2b7258e60ab9c03a15 Mon Sep 17 00:00:00 2001 From: nomisum Date: Wed, 6 Mar 2019 14:12:45 +0100 Subject: [PATCH] max items available, more radio positions params, terminal fixes --- BC_buyables/factions/russia.hpp | 4 +-- BC_buymenu/functions/fn_changeValue.sqf | 17 +++++++++-- BC_buymenu/functions/fn_createGUI.sqf | 6 ++-- BC_buymenu/functions/fn_getVehicleParams.sqf | 11 ++++---- .../functions/client/fn_addInteractions.sqf | 12 +++----- BC_setup/rscDefines.hpp | 2 +- description.ext | 4 +-- .../server/fn_terminalAttachToVeh.sqf | 6 ++++ init.sqf | 4 +-- mission.sqm | 28 +++++++++---------- 10 files changed, 55 insertions(+), 39 deletions(-) diff --git a/BC_buyables/factions/russia.hpp b/BC_buyables/factions/russia.hpp index f6c502a8..e5c05fb3 100644 --- a/BC_buyables/factions/russia.hpp +++ b/BC_buyables/factions/russia.hpp @@ -12,11 +12,11 @@ class Russia { driverGps = "true"; crewHelmet = "rhs_tsh4"; disableTIEquipment = "true"; + terminalPositionOffset = "[0.3,-2.85,0.7]"; + terminalVectorDirAndUp = "[[0,1,0.3],[0,0,0.7]]"; class rhs_gaz66_r142_vdv { condition = "!BC_IS_WOODLAND"; - terminalPositionOffset = "[0.3,-2.85,0.7]"; - terminalVectorDirAndUp = "[[0,1,0.3],[0,0,0.7]]"; vehicleInit = "[['rhs_sand',1], ['mast_handler',0,'cover_hide',0,'spare_hide',0,'bench_hide',0,'rear_numplate_hide',1,'light_hide',1]]"; code = "[(_this select 0)] call BC_buyables_fnc_configureOpforStartVehicle;"; }; diff --git a/BC_buymenu/functions/fn_changeValue.sqf b/BC_buymenu/functions/fn_changeValue.sqf index 8777b988..5e77e299 100644 --- a/BC_buymenu/functions/fn_changeValue.sqf +++ b/BC_buymenu/functions/fn_changeValue.sqf @@ -62,6 +62,7 @@ private _enableDisableButtons = { // reset to default _ctrlSingleCount ctrlSetBackgroundColor [0,0,0,0.8]; + _ctrlSingleCount ctrlSetStructuredText parseText ("" + ("max " + str _stock) + ""); // disable all buttons of cat if necessary and exit if (_catValue >= _valueMaxInThisCat) exitWith { @@ -70,6 +71,17 @@ private _enableDisableButtons = { _btnPlus ctrlEnable false; _btnMinus ctrlEnable true; } forEach _catPlusMinusButtons; + + // just do disable again on individual basis when max item value is reached + if (_itemValue >= _stock) then { + _ctrlSingleCount ctrlSetBackgroundColor [0.4,0.66,0.4,1]; + _ctrlSingleCount ctrlSetStructuredText parseText ("" + ("max " + str _stock) + ""); + + _ctrlChosenInThisCat ctrlSetStructuredText parseText ( + _catFormatting + str _catValue + "/" + str _maxValue + "" + ); + _ctrlChosenInThisCat ctrlCommit 0; + }; true }; @@ -81,9 +93,10 @@ private _enableDisableButtons = { } forEach _catPlusMinusButtons; // just do disable again on individual basis when max item value is reached - if (_itemValue == _maxItemValue || _itemValue >= _stock) exitWith { + if (_itemValue == _maxItemValue || _itemValue >= _stock) exitWith { _btnPlus ctrlEnable false; - _ctrlSingleCount ctrlSetBackgroundColor [0.8,0,0,0.8]; + _ctrlSingleCount ctrlSetBackgroundColor [0.4,0.66,0.4,1]; + _ctrlSingleCount ctrlSetStructuredText parseText ("" + ("max " + str _stock) + ""); false }; diff --git a/BC_buymenu/functions/fn_createGUI.sqf b/BC_buymenu/functions/fn_createGUI.sqf index 052485b3..9bdc655a 100644 --- a/BC_buymenu/functions/fn_createGUI.sqf +++ b/BC_buymenu/functions/fn_createGUI.sqf @@ -353,11 +353,11 @@ for "_i" from 0 to (count _categoriesExtracted - 1) do { private _singleCount = _display ctrlCreate ["RscStructuredText", -1]; _singleCount ctrlsetFont "RobotoCondensedBold"; _singleCount ctrlSetBackgroundColor [0,0,0,0.8]; - _singleCount ctrlSetStructuredText parseText ("" + ("max: " + str _stock) + ""); + _singleCount ctrlSetStructuredText parseText ("" + ("max " + str _stock) + ""); _singleCount ctrlSetPosition [ - _columnWidth * _multiplicator + safezoneX + _columnWidth, + _columnWidth * _multiplicator + safezoneX + _columnWidth + _columnWidth/2, (_i * (_rowHeight * 8) + safezoneY) + _rowHeight * 3.65, - _columnWidth * 4, + _columnWidth * 3, _rowHeight * 0.85 ]; _singleCount ctrlCommit 0; diff --git a/BC_buymenu/functions/fn_getVehicleParams.sqf b/BC_buymenu/functions/fn_getVehicleParams.sqf index 77aefbea..cbab066b 100644 --- a/BC_buymenu/functions/fn_getVehicleParams.sqf +++ b/BC_buymenu/functions/fn_getVehicleParams.sqf @@ -10,12 +10,13 @@ private _driverGPS = [(_categoryConfig >> "driverGPS"), "text", "true"] call CBA private _crewHelmet = [(_categoryConfig >> "crewHelmet"), "text", ""] call CBA_fnc_getConfigEntry; private _disableTIEquipment = [(_categoryConfig >> "disableTIEquipment"), "text", "true"] call CBA_fnc_getConfigEntry; -// diag_log format ["_itemConfig %1, _isSpecial %2, _crewHelmet %3", _itemConfig, _isSpecial, _crewHelmet]; +diag_log format ["_baseConfig %1, _itemConfig %2, _isStartVehicle %3", _baseConfig, _itemConfig, _isStartVehicle]; -private _canMoveDuringTransmission = [(_itemConfig >> "canMoveDuringTransmission"), "text", "false"] call CBA_fnc_getConfigEntry isEqualTo "true"; -private _terminal_position_offset = ([(_itemConfig >> "terminalPositionOffset"), "array", []] call CBA_fnc_getConfigEntry); -private _terminal_position_vectorDirAndUp = ([(_itemConfig >> "terminalVectorDirAndUp"), "array", []] call CBA_fnc_getConfigEntry); -private _antennaOffset = ([(_itemConfig >> "antennaOffset"), "array", []] call CBA_fnc_getConfigEntry); + +private _canMoveDuringTransmission = [(_baseConfig >> "StartVehicle" >> "canMoveDuringTransmission"), "text", "false"] call CBA_fnc_getConfigEntry isEqualTo "true"; +private _terminal_position_offset = ([(_baseConfig >> "StartVehicle" >> "terminalPositionOffset"), "array", []] call CBA_fnc_getConfigEntry); +private _terminal_position_vectorDirAndUp = ([(_baseConfig >> "StartVehicle" >> "terminalVectorDirAndUp"), "array", []] call CBA_fnc_getConfigEntry); +private _antennaOffset = ([(_baseConfig >> "StartVehicle" >> "antennaOffset"), "array", []] call CBA_fnc_getConfigEntry); // diag_log format ["_canMoveDuringTransmission %1", _canMoveDuringTransmission]; diff --git a/BC_setup/functions/client/fn_addInteractions.sqf b/BC_setup/functions/client/fn_addInteractions.sqf index 9ef61a87..d4599450 100644 --- a/BC_setup/functions/client/fn_addInteractions.sqf +++ b/BC_setup/functions/client/fn_addInteractions.sqf @@ -120,7 +120,7 @@ if (!hasInterface) exitWith {}; _terminal setPos [getPos _terminal select 0, getPos _terminal select 1, 0.1]; GRAD_TERMINAL = true; publicVariable "GRAD_TERMINAL"; - [_terminal, true, [0,1.4,0], 270]] remoteExec ["ace_dragging_fnc_setDraggable", 0, true]; + [_terminal, true, [0,1.4,0], 270] remoteExec ["ace_dragging_fnc_setDraggable", 0, true]; }, {hint "Cancelled action"}, (localize "str_GRAD_detaching_radio")] call ace_common_fnc_progressBar; }, {(side player == east) && ((_this select 0) getVariable ["detachableRadio", 0] == 1)}] call ace_interact_menu_fnc_createAction; @@ -130,7 +130,7 @@ if (!hasInterface) exitWith {}; // TERMINAL TRANSMISSION private _openAction = ["terminalActionOpen", "Start transmission", "", { - [_target] call GRAD_tracking_fnc_terminalOpen; + [_target] spawn GRAD_tracking_fnc_terminalOpen; }, {_target getVariable ['TerminalStatus',-1] == 0}] call ace_interact_menu_fnc_createAction; @@ -139,7 +139,7 @@ if (!hasInterface) exitWith {}; private _closeAction = ["terminalActionClose", "End transmission", "", { - [_target] call GRAD_tracking_fnc_terminalClose; + [_target] spawn GRAD_tracking_fnc_terminalClose; }, {_target getVariable ['TerminalStatus',-1] == 2}] call ace_interact_menu_fnc_createAction; @@ -164,13 +164,9 @@ if (!hasInterface) exitWith {}; _terminal = missionNamespace getVariable ["GRAD_tracking_terminalObj", objNull]; _radioVeh = missionNamespace getVariable ["GRAD_tracking_radioVehObj", objNull]; - [_terminal, false, [0,1.4,0], 270]] remoteExec ["ace_dragging_fnc_setDraggable", 0, true]; GRAD_TERMINAL = false; publicVariable "GRAD_TERMINAL"; - private _offset = _radioVeh getVariable ["BC_terminal_position_offset", [0,-2,0]]; - private _vectorDirAndUp = _radioVeh getVariable ["BC_terminal_position_vectorDirAndUp", [[0,0,0],[0,0,0]]]; - (_terminal) attachTo [_radioVeh ,_offset]; - (_terminal) setVectorDirAndUp _vectorDirAndUp; + [_terminal, _radioVeh] call GRAD_tracking_fnc_terminalAttachToVeh; }, {hint "Cancelled action"}, (localize "str_GRAD_attaching_radio")] call ace_common_fnc_progressBar; }, diff --git a/BC_setup/rscDefines.hpp b/BC_setup/rscDefines.hpp index 345dfdf1..f9f0bb9e 100644 --- a/BC_setup/rscDefines.hpp +++ b/BC_setup/rscDefines.hpp @@ -433,7 +433,7 @@ class BC_setup_RscMapControl y = 0.10; w = 0.80; h = 0.60; - + widthRailWay = 1; moveOnEdges = 0; shadow = 1; ptsPerSquareSea = 5; diff --git a/description.ext b/description.ext index b0de2b14..eeaa17a0 100644 --- a/description.ext +++ b/description.ext @@ -149,8 +149,8 @@ class Params class GRAD_INTERVALS_NEEDED { title = "Number of random places opfor needs to transmit at"; - values[] = {1, 2, 3, 4, 5, 6}; - texts[] = {"none","2","3","4","5","6"}; + values[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + texts[] = {"none","2","3","4","5","6","7","8","9","10"}; default = 2; }; diff --git a/grad_tracking/functions/server/fn_terminalAttachToVeh.sqf b/grad_tracking/functions/server/fn_terminalAttachToVeh.sqf index 7785673a..c8ac127b 100644 --- a/grad_tracking/functions/server/fn_terminalAttachToVeh.sqf +++ b/grad_tracking/functions/server/fn_terminalAttachToVeh.sqf @@ -1,8 +1,14 @@ params ["_terminal", "_radioVeh"]; +/* +private _offset = _radioVeh getVariable ["BC_terminal_position_offset", [0,-2,0]]; +private _vectorDirAndUp = _radioVeh getVariable ["BC_terminal_position_vectorDirAndUp", [[0,0,0],[0,0,0]]]; +*/ + _terminal attachTo [_radioVeh,[0.3,-2.85,0.7]]; _terminal setVectorDirAndUp [[0,1,0.3],[0,0,0.7]]; +[_terminal, false, [0,1.4,0], 270] remoteExec ["ace_dragging_fnc_setDraggable", 0, true]; _terminal setVariable ["TerminalStatus",0,true]; _terminal setObjectTextureGlobal [0, "#(argb,8,8,3)color(0,0,0,0.0,co)"]; diff --git a/init.sqf b/init.sqf index 1bbe8643..a1be8ab1 100644 --- a/init.sqf +++ b/init.sqf @@ -18,9 +18,9 @@ if (BC_IS_WOODLAND) then { */ // call compile preprocessfile "BC_loadouts\setLoadoutRandomization.sqf"; - - waitUntil {!isNil "JIP_TIME_ALLOWED"}; +waitUntil {!isNil "CONQUER_MODE"}; +waitUntil {!isNil "PREPARATION_TIME"}; jipTime = JIP_TIME_ALLOWED; waitUntil {!isNil "GRAD_REPLAY_PRECISION"}; diff --git a/mission.sqm b/mission.sqm index d31ca1e3..e51b6798 100644 --- a/mission.sqm +++ b/mission.sqm @@ -16,10 +16,10 @@ class EditorData }; class Camera { - pos[]={1571.146,14.665044,5208.625}; - dir[]={0.20212093,-0.22939655,0.95224828}; - up[]={0.047652557,0.97329503,0.22450903}; - aside[]={0.97832167,-2.1703745e-006,-0.20766054}; + pos[]={1632.7085,33.223434,5322.4546}; + dir[]={0.376863,-0.37506327,0.84708482}; + up[]={0.15249044,0.92695153,0.34275967}; + aside[]={0.91376495,-1.4356337e-006,-0.40653318}; }; }; binarizationWanted=0; @@ -7379,7 +7379,7 @@ class Mission class Attribute0 { property="TFAR_freq_lr"; - expression="if !(_value isEqualTo '') then {_value=[_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_lr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; } else { _value = [str _value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; }"; class Value { class data @@ -7397,7 +7397,7 @@ class Mission class Attribute1 { property="TFAR_freq_sr"; - expression="if !(_value isEqualTo '') then {_value=[_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_sr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; } else { _value = [str _value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; }"; class Value { class data @@ -7711,7 +7711,7 @@ class Mission class Attribute0 { property="TFAR_freq_lr"; - expression="if !(_value isEqualTo '') then {_value=[_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_lr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; } else { _value = [str _value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; }"; class Value { class data @@ -7729,7 +7729,7 @@ class Mission class Attribute1 { property="TFAR_freq_sr"; - expression="if !(_value isEqualTo '') then {_value=[_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_sr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; } else { _value = [str _value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; }"; class Value { class data @@ -8043,7 +8043,7 @@ class Mission class Attribute0 { property="TFAR_freq_lr"; - expression="if !(_value isEqualTo '') then {_value=[_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_lr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; } else { _value = [str _value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; }"; class Value { class data @@ -8061,7 +8061,7 @@ class Mission class Attribute1 { property="TFAR_freq_sr"; - expression="if !(_value isEqualTo '') then {_value=[_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_sr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; } else { _value = [str _value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; }"; class Value { class data @@ -11351,7 +11351,7 @@ class Mission class Attribute0 { property="TFAR_freq_lr"; - expression="if !(_value isEqualTo '') then {_value=[_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_lr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; } else { _value = [str _value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; }"; class Value { class data @@ -11369,7 +11369,7 @@ class Mission class Attribute1 { property="TFAR_freq_sr"; - expression="if !(_value isEqualTo '') then {_value=[_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_sr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; } else { _value = [str _value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; }"; class Value { class data @@ -11823,7 +11823,7 @@ class Mission class Attribute0 { property="TFAR_freq_lr"; - expression="if !(_value isEqualTo '') then {_value=[_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_lr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; } else { _value = [str _value,9,87,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_lr',_value,true]; }"; class Value { class data @@ -11841,7 +11841,7 @@ class Mission class Attribute1 { property="TFAR_freq_sr"; - expression="if !(_value isEqualTo '') then {_value=[_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput;_this setVariable ['TFAR_freq_sr',_value,true];}"; + expression="if (_value isEqualTo '' || _value isEqualTo []) exitWith {}; if (_value isEqualType '') then { _value = [_value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; } else { _value = [str _value,8,512,30,10] call tfar_fnc_parseFrequenciesInput; _this setVariable ['TFAR_freq_sr',_value,true]; }"; class Value { class data