|
| 1 | +#include "macros.hpp" |
| 2 | +/* |
| 3 | + Streamator |
| 4 | +
|
| 5 | + Author: joko // Jonas |
| 6 | +
|
| 7 | + Description: |
| 8 | + Register Line Width SubMenus |
| 9 | +
|
| 10 | + Parameter(s): |
| 11 | +
|
| 12 | + Returns: |
| 13 | +
|
| 14 | +*/ |
| 15 | + |
| 16 | +private _fnc_doLineWidth = { |
| 17 | + params ["_type"]; |
| 18 | + private _value = 3; |
| 19 | + if (GVAR(CameraSpeedMode)) then { |
| 20 | + _value = 6; |
| 21 | + }; |
| 22 | + if (GVAR(CameraSmoothingMode)) then { |
| 23 | + _value = 1; |
| 24 | + }; |
| 25 | + if (GVAR(CameraZoomMode)) then { |
| 26 | + _value = -_value; |
| 27 | + }; |
| 28 | + switch (_type) do { |
| 29 | + case ("3D Tracer"): { |
| 30 | + GVAR(3DBulletTracerLineWidth) = ((GVAR(3DBulletTracerLineWidth) + _value) max 1) min 30; |
| 31 | + }; |
| 32 | + case ("Map Tracer"): { |
| 33 | + GVAR(MapBulletTracerLineWidth) = ((GVAR(MapBulletTracerLineWidth) + _value) max 1) min 30; |
| 34 | + }; |
| 35 | + case ("3D Laser Target"): { |
| 36 | + GVAR(3DLaserTargetLineWidth) = ((GVAR(3DLaserTargetLineWidth) + _value) max 1) min 30; |
| 37 | + }; |
| 38 | + case ("Map Laser Target"): { |
| 39 | + GVAR(MapLaserTargetLineWidth) = ((GVAR(MapLaserTargetLineWidth) + _value) max 1) min 30; |
| 40 | + }; |
| 41 | + }; |
| 42 | + true |
| 43 | +}; |
| 44 | + |
| 45 | +private _fnc_renderLineWidth = { |
| 46 | + params ["_type"]; |
| 47 | + private _value = 3; |
| 48 | + private _ret = true; |
| 49 | + if (GVAR(CameraSpeedMode)) then { |
| 50 | + _value = 6; |
| 51 | + }; |
| 52 | + if (GVAR(CameraSmoothingMode)) then { |
| 53 | + _value = 1; |
| 54 | + }; |
| 55 | + |
| 56 | + private _mType = "Add"; |
| 57 | + if (GVAR(CameraZoomMode)) then { |
| 58 | + _mType = "Substract"; |
| 59 | + }; |
| 60 | + |
| 61 | + private _current = switch (_type) do { |
| 62 | + case ("3D Tracer"): { |
| 63 | + if (GVAR(3DBulletTracerLineWidth) == 30 && _mType == "Add") then { |
| 64 | + _ret = false; |
| 65 | + }; |
| 66 | + |
| 67 | + if (GVAR(3DBulletTracerLineWidth) < 1 && _mType == "Substract") then { |
| 68 | + _ret = false; |
| 69 | + }; |
| 70 | + |
| 71 | + GVAR(3DBulletTracerLineWidth) |
| 72 | + }; |
| 73 | + case ("Map Tracer"): { |
| 74 | + if (GVAR(MapBulletTracerLineWidth) == 30 && _mType == "Add") then { |
| 75 | + _ret = false; |
| 76 | + }; |
| 77 | + |
| 78 | + if (GVAR(MapBulletTracerLineWidth) < 1 && _mType == "Substract") then { |
| 79 | + _ret = false; |
| 80 | + }; |
| 81 | + |
| 82 | + GVAR(MapBulletTracerLineWidth) |
| 83 | + }; |
| 84 | + case ("3D Laser Target"): { |
| 85 | + if (GVAR(3DLaserTargetLineWidth) == 30 && _mType == "Add") then { |
| 86 | + _ret = false; |
| 87 | + }; |
| 88 | + |
| 89 | + if (GVAR(3DLaserTargetLineWidth) < 1 && _mType == "Substract") then { |
| 90 | + _ret = false; |
| 91 | + }; |
| 92 | + |
| 93 | + GVAR(3DLaserTargetLineWidth) |
| 94 | + }; |
| 95 | + case ("Map Laser Target"): { |
| 96 | + if (GVAR(MapLaserTargetLineWidth) == 30 && _mType == "Add") then { |
| 97 | + _ret = false; |
| 98 | + }; |
| 99 | + |
| 100 | + if (GVAR(MapLaserTargetLineWidth) < 1 && _mType == "Substract") then { |
| 101 | + _ret = false; |
| 102 | + }; |
| 103 | + |
| 104 | + GVAR(MapLaserTargetLineWidth) |
| 105 | + }; |
| 106 | + }; |
| 107 | + _name = format [_name, _mType, _value, _type, _current]; |
| 108 | + _ret |
| 109 | +}; |
| 110 | + |
| 111 | +["%1 %2 to %3 Line Width (%4)", "MAIN/LINES", DIK_F1, _fnc_doLineWidth, _fnc_renderLineWidth, false, "3D Tracer"] call FUNC(addMenuItem); |
| 112 | +["%1 %2 to %3 Line Width (%4)", "MAIN/LINES", DIK_F2, _fnc_doLineWidth, _fnc_renderLineWidth, false, "Map Tracer"] call FUNC(addMenuItem); |
| 113 | +["%1 %2 to %3 Line Width (%4)", "MAIN/LINES", DIK_F3, _fnc_doLineWidth, _fnc_renderLineWidth, false, "3D Laser Target"] call FUNC(addMenuItem); |
| 114 | +["%1 %2 to %3 Line Width (%4)", "MAIN/LINES", DIK_F4, _fnc_doLineWidth, _fnc_renderLineWidth, false, "Map Laser Target"] call FUNC(addMenuItem); |
0 commit comments