mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #2746 from acemod/fixFlashlightPrivates
fix privates in Map module
This commit is contained in:
commit
9ecffcd133
@ -5,7 +5,7 @@ class CfgVehicles {
|
||||
class ACE_MapFlashlight {
|
||||
displayName = CSTRING(Action_Flashlights);
|
||||
icon = QUOTE(\a3\ui_f\data\IGUI\Cfg\VehicleToggles\lightsiconon_ca.paa);
|
||||
condition = QUOTE(GVAR(mapIllumination) && visibleMap && (count ([ACE_player] call FUNC(getUnitFlashlights)) > 0));
|
||||
condition = QUOTE(GVAR(mapIllumination) && visibleMap && {count ([ACE_player] call FUNC(getUnitFlashlights)) > 0});
|
||||
statement = "true";
|
||||
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
||||
insertChildren = QUOTE(_this call DFUNC(compileFlashlightMenu));
|
||||
|
@ -100,7 +100,7 @@ call FUNC(determineZoom);
|
||||
GVAR(glow) = objNull;
|
||||
|
||||
["playerInventoryChanged", {
|
||||
_flashlights = [ACE_player] call FUNC(getUnitFlashlights);
|
||||
private _flashlights = [ACE_player] call FUNC(getUnitFlashlights);
|
||||
if ((GVAR(flashlightInUse) != "") && !(GVAR(flashlightInUse) in _flashlights)) then {
|
||||
GVAR(flashlightInUse) = "";
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "script_component.hpp"
|
||||
// BEGIN_COUNTER(blueForceTrackingUpdate);
|
||||
|
||||
private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_markerType", "_colour", "_marker"];
|
||||
private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_colour", "_marker"];
|
||||
|
||||
// Delete last set of markers (always)
|
||||
{
|
||||
@ -28,12 +28,10 @@ if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then {
|
||||
};
|
||||
|
||||
{
|
||||
_markerType = [_x] call EFUNC(common,getMarkerType);
|
||||
private _markerType = [_x] call EFUNC(common,getMarkerType);
|
||||
private _colour = format ["Color%1", side _x];
|
||||
|
||||
|
||||
_colour = format ["Color%1", side _x];
|
||||
|
||||
_marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]];
|
||||
private _marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]];
|
||||
_marker setMarkerTypeLocal _markerType;
|
||||
_marker setMarkerColorLocal _colour;
|
||||
_marker setMarkerTextLocal (groupID _x);
|
||||
|
@ -18,48 +18,29 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_vehicle", "_player", "_parameters"];
|
||||
params ["", "_player"];
|
||||
|
||||
private["_action", "_actions", "_cfg", "_displayName", "_flashlights", "_icon", "_statement"];
|
||||
|
||||
_actions = [];
|
||||
_flashlights = [_player] call FUNC(getUnitFlashlights);
|
||||
|
||||
//add all carried flashlight menus and on/off submenu actions
|
||||
{
|
||||
_displayName = getText (configFile >> "CfgWeapons" >> _x >> "displayName");
|
||||
_icon = getText (configFile >> "CfgWeapons" >> _x >> "picture");
|
||||
|
||||
_children = {
|
||||
params ["_vehicle", "_player", "_flashlight"];
|
||||
_actions = [];
|
||||
|
||||
_onAction = [
|
||||
(_flashlight + "_On"),
|
||||
"On",
|
||||
"",
|
||||
{[_this select 2] call FUNC(switchFlashlight)},
|
||||
{GVAR(flashlightInUse) != (_this select 2)},
|
||||
{},
|
||||
_flashlight
|
||||
] call EFUNC(interact_menu,createAction);
|
||||
|
||||
_offAction = [
|
||||
(_flashlight + "_Off"),
|
||||
"Off",
|
||||
"",
|
||||
{[""] call FUNC(switchFlashlight)},
|
||||
{GVAR(flashlightInUse) == (_this select 2)},
|
||||
{},
|
||||
_flashlight
|
||||
] call EFUNC(interact_menu,createAction);
|
||||
|
||||
_actions pushBack [_onAction, [], _player];
|
||||
_actions pushBack [_offAction, [], _player];
|
||||
|
||||
_actions
|
||||
_cfg = (configFile >> "CfgWeapons" >> _x);
|
||||
_displayName = getText (_cfg >> "displayName");
|
||||
_icon = getText (_cfg >> "picture");
|
||||
|
||||
_statement = if (GVAR(flashlightInUse) == _x) then {
|
||||
_displayName = format [localize LSTRING(turnLightOff), _displayName];
|
||||
{[""] call FUNC(switchFlashlight)}
|
||||
} else {
|
||||
_displayName = format [localize LSTRING(turnLightOn), _displayName];
|
||||
{[_this select 2] call FUNC(switchFlashlight)}
|
||||
};
|
||||
|
||||
_parentAction = [_x, _displayName, _icon, {true}, {true}, _children, _x] call EFUNC(interact_menu,createAction);
|
||||
_actions pushBack [_parentAction, [], _player];
|
||||
_action = [_x, _displayName, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction);
|
||||
_actions pushBack [_action, [], _player];
|
||||
} forEach _flashlights;
|
||||
|
||||
_actions
|
||||
_actions
|
||||
|
@ -12,14 +12,13 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_unit"];
|
||||
|
||||
EXPLODE_1_PVT(_this,_unit);
|
||||
|
||||
private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight", "_flareTint", "_lightTint", "_l"];
|
||||
private ["_fnc_blendColor", "_lightTint", "_fnc_calcColor", "_l", "_lightLevel", "_vehicle", "_isEnclosed", "_nearObjects", "_light", "_ll", "_flashlight", "_flareTint"];
|
||||
|
||||
// Blend two colors
|
||||
_fnc_blendColor = {
|
||||
EXPLODE_3_PVT(_this,_c1,_c2,_alpha);
|
||||
params ["_c1", "_c2", "_alpha"];
|
||||
[(_c1 select 0) * (1 - _alpha) + (_c2 select 0) * _alpha,
|
||||
(_c1 select 1) * (1 - _alpha) + (_c2 select 1) * _alpha,
|
||||
(_c1 select 2) * (1 - _alpha) + (_c2 select 2) * _alpha,
|
||||
@ -27,16 +26,17 @@ _fnc_blendColor = {
|
||||
};
|
||||
|
||||
// Ambient light tint depending on time of day
|
||||
_lightTint = switch (true) do {
|
||||
case (sunOrMoon == 1.0) : { [0.5,0.5,0.5,1] };
|
||||
case (sunOrMoon > 0.80) : {[[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor};
|
||||
case (sunOrMoon > 0.50) : {[[0,0,0.1,1], [1.0 - overcast,0.2,0,1], (sunOrMoon - 0.5)/0.3] call _fnc_blendColor};
|
||||
case (sunOrMoon <= 0.5) : { [0,0,0.1,1] };
|
||||
_lightTint = call {
|
||||
if (sunOrMoon == 1.0) exitWith { [0.5,0.5,0.5,1] };
|
||||
if (sunOrMoon > 0.80) exitWith { [[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor };
|
||||
if (sunOrMoon > 0.50) exitWith { [[0,0,0.1,1], [1.0 - overcast,0.2,0,1], (sunOrMoon - 0.5)/0.3] call _fnc_blendColor };
|
||||
if (sunOrMoon <= 0.5) exitWith { [0,0,0.1,1] };
|
||||
[0,0,0,0]
|
||||
};
|
||||
|
||||
// Calculates overlay color from tint and light level
|
||||
_fnc_calcColor = {
|
||||
EXPLODE_2_PVT(_this,_c1,_lightLevel);
|
||||
params ["_c1", "_lightLevel"];
|
||||
|
||||
if (_lightLevel < 0.5) then {
|
||||
_l = _lightLevel / 0.5;
|
||||
@ -68,7 +68,6 @@ if (_lightLevel > 0.95) exitWith {
|
||||
[false, [0.5,0.5,0.5,0]]
|
||||
};
|
||||
|
||||
private "_vehicle";
|
||||
_vehicle = vehicle _unit;
|
||||
|
||||
// Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination)
|
||||
@ -124,4 +123,4 @@ if (_lightLevel > 0.95) exitWith {
|
||||
};
|
||||
|
||||
// Calculate resulting map color
|
||||
[true, [_lightTint, _lightLevel] call _fnc_calcColor]
|
||||
[true, [_lightTint, _lightLevel] call _fnc_calcColor]
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_grids", "_fourSize", "_sixSize", "_continue", "_size", "_i"];
|
||||
_grids = configFile >> "CfgWorlds" >> worldName >> "Grid";
|
||||
_grids = (configFile >> "CfgWorlds" >> worldName >> "Grid");
|
||||
_fourSize = -1;
|
||||
_sixSize = -1;
|
||||
for "_i" from 1 to 10 do {
|
||||
|
@ -16,15 +16,16 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_light", "_color", "_class"];
|
||||
params ["_flashlight"];
|
||||
|
||||
_light = GVAR(glow);
|
||||
if (!isNull _light) then {deleteVehicle _light};
|
||||
|
||||
if (_flashlight != "") then {
|
||||
_colour = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour");
|
||||
if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"};
|
||||
_class = format["ACE_FlashlightProxy_%1", _colour];
|
||||
_color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour");
|
||||
if !(_color in ["white", "red", "green", "blue", "yellow"]) then {_color = "white"};
|
||||
_class = format["ACE_FlashlightProxy_%1", _color];
|
||||
|
||||
_light = _class createVehicle [0,0,0];
|
||||
_light attachTo [ACE_player, [0,0.5,-0.1], "head"];
|
||||
@ -32,4 +33,4 @@ if (_flashlight != "") then {
|
||||
_light = objNull;
|
||||
};
|
||||
|
||||
GVAR(glow) = _light;
|
||||
GVAR(glow) = _light;
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
_flashlights = [];
|
||||
private _flashlights = [];
|
||||
|
||||
{
|
||||
if ((isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour")) && !(_x in _flashlights)) then {
|
||||
@ -26,4 +26,4 @@ _flashlights = [];
|
||||
};
|
||||
} forEach (items _unit);
|
||||
|
||||
_flashlights
|
||||
_flashlights
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hmd", "_flashlight", "_screenSize", "_realViewPortY", "_realViewPortX", "_fillTex", "_colourAlpha", "_shadeAlpha", "_colourList", "_maxColour"];
|
||||
params ["_mapCtrl", "_mapScale", "_mapCentre", "_lightLevel"];
|
||||
|
||||
_hmd = hmd ACE_player;
|
||||
@ -50,6 +51,7 @@ if (_flashlight == "") then {
|
||||
//ambient shade fill
|
||||
_mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], _mapCentre, _screenSize, _screenSize, 0, "", 0];
|
||||
} else {
|
||||
private ["_mousePos", "_colour", "_size", "_flashTex", "_beamSize", "_viewPortRatioFixY", "_offsetX", "_offsetYDown", "_offsetYUp"];
|
||||
//mouse pos
|
||||
_mousePos = GVAR(mousePos);
|
||||
|
||||
@ -86,4 +88,4 @@ if (_flashlight == "") then {
|
||||
_mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0) + _offsetX, (_mousePos select 1)], _screenSize * 2, _beamSize, 0, "", 0]; //right
|
||||
_mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0), (_mousePos select 1) - _offsetYDown], _screenSize * 4, _screenSize, 0, "", 0]; //down
|
||||
_mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0), (_mousePos select 1) + _offsetYUp], _screenSize * 4, _screenSize * 4, 0, "", 0]; //up
|
||||
};
|
||||
};
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_mapCtrl", "_mapScale", "_mapCentre", "_light"];
|
||||
_mapCtrl = findDisplay 12 displayCtrl 51;
|
||||
_mapScale = ctrlMapScale _mapCtrl;
|
||||
_mapCentre = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5];
|
||||
@ -73,4 +73,4 @@ if (GVAR(mapLimitZoom)) then {
|
||||
_mapCtrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, _mapCentre];
|
||||
ctrlMapAnimCommit _mapCtrl;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -256,6 +256,30 @@
|
||||
<Czech>Snížit jas</Czech>
|
||||
<Spanish>Reducir brillo</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Map_turnLightOn">
|
||||
<English>Turn On %1</English>
|
||||
<German>%1 Aktivieren</German>
|
||||
<Spanish>Encender %1</Spanish>
|
||||
<Polish>Włącz %1</Polish>
|
||||
<French>Allumer %1</French>
|
||||
<Czech>Zapnout %1</Czech>
|
||||
<Italian>Accendi %1</Italian>
|
||||
<Hungarian>%1 Bekapcsolása</Hungarian>
|
||||
<Portuguese>Ativar %1</Portuguese>
|
||||
<Russian>Активировать %1</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Map_turnLightOff">
|
||||
<English>Turn Off %1</English>
|
||||
<German>%1 Deaktivieren</German>
|
||||
<Spanish>Apagar %1</Spanish>
|
||||
<Polish>Wyłącz %1</Polish>
|
||||
<French>Éteindre %1</French>
|
||||
<Czech>Vypnout %1</Czech>
|
||||
<Italian>Spegni %1</Italian>
|
||||
<Hungarian>%1 Kikapcsolása</Hungarian>
|
||||
<Portuguese>Desativar %1</Portuguese>
|
||||
<Russian>Деактивировать %1</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Map_DefaultChannel_DisplayName">
|
||||
<English>Set Channel At Start</English>
|
||||
<Polish>Ust. domyślny kanał</Polish>
|
||||
|
Loading…
Reference in New Issue
Block a user