initial files

This commit is contained in:
Samuele Lorefice
2025-05-24 16:17:33 +02:00
commit 9e023649ac
477 changed files with 118566 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
_idact = -1;
while { true } do {
waitUntil{ sleep 0.3; alive player };
_idact = player addAction ["<t color='#FF8000'>" + localize "STR_GREUH_EXTENDED_OPTIONS_ACTIONMENU" + "</t>","GREUH\scripts\GREUH_dialog.sqf","",-1000,false,true];
waitUntil{ sleep 0.3; !alive player};
};

View File

@@ -0,0 +1,49 @@
if (isDedicated) then { exit };
waitUntil { alive player };
desiredviewdistance_inf = viewDistance;
desiredviewdistance_veh = viewDistance;
desiredviewdistance_obj = 75;
desired_fps = 0;
show_teammates = false;
show_nametags = false;
show_platoon = false;
desired_vehvolume = 100;
greuh_options_profile = profileNamespace getVariable "GREUH_OPTIONS_PROFILE";
if ( !isNil "greuh_options_profile" ) then {
desiredviewdistance_inf = greuh_options_profile select 0;
desiredviewdistance_veh = greuh_options_profile select 1;
desiredviewdistance_obj = greuh_options_profile select 2;
show_teammates = greuh_options_profile select 3;
show_platoon = greuh_options_profile select 4;
if ( count greuh_options_profile > 5 ) then {
desired_vehvolume = greuh_options_profile select 5;
if ( isNil "desired_vehvolume" ) then {
desired_vehvolume = 100;
};
};
if ( count greuh_options_profile > 6 ) then {
show_nametags = greuh_options_profile select 6;
if ( isNil "show_nametags" ) then {
show_nametags = false;
};
};
if ( count greuh_options_profile > 7) then {
desired_fps = greuh_options_profile select 7;
if ( isNil "desired_fps" ) then {
desired_fps = 0;
};
};
};
[] call compile preprocessFileLineNumbers "GREUH\GREUH_config.sqf";
[] call compile preprocessFileLineNumbers "GREUH\scripts\GREUH_version.sqf";
execVM "GREUH\scripts\GREUH_actionmanager.sqf";
if ( GREUH_allow_mapmarkers ) then { execVM "GREUH\scripts\GREUH_playermarkers.sqf"; };
if ( GREUH_allow_platoonview ) then { execVM "GREUH\scripts\GREUH_platoonoverlay.sqf"; };
if ( GREUH_allow_platoonview ) then { execVM "GREUH\scripts\GREUH_cache_units.sqf"; };
if ( GREUH_allow_customsquads ) then { execVM "GREUH\scripts\GREUH_squadmanagement.sqf"; };
if ( GREUH_allow_viewdistance ) then { execVM "GREUH\scripts\GREUH_view_distance_management.sqf"; };
execVM "GREUH\scripts\GREUH_dynamic_view_distance.sqf";

View File

@@ -0,0 +1,17 @@
private [ "_scanned_units", "_scanned_groups" ];
waitUntil { !isNil "nametags_distance" };
while { true } do {
_scanned_units = [ allUnits, { ( alive _x ) && ( side group _x == GRLIB_side_friendly ) } ] call BIS_fnc_conditionalSelect;
_scanned_units = [ _scanned_units, { (_x == leader group player ) || (_x distance player < nametags_distance) } ] call BIS_fnc_conditionalSelect;
_scanned_units = [ _scanned_units, { (_x != player) && (( vehicle player ) != ( vehicle _x )) } ] call BIS_fnc_conditionalSelect;
GRLIB_nametag_units = [] + _scanned_units;
_scanned_groups = [ allGroups, { ( side _x == side player ) && ( isplayer (leader _x) ) } ] call BIS_fnc_conditionalSelect;
_scanned_groups = [ _scanned_groups, { ( count units _x > 1 ) || ( count units _x == 1 && leader _x != player ) } ] call BIS_fnc_conditionalSelect;
GRLIB_overlay_groups = [] + _scanned_groups;
sleep 1;
};

View File

@@ -0,0 +1,115 @@
_squadcontrols = [511,512,513,514,515,521,522,523,524,525,526,527];
_platooncontrols = [611,612,613,614];
_viewcontrols = [712,713,714,722,723,724,732,733,734];
_worldcontrols = [812,813,814,815];
_markerscontrols = [911,912,913,914];
_allbuttons = [6677,511,512,513,514,613,614,812,813,814,815,913,914,712,722,732];
_rename_controls = [521,522,523,524,525,526,527];
_leader_controls = [561,562,563,564,565,566,567];
renaming = false;
choosingleader = false;
_dialog = createDialog "GREUH_Menu";
waitUntil { dialog };
if ( GREUH_allow_customsquads ) then {
ctrlShow [501, false];
} else {
ctrlShow [501, true];
{ ctrlShow [_x, false] } foreach _squadcontrols;
};
if ( GREUH_allow_platoonview ) then {
ctrlShow [601, false];
} else {
ctrlShow [601, true];
{ ctrlShow [_x, false] } foreach _platooncontrols;
};
if ( GREUH_allow_viewdistance ) then {
ctrlShow [701, false];
sliderSetRange [712, 1000, 10000];
sliderSetPosition [712, desiredviewdistance_inf];
sliderSetSpeed [712, 500, 500];
sliderSetRange [722, 1000, 10000];
sliderSetPosition [722, desiredviewdistance_veh];
sliderSetSpeed [722, 500, 500];
sliderSetRange [732, 30, 100];
sliderSetPosition [732, desiredviewdistance_obj];
sliderSetSpeed [732, 5, 5];
ctrlSetText [ 960, format ["%1",desired_fps] ];
} else {
ctrlShow [701, true];
{ ctrlShow [_x, false] } foreach _viewcontrols;
};
if ( GREUH_allow_worldquality ) then {
ctrlShow [801, false];
} else {
ctrlShow [801, true];
{ ctrlShow [_x, false] } foreach _worldcontrols;
};
if ( GREUH_allow_mapmarkers ) then {
ctrlShow [901, false];
} else {
ctrlShow [901, true];
{ ctrlShow [_x, false] } foreach _markerscontrols;
};
if ( true ) then {
sliderSetSpeed [ 1102, 5, 5];
sliderSetRange [ 1102, 0, 100];
sliderSetPosition [ 1102, desired_vehvolume ];
};
while { dialog && alive player } do {
if ( renaming ) then {
{ ctrlEnable [_x, false] } foreach (_allbuttons);
{ ctrlShow [_x, true] } foreach _rename_controls;
{ ctrlShow [_x, false] } foreach _leader_controls;
} else {
if ( choosingleader ) then {
{ ctrlEnable [_x, false] } foreach _allbuttons;
{ ctrlShow [_x, false] } foreach _rename_controls;
{ ctrlShow [_x, true] } foreach _leader_controls;
} else {
{ ctrlEnable [_x, true] } foreach _allbuttons;
{ ctrlShow [_x, false] } foreach (_rename_controls + _leader_controls);
ctrlEnable [513,(leader (group player) == player)];
ctrlEnable [514,(leader (group player) == player)];
};
};
if ( GREUH_allow_platoonview ) then { ctrlShow [612, show_platoon]; };
if ( GREUH_allow_mapmarkers ) then { ctrlShow [912, show_teammates]; };
ctrlShow [ 962, show_nametags ];
if ( GREUH_allow_customsquads ) then {
lbClear 515;
{
_brakets = "";
if ( _x == group player ) then { _brakets = ">> "; };
lbAdd [515, format [ "%4%1 - %2 (%3)",groupId _x, name leader _x, count units _x,_brakets ]];
} foreach groups_list;
};
if ( GREUH_allow_viewdistance ) then {
ctrlSetText [713, format [ '%1m' ,round desiredviewdistance_inf]];
ctrlSetText [723, format [ '%1m' ,round desiredviewdistance_veh]];
ctrlSetText [733, format [ '%1m' ,round ((desiredviewdistance_obj / 100.0) * desiredviewdistance_inf) ]];
};
ctrlSetText [ 1103, format [ "%1%2", round (desired_vehvolume), "%" ] ];
desired_fps = parseNumber (ctrlText 960);
uiSleep 0.2;
};
if (!alive player) then { closeDialog 0 };
greuh_options_profile = [ desiredviewdistance_inf, desiredviewdistance_veh, desiredviewdistance_obj, show_teammates, show_platoon, desired_vehvolume, show_nametags, desired_fps ];
profileNamespace setVariable [ "GREUH_OPTIONS_PROFILE",greuh_options_profile ];
saveProfileNamespace;

View File

@@ -0,0 +1,44 @@
GREUH_view_distance_factor = 1.0;
GREUH_force_adjust_view_distance = false;
private _min_view_distance_factor = 0.25;
private _base_increment = 0.075;
private _corrected_increment = -1;
private _consecutive_before_adjust = 3;
private _consecutive_fps_too_low = 0;
private _consecutive_fps_too_fast = 0;
private _smoothing_margin = 0.1;
while { true } do {
_corrected_increment = _base_increment * GREUH_view_distance_factor;
if ( (diag_fps * ( 1 - _smoothing_margin )) < desired_fps ) then {
_consecutive_fps_too_low = _consecutive_fps_too_low + 1;
_consecutive_fps_too_fast = 0;
};
if ( (diag_fps * ( 1 + _smoothing_margin )) > desired_fps ) then {
_consecutive_fps_too_fast = _consecutive_fps_too_fast + 1;
_consecutive_fps_too_low = 0;
};
if ( GREUH_view_distance_factor > _min_view_distance_factor && _consecutive_fps_too_low >= _consecutive_before_adjust ) then {
_consecutive_fps_too_low = 0;
GREUH_view_distance_factor = GREUH_view_distance_factor - _corrected_increment;
if ( GREUH_view_distance_factor < _min_view_distance_factor ) then {
GREUH_view_distance_factor = _min_view_distance_factor;
};
GREUH_force_adjust_view_distance = true;
};
if ( GREUH_view_distance_factor < 1.0 && _consecutive_fps_too_fast >= _consecutive_before_adjust ) then {
_consecutive_fps_too_fast = 0;
GREUH_view_distance_factor = GREUH_view_distance_factor + _corrected_increment;
if ( GREUH_view_distance_factor > 1.0 ) then {
GREUH_view_distance_factor = 1.0;
};
GREUH_force_adjust_view_distance = true;
};
sleep 0.75;
};

View File

