bug fix
This commit is contained in:
@@ -124,6 +124,7 @@ public class CostumeEntry
|
||||
{
|
||||
public string Id;
|
||||
public int CharaId;
|
||||
public string DressName;
|
||||
public int BodyType;
|
||||
public int BodyTypeSub;
|
||||
public Sprite Icon;
|
||||
|
||||
@@ -44,6 +44,7 @@ public class UmaDatabaseController
|
||||
|
||||
public IEnumerable<UmaDatabaseEntry> MetaEntries;
|
||||
public IEnumerable<DataRow> CharaData;
|
||||
public IEnumerable<DataRow> MobCharaData;
|
||||
public IEnumerable<FaceTypeData> FaceTypeData;
|
||||
public IEnumerable<DataRow> LiveData;
|
||||
public IEnumerable<DataRow> DressData;
|
||||
@@ -73,7 +74,8 @@ public class UmaDatabaseController
|
||||
MetaEntries = ReadMeta(metaDb);
|
||||
|
||||
masterDb.Open();
|
||||
CharaData = ReadMaster(masterDb);
|
||||
CharaData = ReadCharaMaster(masterDb);
|
||||
MobCharaData = ReadMobCharaMaster(masterDb);
|
||||
FaceTypeData = ReadFaceTypeData(masterDb);
|
||||
LiveData = ReadAllLiveData(masterDb);
|
||||
DressData = ReadAllDressData(masterDb);
|
||||
@@ -119,10 +121,20 @@ public class UmaDatabaseController
|
||||
return entries;
|
||||
}
|
||||
|
||||
static IEnumerable<DataRow> ReadMaster(SqliteConnection conn)
|
||||
static IEnumerable<DataRow> ReadCharaMaster(SqliteConnection conn)
|
||||
{
|
||||
return ReadMaster(conn, "SELECT * FROM chara_data C,(SELECT D.'index' charaid,D.'text' charaname FROM text_data D WHERE id like 6) T WHERE C.id like T.charaid");
|
||||
}
|
||||
|
||||
static IEnumerable<DataRow> ReadMobCharaMaster(SqliteConnection conn)
|
||||
{
|
||||
return ReadMaster(conn, "SELECT * FROM chara_data C,(SELECT D.'index' charaid,D.'text' charaname FROM text_data D WHERE id like 6) T WHERE C.id like T.charaid");
|
||||
}
|
||||
|
||||
static IEnumerable<DataRow> ReadMaster(SqliteConnection conn,string sql)
|
||||
{
|
||||
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
||||
sqlite_cmd.CommandText = "SELECT * FROM chara_data C,(SELECT D.'index' charaid,D.'text' charaname FROM text_data D WHERE id like 6) T WHERE C.id like T.charaid";
|
||||
sqlite_cmd.CommandText = sql;
|
||||
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
||||
var result = new DataTable();
|
||||
result.Load(sqlite_datareader);
|
||||
@@ -158,43 +170,24 @@ public class UmaDatabaseController
|
||||
|
||||
static IEnumerable<DataRow> ReadAllLiveData(SqliteConnection conn)
|
||||
{
|
||||
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
||||
sqlite_cmd.CommandText =
|
||||
$"SELECT * FROM live_data L,(SELECT D.'index' songid,D.'text' songname FROM text_data D WHERE id like 16) T WHERE L.music_id like T.songid";
|
||||
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
||||
var result = new DataTable();
|
||||
result.Load(sqlite_datareader);
|
||||
var temp = result.Rows.GetEnumerator();
|
||||
while (temp.MoveNext())
|
||||
{
|
||||
yield return (DataRow)temp.Current;
|
||||
}
|
||||
return ReadMaster(conn, $"SELECT * FROM live_data L,(SELECT D.'index' songid,D.'text' songname FROM text_data D WHERE id like 16) T WHERE L.music_id like T.songid");
|
||||
}
|
||||
|
||||
static IEnumerable<DataRow> ReadAllDressData(SqliteConnection conn)
|
||||
{
|
||||
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
||||
sqlite_cmd.CommandText =
|
||||
$"SELECT * FROM dress_data";
|
||||
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
||||
var result = new DataTable();
|
||||
result.Load(sqlite_datareader);
|
||||
var temp = result.Rows.GetEnumerator();
|
||||
while (temp.MoveNext())
|
||||
{
|
||||
yield return (DataRow)temp.Current;
|
||||
}
|
||||
return ReadMaster(conn, $"SELECT * FROM dress_data C,(SELECT D.'index' dressid,D.'text' dressname FROM text_data D WHERE id like 14) T WHERE C.id like T.dressid");
|
||||
}
|
||||
|
||||
public static DataRow ReadCharaData(int id)
|
||||
{
|
||||
SqliteCommand sqlite_cmd = instance.masterDb.CreateCommand();
|
||||
sqlite_cmd.CommandText = $"SELECT * FROM chara_data WHERE id LIKE {id}";
|
||||
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
||||
var result = new DataTable();
|
||||
result.Load(sqlite_datareader);
|
||||
DataRow row = result.Rows[0];
|
||||
return row;
|
||||
foreach (var chara in instance.CharaData)
|
||||
{
|
||||
if (Convert.ToInt32(chara["id"]) == id)
|
||||
{
|
||||
return chara;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void CloseAllConnection()
|
||||
|
||||
@@ -94,6 +94,7 @@ public class UmaViewerMain : MonoBehaviour
|
||||
if (costume != null)
|
||||
{
|
||||
costume.CharaId = Convert.ToInt32(data["chara_id"]);
|
||||
costume.DressName = data["dressname"].ToString();
|
||||
costume.BodyType = Convert.ToInt32(data["body_type"]);
|
||||
costume.BodyTypeSub = Convert.ToInt32(data["body_type_sub"]);
|
||||
}
|
||||
|
||||
+118
-83
@@ -15,7 +15,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
public static UmaViewerUI Instance;
|
||||
private UmaViewerMain Main => UmaViewerMain.Instance;
|
||||
private UmaViewerBuilder Builder => UmaViewerBuilder.Instance;
|
||||
|
||||
|
||||
public CanvasScaler canvasScaler;
|
||||
|
||||
[Header("normal models")]
|
||||
@@ -194,9 +194,9 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
LoadedAssetCount++;
|
||||
string filePath = entry.FilePath;
|
||||
var container = Instantiate(UmaContainerAssetsPrefab, LoadedAssetsPanel).GetComponent<UmaUIContainer>();
|
||||
var container = Instantiate(UmaContainerAssetsPrefab, LoadedAssetsPanel).GetComponent<UmaUIContainer>();
|
||||
container.Name = Path.GetFileName(entry.Name);
|
||||
container.Button.onClick.AddListener(() => {Process.Start("explorer.exe", "/select," + filePath);});
|
||||
container.Button.onClick.AddListener(() => { Process.Start("explorer.exe", "/select," + filePath); });
|
||||
LoadedAssetsPanel.sizeDelta = new Vector2(0, LoadedAssetCount * 35);
|
||||
}
|
||||
|
||||
@@ -214,14 +214,16 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
var container1 = Instantiate(UmaContainerPrefab, AnimationSetList.content).GetComponent<UmaUIContainer>();
|
||||
container1.Name = container1.name = "Generic";
|
||||
container1.Button.onClick.AddListener(() => {
|
||||
container1.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(AnimationSetList.content, container1);
|
||||
ListAnimations(-1, false);
|
||||
});
|
||||
|
||||
var container2 = Instantiate(UmaContainerPrefab, AnimationSetList.content).GetComponent<UmaUIContainer>();
|
||||
container2.Name = container2.name = "Tail";
|
||||
container2.Button.onClick.AddListener(() => {
|
||||
container2.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(AnimationSetList.content, container2);
|
||||
ListAnimations(-2, false);
|
||||
});
|
||||
@@ -232,7 +234,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
var container3 = Instantiate(UmaContainerPrefab, CharactersList.content).GetComponent<UmaUIContainer>();
|
||||
container3.Name = container3.name = chara.Id + " " + chara.Name;
|
||||
container3.Button.onClick.AddListener(() => {
|
||||
container3.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(CharactersList.content, container3);
|
||||
ListCostumes(charaInstance, false);
|
||||
});
|
||||
@@ -245,7 +248,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
var container4 = Instantiate(UmaContainerPrefab, AnimationSetList.content).GetComponent<UmaUIContainer>();
|
||||
container4.Name = container4.name = chara.Id + " " + chara.Name;
|
||||
container4.Button.onClick.AddListener(() => {
|
||||
container4.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(AnimationSetList.content, container4);
|
||||
ListAnimations(charaInstance.Id, false);
|
||||
});
|
||||
@@ -262,7 +266,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
var container1 = Instantiate(UmaContainerPrefab, MiniAnimationSetList.content).GetComponent<UmaUIContainer>();
|
||||
container1.Name = container1.name = "General";
|
||||
container1.Button.onClick.AddListener(() => {
|
||||
container1.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(MiniAnimationSetList.content, container1);
|
||||
ListAnimations(-1, true);
|
||||
});
|
||||
@@ -272,7 +277,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
var charaInstance = chara;
|
||||
var container2 = Instantiate(UmaContainerPrefab, MiniCharactersList.content).GetComponent<UmaUIContainer>();
|
||||
container2.Name = container2.name = chara.Id + " " + chara.Name;
|
||||
container2.Button.onClick.AddListener(() => {
|
||||
container2.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(MiniCharactersList.content, container2);
|
||||
ListCostumes(charaInstance, true);
|
||||
});
|
||||
@@ -285,7 +291,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
var container3 = Instantiate(UmaContainerPrefab, MiniAnimationSetList.content).GetComponent<UmaUIContainer>();
|
||||
container3.Name = container3.name = chara.Id + " " + chara.Name;
|
||||
container3.Button.onClick.AddListener(() => {
|
||||
container3.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(MiniAnimationSetList.content, container3);
|
||||
ListAnimations(charaInstance.Id, true);
|
||||
});
|
||||
@@ -302,9 +309,9 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
foreach (FacialMorph morph in targetMorph)
|
||||
{
|
||||
if(morph is FacialOtherMorph extraMorph)
|
||||
if (morph is FacialOtherMorph extraMorph)
|
||||
{
|
||||
foreach(var prop in extraMorph.BindProperties)
|
||||
foreach (var prop in extraMorph.BindProperties)
|
||||
{
|
||||
var container = Instantiate(UmaContainerSliderPrefab, TargetList.content).GetComponent<UmaUIContainer>();
|
||||
container.Name = $"{morph.locator.name}({prop.Type})";
|
||||
@@ -323,7 +330,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
break;
|
||||
case BindProperty.BindType.EyeSelect:
|
||||
container.Slider.wholeNumbers = true;
|
||||
container.Slider.maxValue = prop.BindPrefab.Count/2 - 1;
|
||||
container.Slider.maxValue = prop.BindPrefab.Count / 2 - 1;
|
||||
container.Slider.minValue = 0;
|
||||
break;
|
||||
case BindProperty.BindType.Enable:
|
||||
@@ -342,9 +349,10 @@ public class UmaViewerUI : MonoBehaviour
|
||||
container.Slider.minValue = 0;
|
||||
break;
|
||||
}
|
||||
container.Slider.onValueChanged.AddListener((a) => {
|
||||
container.Slider.onValueChanged.AddListener((a) =>
|
||||
{
|
||||
target.ChangeMorphWeight(prop, a);
|
||||
if(prop.Type == BindProperty.BindType.Enable&& morph.name.Contains("Manga"))
|
||||
if (prop.Type == BindProperty.BindType.Enable && morph.name.Contains("Manga"))
|
||||
{
|
||||
target.ChangeMorphWeight(target.EyeMorphs[42], container.Slider.value > 0 ? 1 : 0);
|
||||
target.ChangeMorphWeight(target.EyeMorphs[43], container.Slider.value > 0 ? 1 : 0);
|
||||
@@ -408,12 +416,12 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
mat.mainTextureOffset = new Vector2(0.25f * (val % 4), -0.25f * (val / 4));
|
||||
}
|
||||
else if(type == 1)
|
||||
else if (type == 1)
|
||||
{
|
||||
var vector = mat.GetVector("_UVOffset");
|
||||
mat.SetVector("_UVOffset", new Vector4(0.25f * (val % 4), -0.25f * (val / 4), vector.z, vector.w));
|
||||
}
|
||||
else if(type == 2)
|
||||
else if (type == 2)
|
||||
{
|
||||
var vector = mat.GetVector("_UVOffset");
|
||||
mat.SetVector("_UVOffset", new Vector4(vector.x, vector.y, 0.25f * (val % 4), -0.25f * (val / 4)));
|
||||
@@ -430,8 +438,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
public void UpdateFacialPanels()
|
||||
{
|
||||
if(currentFaceDrivenKeyTarget)
|
||||
LoadFacialPanels(currentFaceDrivenKeyTarget);
|
||||
if (currentFaceDrivenKeyTarget)
|
||||
LoadFacialPanels(currentFaceDrivenKeyTarget);
|
||||
}
|
||||
|
||||
public void LoadEmotionPanels(FaceEmotionKeyTarget target)
|
||||
@@ -443,7 +451,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
if (target == null) return;
|
||||
|
||||
foreach(var emotion in target.FaceEmotionKey)
|
||||
foreach (var emotion in target.FaceEmotionKey)
|
||||
{
|
||||
if (emotion.label == "Base")
|
||||
{
|
||||
@@ -464,10 +472,11 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
var liveInstance = live;
|
||||
var container = Instantiate(UmaContainerLivePrefab, LiveList.content).GetComponent<UmaUIContainer>();
|
||||
container.Name = " "+ live.MusicId + " " + live.SongName;
|
||||
container.Name = " " + live.MusicId + " " + live.SongName;
|
||||
container.Image.sprite = live.Icon;
|
||||
container.Image.enabled = container.Image.sprite;
|
||||
container.Button.onClick.AddListener(() => {
|
||||
container.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(LiveList.content, container);
|
||||
ShowLiveSelectPannel(live);
|
||||
});
|
||||
@@ -476,7 +485,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
CharaContainer.Name = " " + live.MusicId + " " + live.SongName;
|
||||
CharaContainer.Image.sprite = live.Icon;
|
||||
CharaContainer.Image.enabled = CharaContainer.Image.sprite;
|
||||
CharaContainer.Button.onClick.AddListener(() => {
|
||||
CharaContainer.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(LiveSoundList.content, container);
|
||||
ListLiveSounds(live.MusicId);
|
||||
});
|
||||
@@ -500,11 +510,11 @@ public class UmaViewerUI : MonoBehaviour
|
||||
}
|
||||
NormalSoundCtrl.Initialize(pageentrys, NormalSoundList);
|
||||
}
|
||||
|
||||
|
||||
public void LoadPropPanel()
|
||||
{
|
||||
var pageentrys = new List<PageManager.Entry>();
|
||||
foreach (var prop in Main.AbList.Where(a=>a.Name.Contains("pfb_chr_prop") && !a.Name.Contains("clothes")))
|
||||
foreach (var prop in Main.AbList.Where(a => a.Name.Contains("pfb_chr_prop") && !a.Name.Contains("clothes")))
|
||||
{
|
||||
var pageentry = new PageManager.Entry();
|
||||
pageentry.Name = Path.GetFileName(prop.Name);
|
||||
@@ -515,7 +525,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
};
|
||||
pageentrys.Add(pageentry);
|
||||
}
|
||||
PropPageCtrl.Initialize(pageentrys,PropList);
|
||||
PropPageCtrl.Initialize(pageentrys, PropList);
|
||||
}
|
||||
|
||||
public void LoadMapPanel()
|
||||
@@ -540,7 +550,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
if (currentLive == null) return;
|
||||
var selectlist = LiveSelectList.content.GetComponentsInChildren<LiveCharacterSelect>();
|
||||
if(selectlist != null)
|
||||
if (selectlist != null)
|
||||
{
|
||||
Builder.LoadLive(currentLive, new List<LiveCharacterSelect>(selectlist));
|
||||
LiveSelectPannel.SetActive(false);
|
||||
@@ -554,7 +564,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
Destroy(LiveSelectList.content.GetChild(i).gameObject);
|
||||
}
|
||||
|
||||
|
||||
currentLive = entry;
|
||||
LiveSelectImage.sprite = entry.Icon;
|
||||
LiveSelectInfoText.text = $"{entry.SongName}\nMembers Count: {entry.MemberCount}";
|
||||
@@ -562,7 +572,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
var chara = Instantiate(LiveSelectPrefab, LiveSelectList.content).GetComponent<LiveCharacterSelect>();
|
||||
chara.IndexText.text = (i + 1).ToString();
|
||||
chara.GetComponent<Button>().onClick.AddListener(() => {
|
||||
chara.GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
chara.SelectChara(this);
|
||||
foreach (var t in LiveSelectList.content.GetComponentsInChildren<LiveCharacterSelect>())
|
||||
{
|
||||
@@ -579,33 +590,49 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
Destroy(costumeList.content.GetChild(i).gameObject);
|
||||
}
|
||||
string nameVar = mini ? $"pfb_mbdy{chara.Id}" : $"pfb_bdy{chara.Id}";
|
||||
foreach (var entry in Main.AbList.Where(a => !a.Name.Contains("clothes") && a.Name.Contains(nameVar)))
|
||||
|
||||
Action<CharaEntry> action = delegate (CharaEntry achara)
|
||||
{
|
||||
var container = Instantiate(UmaContainerCostumePrefab, costumeList.content).GetComponent<UmaUIContainer>();
|
||||
string[] split = entry.Name.Split('_');
|
||||
string costumeId = split[split.Length - 1];
|
||||
container.Name = container.name = GetCostumeName(costumeId);
|
||||
var icon = Main.Costumes.FirstOrDefault(a => (a.CharaId == chara.Id && a.BodyTypeSub == int.Parse(costumeId)));
|
||||
container.Image.sprite = (icon == null ? CostumeIconDefault : icon.Icon);
|
||||
container.Image.enabled = true;
|
||||
container.Button.onClick.AddListener(() => {
|
||||
if (LiveSelectPannel.activeInHierarchy && CurrentSeletChara)
|
||||
{
|
||||
CurrentSeletChara.SetValue(chara.Id, costumeId, chara.Icon, container.Image.sprite);
|
||||
}
|
||||
else
|
||||
{
|
||||
HighlightChildImage(costumeList.content, container);
|
||||
StartCoroutine(Builder.LoadUma(chara.Id, costumeId, mini));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
string nameVar = mini ? $"pfb_mbdy{achara.Id}" : $"pfb_bdy{achara.Id}";
|
||||
foreach (var entry in Main.AbList.Where(a => !a.Name.Contains("clothes") && a.Name.Contains(nameVar)))
|
||||
{
|
||||
var container = Instantiate(UmaContainerCostumePrefab, costumeList.content).GetComponent<UmaUIContainer>();
|
||||
string[] split = entry.Name.Split('_');
|
||||
string costumeId = split[split.Length - 1];
|
||||
var dressdata = Main.Costumes.FirstOrDefault(a => (a.CharaId == achara.Id && a.BodyTypeSub == int.Parse(costumeId)));
|
||||
container.Name = container.name = GetCostumeName(costumeId, (dressdata == null ? costumeId : dressdata.DressName));
|
||||
container.Image.sprite = (dressdata == null ? CostumeIconDefault : dressdata.Icon);
|
||||
container.Image.enabled = true;
|
||||
container.Button.onClick.AddListener(() =>
|
||||
{
|
||||
if (LiveSelectPannel.activeInHierarchy && CurrentSeletChara)
|
||||
{
|
||||
CurrentSeletChara.SetValue(achara.Id, costumeId, achara.Icon, container.Image.sprite);
|
||||
}
|
||||
else
|
||||
{
|
||||
HighlightChildImage(costumeList.content, container);
|
||||
StartCoroutine(Builder.LoadUma(achara.Id, costumeId, mini));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
if(chara == null)
|
||||
{
|
||||
foreach(var cha in Main.Characters)
|
||||
{
|
||||
action.Invoke(cha);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
action.Invoke(chara);
|
||||
}
|
||||
|
||||
//Common costumes
|
||||
List<string> costumes = new List<string>();
|
||||
nameVar = mini ? "pfb_mbdy0" : $"pfb_bdy0";
|
||||
var nameVar = mini ? "pfb_mbdy0" : $"pfb_bdy0";
|
||||
foreach (var entry in Main.AbChara.Where(a => a.Name.Contains("/body/") && !a.Name.Contains("/clothes/") && a.Name.Contains(nameVar)))
|
||||
{
|
||||
string id = Path.GetFileName(entry.Name);
|
||||
@@ -615,15 +642,16 @@ public class UmaViewerUI : MonoBehaviour
|
||||
costumes.Add(id);
|
||||
string costumeId = id;
|
||||
var container = Instantiate(UmaContainerCostumePrefab, costumeList.content).GetComponent<UmaUIContainer>();
|
||||
container.Name = container.name = GetCostumeName(id);
|
||||
var data = costumeId.Split('_');
|
||||
var bodytype = int.Parse(data[0]);
|
||||
var bodysub = int.Parse(data[1]);
|
||||
|
||||
var icon = Main.Costumes.FirstOrDefault(a => a.BodyType == bodytype && a.BodyTypeSub == bodysub);
|
||||
container.Image.sprite = (icon == null ? CostumeIconDefault : icon.Icon);
|
||||
var dressdata = Main.Costumes.FirstOrDefault(a => a.BodyType == bodytype && a.BodyTypeSub == bodysub);
|
||||
container.Name = container.name = GetCostumeName(id, (dressdata == null ? id : dressdata.DressName));
|
||||
container.Image.sprite = (dressdata == null ? CostumeIconDefault : dressdata.Icon);
|
||||
container.Image.enabled = true;
|
||||
container.Button.onClick.AddListener(() => {
|
||||
container.Button.onClick.AddListener(() =>
|
||||
{
|
||||
if (LiveSelectPannel.activeInHierarchy && CurrentSeletChara)
|
||||
{
|
||||
CurrentSeletChara.SetValue(chara.Id, costumeId, chara.Icon, container.Image.sprite);
|
||||
@@ -659,7 +687,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
container.Image.enabled = true;
|
||||
}
|
||||
|
||||
container.Button.onClick.AddListener(() => {
|
||||
container.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(LiveCharaSoundList.content, container);
|
||||
if (isCriware)
|
||||
{
|
||||
@@ -683,11 +712,12 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
var subSounds = Builder.LoadAudio(awb);
|
||||
|
||||
foreach(var sound in subSounds)
|
||||
foreach (var sound in subSounds)
|
||||
{
|
||||
var container = Instantiate(UmaContainerPrefab, NormalSubSoundList.content).GetComponent<UmaUIContainer>();
|
||||
container.Name = $"Clip_{subSounds.IndexOf(sound)}";
|
||||
container.Button.onClick.AddListener(() => {
|
||||
container.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(NormalSubSoundList.content, container);
|
||||
Builder.PlaySound(awb, subSounds.IndexOf(sound));
|
||||
});
|
||||
@@ -719,7 +749,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
var pageentry = new PageManager.Entry();
|
||||
pageentry.Name = Path.GetFileName(entry.Name);
|
||||
pageentry.FontSize = 20;
|
||||
pageentry.OnClick = (container) => {
|
||||
pageentry.OnClick = (container) =>
|
||||
{
|
||||
HighlightChildImage(animationList.content, container);
|
||||
Builder.LoadAsset(entry);
|
||||
LoadedAnimation();
|
||||
@@ -736,7 +767,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
var container = Instantiate(UmaContainerPrefab, animationList.content).GetComponent<UmaUIContainer>();
|
||||
container.Name = container.name = Path.GetFileName(entry.Name);
|
||||
container.FontSize = 20;
|
||||
container.Button.onClick.AddListener(() => {
|
||||
container.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(animationList.content, container);
|
||||
Builder.LoadAsset(entryInstance);
|
||||
LoadedAnimation();
|
||||
@@ -753,7 +785,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
var container = Instantiate(UmaContainerPrefab, animationList.content).GetComponent<UmaUIContainer>();
|
||||
container.Name = container.name = Path.GetFileName(entry.Name);
|
||||
container.FontSize = 20;
|
||||
container.Button.onClick.AddListener(() => {
|
||||
container.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(animationList.content, container);
|
||||
Builder.LoadAsset(entryInstance);
|
||||
LoadedAnimation();
|
||||
@@ -767,7 +800,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
var container = Instantiate(UmaContainerPrefab, animationList.content).GetComponent<UmaUIContainer>();
|
||||
container.Name = container.name = Path.GetFileName(entry.Name);
|
||||
container.FontSize = 20;
|
||||
container.Button.onClick.AddListener(() => {
|
||||
container.Button.onClick.AddListener(() =>
|
||||
{
|
||||
HighlightChildImage(animationList.content, container);
|
||||
Builder.LoadAsset(entryInstance);
|
||||
LoadedAnimation();
|
||||
@@ -787,13 +821,14 @@ public class UmaViewerUI : MonoBehaviour
|
||||
pageentry.Name = Path.GetFileName(entry.Name);
|
||||
pageentry.Sprite = Builder.LoadSprite(entry);
|
||||
if (pageentry.Sprite == null) continue;
|
||||
pageentry.OnClick = (container) => {
|
||||
pageentry.OnClick = (container) =>
|
||||
{
|
||||
HighlightChildImage(BackGroundList.content, container);
|
||||
BG_Image.sprite = pageentry.Sprite;
|
||||
BG_Image.SetVerticesDirty();
|
||||
};
|
||||
|
||||
if(BG_Image.sprite == null)
|
||||
if (BG_Image.sprite == null)
|
||||
{
|
||||
BG_Image.sprite = pageentry.Sprite;
|
||||
BG_Image.SetVerticesDirty();
|
||||
@@ -824,12 +859,11 @@ public class UmaViewerUI : MonoBehaviour
|
||||
return (entry == null) ? id.ToString() : entry.Name;
|
||||
}
|
||||
|
||||
public static string GetCostumeName(string costumeId)
|
||||
public static string GetCostumeName(string costumeId, string defaultname)
|
||||
{
|
||||
switch (costumeId)
|
||||
{
|
||||
case "00":
|
||||
return "Default";
|
||||
// case "00":return "Default";
|
||||
case "90":
|
||||
return "Upgraded";
|
||||
case "0001_00_01":
|
||||
@@ -857,7 +891,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
case "0004_01_00":
|
||||
return "Towel";
|
||||
default:
|
||||
return costumeId;
|
||||
return defaultname;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -950,7 +984,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
public void AudioPause()
|
||||
{
|
||||
if (Builder.CurrentAudioSources.Count>0)
|
||||
if (Builder.CurrentAudioSources.Count > 0)
|
||||
{
|
||||
AudioSource MainSource = Builder.CurrentAudioSources[0];
|
||||
var state = MainSource.isPlaying;
|
||||
@@ -974,7 +1008,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
public void AudioProgressChange(float val)
|
||||
{
|
||||
if (Builder.CurrentAudioSources.Count>0)
|
||||
if (Builder.CurrentAudioSources.Count > 0)
|
||||
{
|
||||
foreach (AudioSource source in Builder.CurrentAudioSources)
|
||||
{
|
||||
@@ -1024,7 +1058,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
animator_face.Play(0, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1037,7 +1071,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
if (animator != null)
|
||||
{
|
||||
var AnimeClip = Builder.CurrentUMAContainer.OverrideController["clip_2"];
|
||||
|
||||
|
||||
// Pause and Seek;
|
||||
animator.speed = 0;
|
||||
animator.Play(0, 0, val);
|
||||
@@ -1080,7 +1114,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
public static string ToTimeFormat(float time)
|
||||
{
|
||||
|
||||
|
||||
int seconds = (int)time;
|
||||
int hour = seconds / 3600;
|
||||
int minute = seconds % 3600 / 60;
|
||||
@@ -1099,9 +1133,9 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
public string GetCurrentLyrics(float time)
|
||||
{
|
||||
for(int i = Builder.CurrentLyrics.Count-1; i >=0; i--)
|
||||
for (int i = Builder.CurrentLyrics.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if(Builder.CurrentLyrics[i].time< time)
|
||||
if (Builder.CurrentLyrics[i].time < time)
|
||||
{
|
||||
return Builder.CurrentLyrics[i].text;
|
||||
}
|
||||
@@ -1112,7 +1146,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
public void RecordVMD()
|
||||
{
|
||||
var buttonText = VMDButton.GetComponentInChildren<TextMeshProUGUI>();
|
||||
if (!UmaViewerBuilder.Instance.CurrentUMAContainer|| UmaViewerBuilder.Instance.CurrentUMAContainer.IsMini)
|
||||
if (!UmaViewerBuilder.Instance.CurrentUMAContainer || UmaViewerBuilder.Instance.CurrentUMAContainer.IsMini)
|
||||
{
|
||||
buttonText.text = string.Format("<color=#FF0000>{0}</color>", "Need Normal UMA");
|
||||
return;
|
||||
@@ -1122,7 +1156,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
var camera = UmaViewerBuilder.Instance.AnimationCamera;
|
||||
|
||||
var rootbone = container.transform.Find("Position");
|
||||
if(rootbone.gameObject.TryGetComponent(out UnityHumanoidVMDRecorder recorder))
|
||||
if (rootbone.gameObject.TryGetComponent(out UnityHumanoidVMDRecorder recorder))
|
||||
{
|
||||
if (recorder.IsRecording)
|
||||
{
|
||||
@@ -1156,8 +1190,9 @@ public class UmaViewerUI : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateGameDB() {
|
||||
if (UpdateResVerCoroutine != null&&Config.Instance.WorkMode != WorkMode.Standalone) return;
|
||||
public void UpdateGameDB()
|
||||
{
|
||||
if (UpdateResVerCoroutine != null && Config.Instance.WorkMode != WorkMode.Standalone) return;
|
||||
UmaDatabaseController.Instance.CloseAllConnection();
|
||||
ManifestDB dB = new ManifestDB();
|
||||
UpdateResVerCoroutine = dB.UpdateResourceVersion(delegate (string msg) { ShowMessage(msg); });
|
||||
@@ -1166,7 +1201,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
|
||||
public void ChangeWorkMode(int mode)
|
||||
{
|
||||
if((int)Config.Instance.WorkMode != mode)
|
||||
if ((int)Config.Instance.WorkMode != mode)
|
||||
{
|
||||
Config.Instance.WorkMode = (WorkMode)mode;
|
||||
Config.Instance.UpdateConfig();
|
||||
@@ -1176,9 +1211,9 @@ public class UmaViewerUI : MonoBehaviour
|
||||
public void ChangeMainPath()
|
||||
{
|
||||
var path = StandaloneFileBrowser.OpenFolderPanel("Select Folder", Config.Instance.MainPath, false);
|
||||
if (path != null && path.Length > 0 && !string.IsNullOrEmpty(path[0]))
|
||||
if (path != null && path.Length > 0 && !string.IsNullOrEmpty(path[0]))
|
||||
{
|
||||
if(path[0] != Config.Instance.MainPath)
|
||||
if (path[0] != Config.Instance.MainPath)
|
||||
{
|
||||
Config.Instance.MainPath = path[0];
|
||||
Config.Instance.UpdateConfig();
|
||||
|
||||
Reference in New Issue
Block a user