Skip to content

Commit

Permalink
max items available, more radio positions params, terminal fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nomisum committed Mar 6, 2019
1 parent 767698c commit be32981
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 39 deletions.
4 changes: 2 additions & 2 deletions BC_buyables/factions/russia.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;";
};
Expand Down
17 changes: 15 additions & 2 deletions BC_buymenu/functions/fn_changeValue.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private _enableDisableButtons = {

// reset to default
_ctrlSingleCount ctrlSetBackgroundColor [0,0,0,0.8];
_ctrlSingleCount ctrlSetStructuredText parseText ("<t size='0.7' align='center' shadow='0' color='#999999'>" + ("max " + str _stock) + "</t>");

// disable all buttons of cat if necessary and exit
if (_catValue >= _valueMaxInThisCat) exitWith {
Expand All @@ -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 ("<t size='0.7' align='center' shadow='0' color='#000000'>" + ("max " + str _stock) + "</t>");

_ctrlChosenInThisCat ctrlSetStructuredText parseText (
_catFormatting + str _catValue + "/" + str _maxValue + "</t>"
);
_ctrlChosenInThisCat ctrlCommit 0;
};
true
};

Expand All @@ -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 ("<t size='0.7' align='center' shadow='0' color='#000000'>" + ("max " + str _stock) + "</t>");
false
};

Expand Down
6 changes: 3 additions & 3 deletions BC_buymenu/functions/fn_createGUI.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 ("<t size='0.7' align='center' shadow='0' color='#999999'>" + ("max: " + str _stock) + "</t>");
_singleCount ctrlSetStructuredText parseText ("<t size='0.7' align='center' shadow='0' color='#999999'>" + ("max " + str _stock) + "</t>");
_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;
Expand Down
11 changes: 6 additions & 5 deletions BC_buymenu/functions/fn_getVehicleParams.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
12 changes: 4 additions & 8 deletions BC_setup/functions/client/fn_addInteractions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion BC_setup/rscDefines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions description.ext
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
6 changes: 6 additions & 0 deletions grad_tracking/functions/server/fn_terminalAttachToVeh.sqf
Original file line number Diff line number Diff line change
@@ -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)"];
Expand Down
4 changes: 2 additions & 2 deletions init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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"};
Expand Down
28 changes: 14 additions & 14 deletions mission.sqm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit be32981

Please sign in to comment.