mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-13 05:05:08 +00:00
Merge pull request #7 from CarsonKompon/fix-editor-button-new
Added New (CTRL+N) Button
This commit is contained in:
commit
03fd520517
3 changed files with 39 additions and 10 deletions
|
@ -16383,7 +16383,19 @@ MonoBehaviour:
|
||||||
m_TargetGraphic: {fileID: 1683100751}
|
m_TargetGraphic: {fileID: 1683100751}
|
||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1423699437}
|
||||||
|
m_TargetAssemblyTypeName: RhythmHeavenMania.Editor.Editor, Assembly-CSharp
|
||||||
|
m_MethodName: LoadRemix
|
||||||
|
m_Mode: 5
|
||||||
|
m_Arguments:
|
||||||
|
m_ObjectArgument: {fileID: 0}
|
||||||
|
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||||
|
m_IntArgument: 0
|
||||||
|
m_FloatArgument: 0
|
||||||
|
m_StringArgument:
|
||||||
|
m_BoolArgument: 0
|
||||||
|
m_CallState: 2
|
||||||
--- !u!114 &1683100751
|
--- !u!114 &1683100751
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -73,9 +73,7 @@ namespace RhythmHeavenMania
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Beatmap = new Beatmap();
|
NewRemix();
|
||||||
Beatmap.bpm = 120f;
|
|
||||||
Beatmap.firstBeatOffset = 0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SortEventsList();
|
SortEventsList();
|
||||||
|
@ -106,11 +104,25 @@ namespace RhythmHeavenMania
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadRemix(string json)
|
public void NewRemix()
|
||||||
|
{
|
||||||
|
Beatmap = new Beatmap();
|
||||||
|
Beatmap.bpm = 120f;
|
||||||
|
Beatmap.firstBeatOffset = 0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadRemix(string json = "")
|
||||||
{
|
{
|
||||||
SortEventsList();
|
SortEventsList();
|
||||||
|
|
||||||
Beatmap = JsonConvert.DeserializeObject<Beatmap>(json);
|
if (json != "")
|
||||||
|
{
|
||||||
|
Beatmap = JsonConvert.DeserializeObject<Beatmap>(json);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NewRemix();
|
||||||
|
}
|
||||||
Conductor.instance.SetBpm(Beatmap.bpm);
|
Conductor.instance.SetBpm(Beatmap.bpm);
|
||||||
Conductor.instance.firstBeatOffset = Beatmap.firstBeatOffset;
|
Conductor.instance.firstBeatOffset = Beatmap.firstBeatOffset;
|
||||||
Stop(0);
|
Stop(0);
|
||||||
|
|
|
@ -319,6 +319,14 @@ namespace RhythmHeavenMania.Editor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void LoadRemix(string json = "")
|
||||||
|
{
|
||||||
|
GameManager.instance.LoadRemix(json);
|
||||||
|
Timeline.instance.LoadRemix();
|
||||||
|
Timeline.instance.TempoInfo.UpdateStartingBPMText();
|
||||||
|
Timeline.instance.TempoInfo.UpdateOffsetText();
|
||||||
|
}
|
||||||
|
|
||||||
public void OpenRemix()
|
public void OpenRemix()
|
||||||
{
|
{
|
||||||
var extensions = new[]
|
var extensions = new[]
|
||||||
|
@ -348,10 +356,7 @@ namespace RhythmHeavenMania.Editor
|
||||||
stream.CopyTo(ms);
|
stream.CopyTo(ms);
|
||||||
bytes = ms.ToArray();
|
bytes = ms.ToArray();
|
||||||
string json = Encoding.Default.GetString(bytes);
|
string json = Encoding.Default.GetString(bytes);
|
||||||
GameManager.instance.LoadRemix(json);
|
LoadRemix(json);
|
||||||
Timeline.instance.LoadRemix();
|
|
||||||
Timeline.instance.TempoInfo.UpdateStartingBPMText();
|
|
||||||
Timeline.instance.TempoInfo.UpdateOffsetText();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue