Skip to content

Commit

Permalink
Merge pull request #8 from o-tr/master
Browse files Browse the repository at this point in the history
v0.2.6をリリース
  • Loading branch information
o-tr authored Nov 15, 2024
2 parents e573b36 + f43b3be commit 2a6eeec
Show file tree
Hide file tree
Showing 6 changed files with 365 additions and 303 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.
9 changes: 5 additions & 4 deletions Runtime/jp.ootr.ImageSlide/Scripts/22_LogicQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ protected void SeekTo(int index)
AddSyncQueue(json.String);
}

protected void UpdateSeekMode(SeekMode mode)
protected void SyncSeekMode(SeekMode mode)
{
var modeInt = (int)mode;
var dic = new DataDictionary();
dic.SetValue("type", (int)QueueType.UpdateSeekMode);
dic.SetValue("mode", (int)mode);
dic.SetValue("mode", modeInt);
if (!VRCJson.TrySerializeToJson(dic, JsonExportType.Minify, out var json))
{
ConsoleError($"failed to serialize update seek mode json: {json}, {mode}", _logicQueuePrefix);
Expand Down Expand Up @@ -359,9 +360,9 @@ private void ApplySeekMode(DataToken data)
return;
}

var mode = (SeekMode)modeToken.Double;
var mode = (int)modeToken.Double;

SeekModeChanged(mode);
SeekModeChanged((SeekMode)mode);
ProcessQueue();
}

Expand Down
20 changes: 16 additions & 4 deletions Runtime/jp.ootr.ImageSlide/Scripts/23_LogicViewerSeekMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class LogicViewerSeekMode : LogicQueue {
[SerializeField] private Toggle allowViewedOnlyToggle;
[SerializeField] private Toggle disallowAllToggle;

private bool _isSeekModeChangedByScript;

public override void InitController()
{
base.InitController();
Expand All @@ -21,35 +23,45 @@ public override void InitController()

private void UpdateToggleGroup()
{
_isSeekModeChangedByScript = true;
allowAllToggle.isOn = seekMode == SeekMode.AllowAll;
allowPreviousOnlyToggle.isOn = seekMode == SeekMode.AllowPreviousOnly;
allowViewedOnlyToggle.isOn = seekMode == SeekMode.AllowViewedOnly;
disallowAllToggle.isOn = seekMode == SeekMode.DisallowAll;
_isSeekModeChangedByScript = false;
}

public void UpdateSeekMode()
{
if (_isSeekModeChangedByScript) return;
var value = seekModeToggleGroup.GetFirstActiveToggle();
if (value == null) return;
var mode = value.name;
switch (mode)
{
case "AllowAll":
SeekModeChanged(SeekMode.AllowAll);
SyncSeekMode(SeekMode.AllowAll);
break;
case "AllowPreviousOnly":
SeekModeChanged(SeekMode.AllowPreviousOnly);
SyncSeekMode(SeekMode.AllowPreviousOnly);
break;
case "AllowViewedOnly":
SeekModeChanged(SeekMode.AllowViewedOnly);
SyncSeekMode(SeekMode.AllowViewedOnly);
break;
case "DisallowAll":
SeekModeChanged(SeekMode.DisallowAll);
SyncSeekMode(SeekMode.DisallowAll);
break;
default:
ConsoleError($"Unknown seek mode: {mode}");
break;
}
}

protected override void SeekModeChanged(SeekMode mode)
{
base.SeekModeChanged(mode);
seekMode = mode;
UpdateToggleGroup();
}
}
}
Loading

0 comments on commit 2a6eeec

Please sign in to comment.