@@ -0,0 +1,139 @@
platoon_icon1 = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";
platoon_icon2 = "\A3\ui_f\data\igui\cfg\cursors\board_ca.paa";
soldier_icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\private_gs.paa";
formation_leader_icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\corporal_gs.paa";
commander_icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\general_gs.paa";
group_leader_icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";
wounded_icon = "\A3\ui_f\data\map\vehicleicons\pictureHeal_ca.paa";
nametags_distance = 32.0;
private [ "_groups", "_unitstocount", "_totalx", "_totaly", "_totalz", "_alpha", "_textalpha", "_size", "_screenpos", "_grouppos", "_distlabel", "_dist", "_nextunit", "_color", "_drawicon", "_displayname", "_iconpos" ];
waitUntil { !isNil "GRLIB_overlay_groups" };
waitUntil { !isNil "GRLIB_nametag_units" };
["platoon_overlay", "onEachFrame", {
if ( show_platoon ) then {
{
if ( count units _x > 0 ) then {
_totalx = 0;
_totaly = 0;
_totalz = 0;
_grouppos = [];
_unitstocount = [];
{
if ( _x distance (leader group _x) < 300) then {
_unitstocount pushback _x;
_totalx = _totalx + (getpos _x select 0);
_totaly = _totaly + (getpos _x select 1);
_totalz = _totalz + (getpos _x select 2);
};
} foreach units _x;
if ( count _unitstocount > 0 ) then {
_totalx = _totalx / (count _unitstocount);
_totaly = _totaly / (count _unitstocount);
_totalz = _totalz / (count _unitstocount);
};
if ( _totalz > 2.1 ) then {
_grouppos = [_totalx, _totaly, _totalz + 10];
} else {
_grouppos = [_totalx, _totaly, 2.1];
};
_alpha = 0.5;
_textalpha = 0;
_size = 0.8;
_screenpos = worldToScreen _grouppos;
if (count _screenpos != 0) then {
if ( (abs (((worldToScreen _grouppos) select 0) - 0.5) < 0.06) && (abs (((worldToScreen _grouppos) select 1) - 0.5) < 0.08)) then {
_alpha = 1;
_textalpha = 1;
_size = 1;
};
};
_dist = player distance _grouppos;
_distlabel = "";
if ( _dist > 200 ) then {
if ( _dist >= 1000 ) then {
_distlabel = format [" (%1km)", floor (_dist / 1000)];
} else {
_distlabel = format [" (%1m)", (floor (_dist / 100)) * 100];
};
};
_color = [0.8,1,0.2,_alpha];
if ( _x == group player) then { _color = [1,0.9,0.3,_alpha] };
drawIcon3D [platoon_icon1, _color, _grouppos, _size / 2, _size / 2,0, format ["%1 - %2%3",groupID _x, name (leader _x),_distlabel], 2, 0.03 * _textalpha, "puristaMedium"];
drawIcon3D [platoon_icon2, _color, _grouppos, _size, _size,0, "", 2, 0.04, "puristaMedium"];
};
} foreach GRLIB_overlay_groups;
};
if ( show_nametags ) then {
{
_nextunit = _x;
private _local_nametags_distance = nametags_distance;
if( _nextunit == leader group player ) then {
_local_nametags_distance = nametags_distance * 3;
};
_alpha = 1;
if ( _nextunit distance player > (_local_nametags_distance / 2) ) then {
_alpha = 1 - ((((_nextunit distance player) - (_local_nametags_distance / 2)) * 2) / _local_nametags_distance);
};
_color = [];
if ( _nextunit in (units group player)) then {
switch ( _nextunit getVariable [ "GRLIB_squad_color", "MAIN" ] ) do {
case "BLUE" : { _color = [0.15,0.35,1.0,_alpha] };
case "RED" : { _color = [0.8,0,0,_alpha] };
case "YELLOW" : { _color = [0.85,0.85,0,_alpha] };
case "GREEN" : { _color = [0,0.75,0,_alpha] };
default { _color = [0.9,0.9,0.9,_alpha] };
};
} else {
_color = [0.92,0.7,0.25,_alpha];
};
_drawicon = soldier_icon;
if ( _nextunit getVariable [ "FAR_isUnconscious", 0 ] == 1 ) then {
_drawicon = wounded_icon;
} else {
if ( _nextunit == [] call KPLIB_fnc_getCommander ) then {
_drawicon = commander_icon;
} else {
if ( _nextunit == (leader group _nextunit) && (count (units group _nextunit) > 1 ) ) then {
_drawicon = group_leader_icon;
} else {
if ( ( isFormationLeader _nextunit ) && ( count formationMembers _nextunit > 1 ) ) then {
_drawicon = formation_leader_icon;
};
};
};
};
_displayname = "";
if(count (squadParams _nextunit) != 0) then {
_displayname = "[" + ((squadParams _nextunit select 0) select 0) + "] ";
};
_displayname = _displayname + ( name _nextunit );
_height = 2 + ((player distance _nextunit) / (0.75 * _local_nametags_distance));
_iconpos = [ getPosATL _nextunit select 0, getPosATL _nextunit select 1, (getPosATL _nextunit select 2) + _height ];
drawIcon3D [ _drawicon, _color, _iconpos , 0.75, 0.75,0, format [ "%1", _displayname] , 2, 0.032, "puristaMedium"];
} foreach GRLIB_nametag_units;
};
}] call BIS_fnc_addStackedEventHandler;

View File

