bug fix
This commit is contained in:
@@ -36,8 +36,7 @@ public class Config
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
UmaViewerUI.Instance.MessagePannel.SetActive(true);
|
UmaViewerUI.Instance.ShowMessage("Config load error. Using default. " + ex.Message);
|
||||||
UmaViewerUI.Instance.MessageText.text = "Config load error. Using default. " + ex.Message;
|
|
||||||
MainPath = $@"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\Cygames\umamusume";
|
MainPath = $@"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\Cygames\umamusume";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,8 +47,7 @@ public class Config
|
|||||||
public void UpdateConfig()
|
public void UpdateConfig()
|
||||||
{
|
{
|
||||||
File.WriteAllText(configPath, JsonUtility.ToJson(this, true));
|
File.WriteAllText(configPath, JsonUtility.ToJson(this, true));
|
||||||
UmaViewerUI.Instance.MessagePannel.SetActive(true);
|
UmaViewerUI.Instance.ShowMessage("The configuration has changed. Please restart the application.");
|
||||||
UmaViewerUI.Instance.MessageText.text = "The configuration has changed. Please restart the application.";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,9 +199,17 @@ public class ManifestDB
|
|||||||
}
|
}
|
||||||
|
|
||||||
callback?.Invoke($"Decompress master.mdb");
|
callback?.Invoke($"Decompress master.mdb");
|
||||||
var masterPath = $"{Path.GetDirectoryName(DBPath)}/master/master.mdb";
|
var masterPath = $"{Path.GetDirectoryName(DBPath)}/master/master_umaviewer.mdb";
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(masterPath));
|
Directory.CreateDirectory(Path.GetDirectoryName(masterPath));
|
||||||
File.WriteAllBytes(masterPath, LZ4Util.DecompressFromFile(path));
|
try
|
||||||
|
{
|
||||||
|
File.WriteAllBytes(masterPath, LZ4Util.DecompressFromFile(path));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
callback?.Invoke($"Decompress master.mdb error");
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,7 @@ public class UmaDatabaseEntry
|
|||||||
var path = $"{Config.Instance.MainPath}\\dat\\{entry.Url.Substring(0, 2)}\\{entry.Url}";
|
var path = $"{Config.Instance.MainPath}\\dat\\{entry.Url.Substring(0, 2)}\\{entry.Url}";
|
||||||
UmaViewerDownload.DownloadAssetSync(entry, path , delegate(string msg)
|
UmaViewerDownload.DownloadAssetSync(entry, path , delegate(string msg)
|
||||||
{
|
{
|
||||||
UmaViewerUI.Instance.MessagePannel.SetActive(true);
|
UmaViewerUI.Instance.ShowMessage(msg);
|
||||||
UmaViewerUI.Instance.MessageText.text = msg;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,13 +60,14 @@ public class UmaDatabaseController
|
|||||||
if(Config.Instance.WorkMode == WorkMode.Standalone)
|
if(Config.Instance.WorkMode == WorkMode.Standalone)
|
||||||
{
|
{
|
||||||
metaDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\meta_umaviewer;");
|
metaDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\meta_umaviewer;");
|
||||||
|
masterDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\master\master_umaviewer.mdb;");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
metaDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\meta;");
|
metaDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\meta;");
|
||||||
|
masterDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\master\master.mdb;");
|
||||||
}
|
}
|
||||||
|
|
||||||
masterDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\master\master.mdb;");
|
|
||||||
|
|
||||||
metaDb.Open();
|
metaDb.Open();
|
||||||
MetaEntries = ReadMeta(metaDb);
|
MetaEntries = ReadMeta(metaDb);
|
||||||
@@ -79,19 +80,17 @@ public class UmaDatabaseController
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
UmaViewerUI.Instance.MessagePannel.SetActive(true);
|
CloseAllConnection();
|
||||||
UmaViewerUI.Instance.MessageText.text = $"Database not found at: {Config.Instance.MainPath}";
|
var msg = $"Database not found at: {Config.Instance.MainPath}";
|
||||||
if(Config.Instance.WorkMode == WorkMode.Standalone)
|
if(Config.Instance.WorkMode == WorkMode.Standalone)
|
||||||
{
|
{
|
||||||
UmaViewerUI.Instance.MessageText.text += "\nPlease update the database in the settings panel";
|
msg += "\nPlease update the database in the settings panel";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UmaViewerUI.Instance.MessageText.text += "\nPlease install the dmm game client";
|
msg += "\nPlease install the dmm game client";
|
||||||
}
|
}
|
||||||
|
UmaViewerUI.Instance.ShowMessage(msg);
|
||||||
masterDb.Close();
|
|
||||||
metaDb.Close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1160,7 +1160,7 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
if (UpdateResVerCoroutine != null&&Config.Instance.WorkMode != WorkMode.Standalone) return;
|
if (UpdateResVerCoroutine != null&&Config.Instance.WorkMode != WorkMode.Standalone) return;
|
||||||
UmaDatabaseController.Instance.CloseAllConnection();
|
UmaDatabaseController.Instance.CloseAllConnection();
|
||||||
ManifestDB dB = new ManifestDB();
|
ManifestDB dB = new ManifestDB();
|
||||||
UpdateResVerCoroutine = dB.UpdateResourceVersion(delegate (string msg) { MessagePannel.SetActive(true); MessageText.text = msg; });
|
UpdateResVerCoroutine = dB.UpdateResourceVersion(delegate (string msg) { ShowMessage(msg); });
|
||||||
StartCoroutine(UpdateResVerCoroutine);
|
StartCoroutine(UpdateResVerCoroutine);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1191,4 +1191,10 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
Shader.SetGlobalFloat("_GlobalOutlineWidth", val);
|
Shader.SetGlobalFloat("_GlobalOutlineWidth", val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ShowMessage(string msg)
|
||||||
|
{
|
||||||
|
MessagePannel.SetActive(true);
|
||||||
|
MessageText.text = msg;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user