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:
10Dozen 2021-07-23 16:06:31 +03:00 committed by GitHub
parent 5e56885b1e
commit d3ee39d8e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 61 additions and 0 deletions

View File

@ -173,3 +173,4 @@ zGuba
Fyuran <dankemedic@hotmail.com>
dabako <dabako@dabakoworld.de>
Frank <frankplow@protonmail.com>
10Dozen a.k.a Dusin

View File

@ -6,7 +6,9 @@ PREP(onLBSelChangedChannel);
PREP(onLBSelChangedColor);
PREP(onLBSelChangedShape);
PREP(onSliderPosChangedAngle);
PREP(onSliderMouseButtonUpAngle);
PREP(onSliderPosChangedScale);
PREP(onSliderMouseButtonUpScale);
PREP(placeMarker);
PREP(sendMarkersJIP);
PREP(setMarkerJIP);

View File

@ -332,10 +332,12 @@
private _curSelAngle = GETGVAR(currentMarkerAngle,0);
_aceAngleSlider sliderSetPosition _curSelAngle;
_aceAngleSlider ctrlSetTooltip LLSTRING(MarkerDirectionScaleSlider_Tooltip);
//Update now and add eventHandler:
[_aceAngleSlider, _curSelAngle] call FUNC(onSliderPosChangedAngle);
_aceAngleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}];
_aceAngleSlider ctrlAddEventHandler ["MouseButtonUp", {_this call FUNC(onSliderMouseButtonUpAngle)}];
////////////////////
// init marker scale slider
@ -348,8 +350,10 @@
private _curSelScale = GETGVAR(currentMarkerScale,1);
_aceScaleSlider sliderSetPosition _curSelScale;
_aceScaleSlider ctrlSetTooltip LLSTRING(MarkerDirectionScaleSlider_Tooltip);
//Update now and add eventHandler:
[_aceScaleSlider, _curSelScale] call FUNC(onSliderPosChangedScale);
_aceScaleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedScale)}];
_aceScaleSlider ctrlAddEventHandler ["MouseButtonUp", {_this call FUNC(onSliderMouseButtonUpScale)}];
}, _this] call CBA_fnc_execNextFrame;

View 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);

View 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);

View File

@ -24,6 +24,10 @@
<Chinese>方位: %1°</Chinese>
<Turkish>Yön: %1°</Turkish>
</Key>
<Key ID="STR_ACE_Markers_MarkerDirectionScaleSlider_Tooltip">
<English>Click RMB to reset</English>
<Russian>Нажми ПКМ чтобы сбросить</Russian>
</Key>
<Key ID="STR_ACE_Markers_Module_DisplayName">
<English>Markers</English>
<German>Markierungen</German>