@@ -0,0 +1,190 @@
private _marked_players = [];
private _marked_vehicles = [];
private _marked_squadmates = [];
private _marker_objs = [];
private _color = "";
private _ticks = 0;
private _cfg = configFile >> "cfgVehicles";
if ( side player == GRLIB_side_friendly ) then {
_color = GRLIB_color_friendly;
} else {
_color = GRLIB_color_enemy;
};
while { true } do {
waitUntil { sleep 0.2; show_teammates };
while { show_teammates } do {
if ( _ticks == 0 ) then {
{
private _nextmarker = _x select 0;
private _nextobj = _x select 1;
if ( (isNull _nextobj) || !(alive _nextobj) ) then {
deleteMarkerLocal _nextmarker;
};
} foreach _marker_objs;
private _playableunits = [];
if ( count playableUnits > 0 ) then {
_playableunits = [ playableUnits, { (side (group _x)) == (side (group player)) } ] call BIS_fnc_conditionalSelect;
} else {
_playableunits = [ player ];
};
{
if ( vehicle _x == _x ) then {
_marked_players pushbackUnique _x;
} else {
_marked_vehicles pushbackUnique (vehicle _x);
};
} foreach _playableunits;
{
if ( alive _x && !(isPlayer _x) ) then {
if ( vehicle _x == _x ) then {
_marked_squadmates pushbackUnique _x;
} else {
_marked_vehicles pushbackUnique (vehicle _x);
};
};
} foreach (units (group player));
private _stuff_to_unmark = [];
{
if ( (vehicle _x != _x) || !(alive _x) ) then {
_stuff_to_unmark pushback _x;
_marked_players = _marked_players - [_x];
};
} foreach _marked_players;
{
if ( (vehicle _x != _x) || !(alive _x) ) then {
_stuff_to_unmark pushback _x;
_marked_squadmates = _marked_squadmates - [_x];
};
} foreach _marked_squadmates;
{
if ( (count (crew _x) == 0) || !(alive _x) ) then {
_stuff_to_unmark pushback _x;
_marked_vehicles = _marked_vehicles - [_x];
};
} foreach _marked_vehicles;
{
private _nextmarker = _x getVariable [ "spotmarker", "" ];
if ( _nextmarker != "" ) then {
deleteMarkerLocal _nextmarker;
_x setVariable [ "spotmarker", "" ];
};
} foreach _stuff_to_unmark;
{
private _nextplayer = _x;
private _marker = _nextplayer getVariable [ "spotmarker", "" ];
if ( _marker == "" ) then {
_marker = ( createMarkerLocal [ format [ "playermarker%1", (allUnits find _x) * (time % 1000) * (floor (random 100)) ], getpos _nextplayer ] );
_marker_objs pushback [ _marker, _nextplayer ];
_nextplayer setVariable [ "spotmarker", _marker ];
private _playername = "";
if( count (squadParams _nextplayer) != 0 ) then {
_playername = "[" + ((squadParams _nextplayer select 0) select 0) + "] ";
};
_playername = _playername + (name _nextplayer);
_marker setMarkerTextLocal _playername;
_marker setMarkerSizeLocal [ 0.75, 0.75 ];
_marker setMarkerColorLocal _color;
};
private _markertype = "mil_start";
if ( _nextplayer getVariable [ "FAR_isUnconscious", 0 ] == 1 ) then {
_markertype = "MinefieldAP";
};
_marker setMarkerTypeLocal _markertype;
} foreach _marked_players;
{
private _nextai = _x;
private _marker = _nextai getVariable [ "spotmarker", "" ];
if ( _marker == "" ) then {
_marker = ( createMarkerLocal [ format [ "squadaimarker%1", (allUnits find _x) * (time % 1000) * (floor (random 10000)) ], getpos _nextai ] );
_marker_objs pushback [ _marker, _nextai ];
_nextai setVariable [ "spotmarker", _marker ];
_marker setMarkerTypeLocal "mil_triangle";
_marker setMarkerSizeLocal [ 0.6, 0.6 ];
_marker setMarkerColorLocal _color;
};
_marker setMarkerTextLocal format [ "%1", ( [ _nextai ] call KPLIB_fnc_getUnitPositionId )];
} foreach _marked_squadmates;
{
private _nextvehicle = _x;
private _marker = _nextvehicle getVariable [ "spotmarker", "" ];
if ( _marker == "" ) then {
_marker = ( createMarkerLocal [ format [ "vehiclemarker%1", (vehicles find _x) * (time % 1000) * (floor (random 10000)) ], getpos _nextvehicle ] );
_marker_objs pushback [ _marker, _nextvehicle ];
_nextvehicle setVariable [ "spotmarker", _marker ];
_marker setMarkerTypeLocal "mil_arrow2";
_marker setMarkerSizeLocal [0.75,0.75];
_marker setMarkerColorLocal _color;
};
private _datcrew = crew _nextvehicle;
private _vehiclename = "";
{
if (isPlayer _x) then {
_vehiclename = _vehiclename + (name _x);
} else {
_vehiclename = _vehiclename + ( format [ "%1", [ _x ] call KPLIB_fnc_getUnitPositionId ] );
};
if( (_datcrew find _x) != ((count _datcrew) - 1) ) then {
_vehiclename = _vehiclename + ",";
};
_vehiclename = _vehiclename + " ";
} foreach _datcrew;
_vehiclename = _vehiclename + "(" + getText (_cfg >> typeOf _nextvehicle >> "displayName") + ")";
_marker setMarkerTextLocal _vehiclename;
} foreach _marked_vehicles;
};
private _markerunits = [] + _marked_players + _marked_squadmates + _marked_vehicles;
{
private _nextunit = _x;
private _marker = _nextunit getVariable [ "spotmarker", "" ];
if ( _marker != "" ) then {
_marker setMarkerPosLocal (getPos _nextunit);
private _mrkdir = getDir _nextunit;
if ( isPlayer _nextunit ) then {
if ( _nextunit getVariable [ "FAR_isUnconscious", 0 ] == 1 ) then {
_mrkdir = 0;
};
};
_marker setMarkerDirLocal _mrkdir;
};
} foreach _markerunits;
_ticks = _ticks + 1;
if ( _ticks > 10 ) then {
_ticks = 0;
};
sleep 0.1;
};
{
private _nextunit = _x;
private _marker = _nextunit getVariable [ "spotmarker", "" ];
if ( _marker != "" ) then {
deleteMarkerLocal _marker;
_nextunit setVariable [ "spotmarker", "" ];
};
} forEach (allUnits + vehicles);
};

