Skip to content

Commit

Permalink
Merge pull request #26 from o-tr/master
Browse files Browse the repository at this point in the history
v0.2.22をリリース
  • Loading branch information
o-tr authored Dec 8, 2024
2 parents d11b540 + 1a30e63 commit 8352ba1
Show file tree
Hide file tree
Showing 11 changed files with 365 additions and 21 deletions.
Binary file modified Assets/Textures/SplashScreen/ImageSlide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Assets/Textures/SplashScreen/ImageSlideViewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion Prefabs/ImageSlideViewer.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
- m_Target: {fileID: 36657328902437027}
m_TargetAssemblyTypeName:
m_MethodName: SendCustomEvent
m_Mode: 5
Expand Down Expand Up @@ -1895,6 +1895,11 @@ MonoBehaviour:
syncingModalContainerTransform: {fileID: 5091887414043655682}
syncingModalContent: {fileID: 9178016270300395852}
syncingModalContentSizeFitter: {fileID: 4014660389653803171}
errorModal: {fileID: 5403126539454890960}
errorModalTransform: {fileID: 1582463422937012609}
errorTitle: {fileID: 3804332363416238641}
errorDescription: {fileID: 5015560605636087544}
errorDescriptionSizeFitter: {fileID: 5513127115311266921}
targetColliders:
- {fileID: 722368441950897630}
transformLockButtonActiveIcon: {fileID: 2971953338018381896}
Expand Down
4 changes: 2 additions & 2 deletions Runtime/jp.ootr.ImageSlide/Scripts/12_UIErrorModal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class UIErrorModal : UIAnimationHandler
[SerializeField] private TextMeshProUGUI errorDescription;
[SerializeField] private ContentSizeFitter errorDescriptionSizeFitter;

protected void ShowErrorModal(string title, string description)
protected virtual void ShowErrorModal(string title, string description)
{
errorModal.SetActive(true);
errorTitle.text = title;
Expand All @@ -23,7 +23,7 @@ protected void ShowErrorModal(string title, string description)
errorModalTransform.ToListChildrenVertical(24, 24, true);
}

public void CloseErrorModal()
public virtual void CloseErrorModal()
{
errorModal.SetActive(false);
}
Expand Down
21 changes: 20 additions & 1 deletion Runtime/jp.ootr.ImageSlide/Scripts/22_LogicQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ private void DoSyncAll()
if (!VRCJson.TrySerializeToJson(dic, JsonExportType.Minify, out var json))
{
ConsoleError($"failed to serialize sync all json: {json}", _logicQueuePrefix);
ProcessQueue();
return;
}

Expand Down Expand Up @@ -462,19 +463,37 @@ private void UpdateList(DataToken data)
sources.DataList.Count != options.DataList.Count)
{
ConsoleError($"sources or options not found in update list: {data}", _logicQueuePrefix);
ProcessQueue();
return;
}

Sources = sources.DataList.ToStringArray();
Options = options.DataList.ToStringArray();
var fileNames = new string[Sources.Length][];
var error = false;

for (int i = 0; i < Sources.Length; i++)
{
fileNames[i] = controller.CcGetFileNames(Sources[i]);
var files = controller.CcGetFileNames(Sources[i]);
if (files == null)
{
Sources = Sources.Remove(i);
Options = Options.Remove(i);
fileNames = fileNames.Remove(i);
error = true;
continue;
}
fileNames[i] = files;
}
FileNames = fileNames;

if (error)
{
ConsoleError($"failed to update list: {data}", _logicQueuePrefix);
ProcessQueue();
return;
}

UrlsUpdated();
ProcessQueue();
}
Expand Down
12 changes: 12 additions & 0 deletions Runtime/jp.ootr.ImageSlide/Scripts/61_EventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ protected override void HideSyncingModal()
base.HideSyncingModal();
foreach (var listener in listeners) listener.HideSyncingModal();
}

protected override void ShowErrorModal(string title, string description)
{
base.ShowErrorModal(title, description);
foreach (var listener in listeners) listener.ShowErrorModal(title, description);
}

public override void CloseErrorModal()
{
base.CloseErrorModal();
foreach (var listener in listeners) listener.CloseErrorModal();
}

protected override void SeekModeChanged(SeekMode mode)
{
Expand Down
30 changes: 30 additions & 0 deletions Runtime/jp.ootr.ImageSlide/Scripts/Viewer/16_UIErrorModal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using jp.ootr.common;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

namespace jp.ootr.ImageSlide.Viewer
{
public class UIErrorModal : UISplashScreen {
[SerializeField] private GameObject errorModal;
[SerializeField] private RectTransform errorModalTransform;
[SerializeField] private TextMeshProUGUI errorTitle;
[SerializeField] private TextMeshProUGUI errorDescription;
[SerializeField] private ContentSizeFitter errorDescriptionSizeFitter;

public void ShowErrorModal(string title, string message)
{
errorModal.SetActive(true);
errorTitle.text = title;
errorDescription.text = message;
errorDescriptionSizeFitter.SetLayoutVertical();

errorModalTransform.ToListChildrenVertical(24, 24, true);
}

public void CloseErrorModal()
{
errorModal.SetActive(false);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace jp.ootr.ImageSlide.Viewer
{
public class TransformLock : UISplashScreen
public class TransformLock : UIErrorModal
{
[SerializeField] private Collider[] targetColliders;
[SerializeField] private GameObject transformLockButtonActiveIcon;
Expand Down
Loading

0 comments on commit 8352ba1

Please sign in to comment.