-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert all suitable settings to CBA Settings #36
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
471636c
Add in-game plugin settings
jonpas 6130591
Separate settings into separate file
jonpas 8929da7
Remove unneeded includes
jonpas 3a51653
Convert difficulty settings to CBA
jonpas df0bc12
Convert difficulty and basic mission settings to CBA settings, Deprec…
jonpas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,9 @@ class CfgVehicles | |
{ | ||
class Logic; | ||
class Module_F: Logic { class ArgumentsBaseUnits { class Units; }; class ModuleDescription { class AnyBrain; }; }; | ||
|
||
class GVAR(basicMissionSetup) : Module_F { | ||
scope = 2; | ||
scope = 1; | ||
displayName = "Basic Mission Setup"; | ||
author = "ACRE Team"; | ||
category = QGVAR(mission_setup); | ||
|
@@ -28,14 +28,14 @@ class CfgVehicles | |
class Arguments { | ||
class RadioSetup { | ||
displayName = "Channels Per Side"; | ||
description = "Set to true to have each side have different ACRE radio frequencies"; | ||
typeName = "BOOL"; | ||
description = "Set to true to have each side have different ACRE radio frequencies"; | ||
typeName = "BOOL"; | ||
class values { }; | ||
}; | ||
class BabelSetup { | ||
displayName = "Babel Language Per Side"; | ||
description = "Select whether each side has its own language, and whether they also share a common tongue."; | ||
typeName = "NUMBER"; | ||
description = "Select whether each side has its own language, and whether they also share a common tongue."; | ||
typeName = "NUMBER"; | ||
class values { | ||
class AllDifferent {name = "Per-Side"; value = 1; }; | ||
class SharingDifferent {name = "Per-Side /w Common"; value = 2; default = 2; }; | ||
|
@@ -69,9 +69,9 @@ class CfgVehicles | |
sync[] = {}; | ||
}; | ||
}; | ||
|
||
class GVAR(DifficultySettings) : Module_F { | ||
scope = 2; | ||
scope = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing again with hiding the module |
||
displayName = "Difficulty Settings"; | ||
category = QGVAR(mission_setup); | ||
|
||
|
@@ -87,29 +87,29 @@ class CfgVehicles | |
class Arguments { | ||
class SignalLoss { | ||
displayName = "Signal Loss"; | ||
description = "Set to false to disable signal and terrain loss values"; | ||
typeName = "BOOL"; | ||
description = "Set to false to disable signal and terrain loss values"; | ||
typeName = "BOOL"; | ||
defaultValue = true; | ||
class values { }; | ||
}; | ||
class FullDuplex { | ||
displayName = "Full-Duplex Transmissions"; | ||
description = "Set to true to enable full-duplex, or multiple people transmitting"; | ||
typeName = "BOOL"; | ||
description = "Set to true to enable full-duplex, or multiple people transmitting"; | ||
typeName = "BOOL"; | ||
defaultValue = false; | ||
class values { }; | ||
}; | ||
class Interference { | ||
displayName = "Signal Interference"; | ||
description = "Set to false to disable the interference from multiple transmitters"; | ||
typeName = "BOOL"; | ||
description = "Set to false to disable the interference from multiple transmitters"; | ||
typeName = "BOOL"; | ||
defaultValue = true; | ||
class values { }; | ||
}; | ||
class IgnoreAntennaDirection { | ||
displayName = "Ignore Antenna Direction"; | ||
description = "Set to true to disable loss due to antenna directional radiation patterns."; | ||
typeName = "BOOL"; | ||
description = "Set to true to disable loss due to antenna directional radiation patterns."; | ||
typeName = "BOOL"; | ||
defaultValue = false; | ||
class values { }; | ||
}; | ||
|
@@ -120,7 +120,7 @@ class CfgVehicles | |
sync[] = {}; | ||
}; | ||
}; | ||
|
||
class GVAR(nameChannels) : Module_F { | ||
scope = 2; | ||
displayName = "Name Channels"; | ||
|
@@ -137,11 +137,11 @@ class CfgVehicles | |
|
||
// Module arguments | ||
class Arguments { | ||
|
||
class SideSelect { | ||
displayName = "Side"; | ||
description = "Select the side to name channels for"; | ||
typeName = "NUMBER"; | ||
description = "Select the side to name channels for"; | ||
typeName = "NUMBER"; | ||
class values | ||
{ | ||
class All {name = "All"; value = 1; default = 1;}; | ||
|
@@ -151,7 +151,7 @@ class CfgVehicles | |
class Civ {name = "Civilian"; value = 5;}; | ||
}; | ||
}; | ||
|
||
class Channel_1 { | ||
displayName = "Channel 1"; | ||
description = "Name of Channel 1"; | ||
|
@@ -209,4 +209,4 @@ class CfgVehicles | |
sync[] = {}; | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Author: ACRE2Team | ||
* Returns all radios defined in CfgAcreRadios. | ||
* | ||
* Arguments: | ||
* None | ||
* | ||
* Return Value: | ||
* 1: Radio Class Names <ARRAY> | ||
* 2: Radio Display Names <ARRAY> | ||
* | ||
* Example: | ||
* [] call acre_api_fnc_getAllRadios; | ||
* | ||
* Public: Yes | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
// Return cached if already ran | ||
if (!isNil QGVAR(allRadios)) exitWith { | ||
GVAR(allRadios) | ||
}; | ||
|
||
// Compile and cache for later calls | ||
private _classes = []; | ||
private _names = []; | ||
{ | ||
private _isAcre = getNumber (_x >> "isAcre"); // All radio classes have that | ||
private _name = getText (_x >> "name"); // Only non-base classes have that | ||
|
||
// Has name and isAcre, assume valid radio class | ||
if (_isAcre == 1 && {_name != ""}) then { | ||
_classes pushBack (configName _x); | ||
_names pushBack _name; | ||
}; | ||
} forEach ("true" configClasses (configFile >> "CfgAcreComponents")); | ||
|
||
GVAR(allRadios) = [_classes, _names]; | ||
GVAR(allRadios) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Author: ACRE2Team | ||
* Sets up side frequencies and babel settings from settings menu. Can be ran only once per mission. | ||
* | ||
* Arguments: | ||
* 1: Radio Order <NUMBER> | ||
* 0: Radio Class Name <STRING> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [0, "ACRE_PRC343"] call acre_api_fnc_setupDefaultRadios; | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
// Exit on dedicated server or headless client | ||
if (!hasInterface) exitWith {}; | ||
|
||
// Run once after all 4 defaults have been initialized | ||
if (!isNil QGVAR(hasSetupDefaultRadios) && {GVAR(hasSetupDefaultRadios)}) exitWith {}; | ||
|
||
params ["_order", "_radioClass"]; | ||
|
||
// Wait for all 4 defaults to be initialized | ||
if (isNil QGVAR(defaultRadios)) then { | ||
GVAR(defaultRadios) = []; | ||
}; | ||
GVAR(defaultRadios) set [_order, _radioClass]; | ||
if (count (GVAR(defaultRadios) select {_x isEqualType ""}) < 4) exitWith {}; | ||
|
||
// Apply default radios | ||
private _addRadios = { | ||
// Don't regive radios if already given | ||
if (acre_player getVariable [QGVAR(hasGivenDefaultRadios), false]) exitWith {}; | ||
acre_player setVariable [QGVAR(hasGivenDefaultRadios), true, true]; | ||
|
||
private _cleanRadioList = []; | ||
if !("ACRE_PRC343" in _this) then { | ||
[acre_player, "ItemRadio"] call EFUNC(lib,removeGear); | ||
[acre_player, "ACRE_PRC343"] call EFUNC(lib,removeGear); | ||
_cleanRadioList = _this; | ||
} else { | ||
private _countDefaultRadios = 0; | ||
{ | ||
if (_x == "ACRE_PRC343") then { | ||
_countDefaultRadios = _countDefaultRadios + 1; | ||
if (_countDefaultRadios > 1) then { | ||
_cleanRadioList pushBack _x; | ||
}; | ||
} else { | ||
_cleanRadioList pushBack _x; | ||
}; | ||
} forEach _this; | ||
}; | ||
|
||
TRACE_1("Adding Radios",_cleanRadioList); | ||
|
||
if (!((["ACRE_PRC77", "ACRE_PRC117F"] arrayIntersect _cleanRadioList) isEqualTo []) && {backpack acre_player == ""}) then { | ||
acre_player addBackpack "B_AssaultPack_khk"; | ||
}; | ||
|
||
{ | ||
if (_x != "") then { | ||
acre_player addItem _x; | ||
}; | ||
} forEach _cleanRadioList; | ||
}; | ||
|
||
if (isNull acre_player) then { | ||
GVAR(defaultRadios) spawn { | ||
waitUntil {!isNull acre_player}; | ||
_this call _addRadios; | ||
}; | ||
} else { | ||
GVAR(defaultRadios) call _addRadios; | ||
}; | ||
|
||
|
||
GVAR(hasSetupDefaultRadios) = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Author: ACRE2Team | ||
* Sets up side frequencies and babel settings from settings menu. Can be ran only once per mission. | ||
* | ||
* Arguments: | ||
* 0: Unique Side Frequencies <BOOL> | ||
* 1: Babel <NUMBER> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [false, 0] call acre_api_fnc_setupFrequenciesAndBabel; | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
// Run once | ||
if (!isNil QGVAR(hasSetupFrequenciesAndBabel) && {GVAR(hasSetupFrequenciesAndBabel)}) exitWith {}; | ||
|
||
params ["_uniqueFrequencies", "_babel"]; | ||
|
||
// Unique frequencies are handled in FUNC(setupMission), no need to handle it here | ||
|
||
// No babel | ||
if (_babel == 0) exitWith { | ||
[false, _uniqueFrequencies] call FUNC(setupMission); | ||
}; | ||
|
||
// One language per side babel | ||
if (_babel == 1) exitWith { | ||
[true, _uniqueFrequencies] call FUNC(setupMission); | ||
}; | ||
|
||
// One language per side + common babel (Zeus gets ALL Languages, including "Common") | ||
// Handle the babel setup via an array, so the bool is set to false | ||
if (_babel == 2) exitWith { | ||
[false, _uniqueFrequencies] call FUNC(setupMission); | ||
[ | ||
[east, "Opfor", "Common"], | ||
[west, "Blufor", "Common"], | ||
[independent, "Indepedent", "Common"], | ||
[civilian, "Civilian", "Common"], | ||
[sideLogic, "Opfor", "Blufor", "Indepedent", "Civilian", "Common"] | ||
] call FUNC(babelSetupMission); | ||
}; | ||
|
||
GVAR(hasSetupFrequenciesAndBabel) = true; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would disagree with hiding the modules for now. As they are pretty intuitive for most mission makers