View File

@@ -0,0 +1,105 @@
groups_list = [];
squadaction = "";
squadname = "";
if (isNil "global_group_ids") then { global_group_ids = [] };
if (isNil "global_groups_renamed") then { global_groups_renamed = [] };
global_new_leader = [];
while { true } do {
if ( squadaction != "" ) then {
_grp = grpNull;
switch (squadaction) do {
case "create" : {
_grp = createGroup [(side player), true];
[player] join _grp;
hint "New squad created";
};
case "join" : {
if(lbCurSel 515 != -1) then { _grp = groups_list select (lbCurSel 515); };
if (!(isNull _grp) && (_grp != group player)) then {
[player] join _grp;
hint "Squad joined";
};
};
case "rename" : {
if ( leader group player == player ) then {
renaming = true;
ctrlSetText [527, (groupid (group player))];
waitUntil { ((squadaction == "") || (squadname != "") || !(dialog) || !(alive player)) };
if ( alive player && dialog && ( squadname != "" )) then {
if ( (group player) in global_groups_renamed ) then {
global_group_ids set [global_groups_renamed find (group player),squadname];
} else {
global_group_ids = global_group_ids + [squadname];
global_groups_renamed = global_groups_renamed + [group player];
};
publicVariable "global_group_ids";
publicVariable "global_groups_renamed";
};
squadname = "";
renaming = false;
} else {
hint "Sorry, only the squad leader can rename their squad.";
};
};
case "leader" : {
if ( leader group player == player ) then {
choosingleader = true;
choose_squadleader = -10;
_player_group_filtered = [];
{
if ( isPlayer _x ) then {
_player_group_filtered = _player_group_filtered + [_x];
};
} foreach (units group player);
lbClear 567;
{
lbAdd [567, name _x ];
} foreach _player_group_filtered;
_count_units_grp_player = count (units group player);
waitUntil { ((squadaction == "") || (choose_squadleader >= 0) || !(dialog) || !(alive player) || (_count_units_grp_player != count (units group player))) };
if ( alive player && dialog && ( choose_squadleader >= 0 )) then {
global_new_leader = [group player, _player_group_filtered select choose_squadleader];
publicVariable "global_new_leader";
};
choose_squadleader = -10;
choosingleader = false;
} else {
hint "Sorry, only the squad leader can choose a new leader.";
};
};
};
squadaction = "";
};
{ if ( (isplayer leader _x) && (side _x == side player) && !(_x in groups_list)) then { groups_list = groups_list + [_x] }; } foreach allGroups;
{ if (!(_x in allGroups) || (!isplayer leader _x)) then { groups_list = groups_list - [_x] }; } foreach groups_list;
{
if (count global_groups_renamed != 0) then {
if (_x in global_groups_renamed) then {
if (groupid _x != global_group_ids select (global_groups_renamed find _x)) then {
_x setgroupid [(global_group_ids select (global_groups_renamed find _x))];
};
};
};
} foreach groups_list;
if ( count global_new_leader != 0 ) then {
if ( group player == global_new_leader select 0 ) then {
(global_new_leader select 0) selectLeader (global_new_leader select 1);
hint format ["%1 is your new squad leader.",name (global_new_leader select 1)];
global_new_leader = [];
};
};
sleep 0.5;
};

