Skip to content

Commit

Permalink
Merge pull request #1099 from zgmrvn/master
Browse files Browse the repository at this point in the history
CBA Settings implementation to replace removed userconfig file
  • Loading branch information
kavinsky authored Sep 20, 2016
2 parents 3e6bcd3 + 15e5186 commit 7e57381
Show file tree
Hide file tree
Showing 6 changed files with 2,500 additions and 81 deletions.
2 changes: 1 addition & 1 deletion arma3/@task_force_radio/addons/task_force_radio/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class CfgPatches
units[] = {};
weapons[] = {};
requiredVersion = 1.0;
requiredAddons[] = { "CBA_Main", "task_force_radio_items"};
requiredAddons[] = { "CBA_Main", "cba_settings", "task_force_radio_items"};
author = "[TF]Nkey";
authorUrl = "https://github.com/michail-nikolaev/task-force-arma-3-radio";
url="https://github.com/michail-nikolaev/task-force-arma-3-radio";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// server
["TF_no_auto_long_range_radio", "CHECKBOX", localize "STR_radio_no_auto_long_range_radio", "Task Force Arrowhead Radio", true, true] call CBA_Settings_fnc_init;
["TF_give_personal_radio_to_regular_soldier", "CHECKBOX", localize "STR_radio_give_personal_radio_to_regular_soldier", "Task Force Arrowhead Radio", false, true] call CBA_Settings_fnc_init;
["TF_give_microdagr_to_soldier", "CHECKBOX", localize "STR_radio_give_microdagr_to_soldier", "Task Force Arrowhead Radio", true, true] call CBA_Settings_fnc_init;
["TF_same_sw_frequencies_for_side", "CHECKBOX", localize "STR_radio_same_sw_frequencies_for_side", "Task Force Arrowhead Radio", false, true] call CBA_Settings_fnc_init;
["TF_same_lr_frequencies_for_side", "CHECKBOX", localize "STR_radio_same_lr_frequencies_for_side", "Task Force Arrowhead Radio", false, true] call CBA_Settings_fnc_init;
["TF_same_dd_frequencies_for_side", "CHECKBOX", localize "STR_radio_same_dd_frequencies_for_side", "Task Force Arrowhead Radio", false, true] call CBA_Settings_fnc_init;
// client
["TF_default_radioVolume", "SLIDER", localize "STR_radio_default_radioVolume", "Task Force Arrowhead Radio", [1, 9, 9, 0]] call CBA_Settings_fnc_init;
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//#define DEBUG_MODE_FULL

// cba settings
#include "cba_settings.sqf"

if (isNil "tf_radio_channel_name") then {
tf_radio_channel_name = "TaskForceRadio";
};
Expand Down Expand Up @@ -130,27 +133,6 @@ disableSerialization;
#include "diary.sqf"

waitUntil {sleep 0.2;time > 0};
if (isNil "tf_no_auto_long_range_radio") then {
if (!isNil "tf_no_auto_long_range_radio_server") then {
tf_no_auto_long_range_radio = tf_no_auto_long_range_radio_server;
}else{
tf_no_auto_long_range_radio = true;
};
};
if (isNil "TF_give_personal_radio_to_regular_soldier") then {
if (!isNil "TF_give_personal_radio_to_regular_soldier_server") then {
TF_give_personal_radio_to_regular_soldier = TF_give_personal_radio_to_regular_soldier_server;
}else{
TF_give_personal_radio_to_regular_soldier = false;
};
};
if (isNil "TF_give_microdagr_to_soldier") then {
if (!isNil "TF_give_microdagr_to_soldier_server") then {
TF_give_microdagr_to_soldier = TF_give_microdagr_to_soldier_server;
}else{
TF_give_microdagr_to_soldier = true;
};
};
waitUntil {sleep 0.1;!(isNull player)};
TFAR_currentUnit = call TFAR_fnc_currentUnit;
[parseText(localize ("STR_init")), 5] call TFAR_fnc_ShowHint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,11 @@
#define MAX_RADIO_COUNT 1000
private ["_variableName", "_radio_request", "_responseVariableName", "_response", "_task_force_radio_used", "_last_check", "_allUnits"];

// cba settings
#include "cba_settings.sqf"

TF_server_addon_version = TF_ADDON_VERSION;
publicVariable "TF_server_addon_version";

if (isNumber (ConfigFile >> "task_force_radio_settings" >> "tf_no_auto_long_range_radio")) then {
tf_no_auto_long_range_radio_server = getNumber (ConfigFile >> "task_force_radio_settings" >> "tf_no_auto_long_range_radio") == 1;
} else {
tf_no_auto_long_range_radio_server = true;
};
publicVariable "tf_no_auto_long_range_radio_server";
if (isNumber (ConfigFile >> "task_force_radio_settings" >> "TF_give_personal_radio_to_regular_soldier")) then {
TF_give_personal_radio_to_regular_soldier_server = getNumber (ConfigFile >> "task_force_radio_settings" >> "TF_give_personal_radio_to_regular_soldier") == 1;
} else {
TF_give_personal_radio_to_regular_soldier_server = false;
};
publicVariable "TF_give_personal_radio_to_regular_soldier_server";
if (isNumber (ConfigFile >> "task_force_radio_settings" >> "tf_same_sw_frequencies_for_side")) then {
tf_same_sw_frequencies_for_side_server = getNumber (ConfigFile >> "task_force_radio_settings" >> "tf_same_sw_frequencies_for_side") == 1;
} else {
tf_same_sw_frequencies_for_side_server = false;
};
publicVariable "tf_same_sw_frequencies_for_side_server";
if (isNumber (ConfigFile >> "task_force_radio_settings" >> "tf_same_lr_frequencies_for_side")) then {
tf_same_lr_frequencies_for_side_server = getNumber (ConfigFile >> "task_force_radio_settings" >> "tf_same_lr_frequencies_for_side") == 1;
} else {
tf_same_lr_frequencies_for_side_server = false;
};
publicVariable "tf_same_lr_frequencies_for_side_server";
if (isNumber (ConfigFile >> "task_force_radio_settings" >> "tf_same_dd_frequencies_for_side")) then {
tf_same_dd_frequencies_for_side_server = getNumber (ConfigFile >> "task_force_radio_settings" >> "tf_same_dd_frequencies_for_side") == 1;
} else {
tf_same_dd_frequencies_for_side_server = false;
};
publicVariable "tf_same_dd_frequencies_for_side_server";


if (isNumber (ConfigFile >> "task_force_radio_settings" >> "TF_give_microdagr_to_soldier")) then {
TF_give_microdagr_to_soldier_server = getNumber (ConfigFile >> "task_force_radio_settings" >> "TF_give_microdagr_to_soldier") == 1;
} else {
TF_give_microdagr_to_soldier_server = true;
};
publicVariable "TF_give_microdagr_to_soldier_server";

waitUntil {sleep 0.1;time > 0};

Expand Down
2,485 changes: 2,484 additions & 1 deletion arma3/@task_force_radio/addons/task_force_radio/stringtable.xml

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions arma3/userconfig/task_force_radio/radio_settings.hpp

This file was deleted.

0 comments on commit 7e57381

Please sign in to comment.