mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fix privates in Map module
This commit is contained in:
parent
733c695c41
commit
2dcdd224bd
@ -68,7 +68,7 @@ call FUNC(determineZoom);
|
|||||||
GVAR(glow) = objNull;
|
GVAR(glow) = objNull;
|
||||||
|
|
||||||
["playerInventoryChanged", {
|
["playerInventoryChanged", {
|
||||||
_flashlights = [ACE_player] call FUNC(getUnitFlashlights);
|
local _flashlights = [ACE_player] call FUNC(getUnitFlashlights);
|
||||||
if ((GVAR(flashlightInUse) != "") && !(GVAR(flashlightInUse) in _flashlights)) then {
|
if ((GVAR(flashlightInUse) != "") && !(GVAR(flashlightInUse) in _flashlights)) then {
|
||||||
GVAR(flashlightInUse) = "";
|
GVAR(flashlightInUse) = "";
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
// BEGIN_COUNTER(blueForceTrackingUpdate);
|
// BEGIN_COUNTER(blueForceTrackingUpdate);
|
||||||
|
|
||||||
private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_markerType", "_colour", "_marker"];
|
private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_colour", "_marker"];
|
||||||
|
|
||||||
// Delete last set of markers (always)
|
// Delete last set of markers (always)
|
||||||
{
|
{
|
||||||
@ -28,12 +28,12 @@ if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
_markerType = [_x] call EFUNC(common,getMarkerType);
|
local _markerType = [_x] call EFUNC(common,getMarkerType);
|
||||||
|
|
||||||
|
|
||||||
_colour = format ["Color%1", side _x];
|
local _colour = format ["Color%1", side _x];
|
||||||
|
|
||||||
_marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]];
|
local _marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]];
|
||||||
_marker setMarkerTypeLocal _markerType;
|
_marker setMarkerTypeLocal _markerType;
|
||||||
_marker setMarkerColorLocal _colour;
|
_marker setMarkerColorLocal _colour;
|
||||||
_marker setMarkerTextLocal (groupID _x);
|
_marker setMarkerTextLocal (groupID _x);
|
||||||
|
@ -25,12 +25,14 @@ _flashlights = [_player] call FUNC(getUnitFlashlights);
|
|||||||
|
|
||||||
//add all carried flashlight menus and on/off submenu actions
|
//add all carried flashlight menus and on/off submenu actions
|
||||||
{
|
{
|
||||||
_displayName = getText (configFile >> "CfgWeapons" >> _x >> "displayName");
|
private ["_cfg", "_displayName"," _icon", "_children", "_parentAction"];
|
||||||
_icon = getText (configFile >> "CfgWeapons" >> _x >> "picture");
|
_cfg = (configFile >> "CfgWeapons" >> _x);
|
||||||
|
_displayName = getText (_cfg >> "displayName");
|
||||||
|
_icon = getText (_cfg >> "picture");
|
||||||
|
|
||||||
_children = {
|
_children = {
|
||||||
|
private ["_onAction", "_offAction"];
|
||||||
params ["_vehicle", "_player", "_flashlight"];
|
params ["_vehicle", "_player", "_flashlight"];
|
||||||
_actions = [];
|
|
||||||
|
|
||||||
_onAction = [
|
_onAction = [
|
||||||
(_flashlight + "_On"),
|
(_flashlight + "_On"),
|
||||||
@ -52,10 +54,7 @@ _flashlights = [_player] call FUNC(getUnitFlashlights);
|
|||||||
_flashlight
|
_flashlight
|
||||||
] call EFUNC(interact_menu,createAction);
|
] call EFUNC(interact_menu,createAction);
|
||||||
|
|
||||||
_actions pushBack [_onAction, [], _player];
|
[[_onAction, [], _player], [_offAction, [], _player]]
|
||||||
_actions pushBack [_offAction, [], _player];
|
|
||||||
|
|
||||||
_actions
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_parentAction = [_x, _displayName, _icon, {true}, {true}, _children, _x] call EFUNC(interact_menu,createAction);
|
_parentAction = [_x, _displayName, _icon, {true}, {true}, _children, _x] call EFUNC(interact_menu,createAction);
|
||||||
|
@ -12,14 +12,13 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
params ["_unit"];
|
||||||
|
|
||||||
EXPLODE_1_PVT(_this,_unit);
|
private ["_fnc_blendColor", "_lightTint", "_fnc_calcColor", "_l", "_lightLevel", "_vehicle", "_isEnclosed", "_nearObjects", "_light", "_ll", "_flashlight", "_flareTint"];
|
||||||
|
|
||||||
private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight", "_flareTint", "_lightTint", "_l"];
|
|
||||||
|
|
||||||
// Blend two colors
|
// Blend two colors
|
||||||
_fnc_blendColor = {
|
_fnc_blendColor = {
|
||||||
EXPLODE_3_PVT(_this,_c1,_c2,_alpha);
|
params ["_c1", "_c2", "_alpha"];
|
||||||
[(_c1 select 0) * (1 - _alpha) + (_c2 select 0) * _alpha,
|
[(_c1 select 0) * (1 - _alpha) + (_c2 select 0) * _alpha,
|
||||||
(_c1 select 1) * (1 - _alpha) + (_c2 select 1) * _alpha,
|
(_c1 select 1) * (1 - _alpha) + (_c2 select 1) * _alpha,
|
||||||
(_c1 select 2) * (1 - _alpha) + (_c2 select 2) * _alpha,
|
(_c1 select 2) * (1 - _alpha) + (_c2 select 2) * _alpha,
|
||||||
@ -27,16 +26,17 @@ _fnc_blendColor = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Ambient light tint depending on ACE_time of day
|
// Ambient light tint depending on ACE_time of day
|
||||||
_lightTint = switch (true) do {
|
_lightTint = call {
|
||||||
case (sunOrMoon == 1.0) : { [0.5,0.5,0.5,1] };
|
if (sunOrMoon == 1.0) exitWith { [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};
|
if (sunOrMoon > 0.80) exitWith { [[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};
|
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 };
|
||||||
case (sunOrMoon <= 0.5) : { [0,0,0.1,1] };
|
if (sunOrMoon <= 0.5) exitWith { [0,0,0.1,1] };
|
||||||
|
[0,0,0,0]
|
||||||
};
|
};
|
||||||
|
|
||||||
// Calculates overlay color from tint and light level
|
// Calculates overlay color from tint and light level
|
||||||
_fnc_calcColor = {
|
_fnc_calcColor = {
|
||||||
EXPLODE_2_PVT(_this,_c1,_lightLevel);
|
params ["_c1", "_lightLevel"];
|
||||||
|
|
||||||
if (_lightLevel < 0.5) then {
|
if (_lightLevel < 0.5) then {
|
||||||
_l = _lightLevel / 0.5;
|
_l = _lightLevel / 0.5;
|
||||||
@ -68,7 +68,6 @@ if (_lightLevel > 0.95) exitWith {
|
|||||||
[false, [0.5,0.5,0.5,0]]
|
[false, [0.5,0.5,0.5,0]]
|
||||||
};
|
};
|
||||||
|
|
||||||
private "_vehicle";
|
|
||||||
_vehicle = vehicle _unit;
|
_vehicle = vehicle _unit;
|
||||||
|
|
||||||
// Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination)
|
// Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination)
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_grids", "_fourSize", "_sixSize", "_continue", "_size", "_i"];
|
private ["_grids", "_fourSize", "_sixSize", "_continue", "_size", "_i"];
|
||||||
_grids = configFile >> "CfgWorlds" >> worldName >> "Grid";
|
_grids = (configFile >> "CfgWorlds" >> worldName >> "Grid");
|
||||||
_fourSize = -1;
|
_fourSize = -1;
|
||||||
_sixSize = -1;
|
_sixSize = -1;
|
||||||
for "_i" from 1 to 10 do {
|
for "_i" from 1 to 10 do {
|
||||||
|
@ -16,15 +16,16 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_light", "_color", "_class"];
|
||||||
params ["_flashlight"];
|
params ["_flashlight"];
|
||||||
|
|
||||||
_light = GVAR(glow);
|
_light = GVAR(glow);
|
||||||
if (!isNull _light) then {deleteVehicle _light};
|
if (!isNull _light) then {deleteVehicle _light};
|
||||||
|
|
||||||
if (_flashlight != "") then {
|
if (_flashlight != "") then {
|
||||||
_colour = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour");
|
_color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour");
|
||||||
if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"};
|
if !(_color in ["white", "red", "green", "blue", "yellow"]) then {_color = "white"};
|
||||||
_class = format["ACE_FlashlightProxy_%1", _colour];
|
_class = format["ACE_FlashlightProxy_%1", _color];
|
||||||
|
|
||||||
_light = _class createVehicle [0,0,0];
|
_light = _class createVehicle [0,0,0];
|
||||||
_light attachTo [ACE_player, [0,0.5,-0.1], "head"];
|
_light attachTo [ACE_player, [0,0.5,-0.1], "head"];
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
_flashlights = [];
|
local _flashlights = [];
|
||||||
|
|
||||||
{
|
{
|
||||||
if ((isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour")) && !(_x in _flashlights)) then {
|
if ((isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour")) && !(_x in _flashlights)) then {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_hmd", "_flashlight", "_screenSize", "_realViewPortY", "_realViewPortX", "_fillTex", "_colourAlpha", "_shadeAlpha", "_colourList", "_maxColour"];
|
||||||
params ["_mapCtrl", "_mapScale", "_mapCentre", "_lightLevel"];
|
params ["_mapCtrl", "_mapScale", "_mapCentre", "_lightLevel"];
|
||||||
|
|
||||||
_hmd = hmd ACE_player;
|
_hmd = hmd ACE_player;
|
||||||
@ -50,6 +51,7 @@ if (_flashlight == "") then {
|
|||||||
//ambient shade fill
|
//ambient shade fill
|
||||||
_mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], _mapCentre, _screenSize, _screenSize, 0, "", 0];
|
_mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], _mapCentre, _screenSize, _screenSize, 0, "", 0];
|
||||||
} else {
|
} else {
|
||||||
|
private ["_mousePos", "_colour", "_size", "_flashTex", "_beamSize", "_viewPortRatioFixY", "_offsetX", "_offsetYDown", "_offsetYUp"];
|
||||||
//mouse pos
|
//mouse pos
|
||||||
_mousePos = GVAR(mousePos);
|
_mousePos = GVAR(mousePos);
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
private ["_mapCtrl", "_mapScale", "_mapCentre", "_light"];
|
||||||
_mapCtrl = findDisplay 12 displayCtrl 51;
|
_mapCtrl = findDisplay 12 displayCtrl 51;
|
||||||
_mapScale = ctrlMapScale _mapCtrl;
|
_mapScale = ctrlMapScale _mapCtrl;
|
||||||
_mapCentre = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5];
|
_mapCentre = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5];
|
||||||
|
Loading…
Reference in New Issue
Block a user