Files
Assembly-CSharp/Assembly-CSharp/PhotoShootProcess.cs
2026-06-12 12:58:31 +08:00

1035 lines
35 KiB
C#

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using DB;
using IO;
using Mai2.Mai2Cue;
using MAI2.Util;
using Mai2.Voice_000001;
using Manager;
using Manager.MaiStudio;
using Manager.UserDatas;
using Process;
using UnityEngine;
// Token: 0x0200016A RID: 362
public class PhotoShootProcess : ProcessBase, IPhotoShootProcess
{
// Token: 0x06000CF5 RID: 3317 RVA: 0x0003CA50 File Offset: 0x0003BC50
public PhotoShootProcess(ProcessDataContainer dataContainer)
: base(dataContainer)
{
}
// Token: 0x06000CF6 RID: 3318 RVA: 0x00003598 File Offset: 0x00002798
public override void OnAddProcess()
{
}
// Token: 0x06000CF7 RID: 3319 RVA: 0x0003CA78 File Offset: 0x0003BC78
public override void OnStart()
{
WebCamManager.Play();
GameObject gameObject = Resources.Load<GameObject>("Process/PhotoShoot/PhotoShootProcess");
this._monitors = new PhotoShootMonitor[]
{
base.CreateInstanceAndSetParent(gameObject, this.container.LeftMonitor).GetComponent<PhotoShootMonitor>(),
base.CreateInstanceAndSetParent(gameObject, this.container.RightMonitor).GetComponent<PhotoShootMonitor>()
};
this._frameIndex = new int[this._monitors.Length];
this._voiceCount = new int[this._monitors.Length];
this._skipTimes = new int[this._monitors.Length];
this._countDawn = new int[this._monitors.Length];
this._userTimer = new float[this._monitors.Length];
this._photoGraphingTimeCounter = new float[this._monitors.Length];
this._canInput = new bool[this._monitors.Length];
this._isPreview = new bool[this._monitors.Length];
this._isFirstSkipButton = new bool[this._monitors.Length];
this._isCountDownGrace = new bool[this._monitors.Length];
this._isChangePhotographingSequence = new bool[this._monitors.Length];
this._slideController = new SlideScrollController[this._monitors.Length];
this._resultTexture = new Texture2D[this._monitors.Length];
this._adjustPosition = new Vector2[this._monitors.Length];
this._restrictionSize = new Vector2[this._monitors.Length];
this._photoSequences = new PhotoShootProcess.PhotoShootSequence[this._monitors.Length];
this._prevPhotoSequences = new PhotoShootProcess.PhotoShootSequence[this._monitors.Length];
this._firstInformationQueues = new Queue<FirstInformationData>[this._monitors.Length];
Material material = Resources.Load<Material>("Materials/CircleFadeMaterial");
this._photoFrameDataList = new List<ReadOnlyCollection<PhotoFrameData>>();
SortedDictionary<int, List<PhotoFrameData>> sortedDictionary = new SortedDictionary<int, List<PhotoFrameData>>();
foreach (KeyValuePair<int, PhotoFrameData> keyValuePair in Singleton<DataManager>.Instance.GetPhotoFrames())
{
int id = keyValuePair.Value.GetID();
if (Singleton<EventManager>.Instance.IsOpenEvent(keyValuePair.Value.eventName.id))
{
List<PhotoFrameData> list = new List<PhotoFrameData> { keyValuePair.Value };
sortedDictionary.Add(id, list);
}
}
foreach (int num in sortedDictionary.Keys)
{
ReadOnlyCollection<PhotoFrameData> readOnlyCollection = new ReadOnlyCollection<PhotoFrameData>(sortedDictionary[num]);
this._photoFrameDataList.Add(readOnlyCollection);
}
this._frameParts = new List<FramePart>();
for (int i = 0; i < this._photoFrameDataList.Count; i++)
{
Texture2D photoFrameTexture2D = this.container.assetManager.GetPhotoFrameTexture2D(this._photoFrameDataList[i][0].imageFile);
Sprite sprite = Sprite.Create(photoFrameTexture2D, new Rect(0f, 0f, (float)photoFrameTexture2D.width, (float)photoFrameTexture2D.height), new Vector2(0.5f, 0.5f));
this._frameParts.Add(new FramePart(this._photoFrameDataList[i][0].name.str, sprite, photoFrameTexture2D));
}
for (int j = 0; j < this._monitors.Length; j++)
{
UserData userData = Singleton<UserDataManager>.Instance.GetUserData((long)j);
this._monitors[j].Initialize(j, userData.IsEntry);
this._monitors[j].SetData(this);
this._slideController[j] = new SlideScrollController();
this._slideController[j].SetAction(j, new Action<int>(this.SlideScrollLeft), new Action<int>(this.SlideScrollRight));
this._firstInformationQueues[j] = new Queue<FirstInformationData>();
this._countDawn[j] = 3;
this._skipTimes[j] = 0;
this._userTimer[j] = 0f;
this._isPreview[j] = false;
this._isFirstSkipButton[j] = false;
this._adjustPosition[j] = Vector2.zero;
this._monitors[j].SetMaterial(new Material(material));
if (this._frameParts.Count == 0)
{
this._monitors[j].SetFrameVisible(false);
}
else
{
this._monitors[j].SetFrameTexture(this._frameParts[this._frameIndex[j]].Tex);
}
if (userData.IsEntry)
{
UserDetail detail = userData.Detail;
UserOption option = userData.Option;
this._monitors[j].SetUserData(null, detail.UserName, (int)detail.Rating, (int)option.DispRate, detail.TotalAwake);
bool flag = false;
long unixTime = TimeManager.GetUnixTime(Singleton<UserDataManager>.Instance.GetUserData((long)j).Detail.EventWatchedDate);
foreach (ReadOnlyCollection<PhotoFrameData> readOnlyCollection2 in this._photoFrameDataList)
{
if (Singleton<EventManager>.Instance.IsDateNewAndOpen(readOnlyCollection2[0].eventName.id, unixTime))
{
flag = true;
break;
}
}
if (!userData.IsGuest() && flag)
{
this._firstInformationQueues[j].Enqueue(new FirstInformationData(WindowMessageID.SinmpeSettingNewFrame, Mai2.Voice_000001.Cue.VO_000176, 1000));
}
this._canInput[j] = false;
}
this._photoSequences[j] = PhotoShootProcess.PhotoShootSequence.None;
this._prevPhotoSequences[j] = PhotoShootProcess.PhotoShootSequence.None;
}
}
// Token: 0x06000CF8 RID: 3320 RVA: 0x0003D038 File Offset: 0x0003C238
public override void OnUpdate()
{
base.OnUpdate();
switch (this._mainSequence)
{
case PhotoShootProcess.MainSequence.Init:
this._counter = 0;
this._mainSequence = PhotoShootProcess.MainSequence.FadeIn;
return;
case PhotoShootProcess.MainSequence.FadeIn:
if (3 < this._counter)
{
this._mainSequence = PhotoShootProcess.MainSequence.Update;
this.container.processManager.NotificationFadeIn(false);
for (int i = 0; i < this._monitors.Length; i++)
{
if (Singleton<UserDataManager>.Instance.GetUserData((long)i).IsEntry)
{
if (0 < this._firstInformationQueues[i].Count)
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.FirstInformation, i);
this._monitors[i].SetFirstInformation();
this.ShowFirstInformation(i);
}
else
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.PhotoCofirm, i);
this._monitors[i].SetPhotoCofirm(true, new Action<int>(this.MessagePhotoShoot), new Action<int>(this.OnFinishConfirmationIn));
this.container.processManager.PrepareTimer(99, 0, false, new Action(this.GotoNextProcess), true);
}
}
}
return;
}
this._counter++;
return;
case PhotoShootProcess.MainSequence.Update:
{
for (int j = 0; j < this._monitors.Length; j++)
{
this.UpdatePhotographing(j);
this._monitors[j].ViewUpdate();
}
break;
}
case PhotoShootProcess.MainSequence.Release:
break;
default:
return;
}
}
// Token: 0x06000CF9 RID: 3321 RVA: 0x00003598 File Offset: 0x00002798
public override void OnLateUpdate()
{
}
// Token: 0x06000CFA RID: 3322 RVA: 0x0003D17C File Offset: 0x0003C37C
public override void OnRelease()
{
WebCamManager.Pause();
if (this._monitors != null)
{
for (int i = 0; i < this._monitors.Length; i++)
{
if (this._monitors[i] != null)
{
Object.Destroy(this._monitors[i].gameObject);
}
}
}
}
// Token: 0x06000CFB RID: 3323 RVA: 0x0003D1CB File Offset: 0x0003C3CB
protected override void UpdateInput(int id)
{
base.UpdateInput(id);
this.InputPhotographing(id);
}
// Token: 0x06000CFC RID: 3324 RVA: 0x0003D1DC File Offset: 0x0003C3DC
private void InputPhotographing(int i)
{
if (!this._canInput[i])
{
return;
}
switch (this._photoSequences[i])
{
case PhotoShootProcess.PhotoShootSequence.FirstInformation:
this.InputFirstInformation(i);
return;
case PhotoShootProcess.PhotoShootSequence.PhotoCofirm:
this.InputPhotoCofirm(i);
return;
case PhotoShootProcess.PhotoShootSequence.Confirmation:
this.InputConfirmation(i);
return;
case PhotoShootProcess.PhotoShootSequence.FrameSelect:
this.InputFrameSelect(i);
return;
case PhotoShootProcess.PhotoShootSequence.Preparation:
this.InputPreparation(i);
return;
case PhotoShootProcess.PhotoShootSequence.Photographing:
case PhotoShootProcess.PhotoShootSequence.Cleanup:
break;
case PhotoShootProcess.PhotoShootSequence.Adjustment:
this.InputAdjustment(i);
return;
case PhotoShootProcess.PhotoShootSequence.Cancel:
this.InputCancelConfirm(i);
break;
default:
return;
}
}
// Token: 0x06000CFD RID: 3325 RVA: 0x0003D260 File Offset: 0x0003C460
private void UpdatePhotographing(int i)
{
this.EnterPhotographingSequence(this._photoSequences[i], i);
switch (this._photoSequences[i])
{
case PhotoShootProcess.PhotoShootSequence.FirstInformation:
this.UpdateFirstInformation(i);
return;
case PhotoShootProcess.PhotoShootSequence.PhotoCofirm:
case PhotoShootProcess.PhotoShootSequence.Confirmation:
case PhotoShootProcess.PhotoShootSequence.Preparation:
case PhotoShootProcess.PhotoShootSequence.Adjustment:
break;
case PhotoShootProcess.PhotoShootSequence.FrameSelect:
this.UpdateAutoScroll();
return;
case PhotoShootProcess.PhotoShootSequence.Photographing:
this.UpdatePhotograph(i);
return;
case PhotoShootProcess.PhotoShootSequence.Cleanup:
this.UpdateCleanUp(i);
break;
default:
return;
}
}
// Token: 0x06000CFE RID: 3326 RVA: 0x0003D2CC File Offset: 0x0003C4CC
private void ShowFirstInformation(int playerIndex)
{
FirstInformationData firstInformationData = this._firstInformationQueues[playerIndex].Dequeue();
this.container.processManager.EnqueueMessage(playerIndex, firstInformationData.MessageID, null);
SoundManager.PlayVoice(firstInformationData.VoiceCue, playerIndex);
this._skipTimes[playerIndex] = firstInformationData.SkipButtonTime;
}
// Token: 0x06000CFF RID: 3327 RVA: 0x0003D31A File Offset: 0x0003C51A
private void MessagePhotoShoot(int i)
{
this.container.processManager.EnqueueMessage(i, WindowMessageID.PhotoShootSelect, null);
}
// Token: 0x06000D00 RID: 3328 RVA: 0x0003D333 File Offset: 0x0003C533
private void MessageAction(int i)
{
this.container.processManager.EnqueueMessage(i, WindowMessageID.IconPhotoContract, null);
}
// Token: 0x06000D01 RID: 3329 RVA: 0x0003D349 File Offset: 0x0003C549
private void OnFinishConfirmationIn(int i)
{
this._canInput[i] = true;
}
// Token: 0x06000D02 RID: 3330 RVA: 0x0003D354 File Offset: 0x0003C554
private void UpdateFirstInformation(int i)
{
if (!this._isFirstSkipButton[i] && this._userTimer[i] > (float)this._skipTimes[i])
{
this._isFirstSkipButton[i] = true;
this._monitors[i].SetFirstInformationSkip();
this.OnFinishConfirmationIn(i);
}
if (this._userTimer[i] < 10000f)
{
this._userTimer[i] += (float)GameManager.GetGameMSecAdd();
return;
}
this.container.processManager.CloseWindow(i);
this._monitors[i].SetFirstInformation();
if (this._firstInformationQueues[i].Count > 0)
{
this._userTimer[i] = 0f;
this._isFirstSkipButton[i] = false;
this.ShowFirstInformation(i);
return;
}
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.PhotoCofirm, i);
this.container.processManager.PrepareTimer(99, 0, false, new Action(this.GotoNextProcess), true);
this._monitors[i].SetPhotoCofirm(true, new Action<int>(this.MessagePhotoShoot), new Action<int>(this.OnFinishConfirmationIn));
base.SetInputLockInfo(i, 1000f);
}
// Token: 0x06000D03 RID: 3331 RVA: 0x0003D46C File Offset: 0x0003C66C
private void InputFirstInformation(int i)
{
if (base.IsInputLock(i))
{
return;
}
if (this._isFirstSkipButton[i] && this._userTimer[i] >= 1000f && InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button04))
{
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button04);
this._userTimer[i] = 10000f;
base.SetInputLockInfo(i, 1000f);
}
}
// Token: 0x06000D04 RID: 3332 RVA: 0x0003D4CC File Offset: 0x0003C6CC
private void InputPhotoCofirm(int i)
{
if (base.IsInputLock(i))
{
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button05))
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.None, i);
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button05);
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_SYS_CANCEL, i);
this.container.processManager.CloseWindow(i);
Singleton<UserDataManager>.Instance.GetUserData((long)i).Extend.ExtendContendBit.SetFlag(ExtendContentBitID.GotoIconPhotoShoot, false);
this.SetReady(i);
base.SetInputLockInfo(i, 1000f);
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button04))
{
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button04);
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_SYS_FIX, i);
this.container.processManager.CloseWindow(i);
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.Confirmation, i);
this.container.processManager.PrepareTimer(99, 0, false, new Action(this.GotoNextProcess), true);
this._monitors[i].SetContract(true, new Action<int>(this.MessageAction), new Action<int>(this.OnFinishConfirmationIn));
base.SetInputLockInfo(i, 1000f);
}
}
// Token: 0x06000D05 RID: 3333 RVA: 0x0003D5E4 File Offset: 0x0003C7E4
private void InputConfirmation(int i)
{
if (base.IsInputLock(i))
{
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button05))
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.None, i);
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button05);
this._monitors[i].SetContract(false, new Action<int>(this.container.processManager.CloseWindow), new Action<int>(this.OnFinishConfirmationIn));
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_SYS_CANCEL, i);
this.SetReady(i);
base.SetInputLockInfo(i, 1000f);
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button04))
{
this._monitors[i].SetFrameSelectActive(true);
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button04);
this._monitors[i].ChangeFrameName(this._frameParts[this._frameIndex[i]].Name);
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.FrameSelect, i);
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_SYS_FIX, i);
this.container.processManager.CloseWindow(i);
base.SetInputLockInfo(i, 1500f);
}
}
// Token: 0x06000D06 RID: 3334 RVA: 0x0003D6E8 File Offset: 0x0003C8E8
private void InputCancelConfirm(int i)
{
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button05))
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.FrameSelect, i);
this._monitors[i].SetFrameSelectActive(true);
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button05);
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_SYS_CANCEL, i);
this.container.processManager.CloseWindow(i);
base.SetInputLockInfo(i, 1500f);
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button04))
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.None, i);
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button04);
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_SYS_FIX, i);
this.container.processManager.CloseWindow(i);
this.SetReady(i);
base.SetInputLockInfo(i, 1500f);
}
}
// Token: 0x06000D07 RID: 3335 RVA: 0x0003D79C File Offset: 0x0003C99C
private void InputFrameSelect(int i)
{
if (base.IsInputLock(i))
{
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button05))
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.Cancel, i);
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button05);
this._monitors[i].SetFrameSelect2Cancel(true, delegate(int index)
{
this.container.processManager.EnqueueMessage(index, WindowMessageID.PhotoShootCancel, null);
});
base.SetInputLockInfo(i, 1500f);
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button04))
{
this._monitors[i].SetFrameSelect2PhotoPreparation(true);
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.Preparation, i);
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button04);
base.SetInputLockInfo(i, 1500f);
return;
}
if (InputManager.GetInputDown(i, InputManager.ButtonSetting.Button03, InputManager.TouchPanelArea.A3) || InputManager.GetInputLongPush(i, InputManager.ButtonSetting.Button03, InputManager.TouchPanelArea.A3, 500L))
{
this.ScrollLeft(i);
base.SetInputLockInfo(i, 100f);
return;
}
if (InputManager.GetInputDown(i, InputManager.ButtonSetting.Button06, InputManager.TouchPanelArea.A6) || InputManager.GetInputLongPush(i, InputManager.ButtonSetting.Button06, InputManager.TouchPanelArea.A6, 500L))
{
this.ScrollRight(i);
base.SetInputLockInfo(i, 100f);
return;
}
if (InputManager.SlideAreaLr(i))
{
this._slideController[i].StartSlideScroll(true, 10);
base.SetInputLockInfo(i, 100f);
return;
}
if (InputManager.SlideAreaRl(i))
{
this._slideController[i].StartSlideScroll(false, 10);
base.SetInputLockInfo(i, 100f);
}
}
// Token: 0x06000D08 RID: 3336 RVA: 0x0003D8D8 File Offset: 0x0003CAD8
private void InputPreparation(int i)
{
if (base.IsInputLock(i))
{
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button05))
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.FrameSelect, i);
this._monitors[i].SetFrameSelect2PhotoPreparation(false);
base.SetInputLockInfo(i, 2000f);
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button05);
return;
}
if (InputManager.GetInputDown(i, InputManager.ButtonSetting.Button01, InputManager.TouchPanelArea.A1) || InputManager.GetInputDown(i, InputManager.ButtonSetting.Button08, InputManager.TouchPanelArea.A8))
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.Photographing, i);
this._monitors[i].SetPreparation2Photographing();
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_SYS_FIX, i);
this._monitors[i].SetPhotoCountDown();
this._isCountDownGrace[i] = false;
SoundManager.StopBGM(2);
}
}
// Token: 0x06000D09 RID: 3337 RVA: 0x0003D97C File Offset: 0x0003CB7C
private void InputAdjustment(int i)
{
if (base.IsInputLock(i))
{
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button05))
{
this._monitors[i].SetAdjust2Preparation();
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.Preparation, i);
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button05);
this.ResetAdjustPosition(i);
base.SetInputLockInfo(i, 2000f);
return;
}
if (InputManager.GetButtonDown(i, InputManager.ButtonSetting.Button04))
{
this.CaptureDevelop(i);
this._userTimer[i] = 0f;
this._monitors[i].PressedButton(InputManager.ButtonSetting.Button04);
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.Cleanup, i);
this._monitors[i].SetPhotographing2Cleanup();
this._isCountDownGrace[i] = false;
base.SetInputLockInfo(i, 2000f);
return;
}
if (InputManager.GetTouchPanelAreaDown(i, new InputManager.TouchPanelArea[]
{
InputManager.TouchPanelArea.E1,
InputManager.TouchPanelArea.B1,
InputManager.TouchPanelArea.B8
}))
{
if (this._adjustPosition[i].y + 10f <= this._restrictionSize[i].y)
{
this._adjustPosition[i] += Vector2.up * 10f;
this._monitors[i].UpdateAdjustCapture(this._adjustPosition[i], 0);
return;
}
}
else if (InputManager.GetTouchPanelAreaDown(i, new InputManager.TouchPanelArea[]
{
InputManager.TouchPanelArea.E3,
InputManager.TouchPanelArea.B2,
InputManager.TouchPanelArea.B3
}))
{
if (this._adjustPosition[i].x + 10f <= this._restrictionSize[i].x)
{
this._adjustPosition[i] += Vector2.right * 10f;
this._monitors[i].UpdateAdjustCapture(this._adjustPosition[i], 1);
return;
}
}
else if (InputManager.GetTouchPanelAreaDown(i, new InputManager.TouchPanelArea[]
{
InputManager.TouchPanelArea.E5,
InputManager.TouchPanelArea.B4,
InputManager.TouchPanelArea.B5
}))
{
if (this._adjustPosition[i].y - 10f >= -this._restrictionSize[i].y)
{
this._adjustPosition[i] += Vector2.down * 10f;
this._monitors[i].UpdateAdjustCapture(this._adjustPosition[i], 2);
return;
}
}
else if (InputManager.GetTouchPanelAreaDown(i, new InputManager.TouchPanelArea[]
{
InputManager.TouchPanelArea.E7,
InputManager.TouchPanelArea.B6,
InputManager.TouchPanelArea.B7
}) && this._adjustPosition[i].x - 10f >= -this._restrictionSize[i].x)
{
this._adjustPosition[i] += Vector2.left * 10f;
this._monitors[i].UpdateAdjustCapture(this._adjustPosition[i], 3);
}
}
// Token: 0x06000D0A RID: 3338 RVA: 0x0003DC58 File Offset: 0x0003CE58
private void UpdatePhotograph(int i)
{
this._photoGraphingTimeCounter[i] += (float)GameManager.GetGameMSecAdd();
if (!this._isCountDownGrace[i])
{
if (this._photoGraphingTimeCounter[i] > 1000f)
{
this._monitors[i].SetPhotoCountDown(3);
this.ChangeCountDownSound(i);
this._isCountDownGrace[i] = true;
this._photoGraphingTimeCounter[i] = 0f;
}
return;
}
if (this._photoGraphingTimeCounter[i] < 2000f && this._photoGraphingTimeCounter[i] >= this._shootIntervalCounter[i])
{
this._shootIntervalCounter[i] += 666f;
this.ChangeCountDownSound(i);
PhotoShootMonitor photoShootMonitor = this._monitors[i];
int[] countDawn = this._countDawn;
int num = countDawn[i] - 1;
countDawn[i] = num;
photoShootMonitor.SetPhotoCountDown(num);
return;
}
if (this._photoGraphingTimeCounter[i] >= 2000f && !this._isPreview[i])
{
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_CAMERA, i);
SoundManager.PlayBGM(Mai2.Mai2Cue.Cue.BGM_ENTRY, 2);
this._isPreview[i] = true;
this._restrictionSize[i] = new Vector2((float)CameraManager.GameCameraParam.Width * 0.625f / 4f - 160f, (float)CameraManager.GameCameraParam.Height * 0.625f / 2f - 160f);
this._monitors[i].Shoot();
this._monitors[i].SetAdjustLength((int)this._restrictionSize[i].x / 10, (int)this._restrictionSize[i].y / 10);
this._monitors[i].SetPhotoCountDown(0);
return;
}
if (this._photoGraphingTimeCounter[i] >= 2500f)
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.Adjustment, i);
this._monitors[i].SetPhotographing2Adjustment();
this._countDawn[i] = 3;
this._isPreview[i] = false;
this._shootIntervalCounter[i] = 666f;
this._photoGraphingTimeCounter[i] = 0f;
this._monitors[i].SetPhotoCountDown(3);
base.SetInputLockInfo(i, 1000f);
}
}
// Token: 0x06000D0B RID: 3339 RVA: 0x0003DE60 File Offset: 0x0003D060
private void UpdateCleanUp(int i)
{
this._userTimer[i] += (float)GameManager.GetGameMSecAdd();
float num = this._userTimer[i] / 2500f;
if (num >= 1f)
{
this._monitors[i].CleanupUpdate(1f);
this._userTimer[i] = 0f;
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.None, i);
this._monitors[i].SetAdjust2Menu(this._resultTexture[i]);
this.SetReady(i);
this.SendTextureToCommonProcess(i);
Singleton<UserDataManager>.Instance.GetUserData((long)i).Detail.EquipIconID = 10;
return;
}
this._monitors[i].CleanupUpdate(num);
}
// Token: 0x06000D0C RID: 3340 RVA: 0x0003DF0C File Offset: 0x0003D10C
private void EnterPhotographingSequence(PhotoShootProcess.PhotoShootSequence sequence, int monitorId)
{
if (!this._isChangePhotographingSequence[monitorId])
{
return;
}
switch (sequence)
{
case PhotoShootProcess.PhotoShootSequence.FrameSelect:
this._slideController[0].Refresh();
this._slideController[1].Refresh();
SoundManager.PlayVoice(Mai2.Voice_000001.Cue.VO_000027, monitorId);
break;
case PhotoShootProcess.PhotoShootSequence.Preparation:
SoundManager.PlayVoice(Mai2.Voice_000001.Cue.VO_000028, monitorId);
break;
case PhotoShootProcess.PhotoShootSequence.Photographing:
this._voiceCount[monitorId] = 3;
SoundManager.PlayVoice(Mai2.Voice_000001.Cue.VO_000029, monitorId);
break;
case PhotoShootProcess.PhotoShootSequence.Adjustment:
SoundManager.PlayVoice(Mai2.Voice_000001.Cue.VO_000033, monitorId);
break;
case PhotoShootProcess.PhotoShootSequence.Cleanup:
SoundManager.PlayVoice(Mai2.Voice_000001.Cue.VO_000034, monitorId);
break;
}
this._isChangePhotographingSequence[monitorId] = false;
}
// Token: 0x06000D0D RID: 3341 RVA: 0x0003DFAC File Offset: 0x0003D1AC
private void ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence next, int monitorId)
{
if (this._prevPhotoSequences[monitorId] != next)
{
PhotoShootProcess.PhotoShootSequence[] photoSequences = this._photoSequences;
this._prevPhotoSequences[monitorId] = next;
photoSequences[monitorId] = next;
this._isChangePhotographingSequence[monitorId] = true;
}
}
// Token: 0x06000D0E RID: 3342 RVA: 0x0003DFE4 File Offset: 0x0003D1E4
private void SetReady(int i)
{
this.ChangePhotographingSequence(PhotoShootProcess.PhotoShootSequence.None, i);
if (this._photoSequences[0] == PhotoShootProcess.PhotoShootSequence.None && this._photoSequences[1] == PhotoShootProcess.PhotoShootSequence.None)
{
MechaManager.LedIf[i].ButtonLedReset();
if (this._mainSequence != PhotoShootProcess.MainSequence.Release)
{
this.GotoNextProcess();
return;
}
}
else
{
this.container.processManager.EnqueueMessage(i, WindowMessageID.PlayPreparationWait, WindowPositionID.Middle, null);
this._monitors[i].SetMenu2Wait();
}
}
// Token: 0x06000D0F RID: 3343 RVA: 0x0003E050 File Offset: 0x0003D250
public Sprite GetFrameSpriteByAdjustIndex(int playerIndex, int diff)
{
int loadIndex = this.GetLoadIndex(playerIndex, diff);
return this._frameParts[loadIndex].Sprite;
}
// Token: 0x06000D10 RID: 3344 RVA: 0x0003E078 File Offset: 0x0003D278
private int GetLoadIndex(int monitorIndex, int diff)
{
int i = this._frameIndex[monitorIndex] + diff;
int count = this._frameParts.Count;
while (i >= count)
{
i -= count;
}
while (i < 0)
{
i = count + i;
}
return i;
}
// Token: 0x06000D11 RID: 3345 RVA: 0x0003E0B4 File Offset: 0x0003D2B4
private void ScrollLeft(int monitorId)
{
if (this._frameIndex[monitorId] + 1 >= this._frameParts.Count)
{
this._frameIndex[monitorId] = 0;
}
else
{
this._frameIndex[monitorId]++;
}
this._monitors[monitorId].Scroll(0, this._frameParts[this._frameIndex[monitorId]].Tex, this._frameParts[this._frameIndex[monitorId]].Name);
}
// Token: 0x06000D12 RID: 3346 RVA: 0x0003E134 File Offset: 0x0003D334
private void ScrollRight(int monitorId)
{
if (this._frameIndex[monitorId] - 1 < 0)
{
this._frameIndex[monitorId] = this._frameParts.Count - 1;
}
else
{
this._frameIndex[monitorId]--;
}
this._monitors[monitorId].Scroll(1, this._frameParts[this._frameIndex[monitorId]].Tex, this._frameParts[this._frameIndex[monitorId]].Name);
}
// Token: 0x06000D13 RID: 3347 RVA: 0x0003E1B4 File Offset: 0x0003D3B4
private void SlideScrollLeft(int monitorId)
{
if (this._frameIndex[monitorId] + 1 >= this._frameParts.Count)
{
this._frameIndex[monitorId] = 0;
}
else
{
this._frameIndex[monitorId]++;
}
this._monitors[monitorId].SlideScroll(0, this._frameParts[this._frameIndex[monitorId]].Tex, this._frameParts[this._frameIndex[monitorId]].Name);
}
// Token: 0x06000D14 RID: 3348 RVA: 0x0003E234 File Offset: 0x0003D434
private void SlideScrollRight(int monitorId)
{
if (this._frameIndex[monitorId] - 1 < 0)
{
this._frameIndex[monitorId] = this._frameParts.Count - 1;
}
else
{
this._frameIndex[monitorId]--;
}
this._monitors[monitorId].SlideScroll(1, this._frameParts[this._frameIndex[monitorId]].Tex, this._frameParts[this._frameIndex[monitorId]].Name);
}
// Token: 0x06000D15 RID: 3349 RVA: 0x0003E2B4 File Offset: 0x0003D4B4
private void UpdateAutoScroll()
{
for (int i = 0; i < this._monitors.Length; i++)
{
if (Singleton<UserDataManager>.Instance.GetUserData((long)i).IsEntry)
{
this._slideController[i].UpdateAutoScroll();
}
}
}
// Token: 0x06000D16 RID: 3350 RVA: 0x0003E2F4 File Offset: 0x0003D4F4
private void ResetAdjustPosition(int i)
{
this._adjustPosition[i] = Vector2.zero;
this._monitors[i].ResetAdjustPosition();
}
// Token: 0x06000D17 RID: 3351 RVA: 0x0003E314 File Offset: 0x0003D514
private void ChangeCountDownSound(int monitorId)
{
switch (this._voiceCount[monitorId])
{
case 1:
SoundManager.PlayVoice(Mai2.Voice_000001.Cue.VO_000032, monitorId);
break;
case 2:
SoundManager.PlayVoice(Mai2.Voice_000001.Cue.VO_000031, monitorId);
break;
case 3:
SoundManager.PlayVoice(Mai2.Voice_000001.Cue.VO_000030, monitorId);
break;
}
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_CAMERA_COUNT, monitorId);
this._voiceCount[monitorId]--;
}
// Token: 0x06000D18 RID: 3352 RVA: 0x0003E37C File Offset: 0x0003D57C
private void SendTextureToCommonProcess(int monitorId)
{
this.container.processManager.SendMessage(new Message(ProcessType.CommonProcess, 30002, new object[]
{
monitorId,
GameManager.FaceIconTexture[monitorId]
}));
}
// Token: 0x06000D19 RID: 3353 RVA: 0x0003E3B4 File Offset: 0x0003D5B4
private void CaptureDevelop(int i)
{
Texture2D tex = this._frameParts[this._frameIndex[i]].Tex;
this._resultTexture[i] = new Texture2D(tex.width, tex.height, 5, false);
int width = this._resultTexture[i].width;
int height = this._resultTexture[i].height;
Color[] array = new Color[width * height];
int num = (int)((float)((i == 0) ? (CameraManager.GameCameraParam.Width - CameraManager.GameCameraParam.Width / 4) : (CameraManager.GameCameraParam.Width / 4)) - ((float)width / 2f + this._adjustPosition[i].x / 0.625f));
int num2 = (int)((float)CameraManager.GameCameraParam.Height / 2f - ((float)height / 2f + this._adjustPosition[i].y / 0.625f));
Color[] pixels = this._monitors[i].GetCaptureTexture().GetPixels(num, num2, width, height);
Color[] pixels2 = tex.GetPixels();
for (int j = 0; j < height; j++)
{
for (int k = 0; k < width; k++)
{
int num3 = k + j * width;
array[num3] = pixels2[num3] * pixels2[num3].a + pixels[num3] * (1f - pixels2[num3].a);
}
}
this._resultTexture[i].SetPixels(array);
this._resultTexture[i].Apply();
this._monitors[i].SetResultTexture(new Vector2((float)width, (float)height), this._resultTexture[i]);
this.ResetAdjustPosition(i);
Texture2D texture2D = new Texture2D(tex.width, tex.height, 5, false);
texture2D.SetPixels(array);
texture2D.Apply();
TextureScale.Scale(texture2D, 256, 256);
GameManager.FaceIconTexture[i] = new Texture2D(texture2D.width, texture2D.height, 5, false);
GameManager.FaceIconTexture[i].LoadRawTextureData(texture2D.GetRawTextureData());
GameManager.FaceIconTexture[i].Apply();
GameManager.IsTakeFaceIcon[i] = true;
byte[] array2 = ImageConversion.EncodeToJPG(texture2D, 50);
using (FileStream fileStream = new FileStream(Path.Combine(WebCamManager.GetDataPath(), "UserIcon_" + i + ".jpg"), FileMode.Create, FileAccess.Write))
{
using (BinaryWriter binaryWriter = new BinaryWriter(fileStream))
{
binaryWriter.Write(array2);
}
}
}
// Token: 0x06000D1A RID: 3354 RVA: 0x0003E668 File Offset: 0x0003D868
public void GotoNextProcess()
{
if (!GameManager.IsCourseMode && !GameManager.IsFreedomMode)
{
this.container.processManager.AddProcess(new FadeProcess(this.container, this, new RegionalSelectProcess(this.container)), 50);
}
else
{
this.container.processManager.AddProcess(new FadeProcess(this.container, this, new GetPresentProcess(this.container, GetPresentProcess.GetPresentType.Music)), 50);
}
this.container.processManager.SetVisibleTimers(false);
this.container.processManager.ClearTimeoutAction();
this._mainSequence = PhotoShootProcess.MainSequence.Release;
}
// Token: 0x040009FF RID: 2559
private const string SHUTTER_MATERIAL_NAME = "Materials/CircleFadeMaterial";
// Token: 0x04000A00 RID: 2560
public const int FIRST_INFO_TIME = 10000;
// Token: 0x04000A01 RID: 2561
private const int MAX_VOICE_COUNT = 3;
// Token: 0x04000A02 RID: 2562
public const int PHOTO_GRAPHING_TIME = 2000;
// Token: 0x04000A03 RID: 2563
public const int PHOTO_COUNTDOWN_INTERVAL = 666;
// Token: 0x04000A04 RID: 2564
private const int ADJUST_MOVE_VALUE = 10;
// Token: 0x04000A05 RID: 2565
private PhotoShootProcess.MainSequence _mainSequence;
// Token: 0x04000A06 RID: 2566
private Vector2[] _restrictionSize;
// Token: 0x04000A07 RID: 2567
private Vector2[] _adjustPosition;
// Token: 0x04000A08 RID: 2568
private PhotoShootMonitor[] _monitors;
// Token: 0x04000A09 RID: 2569
private int[] _frameIndex;
// Token: 0x04000A0A RID: 2570
private int[] _voiceCount;
// Token: 0x04000A0B RID: 2571
private int[] _skipTimes;
// Token: 0x04000A0C RID: 2572
private int[] _countDawn;
// Token: 0x04000A0D RID: 2573
private float[] _userTimer;
// Token: 0x04000A0E RID: 2574
private float[] _photoGraphingTimeCounter;
// Token: 0x04000A0F RID: 2575
private readonly float[] _shootIntervalCounter = new float[] { 666f, 666f };
// Token: 0x04000A10 RID: 2576
private bool[] _canInput;
// Token: 0x04000A11 RID: 2577
private bool[] _isPreview;
// Token: 0x04000A12 RID: 2578
private bool[] _isChangePhotographingSequence;
// Token: 0x04000A13 RID: 2579
private bool[] _isFirstSkipButton;
// Token: 0x04000A14 RID: 2580
private bool[] _isCountDownGrace;
// Token: 0x04000A15 RID: 2581
private PhotoShootProcess.PhotoShootSequence[] _photoSequences;
// Token: 0x04000A16 RID: 2582
private PhotoShootProcess.PhotoShootSequence[] _prevPhotoSequences;
// Token: 0x04000A17 RID: 2583
private Queue<FirstInformationData>[] _firstInformationQueues;
// Token: 0x04000A18 RID: 2584
private SlideScrollController[] _slideController;
// Token: 0x04000A19 RID: 2585
private Texture2D[] _resultTexture;
// Token: 0x04000A1A RID: 2586
private List<ReadOnlyCollection<PhotoFrameData>> _photoFrameDataList;
// Token: 0x04000A1B RID: 2587
private List<FramePart> _frameParts;
// Token: 0x04000A1C RID: 2588
private int _counter;
// Token: 0x02000A47 RID: 2631
private enum MainSequence
{
// Token: 0x040063A4 RID: 25508
Init,
// Token: 0x040063A5 RID: 25509
FadeIn,
// Token: 0x040063A6 RID: 25510
Update,
// Token: 0x040063A7 RID: 25511
Release
}
// Token: 0x02000A48 RID: 2632
private enum PhotoShootSequence : byte
{
// Token: 0x040063A9 RID: 25513
FirstInformation,
// Token: 0x040063AA RID: 25514
PhotoCofirm,
// Token: 0x040063AB RID: 25515
Confirmation,
// Token: 0x040063AC RID: 25516
FrameSelect,
// Token: 0x040063AD RID: 25517
Preparation,
// Token: 0x040063AE RID: 25518
Photographing,
// Token: 0x040063AF RID: 25519
Adjustment,
// Token: 0x040063B0 RID: 25520
Cleanup,
// Token: 0x040063B1 RID: 25521
Cancel,
// Token: 0x040063B2 RID: 25522
None
}
}