View File

@@ -0,0 +1,4 @@
GREUH_version = 1.2;
player createDiarySubject ["GREUH Options","GREUH Options"];
player createDiaryRecord ["GREUH Options", ["GREUH Options", format ["<font color='#ff8000'>GREUH Extended Options</font><br/>arma.greuh.org<br/><br/><font color='#ff8000'>Scripted by [GREUH] Zbug</font><br/>Version %1",GREUH_version]]];

View File

@@ -0,0 +1,58 @@
private _olddistance_inf = -1;
private _olddistance_veh = -1;
private _olddistance_obj = -1;
private _olddesiredvolume = -1;
private _was_vehicle = false;
private _min_view_distance = 300;
private _desired_inf = -1;
private _desired_veh = -1;
private _desired_obj = -1;
waitUntil { !isNil "GREUH_view_distance_factor" };
waitUntil { !isNil "GREUH_force_adjust_view_distance" };
while { true } do {
waitUntil { sleep 0.3;
(round _olddistance_inf != round desiredviewdistance_inf)
|| (round _olddistance_veh != round desiredviewdistance_veh)
|| (round _olddistance_obj != round desiredviewdistance_obj)
|| ( (( vehicle player == player ) && _was_vehicle)
|| (( vehicle player != player ) && !_was_vehicle) )
|| !(alive player)
|| ( round _olddesiredvolume != round desired_vehvolume)
|| GREUH_force_adjust_view_distance };
waitUntil { alive player };
GREUH_force_adjust_view_distance = false;
_olddistance_inf = round desiredviewdistance_inf;
_olddistance_veh = round desiredviewdistance_veh;
_olddistance_obj = round desiredviewdistance_obj;
_olddesiredvolume = desired_vehvolume;
_was_vehicle = ( vehicle player != player );
if ( _was_vehicle ) then {
_desired_veh = (round desiredviewdistance_veh) * GREUH_view_distance_factor;
if ( _desired_veh < _min_view_distance ) then {
_desired_veh = _min_view_distance;
};
setViewDistance _desired_veh;
1 fadeSound ( desired_vehvolume / 100.0 );
} else {
_desired_inf = (round desiredviewdistance_inf) * GREUH_view_distance_factor;
if ( _desired_inf < _min_view_distance ) then {
_desired_inf = _min_view_distance;
};
setViewDistance _desired_inf;
1 fadeSound 1;
};
_desired_obj = (((desiredviewdistance_obj / 100.0) * desiredviewdistance_inf) * GREUH_view_distance_factor);
if ( _desired_obj < _min_view_distance) then {
_desired_obj = _min_view_distance;
};
setObjectViewDistance _desired_obj;
};