Skip to content

Commit

Permalink
Merge pull request #305 from 7Cav/ModLoadoutUpdate
Browse files Browse the repository at this point in the history
Converted Loadouts to to utilize new classnames
  • Loading branch information
AndreasBrostrom authored Apr 4, 2019
2 parents df8625c + bd6f2ba commit af71b28
Show file tree
Hide file tree
Showing 18 changed files with 1,343 additions and 425 deletions.
3 changes: 3 additions & 0 deletions cScripts/CavFnc/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class cScripts {

class getPlayerRank {};
class setPlayerRank {};

class getPlayerRole {};

class getPlayerName {};

class doPlayerAnnouncement {};
Expand Down
8 changes: 1 addition & 7 deletions cScripts/CavFnc/functions/documents/fn_Doc_Info.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ private _playerName = [player, 'PROFILE'] call FUNC(getPlayerName);
private _playerRank = [player, 'CAV'] call FUNC(getPlayerRank);
private _playerRankFormal = [player, 'FORMAL'] call FUNC(getPlayerRank);

private _playerRole = "trooper";
if (isMultiplayer) then {
_playerRole = roleDescription player;
_playerRole = _playerRole splitString "@";
_playerRole = _playerRole select 0;
if (_playerRole == "") then {_playerRole = "trooper"};
};
private _playerRole = call FUNC(getPlayerRole);

private _playerGroup = call FUNC(getCavSquadName);

Expand Down
9 changes: 2 additions & 7 deletions cScripts/CavFnc/functions/init/fn_initStartupHint.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,8 @@ params [
private _player_name = [player,'PROFILE'] call FUNC(getPlayerName);
private _player_rankFormal = [player,'FORMAL'] call FUNC(getPlayerRank);

private _player_role = "trooper";
if (isMultiplayer) then {
_player_role = roleDescription player;
_player_role = _player_role splitString "@";
_player_role = _player_role select 0;
if (_player_role == "") then {_player_role = "trooper"};
};
private _player_role = call FUNC(getPlayerRole);


private _player_group = groupId (group player);
if (_player_group == "") then { _player_group = "in your squad" } else { _player_group = format["under the callsign <t color='#ffc61a'>%1</t>", _player_group]};
Expand Down
37 changes: 37 additions & 0 deletions cScripts/CavFnc/functions/players/fn_getPlayerRole.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "..\script_component.hpp";
/*
* Author: CPL.Brostrom.A
* This function fetches your rank based on your name prefix.
*
* Arguments:
* None
*
* Return Value:
* Role name <STRING>
*
* Example:
* call cScripts_fnc_getPlayerRole
*
*/

private _return = "Trooper";

if !(isMultiplayer) exitWith { _return };

private _playerRole = roleDescription player;

if !(_playerRole == "") then {
_playerRole = _playerRole splitString "@";
_playerRole = _playerRole select 0;

} else {
_playerRole = getText (configFile >> "CfgVehicles" >> typeOf player >> "displayName");
_playerRole = _playerRole splitString " ";
if (_playerRole select 0 in ["Platoon", "Squad"]) then {
_return = [_playerRole select 0, _playerRole select 1] joinString " ";
} else {
_return = _playerRole joinString " ";
};
};

_return;
21 changes: 9 additions & 12 deletions cScripts/CfgLoadouts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,22 @@ class CfgLoadouts {
#include "Loadouts\CfgLoadouts_Common.hpp"

#include "Loadouts\CfgLoadouts_Alpha.hpp"
#include "Loadouts\CfgLoadouts_AlphaClass.hpp"

#include "Loadouts\CfgLoadouts_Bravo.hpp"
#include "Loadouts\CfgLoadouts_BravoClass.hpp"

#include "Loadouts\CfgLoadouts_Charlie.hpp"
#include "Loadouts\CfgLoadouts_CharlieClass.hpp"

#include "Loadouts\CfgLoadouts_Medical.hpp"
#include "Loadouts\CfgLoadouts_MedicalClass.hpp"
#include "Loadouts\CfgLoadouts_Ranger.hpp" // Not compleeted

#include "Loadouts\CfgLoadouts_Ranger.hpp"
#include "Loadouts\CfgLoadouts_RangerClass.hpp"

#include "Loadouts\CfgLoadouts_Training.hpp"
#include "Loadouts\CfgLoadouts_TrainingClass.hpp"
#include "Loadouts\CfgLoadouts_Training.hpp" // Not compleeted

#include "Loadouts\CfgLoadouts_S3.hpp"
#include "Loadouts\CfgLoadouts_S5.hpp"


#include "Loadouts\CfgLoadouts_AlphaClass.hpp"
#include "Loadouts\CfgLoadouts_BravoClass.hpp"
#include "Loadouts\CfgLoadouts_CharlieClass.hpp"
#include "Loadouts\CfgLoadouts_RangerClass.hpp" // Not compleeted
#include "Loadouts\CfgLoadouts_TrainingClass.hpp" // Not compleeted

#include "Loadouts\CfgLoadouts_UserCustom.hpp"
};
43 changes: 28 additions & 15 deletions cScripts/Loadouts/CfgLoadouts_Alpha.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
/* Gear Date 180930 */

// P E G A S U S A N D H E L I C O P T E R C R E W
// A L P H A C O M P A N Y

class CAV_Alpha_Helo_PILOT : CAV_Alpha_Base { // Use for Helo pilots and Pegasus
class Cav_B_A_AirController_F : Cav_B_Alpha_base_F {
backpack[] = {"B_Kitbag_mcamo"};
nvgs[] = {"rhsusf_ANPVS_15"};
gps[] = {"ItemcTab"};
};

class CAV_Alpha_Helo_COPILOT : CAV_Alpha_Base { // Use for CoPilots

class Cav_B_A_Helicopter_Tra_Pilot_F : Cav_B_Alpha_base_F {
backpack[] = {"B_Kitbag_mcamo"};
nvgs[] = {"rhsusf_ANPVS_15"};
gps[] = {"ItemcTab"};
};
class Cav_B_A_Helicopter_Tra_coPilot_F : Cav_B_Alpha_base_F {
backpack[] = {"B_Kitbag_mcamo"};

magazines[] = {
Expand Down Expand Up @@ -64,8 +69,7 @@ class CAV_Alpha_Helo_COPILOT : CAV_Alpha_Base { // Use for CoPilots
nvgs[] = {"rhsusf_ANPVS_15"};
gps[] = {"ItemAndroid"};
};

class CAV_Alpha_Helo_CHIEF : CAV_Alpha_Base { // Crew Chief
class Cav_B_A_Helicopter_Tra_CrewChief_F : Cav_B_Alpha_base_F {
headgear[] = {"rhsusf_hgu56p_visor_mask_black"};
backpack[] = {"B_Carryall_cbr"};
vest[] = {"rhsusf_mbav_mg"};
Expand Down Expand Up @@ -121,8 +125,7 @@ class CAV_Alpha_Helo_CHIEF : CAV_Alpha_Base { // Crew Chief

preLoadout = "[(_this select 0), 'alpha', 0, 1] call cScripts_fnc_setPreInitPlayerSettings;";
};

class CAV_Alpha_Helo_GNR : CAV_Alpha_Base { // Door Gunner
class Cav_B_A_Helicopter_Tra_DoorGunner_F : Cav_B_Alpha_base_F {
headgear[] = {"rhsusf_hgu56p_visor_mask_black"};
backpack[] = {"B_Kitbag_mcamo"};

Expand Down Expand Up @@ -161,14 +164,14 @@ class CAV_Alpha_Helo_GNR : CAV_Alpha_Base { // Door Gunner
gps[] = {"ItemAndroid"};
};

class CAV_Alpha_Helo_PILOT_ATT : CAV_Alpha_Base { // Use for Attack Rotary

class Cav_B_A_Helicopter_Att_Pilot_F : Cav_B_Alpha_base_F {
headgear[] = {"rhsusf_ihadss"};
backpack[] = {"B_Kitbag_mcamo"};

gps[] = {"ItemAndroid"};
};

class CAV_Alpha_Helo_COPILOT_ATT : CAV_Alpha_Base { // Use for Attack Rotary
class Cav_B_A_Helicopter_Att_coPilot_F : Cav_B_Alpha_base_F {
headgear[] = {"rhsusf_ihadss"};
backpack[] = {"B_Kitbag_mcamo"};

Expand Down Expand Up @@ -227,12 +230,10 @@ class CAV_Alpha_Helo_COPILOT_ATT : CAV_Alpha_Base { // Use for Attack Rotary
};


// F I X E D W I N G

class CAV_Alpha_Fixed_PILOT : CAV_Alpha_Base {
class Cav_B_A_Plane_Fighter_Pilot_F : Cav_B_Alpha_base_F {
nvgs[] = {""};
backpack[] = {"B_AssaultPack_mcamo"};
headgear[] = {"H_PilotHelmetFighter_B"}; // This has been tested by CPT.Blackburn.J
headgear[] = {"H_PilotHelmetFighter_B"};
uniform[] = {"U_B_PilotCoveralls"};
vest[] = {""};

Expand Down Expand Up @@ -279,3 +280,15 @@ class CAV_Alpha_Fixed_PILOT : CAV_Alpha_Base {
preLoadout = "[(_this select 0), 'alpha', 0, 1] call cScripts_fnc_setPreInitPlayerSettings;";

};


class Cav_B_A_Plane_Transport_Pilot_F : Cav_B_Alpha_base_F {
backpack[] = {"B_Kitbag_mcamo"};
nvgs[] = {"rhsusf_ANPVS_15"};
gps[] = {"ItemcTab"};
};
class Cav_B_A_Plane_Transport_coPilot_F : Cav_B_Alpha_base_F {
backpack[] = {"B_Kitbag_mcamo"};
nvgs[] = {"rhsusf_ANPVS_15"};
gps[] = {"ItemcTab"};
};
52 changes: 48 additions & 4 deletions cScripts/Loadouts/CfgLoadouts_AlphaClass.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,59 @@

// A L P H A C O M P A N Y

// Helo Crew
class Cav_B_A_AirController_Pegasus_1_F : Cav_B_A_AirController_F {};
class Cav_B_A_AirController_Pegasus_2_F : Cav_B_A_AirController_F {};

class Cav_B_A_Helicopter_Tra_Pilot_B1_F : Cav_B_A_Helicopter_Tra_Pilot_F {};
class Cav_B_A_Helicopter_Tra_Pilot_B2_F : Cav_B_A_Helicopter_Tra_Pilot_F {};
class Cav_B_A_Helicopter_Tra_Pilot_B3_F : Cav_B_A_Helicopter_Tra_Pilot_F {};
class Cav_B_A_Helicopter_Tra_Pilot_B4_F : Cav_B_A_Helicopter_Tra_Pilot_F {};
class Cav_B_A_Helicopter_Tra_Pilot_B5_F : Cav_B_A_Helicopter_Tra_Pilot_F {};
class Cav_B_A_Helicopter_Tra_Pilot_B6_F : Cav_B_A_Helicopter_Tra_Pilot_F {};

class Cav_B_A_Helicopter_Att_Pilot_Raider_1_F : Cav_B_A_Helicopter_Att_Pilot_F {};
class Cav_B_A_Helicopter_Att_Pilot_Raider_2_F : Cav_B_A_Helicopter_Att_Pilot_F {};
class Cav_B_A_Helicopter_Att_Pilot_Raider_3_F : Cav_B_A_Helicopter_Att_Pilot_F {};
class Cav_B_A_Helicopter_Att_Pilot_Raider_4_F : Cav_B_A_Helicopter_Att_Pilot_F {};
class Cav_B_A_Helicopter_Att_Pilot_Raven_1_F : Cav_B_A_Helicopter_Att_Pilot_F {};
class Cav_B_A_Helicopter_Att_Pilot_Raven_2_F : Cav_B_A_Helicopter_Att_Pilot_F {};
class Cav_B_A_Helicopter_Att_Pilot_Raven_3_F : Cav_B_A_Helicopter_Att_Pilot_F {};
class Cav_B_A_Helicopter_Att_Pilot_Raven_4_F : Cav_B_A_Helicopter_Att_Pilot_F {};

class Cav_B_A_Plane_Fighter_Pilot_Hog_1_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Fighter_Pilot_Hog_2_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Fighter_Pilot_Hog_3_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Fighter_Pilot_Hog_4_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Fighter_Pilot_Hog_5_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Fighter_Pilot_Hog_6_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Fighter_Pilot_Hog_7_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Fighter_Pilot_Hog_8_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Fighter_Pilot_Hog_9_F : Cav_B_A_Plane_Transport_Pilot_F {};

class Cav_B_A_Plane_Transport_Pilot_Titan_1_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Transport_Pilot_Titan_2_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Transport_Pilot_Titan_3_F : Cav_B_A_Plane_Transport_Pilot_F {};
class Cav_B_A_Plane_Transport_Pilot_Titan_4_F : Cav_B_A_Plane_Transport_Pilot_F {};


// L E G A C Y
// Saved for backwards compability

// Old class definitions to New class definition
class CAV_Alpha_Helo_PILOT : Cav_B_A_Helicopter_Tra_Pilot_F {};
class CAV_Alpha_Helo_COPILOT : Cav_B_A_Helicopter_Tra_coPilot_F {};
class CAV_Alpha_Helo_CHIEF : Cav_B_A_Helicopter_Tra_CrewChief_F {};
class CAV_Alpha_Helo_GNR : Cav_B_A_Helicopter_Tra_DoorGunner_F {};
class CAV_Alpha_Helo_PILOT_ATT : Cav_B_A_Helicopter_Att_Pilot_F {};
class CAV_Alpha_Fixed_PILOT : Cav_B_A_Plane_Fighter_Pilot_F {};


// Older class structure
class B_Helipilot_F : CAV_Alpha_Helo_PILOT {};
class rhsusf_army_ocp_helipilot : CAV_Alpha_Helo_COPILOT {};
class B_T_Helicrew_F : CAV_Alpha_Helo_CHIEF {};
class B_Helicrew_F : CAV_Alpha_Helo_GNR {};

class B_T_Helipilot_F : CAV_Alpha_Helo_PILOT_ATT {};
//class undefinedClass : CAV_Alpha_Helo_COPILOT_ATT {};

// Fixed-Wing

class B_Fighter_Pilot_F : CAV_Alpha_Fixed_PILOT {};
Loading

0 comments on commit af71b28

Please sign in to comment.