Skip to content

Commit

Permalink
2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Schwarzer committed Jun 30, 2018
1 parent 90f415d commit 263c284
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public void OnSelectChange()
else Degree.text = OperationManager.SelectedTapNote[0].Degree.ToString("f5");
Combination.isOn = OperationManager.SelectedTapNote[0].Combination;
Size.value = OperationManager.SelectedTapNote[0].Size;
Sizef.text = OperationManager.SelectedTapNote[0].Sizef.ToString();
gameObject.SetActive(true);
}
else if (OperationManager.SelectedTapNote.Count == 0 && OperationManager.SelectedHoldNote.Count == 1)
Expand All @@ -96,6 +97,7 @@ public void OnSelectChange()
else Degree.text = OperationManager.SelectedHoldNote[0].Degree.ToString("f5");
Combination.isOn = OperationManager.SelectedHoldNote[0].Combination;
Size.value = OperationManager.SelectedHoldNote[0].Size;
Sizef.text = OperationManager.SelectedHoldNote[0].Sizef.ToString();
gameObject.SetActive(true);
}
else if (OperationManager.SelectedTapNote.Count + OperationManager.SelectedHoldNote.Count > 1)
Expand All @@ -105,6 +107,7 @@ public void OnSelectChange()
Degree.text = "-";
Combination.isOn = false;
Size.value = 0;
Sizef.text = "-";
gameObject.SetActive(true);
}
else if (OperationManager.SelectedTapNote.Count == 0 && OperationManager.SelectedHoldNote.Count == 0)
Expand Down
11 changes: 8 additions & 3 deletions Assets/Scripts/LimSystem/LimSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class events
public bool Critical;
public bool Combination;
public float Bpm;
public float Sizef;
public joints joints;
}
[System.Serializable]
Expand Down Expand Up @@ -354,6 +355,7 @@ public ChartData(string Text)
TmpTap.Critical = MidJson.events[i].Critical;
TmpTap.Combination = MidJson.events[i].Combination;
TmpTap.Bpm = MidJson.events[i].Bpm;
TmpTap.Sizef = MidJson.events[i].Sizef;
LanotaTapNote.Add(TmpTap);
}
else if (Type == 5)
Expand All @@ -365,6 +367,7 @@ public ChartData(string Text)
TmpHold.Jcount = MidJson.events[i].joints.j_count;
TmpHold.Degree = MidJson.events[i].Degree;
TmpHold.Combination = MidJson.events[i].Combination;
TmpHold.Sizef = MidJson.events[i].Sizef;
if (TmpHold.Jcount != 0)
{
TmpHold.Joints = new List<LanotaJoints>();
Expand Down Expand Up @@ -542,6 +545,7 @@ public override string ToString()
eventtmp.Critical = LanotaTapNote[i].Critical;
eventtmp.Combination = LanotaTapNote[i].Combination;
eventtmp.Bpm = LanotaTapNote[i].Bpm;
eventtmp.Sizef = LanotaTapNote[i].Sizef;
OutputTmp.events.Add(eventtmp);
}
for (int i = 0; i < LanotaHoldNote.Count; ++i)
Expand All @@ -555,6 +559,7 @@ public override string ToString()
eventtmp.joints.j_count = LanotaHoldNote[i].Jcount;
eventtmp.Degree = LanotaHoldNote[i].Degree;
eventtmp.joints.j = new List<Json.j>();
eventtmp.Sizef = LanotaHoldNote[i].Sizef;
if (eventtmp.joints.j_count != 0)
{
for (int k = 0; k < eventtmp.joints.j_count; ++k)
Expand Down Expand Up @@ -1065,7 +1070,7 @@ public class PreferencesContainer
public string Designer = string.Empty;
public float MusicPlayerPreciseOffset = 0;
public float WaveformBlockerPosition = 0;
public int Build = 49;
public int Build = 50;
public bool Autosave = true;
public bool JudgeColor = true;
public bool CloudAutosave = false;
Expand All @@ -1085,8 +1090,8 @@ public class PreferencesContainer

public class LimSystem : MonoBehaviour
{
public static string Version = "v2.1.0";
public static int Build = 49;
public static string Version = "v2.1.1";
public static int Build = 50;
public static Lanotalium.ChartContainer ChartContainer;
public LimTunerManager TunerManager;
public LimEditorManager EditorManager;
Expand Down
81 changes: 62 additions & 19 deletions Assets/Scripts/LytCoop/LimLayestaManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,18 @@ private async Task ConvertChartAsync()
{
await Task.Run(() =>
{
foreach(LimLayestaBuildChart c in buildChartViews)
foreach (LimLayestaBuildChart c in buildChartViews)
{
if (string.IsNullOrWhiteSpace(c.Difficulty)) continue;
if (c.ChartPath != "Instance")
{
File.Copy(c.ChartPath, LimProjectManager.LapFolder + $"/Layesta/chart_{c.Difficulty}.txt", true);
File.Copy(c.ChartPath, LimProjectManager.LapFolder + $"/Layesta/chart_{Convert.ToBase64String(Encoding.UTF8.GetBytes(c.Difficulty))}.txt", true);
}
else
{
File.WriteAllText(LimProjectManager.LapFolder + $"/Layesta/chart_{c.Difficulty}.txt", LimTunerManager.Instance.ChartContainer.ChartData.ToString());
File.WriteAllText(LimProjectManager.LapFolder + $"/Layesta/chart_{Convert.ToBase64String(Encoding.UTF8.GetBytes(c.Difficulty))}.txt", LimTunerManager.Instance.ChartContainer.ChartData.ToString());
}
filesToZip.Add(LimProjectManager.LapFolder + $"/Layesta/chart_{c.Difficulty}.txt");
filesToZip.Add(LimProjectManager.LapFolder + $"/Layesta/chart_{Convert.ToBase64String(Encoding.UTF8.GetBytes(c.Difficulty))}.txt");
}
});
}
Expand All @@ -271,14 +272,15 @@ await Task.Run(() =>
b.Write(Name.text);
b.Write(Designer.text);
b.Write(buildChartViews.Count);
foreach(LimLayestaBuildChart c in buildChartViews)
foreach (LimLayestaBuildChart c in buildChartViews)
{
b.Write(c.Difficulty);
}
Kaliko.ImageLibrary.KalikoImage k = new Kaliko.ImageLibrary.KalikoImage(LimProjectManager.LapFolder + "/Layesta/background.jpg");
b.Write(k.Width);
b.Write(k.Height);
b.Write(Artist.text);
b.Write(2);
b.Close();
fs.Close();
filesToZip.Add(LimProjectManager.LapFolder + "/Layesta/info.bytes");
Expand All @@ -296,6 +298,46 @@ private async Task PrepareLayestaFileAsync(bool overwrite)
await ConvertChartAsync();
await PackLayestaFileAsync();
}
private async Task PrepareLayestaFileInstanceAsync(bool overwrite)
{
Directory.CreateDirectory(LimProjectManager.LapFolder + "/Layesta");
Status.text = LimLanguageManager.TextDict["Layesta_2"];
await ConvertAudioAsync(overwrite);
Status.text = LimLanguageManager.TextDict["Layesta_3"];
await ConvertBackgroundBlurAsync(overwrite);
Status.text = LimLanguageManager.TextDict["Layesta_4"];
await ConvertChartInstanceAsync();
await PackLayestaFileInstanceAsync();
}
private async Task PackLayestaFileInstanceAsync()
{
await Task.Run(() =>
{
FileStream fs = new FileStream(LimProjectManager.LapFolder + "/Layesta/info.bytes", FileMode.Create, FileAccess.Write);
BinaryWriter b = new BinaryWriter(fs);
b.Write(Name.text);
b.Write(Designer.text);
b.Write(1);
b.Write("Master");
Kaliko.ImageLibrary.KalikoImage k = new Kaliko.ImageLibrary.KalikoImage(LimProjectManager.LapFolder + "/Layesta/background.jpg");
b.Write(k.Width);
b.Write(k.Height);
b.Write(Artist.text);
b.Write(2);
b.Close();
fs.Close();
filesToZip.Add(LimProjectManager.LapFolder + "/Layesta/info.bytes");
lzip.compress_File_List(0, LimProjectManager.LapFolder + "/instance.layesta", filesToZip.ToArray(), null, false, filesToZip.Select((s) => Path.GetFileName(s)).ToArray());
});
}
private async Task ConvertChartInstanceAsync()
{
await Task.Run(() =>
{
File.WriteAllText(LimProjectManager.LapFolder + $"/Layesta/chart_{Convert.ToBase64String(Encoding.UTF8.GetBytes("Master"))}.txt", LimTunerManager.Instance.ChartContainer.ChartData.ToString());
filesToZip.Add(LimProjectManager.LapFolder + $"/Layesta/chart_{Convert.ToBase64String(Encoding.UTF8.GetBytes("Master"))}.txt");
});
}

IEnumerator sendCoroutine;
public void SendLayesta()
Expand All @@ -309,7 +351,7 @@ IEnumerator SendLayestaCoroutine()
Directory.CreateDirectory(LimProjectManager.LapFolder + "/Layesta");
Status.text = LimLanguageManager.TextDict["Layesta_1"];
EncodeBackgrounds(OverwriteToggle.isOn);
Task t = PrepareLayestaFileAsync(OverwriteToggle.isOn);
Task t = PrepareLayestaFileInstanceAsync(OverwriteToggle.isOn);
while (!t.IsCompleted) yield return null;
Status.text = LimLanguageManager.TextDict["Layesta_5"];
byte[] b = File.ReadAllBytes(LimProjectManager.LapFolder + "/instance.layesta");
Expand Down Expand Up @@ -364,15 +406,16 @@ public async void BuildLayestaFile()
MessageBoxManager.Instance.ShowMessage(LimLanguageManager.TextDict["Layesta_NoProject"]);
return;
}
string path = WindowsDialogUtility.OpenFileDialog(LimLanguageManager.TextDict["Layesta_Build_Title"], "Layesta Level|*.layesta", LimProjectManager.LapFolder);
if (path == null) return;
if (!path.EndsWith(".layesta")) path += ".layesta";
filesToZip.Clear();
Directory.CreateDirectory(LimProjectManager.LapFolder + "/Layesta");
EncodeBackgrounds(true);
await PrepareLayestaFileAsync(true);
File.Move(LimProjectManager.LapFolder + "/instance.layesta", path);
WindowsDialogUtility.OpenExplorer(path);
string path = WindowsDialogUtility.SaveFileDialog(LimLanguageManager.TextDict["Layesta_Build_Title"], "Layesta Level|*.layesta", LimProjectManager.LapFolder);
if (path == null) return;
if (!path.EndsWith(".layesta")) path += ".layesta";
filesToZip.Clear();
Directory.CreateDirectory(LimProjectManager.LapFolder + "/Layesta");
EncodeBackgrounds(true);
await PrepareLayestaFileAsync(true);
if (File.Exists(path)) File.Delete(path);
File.Move(LimProjectManager.LapFolder + "/instance.layesta", path);
WindowsDialogUtility.OpenExplorer(path);
}
public void BuildAddChartInstance()
{
Expand All @@ -384,7 +427,7 @@ public void BuildAddChartInstance()
LimLayestaBuildChart chart = temp.GetComponent<LimLayestaBuildChart>();
chart.Initialize("Instance");
chart.DifficultyText.text = "Master";
buildChartViews.Insert(0,chart);
buildChartViews.Insert(0, chart);
AddInstanceButton.interactable = false;
BuildRefreshChartList();
}
Expand All @@ -399,13 +442,13 @@ public void BuildAddChartFromFile()
GameObject temp = Instantiate(BuildChartPrefab, BuildChartListContent);
LimLayestaBuildChart chart = temp.GetComponent<LimLayestaBuildChart>();
chart.Initialize(path);
buildChartViews.Insert(0,chart);
buildChartViews.Insert(0, chart);
BuildRefreshChartList();
}
public void BuildRemoveChart(LimLayestaBuildChart chart)
{
buildChartViews.Remove(chart);
if(chart.ChartPath == "Instance")
if (chart.ChartPath == "Instance")
{
AddInstanceButton.interactable = true;
}
Expand All @@ -415,7 +458,7 @@ public void BuildRemoveChart(LimLayestaBuildChart chart)
private void BuildRefreshChartList()
{
float y = 0;
foreach(LimLayestaBuildChart c in buildChartViews)
foreach (LimLayestaBuildChart c in buildChartViews)
{
c.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, y);
y -= 40;
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 2.1.0
bundleVersion: 2.1.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down Expand Up @@ -164,7 +164,7 @@ PlayerSettings:
Standalone: com.Schwarzer.Lanotalium
iOS: com.Schwarzer.Lanotalium
buildNumber:
Standalone: 49
Standalone: 50
iOS: 31
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 16
Expand Down
Loading

0 comments on commit 263c284

Please sign in to comment.