Editor bug fixes (#261)

* Spaceball cleanup and small bug fix

* Replace old hit sound in spaceball

* Camera filters

* added 9 new filters, including 3 types of sepia

* oops

* remark

* normalization of fade out and fade in on filters are by 100

* GenerateFilterTypeEnum comments

* Pure black and white filter

* Zooming

* Constant playback bar offset

* Prepare box selector rewrite

* Update icons, finalize

* Bug fixes
This commit is contained in:
Braedon Lewis
2023-02-05 14:48:49 -05:00
committed by GitHub
parent 5ce7862369
commit b45c4315b5
13 changed files with 130 additions and 88 deletions

View File

@ -7,6 +7,7 @@ namespace HeavenStudio.Editor.Track
{
public override void OnBeginDrag(PointerEventData eventData)
{
if (Conductor.instance.isPlaying) return;
if (eventData.button != PointerEventData.InputButton.Middle) return;
eventData.button = PointerEventData.InputButton.Left;
base.OnBeginDrag(eventData);
@ -14,6 +15,7 @@ namespace HeavenStudio.Editor.Track
public override void OnEndDrag(PointerEventData eventData)
{
if (Conductor.instance.isPlaying) return;
if (eventData.button != PointerEventData.InputButton.Middle) return;
eventData.button = PointerEventData.InputButton.Left;
base.OnEndDrag(eventData);
@ -21,6 +23,7 @@ namespace HeavenStudio.Editor.Track
public override void OnDrag(PointerEventData eventData)
{
if (Conductor.instance.isPlaying) return;
if (eventData.button != PointerEventData.InputButton.Middle) return;
eventData.button = PointerEventData.InputButton.Left;
base.OnDrag(eventData);

View File

@ -225,5 +225,10 @@ namespace HeavenStudio.Editor.Track
//auto-open the dialog
sectionTimelineObj.OnRightClick();
}
public bool InteractingWithEvents()
{
return specialTimelineObjs.FindAll(c => c.hovering == true).Count > 0 || specialTimelineObjs.FindAll(c => c.moving == true).Count > 0;
}
}
}

View File

@ -15,11 +15,11 @@ namespace HeavenStudio.Editor.Track
[SerializeField] private RectTransform raycastRect;
private float startPosX;
private bool moving = false;
public bool hovering;
private float lastPosX;
public bool moving = false;
public bool hovering;
private void Start()
{
rectTransform = GetComponent<RectTransform>();

View File

@ -259,11 +259,11 @@ namespace HeavenStudio.Editor.Track
ZoomInBTN.onClick.AddListener(delegate
{
zoomComponent.ZoomIn(3, Vector2.zero);
zoomComponent.ZoomIn(1, Vector2.zero);
});
ZoomOutBTN.onClick.AddListener(delegate
{
zoomComponent.ZoomOut(-3, Vector2.zero);
zoomComponent.ZoomOut(-1, Vector2.zero);
});
ZoomResetBTN.onClick.AddListener(delegate
{
@ -440,13 +440,13 @@ namespace HeavenStudio.Editor.Track
}
float moveSpeed = 750;
if (Input.GetKey(KeyCode.LeftShift)) moveSpeed *= 6;
if (Input.GetKey(KeyCode.LeftArrow) || Input.GetKey(KeyCode.A))
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) moveSpeed *= 6;
if (Input.GetKey(KeyCode.LeftArrow) || (!Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.A)))
{
TimelineContent.transform.localPosition += new Vector3(moveSpeed * Time.deltaTime, 0);
}
else if (Input.GetKey(KeyCode.RightArrow) || Input.GetKey(KeyCode.D))
else if (Input.GetKey(KeyCode.RightArrow) || (!Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.D)))
{
TimelineContent.transform.localPosition += new Vector3(-moveSpeed * Time.deltaTime, 0);
}

View File

@ -35,11 +35,11 @@ namespace HeavenStudio.Editor.Track
_scaleIncrement = 0.1f * _scale.x;
if (delta > 0 && _scale.x < _maximumScale)
if (delta > 0)
{
ZoomIn(delta, relativeMousePosition);
}
else if (delta < 0 && _scale.x > _minimumScale)
else if (delta < 0)
{
ZoomOut(delta, relativeMousePosition);
}
@ -47,6 +47,9 @@ namespace HeavenStudio.Editor.Track
public void ZoomIn(float delta, Vector2 relativeMousePosition)
{
if (!(_scale.x < _maximumScale)) return;
if (Timeline.instance.InteractingWithEvents() || SpecialTimeline.instance.InteractingWithEvents()) return;
float incre = _scaleIncrement * delta;
var newScale = Mathf.Clamp(_scale.x + incre, _minimumScale, _maximumScale);
@ -58,6 +61,9 @@ namespace HeavenStudio.Editor.Track
public void ZoomOut(float delta, Vector2 relativeMousePosition)
{
if (!(_scale.x > _minimumScale)) return;
if (Timeline.instance.InteractingWithEvents() || SpecialTimeline.instance.InteractingWithEvents()) return;
float incre = _scaleIncrement * -delta;
var newScale = _scale.x - incre;