Skip to content
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

Added GUI prefix and Experimental Battle Menu #3229

Merged
merged 41 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5dd52f7
Refactored GUI addon to use A3A_GUI and FUNC(name)
CalebSerafin Jul 31, 2022
8158149
Corrected issues with stringed macros.
CalebSerafin Jul 31, 2022
dcbf6d2
Fast travel place holders. Menu opens fast travel.
CalebSerafin Aug 3, 2022
c5adb2f
💰 Added donation functionality.
CalebSerafin Oct 3, 2022
84c9339
Donate and Admin mostly functional. FT needs work.
CalebSerafin Jan 3, 2023
3e66921
Migrated SetupGUI to use A3A_GUI prefix.
CalebSerafin Jan 4, 2023
252ab99
Fixed Message syntax.
CalebSerafin Aug 13, 2023
fd3b8ad
Merge remote-tracking branch 'origin/unstable' into CS-AdminMenu
CalebSerafin Apr 17, 2024
58fca3e
Re-added buyVehicleDialog after deletion
CalebSerafin Apr 17, 2024
90d9620
Fixed GUI_ prefix and fast travel time formatting variables.
CalebSerafin Apr 17, 2024
0bac90f
removed plural from FT and fixed current money formatting.
CalebSerafin Apr 17, 2024
0b6edba
Fixed hide top bar anddonate money,
CalebSerafin Apr 18, 2024
31c6ff0
Corrent _this refference.
CalebSerafin Apr 18, 2024
d2a38f2
Removed other language entries in modified string table keys.
CalebSerafin Apr 18, 2024
38cb89d
Revert "Removed other language entries in modified string table keys."
CalebSerafin Apr 18, 2024
9d5bc75
Reverted string table key wipe
CalebSerafin Apr 18, 2024
bc0f5a6
Fixed hinting during canGoUndrecover. and disabled Go Overt.
CalebSerafin May 14, 2024
c8da9ab
Update A3A/addons/core/functions/Dialogs/fn_HQGameOptions.sqf
CalebSerafin May 14, 2024
7b5d481
Update A3A/addons/core/functions/Dialogs/fn_fastTravelRadio.sqf
CalebSerafin May 14, 2024
7762421
Added is Admin functions.
CalebSerafin May 15, 2024
ba29b44
Changed timespan formatting print zero signigicant amounts rather tha…
CalebSerafin May 15, 2024
9e26587
Fixed donate money player list generation.
CalebSerafin May 15, 2024
b311244
Fixed isAdmin check to use new functions for admin tab.
CalebSerafin May 15, 2024
1ac2cc8
Update A3A/addons/core/functions/Time/fn_timeSpan_format.sqf
CalebSerafin May 21, 2024
338f40b
Fixed non-existant variable in sendMoney.
CalebSerafin May 21, 2024
fc47ac2
Removed the silly server side check since arma 3 is based on the crea…
CalebSerafin May 21, 2024
74cc317
Fixed HQGameOptgions not woirking with civ limit.
CalebSerafin May 21, 2024
1f93a6c
Removed fast travel async.
CalebSerafin May 26, 2024
e67c1b1
Merge branch 'unstable' into CS-AdminMenu
CalebSerafin May 26, 2024
8231e0c
Limitetd asset teleport distance to 50m of HQ.
CalebSerafin May 26, 2024
7b1fc43
Removed isClientOrServer
CalebSerafin Jun 3, 2024
a2e130d
Fixed backwards compatibility and error reporting in resourcesPlayer …
CalebSerafin Jun 3, 2024
b795ce3
Fixed semicolon.
CalebSerafin Jun 3, 2024
b079eea
simplified future calculateFastTravel cost calculation
CalebSerafin Jun 3, 2024
b6eb65c
Removed annoying mapscale debug line.
CalebSerafin Jun 3, 2024
3555979
Added unit tests as documentation for timeSpan_format. timeSpan_forma…
CalebSerafin Jun 11, 2024
07aab0c
Made FUNC() consistent. Fixed script errors in hQDialog.
CalebSerafin Jun 11, 2024
c3f887b
Put New battle menu and HQ dialogue behind a paramter setting "Use In…
CalebSerafin Jun 11, 2024
733c9e0
Commented out addAction for Experimental HQ Management
CalebSerafin Jun 11, 2024
ac78fe2
Fixed handling of groups or players passed to canFastTravel or calcul…
CalebSerafin Jun 12, 2024
c6ff419
Merge branch 'unstable' into CS-AdminMenu
CalebSerafin Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion A3A/addons/core/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,13 @@ class CfgFunctions
class prepFunctions {};
class spawnDebuggingLoop {};
class spawnSelectedTemplateAI {};
class debugSpawnVics {};
class debugSpawnVics {};
};

