-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from ARCOMM/2.0-dev
Revamp scheduled code, fix bugs and tidy code
- Loading branch information
Showing
48 changed files
with
684 additions
and
941 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,29 @@ | ||
if (!isDedicated && (isNull player)) then { | ||
waitUntil {sleep 0.1; !isNull player}; | ||
}; | ||
[{isDedicated || !isNull player}, { | ||
private _unitfaction = toLower (faction player); | ||
|
||
private ["_unitfaction"]; | ||
waitUntil {!isNil "f_var_debugMode"}; | ||
|
||
_unitfaction = toLower (faction player); | ||
|
||
if (_unitfaction != toLower (faction (leader group player))) then { | ||
_unitfaction = toLower (faction (leader group player)); | ||
}; | ||
|
||
if (f_var_debugMode == 1) then { | ||
player sideChat format ["DEBUG (briefing.sqf): Player faction: %1", _unitfaction]; | ||
}; | ||
if (_unitfaction != toLower (faction (leader group player))) then { | ||
_unitfaction = toLower (faction (leader group player)); | ||
}; | ||
|
||
#include "f\briefing\f_briefing_arcmf.sqf" | ||
#include "f\briefing\f_briefing_arcmf.sqf" | ||
|
||
if (serverCommandAvailable "#kick" || isServer) then { | ||
#include "f\briefing\f_briefing_admin.sqf" | ||
if (f_var_debugMode == 1) then { | ||
player sideChat format ["DEBUG (briefing.sqf): Briefing for host selected.", _unitfaction]; | ||
if (serverCommandAvailable "#kick" || isServer) then { | ||
#include "f\briefing\f_briefing_admin.sqf" | ||
}; | ||
}; | ||
|
||
if (_unitfaction == "blu_f") exitWith { | ||
#include "f\briefing\f_briefing_blufor.sqf" | ||
if (f_var_debugMode == 1) then { | ||
player sideChat format ["DEBUG (briefing.sqf): Briefing for %1 slot selected.", _unitfaction]; | ||
if (_unitfaction == "blu_f") exitWith { | ||
#include "f\briefing\f_briefing_blufor.sqf" | ||
}; | ||
}; | ||
|
||
if (_unitfaction == "opf_f") exitWith { | ||
#include "f\briefing\f_briefing_opfor.sqf" | ||
if (f_var_debugMode == 1) then { | ||
player sideChat format ["DEBUG (briefing.sqf): Briefing for %1 slot selected.", _unitfaction]; | ||
if (_unitfaction == "opf_f") exitWith { | ||
#include "f\briefing\f_briefing_opfor.sqf" | ||
}; | ||
}; | ||
|
||
if (_unitfaction == "ind_f") exitWith { | ||
#include "f\briefing\f_briefing_indfor.sqf" | ||
if (f_var_debugMode == 1) then { | ||
player sideChat format ["DEBUG (briefing.sqf): Briefing for %1 slot selected.", _unitfaction]; | ||
if (_unitfaction == "ind_f") exitWith { | ||
#include "f\briefing\f_briefing_indfor.sqf" | ||
}; | ||
}; | ||
|
||
if (_unitfaction == "civ_f") exitWith { | ||
#include "f\briefing\f_briefing_civ.sqf" | ||
if (f_var_debugMode == 1) then { | ||
player sideChat format ["DEBUG (briefing.sqf): Briefing for %1 slot selected.", _unitfaction]; | ||
if (_unitfaction == "civ_f") exitWith { | ||
#include "f\briefing\f_briefing_civ.sqf" | ||
}; | ||
}; | ||
|
||
player globalchat format ["DEBUG (briefing.sqf): Faction %1 is not defined.", _unitfaction]; | ||
}, []] call CBA_fnc_waitUntilAndExecute; |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
private "_unit"; | ||
_unit = _this; | ||
params [["_unit", objNull, [objNull]]]; | ||
|
||
if (getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "attendant") == 1) exitWith {"ST_STHudM_Medic";}; | ||
if (getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "engineer") == 1) exitWith {"ST_STHudM_Engineer";}; | ||
if (leader(_unit) == _unit) exitWith {"ST_STHudM_Leader";}; | ||
if (getText(configFile >> "CfgWeapons" >> primaryWeapon(_unit) >> "UIPicture") == "\a3\weapons_f\data\ui\icon_mg_ca.paa") exitWith {"ST_STHudM_MG";}; | ||
if (getText(configFile >> "CfgWeapons" >> secondaryWeapon(_unit) >> "UIPicture") == "\a3\weapons_f\data\ui\icon_at_ca.paa") exitWith {"ST_STHudM_AT";}; | ||
if (isNull _unit) exitWith {""}; | ||
|
||
"ST_STHudM_Rifleman"; | ||
if (leader _unit == _unit) exitWith {"ST_STHudM_Leader"}; | ||
if (getText (configFile >> "CfgWeapons" >> secondaryWeapon _unit >> "UIPicture") == "\a3\weapons_f\data\ui\icon_at_ca.paa") exitWith {"ST_STHudM_AT"}; | ||
if (getText (configFile >> "CfgWeapons" >> primaryWeapon _unit >> "UIPicture") == "\a3\weapons_f\data\ui\icon_mg_ca.paa") exitWith {"ST_STHudM_MG"}; | ||
if (getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant") == 1) exitWith {"ST_STHudM_Medic"}; | ||
if (getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1) exitWith {"ST_STHudM_Engineer"}; | ||
|
||
"ST_STHudM_Rifleman" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
61 changes: 38 additions & 23 deletions
61
ARCMF.VR/f/FTMemberMarkers/fn_SetLocalFTMemberMarkers.sqf
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 |
---|---|---|
@@ -1,27 +1,42 @@ | ||
if (!isDedicated && (isNull player)) then { | ||
waitUntil {sleep 0.1; !isNull player}; | ||
}; | ||
[{isDedicated || !isNull player}, { | ||
[{ | ||
{ | ||
private _unit = _x; | ||
private _markerName = format ["ARC_unitMarker_%1", _unit]; | ||
|
||
f_fnc_SetTeamValue = { | ||
_unit = _this select 0; | ||
_color = _this select 1; | ||
_unit setVariable ["assignedTeam", _color]; | ||
}; | ||
if (alive _unit) then { | ||
private _markerColor = ["ColorWhite","ColorRed","ColorGreen","ColorBlue","ColorYellow"] select (["MAIN","RED","GREEN","BLUE","YELLOW"] find assignedTeam _unit) max 0; | ||
private _markerIcon = [_unit] call f_fnc_GetMarker; | ||
private _markerPos = getPosATL _unit; | ||
private _markerAlpha = linearConversion [ | ||
0, | ||
getNumber (missionConfigFile >> "CfgARCMF" >> "markers" >> (side (group _unit) call ARC_fnc_getFactionFromSide) >> "fireteamMemberFadeDistance"), | ||
(_unit distance player), | ||
1, | ||
0, | ||
true | ||
]; | ||
|
||
[] spawn { | ||
f_var_HandlerGroup = []; | ||
while {!isNull player} do { | ||
{ | ||
if (!(_x in f_var_HandlerGroup) && alive _x) then { | ||
[_x] execVM "f\FTMemberMarkers\f_localFTMemberMarker.sqf"; | ||
f_var_HandlerGroup pushBack _x; | ||
if (_markerName in allMapMarkers) then { | ||
// Marker already exists | ||
_markerName setMarkerPosLocal _markerPos; | ||
_markerName setMarkerTypeLocal _markerIcon; | ||
_markerName setMarkerColorLocal _markerColor; | ||
_markerName setMarkerDirLocal (direction _unit); | ||
_markerName setMarkerAlphaLocal _markerAlpha; | ||
} else { | ||
// Marker doesn't exist | ||
_markerName = createMarkerLocal [_markerName, _markerPos]; | ||
_markerName setMarkerShapeLocal "ICON"; | ||
_markerName setMarkerTypeLocal _markerIcon; | ||
_markerName setMarkerColorLocal _markerColor; | ||
_markerName setMarkerSizeLocal [0.8, 0.8]; | ||
_markerName setMarkerDirLocal (direction _unit); | ||
_markerName setMarkerAlphaLocal _markerAlpha; | ||
}; | ||
} else { | ||
deleteMarkerLocal _markerName; | ||
}; | ||
false | ||
} count units (group player); | ||
sleep 5; | ||
}; | ||
}; | ||
|
||
if (player == leader (group player)) then { | ||
[group player, player] spawn f_fnc_LocalFTMarkerSync; | ||
}; | ||
}, 0.1, []] call CBA_fnc_addPerFrameHandler; | ||
}, []] call CBA_fnc_waitUntilAndExecute; |
Oops, something went wrong.