merge conflict
This commit is contained in:
@@ -19,7 +19,7 @@ public class Screenshot : MonoBehaviour
|
||||
|
||||
public static void TakeScreenshot()
|
||||
{
|
||||
var camera = UmaViewerBuilder.Instance.AnimationCamera.gameObject.activeInHierarchy ? UmaViewerBuilder.Instance.AnimationCamera : Camera.main;
|
||||
var camera = UmaViewerBuilder.Instance.AnimationCamera.GetComponent<Camera>().enabled ? UmaViewerBuilder.Instance.AnimationCamera : Camera.main;
|
||||
int width = int.Parse(UmaViewerUI.Instance.SSWidth.text);
|
||||
int height = int.Parse(UmaViewerUI.Instance.SSHeight.text);
|
||||
width = width == -1 ? Screen.width : width;
|
||||
@@ -46,7 +46,7 @@ public class Screenshot : MonoBehaviour
|
||||
|
||||
private IEnumerator RecordGif(int width, int height, bool transparent, int quality)
|
||||
{
|
||||
var camera = UmaViewerBuilder.Instance.AnimationCamera.gameObject.activeInHierarchy ? UmaViewerBuilder.Instance.AnimationCamera : Camera.main;
|
||||
var camera = UmaViewerBuilder.Instance.AnimationCamera.GetComponent<Camera>().enabled ? UmaViewerBuilder.Instance.AnimationCamera : Camera.main;
|
||||
var ppLayer = camera.GetComponent<PostProcessLayer>();
|
||||
bool oldPpState = ppLayer.enabled;
|
||||
ppLayer.enabled = false;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class UmaViewerMain : MonoBehaviour
|
||||
{
|
||||
Instance = this;
|
||||
new Config();
|
||||
Application.targetFrameRate = -1;
|
||||
Application.targetFrameRate = 120;
|
||||
AbList = UmaDatabaseController.Instance.MetaEntries.ToList();
|
||||
AbChara = AbList.Where(ab => ab.Name.StartsWith(UmaDatabaseController.CharaPath)).ToList();
|
||||
AbMotions = AbList.Where(ab => ab.Name.StartsWith(UmaDatabaseController.MotionPath)).ToList();
|
||||
@@ -46,14 +46,15 @@ public class UmaViewerMain : MonoBehaviour
|
||||
private IEnumerator Start()
|
||||
{
|
||||
Dictionary<int, string> enNames = new Dictionary<int, string>();
|
||||
Dictionary<int, string> mobNames = new Dictionary<int, string>();
|
||||
|
||||
//Main chara names (En only)
|
||||
if (Config.Instance.Language == Language.En)
|
||||
{
|
||||
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/BasicCharaDataInfo", txt =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(txt)) return;
|
||||
var umaData = JArray.Parse(txt);
|
||||
foreach (var item in umaData)
|
||||
foreach (var item in JArray.Parse(txt))
|
||||
{
|
||||
if (!enNames.ContainsKey((int)item["charaId"]))
|
||||
{
|
||||
@@ -62,6 +63,19 @@ public class UmaViewerMain : MonoBehaviour
|
||||
}
|
||||
});
|
||||
}
|
||||
//Mob names (EN & JP)
|
||||
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/BasicMobDataInfo", txt =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(txt)) return;
|
||||
foreach (var item in JArray.Parse(txt))
|
||||
{
|
||||
if (!mobNames.ContainsKey((int)item["mobId"]))
|
||||
{
|
||||
mobNames.Add((int)item["mobId"], Config.Instance.Language == Language.Jp ? item["mobName"].ToString() : item["mobNameEnglish"].ToString());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var UmaCharaData = UmaDatabaseController.Instance.CharaData;
|
||||
foreach (var item in UmaCharaData)
|
||||
@@ -88,9 +102,10 @@ public class UmaViewerMain : MonoBehaviour
|
||||
}
|
||||
|
||||
var id = Convert.ToInt32(item["mob_id"]);
|
||||
var name = mobNames.ContainsKey(id) ? mobNames[id] : "";
|
||||
MobCharacters.Add(new CharaEntry()
|
||||
{
|
||||
Name = $"Mob_{id}",
|
||||
Name = string.IsNullOrEmpty(name)? $"Mob_{id}" : name,
|
||||
Icon = UmaViewerBuilder.Instance.LoadMobCharaIcon(id.ToString()),
|
||||
Id = id,
|
||||
IsMob = true
|
||||
|
||||
@@ -77,7 +77,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
[Header("backgrounds")]
|
||||
public ScrollRect BackGroundList;
|
||||
public PageManager BackGroundPageCtrl;
|
||||
public GameObject BackGroundCameraObj;
|
||||
public GameObject BG_Canvas;
|
||||
public GameObject BG_HSVPickerObj;
|
||||
public Image BG_Image;
|
||||
|
||||
@@ -107,6 +107,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
public Button VMDButton;
|
||||
public Button UpdateDBButton;
|
||||
public TMP_Dropdown WorkModeDropdown;
|
||||
public TMP_Dropdown LanguageDropdown;
|
||||
public List<GameObject> TogglablePanels = new List<GameObject>();
|
||||
public List<GameObject> TogglableFacials = new List<GameObject>();
|
||||
|
||||
@@ -144,6 +145,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
private void Start()
|
||||
{
|
||||
WorkModeDropdown.SetValueWithoutNotify((int)Config.Instance.WorkMode);
|
||||
LanguageDropdown.SetValueWithoutNotify((int)Config.Instance.Language);
|
||||
UpdateDBButton.interactable = (Config.Instance.WorkMode == WorkMode.Standalone);
|
||||
}
|
||||
|
||||
@@ -963,7 +965,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
Camera.main.clearFlags = CameraClearFlags.SolidColor;
|
||||
break;
|
||||
case 2:
|
||||
Camera.main.clearFlags = CameraClearFlags.Depth;
|
||||
Camera.main.clearFlags = CameraClearFlags.SolidColor;
|
||||
ListBackgrounds();
|
||||
break;
|
||||
default:
|
||||
@@ -971,8 +973,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
break;
|
||||
}
|
||||
|
||||
BackGroundCameraObj.SetActive(index == 2);
|
||||
BG_HSVPickerObj.SetActive(index != 2);
|
||||
BG_Canvas.SetActive(index == 2);
|
||||
BackGroundPageCtrl.transform.parent.gameObject.SetActive(index == 2);
|
||||
}
|
||||
|
||||
@@ -1215,6 +1217,15 @@ public class UmaViewerUI : MonoBehaviour
|
||||
StartCoroutine(UpdateResVerCoroutine);
|
||||
}
|
||||
|
||||
public void ChangeLanguage(int lang)
|
||||
{
|
||||
if ((int)Config.Instance.Language != lang)
|
||||
{
|
||||
Config.Instance.Language = (Language)lang;
|
||||
Config.Instance.UpdateConfig();
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeWorkMode(int mode)
|
||||
{
|
||||
if ((int)Config.Instance.WorkMode != mode)
|
||||
|
||||
Reference in New Issue
Block a user