class Dialogs {
file = QPATHTOFOLDER(functions\Dialogs);
class canFastTravel {};
class calculateFastTravelCost {};
class clearForest {};
class createDialog_shouldLoadPersonalSave {};
class dialogHQ {};
Expand Down Expand Up @@ -445,6 +447,10 @@ class CfgFunctions
class OrgPlayers {
file = QPATHTOFOLDER(functions\OrgPlayers);
class donateMoney {};
class sendMoney {};
class isClientAdmin {};
class isLocalAdmin {};
class isLocalAdminOrServer {};
class isMember {};
class makePlayerBossIfEligible {};
class memberAdd {};
Expand Down
14 changes: 10 additions & 4 deletions A3A/addons/core/Stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2925,7 +2925,7 @@
<Russian>Текущий уровень: %2. Стоимость обучения на следующем уровне: %1 €.</Russian>
</Key>
<Key ID="STR_A3A_fn_dialogs_fastTravelRadio_begin">
<Original>Fast traveling, travel time: %1s, please wait.</Original>
<Original>Fast traveling, travel time: %1, please wait.</Original>
<Korean>빠른 이동 중. 도착 시간까지: %1초, 잠시만 기다려 주십시오...</Korean>
<Russian>Быстрое перемещение: пожалуйста, подождите %1 сек.</Russian>
</Key>
Expand Down Expand Up @@ -5373,7 +5373,7 @@
</Container>
<Container name="A3A_fn_OrgPlayers">
<Key ID="STR_A3A_fn_orgp_donMon_donated_faction">
<Original>You have donated 100 € to the cause. This will raise your status among our forces.</Original>
<Original>You have donated %1 € to the cause. This will raise your status among our forces.</Original>
<Italian>Hai donato 100 € alla causa. Ciò accrescerà il tuo status tra le nostre forze.</Italian>
<Spanish>Ha donado 100 € a la causa. Esto incrementará su estatus entre sus fuerzas.</Spanish>
<French>Vous avez donné 100 € à la cause. Cela va améliorer votre réputation au sein de nos forces</French>
Expand All @@ -5384,7 +5384,7 @@
<Chinesesimp>你为大义慷慨贡献了 100 €. 此举将提升你在我军中的地位.</Chinesesimp>
</Key>
<Key ID="STR_A3A_fn_orgp_donMon_donated_player">
<Original>You have donated 100 € to %1.</Original>
<Original>You have donated %2 € to %1.</Original>
<Italian>Hai donato 100 € a %1.</Italian>
<Spanish>Ha donado 100 € a %1.</Spanish>
<French>Vous avez donné 100 € à %1.</French>
Expand All @@ -5394,8 +5394,11 @@
<Czech>Daroval jsi 100 € hráči %1.</Czech>
<Chinesesimp>你慷慨贡献 100 € 给了 %1.</Chinesesimp>
</Key>
<Key ID="STR_A3A_fn_orgp_donMon_received_money">
<Original>You received a %1 € donation from %2.</Original>
</Key>
<Key ID="STR_A3A_fn_orgp_donMon_no_less">
<Original>You have less than 100 € to donate.</Original>
<Original>Insufficient Funds&lt;br/&gt;You have less than %1 € to donate.</Original>
<Italian>Hai meno di 100 € da donare.</Italian>
<Spanish>Tiene menos de 100 € para donar.</Spanish>
<French>Vous avez moins de 100 € à donner.</French>
Expand Down Expand Up @@ -5427,6 +5430,9 @@
<Czech>Darovat peníze</Czech>
<Chinesesimp>贡献资金</Chinesesimp>
</Key>
<Key ID="STR_A3A_fn_orgp_donMon_not_positive">
<Original>Donation amount must be greater than 0.</Original>
</Key>
<Key ID="STR_A3A_fn_orgp_memAdd_added_other">
<Original>%1 has been added to the Server Members List.</Original>
<Italian>%1 è stato aggiunto alla Lista dei Membri del Server</Italian>
Expand Down
10 changes: 5 additions & 5 deletions A3A/addons/core/dialogs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1312,13 +1312,13 @@ class radio_comm {
class 8slots_R2: A3A_core_BattleMenuRedButton
{
idc = -1;
text = ""; //$STR_antistasi_dialogs_radio_comm_construct;
text = "New Battle Menu"; // Don't localize, tempory button.
x = 0.482498 * safezoneW + safezoneX;
y = 0.415981 * safezoneH + safezoneY;
w = 0.175015 * safezoneW;
h = 0.0560125 * safezoneH;
tooltip = $STR_antistasi_dialogs_radio_comm_construct_tooltip;
//action = "closeDialog 0;_nul = createDialog ""construction_menu"";";
tooltip = "Experimental Battle Menu. Work in Progress."; // Don't localize, tempory button.
action = "closeDialog 0; if (A3A_GUIDevPreview) then { _nul = createDialog ""A3A_MainDialog""; } else {[localize ""$STR_A3A_Params_GUIDevPreview_title"",""This paraemter must be enabled in params""] call A3A_fnc_customHint; };";
};
class 8slots_L3: A3A_core_BattleMenuRedButton
{
Expand Down Expand Up @@ -2287,7 +2287,7 @@ class player_money {
y = 0.317959 * safezoneH + safezoneY;
w = 0.175015 * safezoneW;
h = 0.0560125 * safezoneH;
action = "[true] call A3A_fnc_donateMoney;";
action = "[player, cursorObject, 100] call A3A_fnc_sendMoney;";
};
class HQ_button_AA: A3A_core_BattleMenuRedButton
{
Expand All @@ -2298,7 +2298,7 @@ class player_money {
w = 0.175015 * safezoneW;
h = 0.0560125 * safezoneH;
tooltip = $STR_antistasi_dialogs_player_money_donate_faction_tooltip;
action = "[] call A3A_fnc_donateMoney;";
action = "[player, 'faction', 100] call A3A_fnc_sendMoney;";
};
};
};
Expand Down
17 changes: 9 additions & 8 deletions A3A/addons/core/functions/Base/fn_flagaction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ switch _typeX do
petros addAction [localize "STR_A3A_fn_base_flagaction_asset_move", A3A_fnc_carryItem,nil,0,false,true,"","(_this == theBoss) and (petros == leader group petros) and (isNull objectParent _this) and !(call A3A_fnc_isCarrying)"];

petros addAction [localize "STR_A3A_fn_base_flagaction_hq_build", A3A_fnc_buildHQ,nil,0,false,true,"","(_this == theBoss) and (petros != leader group petros)",4];
//petros addAction ["Experimental HQ Management. Work in Progress.", { createDialog "A3A_HqDialog"; },nil,0,false,true,"","A3A_GUIDevPreview and (_this == theBoss) and (petros == leader group petros)",4];
};
case "truckX":
{
Expand Down Expand Up @@ -151,14 +152,14 @@ switch _typeX do
case "Intel_Small":
{
_flag addAction [
localize "STR_A3A_fn_base_flagaction_intel_search",
A3A_fnc_searchIntelOnLeader,
nil,
4,
true,
false,
"",
"!([_target] call A3A_fnc_canFight) && !(_target getVariable ['intelSearchDone', false]) && isPlayer _this",
localize "STR_A3A_fn_base_flagaction_intel_search",
A3A_fnc_searchIntelOnLeader,
nil,
4,
true,
false,
"",
"!([_target] call A3A_fnc_canFight) && !(_target getVariable ['intelSearchDone', false]) && isPlayer _this",
4
];
};
Expand Down
32 changes: 16 additions & 16 deletions A3A/addons/core/functions/Builder/fn_buildingPlacer.sqf
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*
Author: [Killerswin2, Hakon (Stole his bb code)]
team leader structured placer. Allows teamleaders to gain access to a
rts like camera to place objects.
rts like camera to place objects.
Arguments:
1. <object> object that will center placement
2. <number> number that is used for the radius of placement
Return Value:
NONE
Scope: Client
Environment: Unscheduled
Public:
Public:
no
Example:
[player, 100] call A3A_fnc_buildingPlacer.sqf
Expand Down Expand Up @@ -48,7 +48,7 @@ for "_i" from 1 to 36 do {

private _emptyDisplay = findDisplay 46 createDisplay "A3A_teamLeaderBuilder";
A3A_building_EHDB set [BUILD_DISPLAY, _emptyDisplay];
call (A3A_building_EHDB # UPDATE_BB);
call (A3A_building_EHDB # UPDATE_BB);

private _downKeyEH = _emptyDisplay displayAddEventHandler ["KeyDown", {
params["_displayOrControl","_key"];
Expand All @@ -63,7 +63,7 @@ private _downKeyEH = _emptyDisplay displayAddEventHandler ["KeyDown", {

if (_key isEqualTo DIK_R) then {
A3A_building_EHDB set [ROTATION_MODE_CW, true];
};
};
}];

A3A_building_EHDB set [KEY_DOWN_EH, _downKeyEH];
Expand All @@ -79,15 +79,15 @@ private _upKeyEH = _emptyDisplay displayAddEventHandler ["KeyUp", {

if (_tempObject distance (A3A_building_EHDB # BUILD_RADIUS_OBJECT_CENTER) > (A3A_building_EHDB # BUILD_RADIUS)) exitwith {};
if (isOnRoad getPosATL _tempObject) exitwith {}; // can't build on roads

private _price = (A3A_building_EHDB # OBJECT_PRICE);
private _supply = (A3A_building_EHDB # AVAILABLE_MONEY);

// TODO: Hints don't work here, just hope players are watching the numbers for now
if (_price > _supply) exitWith {};

A3A_building_EHDB set [AVAILABLE_MONEY, _supply - _price];
["updateMoney"] call A3A_fnc_teamLeaderRTSPlacerDialog;
["updateMoney"] call A3A_GUI_fnc_teamLeaderRTSPlacerDialog;

private _position = getPosWorld _tempObject;
private _dirAndUp = [vectorDir _tempObject, vectorUp _tempObject];
Expand All @@ -114,7 +114,7 @@ private _upKeyEH = _emptyDisplay displayAddEventHandler ["KeyUp", {
private _buildData = _buildArray deleteAt _objIndex;
private _supply = (A3A_building_EHDB # AVAILABLE_MONEY);
A3A_building_EHDB set [AVAILABLE_MONEY, _supply + (_buildData#4)];
["updateMoney"] call A3A_fnc_teamLeaderRTSPlacerDialog;
["updateMoney"] call A3A_GUI_fnc_teamLeaderRTSPlacerDialog;
};

// Repair
Expand All @@ -135,7 +135,7 @@ private _upKeyEH = _emptyDisplay displayAddEventHandler ["KeyUp", {
private _supply = (A3A_building_EHDB # AVAILABLE_MONEY);
if(_price > _supply) exitWith {};
A3A_building_EHDB set [AVAILABLE_MONEY, _supply - _price];
["updateMoney"] call A3A_fnc_teamLeaderRTSPlacerDialog;
["updateMoney"] call A3A_GUI_fnc_teamLeaderRTSPlacerDialog;

// Place imitation of repaired building
private _oldPos = getPosATL _building;
Expand Down Expand Up @@ -183,7 +183,7 @@ private _eventHanderEachFrame = addMissionEventHandler ["EachFrame", {
private _stateChange = false;
private _object = (A3A_building_EHDB # BUILD_OBJECT_TEMP_OBJECT);
private _vehiclePos = screenToWorld getMousePosition;

//change in position
if (_object distance2d _vehiclePos > 0.1) then {
_stateChange = true;
Expand All @@ -193,7 +193,7 @@ private _eventHanderEachFrame = addMissionEventHandler ["EachFrame", {
private _intersects = lineIntersectsSurfaces [getPosASL A3A_cam, AGLtoASL _vehiclePos, _object, A3A_cam];
private _intersectObj = if (count _intersects > 0) then { _intersects#0#3 } else { objNull };
A3A_building_EHDB set [CURSOR_OBJECT, _intersectObj];
["setContextKey", [""]] call A3A_fnc_setupPlacerHints;
["setContextKey", [""]] call A3A_GUI_fnc_setUpPlacerHints;

//((uiNamespace getVariable "A3A_placerHint_display") displayCtrl IDC_PLACERHINT_TEST_TEXT) ctrlSetText str _intersectObj;

Expand All @@ -209,12 +209,12 @@ private _eventHanderEachFrame = addMissionEventHandler ["EachFrame", {
private _bbsize = (boundingBoxReal _building # 1) vectorDiff (boundingBoxReal _building # 0);
private _price = 6 * sqrt((_bbsize#0) * (_bbsize#1) * (_bbsize#2));
_price = 10 * round (_price / 10);
["setContextKey", ["rebuild", _price]] call A3A_fnc_setupPlacerHints;
["setContextKey", ["rebuild", _price]] call A3A_GUI_fnc_setUpPlacerHints;
};

if (_intersectObj in (A3A_building_EHDB # BUILD_OBJECT_TEMP_OBJECT_ARRAY)) then {
// show C key
["setContextKey", ["cancel", getText (configof _intersectObj >> "displayName")]] call A3A_fnc_setupPlacerHints;
["setContextKey", ["cancel", getText (configof _intersectObj >> "displayName")]] call A3A_GUI_fnc_setUpPlacerHints;
};

if (A3A_building_EHDB # ROTATION_MODE_CCW) then {
Expand All @@ -231,12 +231,12 @@ private _eventHanderEachFrame = addMissionEventHandler ["EachFrame", {
_stateChange = true;
};


if (A3A_building_EHDB # GUI_BUTTON_PRESSED) then {
A3A_building_EHDB set [GUI_BUTTON_PRESSED, false];
_stateChange = true;
};

if (A3A_building_EHDB # SNAP_SURFACE_MODE) then {
private _posASL = AGLtoASL _vehiclePos;
private _intersects = lineIntersectsSurfaces [_posASL vectorAdd [0,0,100], _posASL vectorAdd [0,0,-100], _object];
Expand All @@ -255,11 +255,11 @@ private _eventHanderEachFrame = addMissionEventHandler ["EachFrame", {
private _camClampPos = [0,0,0];
_camClampPos set [0, _cameraPos#0 max (_centerPos#0 - _buildRad) min (_centerPos#0 + _buildRad)];
_camClampPos set [1, _cameraPos#1 max (_centerPos#1 - _buildRad) min (_centerPos#1 + _buildRad)];

// make the clamp a sphere instead of a weird rectangle
_camClampPos set [2, _cameraPos#2 max (_centerPos#2 + 5) min (_centerPos#2 + _buildRad)];
A3A_cam setPosATL _camClampPos;


// Object render state update
if (!_stateChange) exitWith {};
Expand Down
70 changes: 35 additions & 35 deletions A3A/addons/core/functions/Dialogs/fn_HQGameOptions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Maintainer: Caleb Serafin
Authenticated caller must be theBoss or an admin.

Arguments:
<OBJECT> Player executing the change.
<STRING> Spawn Option
<STRING> Action

Return Value:
<ANY> nil.
<SCALAR> Amount to adjust by or set [DEFAULT: nil]
<BOOL> False to use hints. True to hide hints [DEFAULT: False]

Scope: Server, Global Arguments, Global Effect
Environment: Any
Expand All @@ -23,38 +23,23 @@ Example:
params [
["_player",objNull,[objNull]],
["_option","",[""]],
["_action","",[""]]
["_action","",[""]],
["_amount",nil,[nil,0]],
["_noHints",false,[false]]
];
#include "..\..\script_component.hpp"
FIX_LINE_NUMBERS()

////////////////////
// Authentication //
////////////////////
if (!isServer) exitWith {
Warning("A3A_fnc_HQGameOptions should be executed on the server.");
_this remoteExecCall ["A3A_fnc_HQGameOptions",2];
};

private _optionLocalisationTable = [["maxUnits","distanceSPWN","globalCivilianMax"],[localize "STR_A3A_fn_dialogs_HQGameOptions_AILimit",localize "STR_A3A_fn_dialogs_HQGameOptions_spwnDistance",localize "STR_A3A_fn_dialogs_HQGameOptions_civLimit"]];
private _hintTitle = localize "STR_A3A_fn_dialogs_HQGameOptions_title";
private _authenticate = _option in ["maxUnits","distanceSPWN","globalCivilianMax"];

if (_authenticate && {!(_player == theBoss || admin owner _player > 0 || _player == player)}) exitWith {
[_hintTitle, localize "STR_A3A_fn_dialogs_HQGameOptions_commOnly"+(_optionLocalisationTable#1#(_optionLocalisationTable#0 find _option))] remoteExecCall ["A3A_fnc_customHint",_player];
Error("ACCESS VIOLATION | "+ name _player + " ["+(getPlayerUID _player) + "] ["+ str owner _player +"] attempted calling restricted backing method "+str _this);
nil;
};
if (owner _player != remoteExecutedOwner) exitWith {
private _allPlayers = allPlayers;
private _index = _allPlayers findIf {owner _x == remoteExecutedOwner};
private _realPlayer = objNull;
if (_index != -1) then {
_realPlayer = _allPlayers#_index;
};
Error("HACKING | "+ name _realPlayer + " ["+(getPlayerUID _realPlayer) + "] ["+ str remoteExecutedOwner +"] attempted impersonating "+ name _player + " ["+(getPlayerUID _player) + "] ["+ str owner _player +"] while calling "+str _this);
nil;
};

///////////////////////
// Increase/Decrease //
///////////////////////
private _processAction = {
// Increase/Decrease/Set
private _fnc_processAction = {
params["_option","_action","_upperLimit","_lowerLimit","_adjustmentAmount"];
private _inRange = 2; // 2 for in-range, 0 for low, 1 for high.
private _invalid = false;
Expand All @@ -64,6 +49,11 @@ private _processAction = {
switch (_action) do {
case "decrease": { if (_originalAmount < _lowerLimit + _adjustmentAmount) then {_inRange = 0}; _adjustmentAmount = -_adjustmentAmount; };
case "increase": { if (_originalAmount > _upperLimit - _adjustmentAmount) then {_inRange = 1}; };
case "set": {
if (_adjustmentAmount < _lowerLimit) then {_inRange = 0; };
if (_upperLimit < _adjustmentAmount) then {_inRange = 1; };
_adjustmentAmount = _adjustmentAmount - _originalAmount;
};
default {
_invalid = true;
Error("INVALID METHOD | "+ name _player + " ["+(getPlayerUID _player) + "] ["+ str owner _player +"] called invalid backing method "+str _this);
Expand All @@ -79,9 +69,15 @@ private _processAction = {
_hintText = " set to "+str _finalAmount;
Info("SET | "+name _player+" ["+ getPlayerUID _player +"] ["+ str owner _player +"] changed "+_optionName+" from " + str _originalAmount +" to " + str _finalAmount);
} else {
_hintText = " " + [localize "STR_A3A_fn_dialogs_HQGameOptions_lower", localize "STR_A3A_fn_dialogs_HQGameOptions_upper"] select _inRange + str _originalAmount;
_hintText = " " + ([localize "STR_A3A_fn_dialogs_HQGameOptions_lower", localize "STR_A3A_fn_dialogs_HQGameOptions_upper"] select _inRange) + str _originalAmount;
};

if (_noHints) exitWith {
if (_inRange != 2) then {
Warning(_hintText);
}
};

private _graphic = "--------------------------------------------------";
private _padding = _graphic;
private _graphicLength = count _graphic;
Expand All @@ -94,14 +90,18 @@ private _processAction = {
[_hintTitle, _optionName+_hintText+"<br/>"+_graphic+"<br/>"+_graphicLabel] remoteExecCall ["A3A_fnc_customHint",_player];
};

//////////////////////////
// ADD NEW OPTIONS HERE //
//////////////////////////
private _fnc_valueOrDefault = {
params [["_value", _this#1]];
_value;
};


// ADD NEW OPTIONS HERE
switch (_option) do {
case "maxUnits": { [_option,_action,200,80,10] call _processAction; };
case "globalCivilianMax": { [_option,_action,150,0,1] call _processAction; };
//case "maxUnits": { [_option,_action,200,80,[_amount,10] call _fnc_valueOrDefault] call _fnc_processAction; };
case "globalCivilianMax": { [_option,_action,150,0,[_amount,1] call _fnc_valueOrDefault] call _fnc_processAction; };
case "distanceSPWN": { // So close to generalising all of this away 😥, but then:
[_option,_action,2000,600,100] call _processAction;
[_option,_action,2000,600,[_amount,100] call _fnc_valueOrDefault] call _fnc_processAction;
distanceSPWN1 = distanceSPWN * 1.3;
distanceSPWN2 = distanceSPWN /2;
publicVariable "distanceSPWN1";
Expand Down
Loading