bring back tempo and volume change scrolling
This commit is contained in:
parent
b703892ad6
commit
dc5c52331f
File diff suppressed because it is too large
Load diff
|
|
@ -20,6 +20,7 @@ namespace HeavenStudio.Editor
|
||||||
[SerializeField] Sprite saveIcon;
|
[SerializeField] Sprite saveIcon;
|
||||||
[SerializeField] Color saveColor;
|
[SerializeField] Color saveColor;
|
||||||
[SerializeField] Image returnButtonImage;
|
[SerializeField] Image returnButtonImage;
|
||||||
|
[SerializeField] GameObject onSaveButton;
|
||||||
|
|
||||||
[Header("Containers")]
|
[Header("Containers")]
|
||||||
[SerializeField] ChartInfoProperties[] containers;
|
[SerializeField] ChartInfoProperties[] containers;
|
||||||
|
|
@ -59,11 +60,6 @@ namespace HeavenStudio.Editor
|
||||||
|
|
||||||
tabsManager.CleanTabs();
|
tabsManager.CleanTabs();
|
||||||
tabContents = null;
|
tabContents = null;
|
||||||
|
|
||||||
if (saveAfterClose)
|
|
||||||
{
|
|
||||||
Editor.instance.SaveRemix(saveAs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -85,12 +81,21 @@ namespace HeavenStudio.Editor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CloseAndSave()
|
||||||
|
{
|
||||||
|
if (saveAfterClose)
|
||||||
|
{
|
||||||
|
Editor.instance.SaveRemix(saveAs);
|
||||||
|
}
|
||||||
|
SwitchPropertiesDialog();
|
||||||
|
}
|
||||||
|
|
||||||
public void SetSaveOnClose(bool saveAfterClose, bool saveAs = false)
|
public void SetSaveOnClose(bool saveAfterClose, bool saveAs = false)
|
||||||
{
|
{
|
||||||
this.saveAfterClose = saveAfterClose;
|
this.saveAfterClose = saveAfterClose;
|
||||||
this.saveAs = saveAs;
|
this.saveAs = saveAs;
|
||||||
returnButtonImage.sprite = saveAfterClose ? saveIcon : returnIcon;
|
|
||||||
returnButtonImage.color = saveAfterClose ? saveColor : returnColor;
|
onSaveButton.SetActive(saveAfterClose);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetupDialog(PropertyTag[] tags, ChartInfoProperties container)
|
public void SetupDialog(PropertyTag[] tags, ChartInfoProperties container)
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,8 @@ namespace HeavenStudio.Editor.Track
|
||||||
specialTimelineObjs.Add(tempoTimelineObj.chartEntity.guid, tempoTimelineObj);
|
specialTimelineObjs.Add(tempoTimelineObj.chartEntity.guid, tempoTimelineObj);
|
||||||
|
|
||||||
Timeline.instance.FitToSong();
|
Timeline.instance.FitToSong();
|
||||||
|
if (create)
|
||||||
|
tempoTimelineObj.OnRightClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddVolumeChange(bool create, RiqEntity volumeChange_ = null, bool first = false)
|
public void AddVolumeChange(bool create, RiqEntity volumeChange_ = null, bool first = false)
|
||||||
|
|
@ -210,6 +212,8 @@ namespace HeavenStudio.Editor.Track
|
||||||
volumeTimelineObj.SetVisibility(Timeline.instance.timelineState.currentState);
|
volumeTimelineObj.SetVisibility(Timeline.instance.timelineState.currentState);
|
||||||
|
|
||||||
specialTimelineObjs.Add(volumeTimelineObj.chartEntity.guid, volumeTimelineObj);
|
specialTimelineObjs.Add(volumeTimelineObj.chartEntity.guid, volumeTimelineObj);
|
||||||
|
if (create)
|
||||||
|
volumeTimelineObj.OnRightClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddChartSection(bool create, RiqEntity chartSection_ = null)
|
public void AddChartSection(bool create, RiqEntity chartSection_ = null)
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,18 @@ public class TempoDialog : Dialog
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (tempoObj != null && tempoObj.first)
|
||||||
|
{
|
||||||
|
tempoInput.text = tempoObj.chartEntity["tempo"].ToString("F");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void SetTempoObj(TempoTimelineObj tempoObj)
|
public void SetTempoObj(TempoTimelineObj tempoObj)
|
||||||
{
|
{
|
||||||
this.tempoObj = tempoObj;
|
this.tempoObj = tempoObj;
|
||||||
deleteButton.interactable = !tempoObj.first;
|
deleteButton.gameObject.SetActive(!tempoObj.first);
|
||||||
|
|
||||||
tempoInput.text = tempoObj.chartEntity["tempo"].ToString("F");
|
tempoInput.text = tempoObj.chartEntity["tempo"].ToString("F");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,18 @@ namespace HeavenStudio.Editor.Track
|
||||||
if (hovering)
|
if (hovering)
|
||||||
{
|
{
|
||||||
SpecialTimeline.hoveringTypes |= SpecialTimeline.HoveringTypes.TempoChange;
|
SpecialTimeline.hoveringTypes |= SpecialTimeline.HoveringTypes.TempoChange;
|
||||||
|
|
||||||
|
if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.TempoChange)
|
||||||
|
{
|
||||||
|
float newTempo = Input.mouseScrollDelta.y;
|
||||||
|
|
||||||
|
if (Input.GetKey(KeyCode.LeftShift))
|
||||||
|
newTempo *= 5f;
|
||||||
|
if (Input.GetKey(KeyCode.LeftControl))
|
||||||
|
newTempo *= 0.01f;
|
||||||
|
|
||||||
|
SetTempo(chartEntity["tempo"] + newTempo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
UpdateTempo();
|
UpdateTempo();
|
||||||
}
|
}
|
||||||
|
|
@ -34,6 +46,7 @@ namespace HeavenStudio.Editor.Track
|
||||||
{
|
{
|
||||||
Timeline.instance.UpdateStartingBPMText();
|
Timeline.instance.UpdateStartingBPMText();
|
||||||
}
|
}
|
||||||
|
Timeline.instance.FitToSong();
|
||||||
UpdateTempo();
|
UpdateTempo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,18 @@ namespace HeavenStudio.Editor.Track
|
||||||
if (hovering)
|
if (hovering)
|
||||||
{
|
{
|
||||||
SpecialTimeline.hoveringTypes |= SpecialTimeline.HoveringTypes.VolumeChange;
|
SpecialTimeline.hoveringTypes |= SpecialTimeline.HoveringTypes.VolumeChange;
|
||||||
|
|
||||||
|
if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.MusicVolume)
|
||||||
|
{
|
||||||
|
float newVolume = Input.mouseScrollDelta.y;
|
||||||
|
|
||||||
|
if (Input.GetKey(KeyCode.LeftShift))
|
||||||
|
newVolume *= 5f;
|
||||||
|
if (Input.GetKey(KeyCode.LeftControl))
|
||||||
|
newVolume *= 0.01f;
|
||||||
|
|
||||||
|
SetVolume(chartEntity["volume"] + newVolume);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
UpdateVolume();
|
UpdateVolume();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,19 @@ public class VolumeDialog : Dialog
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (volumeObj != null && volumeObj.first)
|
||||||
|
{
|
||||||
|
volumeInput.text = volumeObj.chartEntity["volume"].ToString("F");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void SetVolumeObj(VolumeTimelineObj volumeObj)
|
public void SetVolumeObj(VolumeTimelineObj volumeObj)
|
||||||
{
|
{
|
||||||
this.volumeObj = volumeObj;
|
this.volumeObj = volumeObj;
|
||||||
deleteButton.interactable = !volumeObj.first;
|
deleteButton.gameObject.SetActive(!volumeObj.first);
|
||||||
|
|
||||||
volumeSlider.value = volumeObj.chartEntity["volume"];
|
volumeSlider.value = volumeObj.chartEntity["volume"];
|
||||||
volumeInput.text = volumeObj.chartEntity["volume"].ToString("F");
|
volumeInput.text = volumeObj.chartEntity["volume"].ToString("F");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue