mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Markers - Add direction/scale reset on Right Mouse Button (#8319)
Co-authored-by: PabstMirror <pabstmirror@gmail.com> Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com> Co-authored-by: jonpas <jonpas33@gmail.com>
This commit is contained in:
parent
5e56885b1e
commit
d3ee39d8e4
@ -173,3 +173,4 @@ zGuba
|
|||||||
Fyuran <dankemedic@hotmail.com>
|
Fyuran <dankemedic@hotmail.com>
|
||||||
dabako <dabako@dabakoworld.de>
|
dabako <dabako@dabakoworld.de>
|
||||||
Frank <frankplow@protonmail.com>
|
Frank <frankplow@protonmail.com>
|
||||||
|
10Dozen a.k.a Dusin
|
||||||
|
@ -6,7 +6,9 @@ PREP(onLBSelChangedChannel);
|
|||||||
PREP(onLBSelChangedColor);
|
PREP(onLBSelChangedColor);
|
||||||
PREP(onLBSelChangedShape);
|
PREP(onLBSelChangedShape);
|
||||||
PREP(onSliderPosChangedAngle);
|
PREP(onSliderPosChangedAngle);
|
||||||
|
PREP(onSliderMouseButtonUpAngle);
|
||||||
PREP(onSliderPosChangedScale);
|
PREP(onSliderPosChangedScale);
|
||||||
|
PREP(onSliderMouseButtonUpScale);
|
||||||
PREP(placeMarker);
|
PREP(placeMarker);
|
||||||
PREP(sendMarkersJIP);
|
PREP(sendMarkersJIP);
|
||||||
PREP(setMarkerJIP);
|
PREP(setMarkerJIP);
|
||||||
|
@ -332,10 +332,12 @@
|
|||||||
|
|
||||||
private _curSelAngle = GETGVAR(currentMarkerAngle,0);
|
private _curSelAngle = GETGVAR(currentMarkerAngle,0);
|
||||||
_aceAngleSlider sliderSetPosition _curSelAngle;
|
_aceAngleSlider sliderSetPosition _curSelAngle;
|
||||||
|
_aceAngleSlider ctrlSetTooltip LLSTRING(MarkerDirectionScaleSlider_Tooltip);
|
||||||
|
|
||||||
//Update now and add eventHandler:
|
//Update now and add eventHandler:
|
||||||
[_aceAngleSlider, _curSelAngle] call FUNC(onSliderPosChangedAngle);
|
[_aceAngleSlider, _curSelAngle] call FUNC(onSliderPosChangedAngle);
|
||||||
_aceAngleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}];
|
_aceAngleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}];
|
||||||
|
_aceAngleSlider ctrlAddEventHandler ["MouseButtonUp", {_this call FUNC(onSliderMouseButtonUpAngle)}];
|
||||||
|
|
||||||
////////////////////
|
////////////////////
|
||||||
// init marker scale slider
|
// init marker scale slider
|
||||||
@ -348,8 +350,10 @@
|
|||||||
|
|
||||||
private _curSelScale = GETGVAR(currentMarkerScale,1);
|
private _curSelScale = GETGVAR(currentMarkerScale,1);
|
||||||
_aceScaleSlider sliderSetPosition _curSelScale;
|
_aceScaleSlider sliderSetPosition _curSelScale;
|
||||||
|
_aceScaleSlider ctrlSetTooltip LLSTRING(MarkerDirectionScaleSlider_Tooltip);
|
||||||
|
|
||||||
//Update now and add eventHandler:
|
//Update now and add eventHandler:
|
||||||
[_aceScaleSlider, _curSelScale] call FUNC(onSliderPosChangedScale);
|
[_aceScaleSlider, _curSelScale] call FUNC(onSliderPosChangedScale);
|
||||||
_aceScaleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedScale)}];
|
_aceScaleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedScale)}];
|
||||||
|
_aceScaleSlider ctrlAddEventHandler ["MouseButtonUp", {_this call FUNC(onSliderMouseButtonUpScale)}];
|
||||||
}, _this] call CBA_fnc_execNextFrame;
|
}, _this] call CBA_fnc_execNextFrame;
|
||||||
|
25
addons/markers/functions/fnc_onSliderMouseButtonUpAngle.sqf
Normal file
25
addons/markers/functions/fnc_onSliderMouseButtonUpAngle.sqf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: 10Dozen
|
||||||
|
* Angle slider clicked handler. Resets slider pos to 0 on RMB button up.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Slider (idc 1210) is expected <CONTROL>
|
||||||
|
* 1: Button released (0 - Left mouse btn, 1 - Right mouse btn) <NUMBER>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [Slider, 1] call ace_markers_fnc_onSliderMouseButtonUpAngle
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
params ["_aceAngleSlider", "_button"];
|
||||||
|
TRACE_2("params",_aceAngleSlider,_button);
|
||||||
|
|
||||||
|
if (_button isNotEqualTo 1) exitWith {};
|
||||||
|
|
||||||
|
_aceAngleSlider sliderSetPosition 0;
|
||||||
|
[_aceAngleSlider, 0] call FUNC(onSliderPosChangedAngle);
|
25
addons/markers/functions/fnc_onSliderMouseButtonUpScale.sqf
Normal file
25
addons/markers/functions/fnc_onSliderMouseButtonUpScale.sqf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: 10Dozen
|
||||||
|
* Scale slider clicked handler. Resets slider pos to 1 on RMB button up.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Slider (idc 1420) is expected <CONTROL>
|
||||||
|
* 1: Button released (0 - Left mouse btn, 1 - Right mouse btn) <NUMBER>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [Slider, 1] call ace_markers_fnc_onSliderMouseButtonUpScale
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
params ["_aceScaleSlider", "_button"];
|
||||||
|
TRACE_2("params",_aceScaleSlider,_button);
|
||||||
|
|
||||||
|
if (_button isNotEqualTo 1) exitWith {};
|
||||||
|
|
||||||
|
_aceScaleSlider sliderSetPosition 1;
|
||||||
|
[_aceScaleSlider, 1] call FUNC(onSliderPosChangedScale);
|
@ -24,6 +24,10 @@
|
|||||||
<Chinese>方位: %1°</Chinese>
|
<Chinese>方位: %1°</Chinese>
|
||||||
<Turkish>Yön: %1°</Turkish>
|
<Turkish>Yön: %1°</Turkish>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Markers_MarkerDirectionScaleSlider_Tooltip">
|
||||||
|
<English>Click RMB to reset</English>
|
||||||
|
<Russian>Нажми ПКМ чтобы сбросить</Russian>
|
||||||
|
</Key>
|
||||||
<Key ID="STR_ACE_Markers_Module_DisplayName">
|
<Key ID="STR_ACE_Markers_Module_DisplayName">
|
||||||
<English>Markers</English>
|
<English>Markers</English>
|
||||||
<German>Markierungen</German>
|
<German>Markierungen</German>
|
||||||
|
Loading…
Reference in New Issue
Block a user