1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using I2.Loc;
- using MaidStatus;
- using UnityEngine;
- using wf;
- public class DanceSelect : WfScreenChildren
- {
- public static void CreateDanceData()
- {
- if (DanceSelect.dance_data_list_ != null)
- {
- return;
- }
- HashSet<int> enabled_id_list = new HashSet<int>();
- Action<string> action = delegate(string file_name)
- {
- file_name += ".nei";
- if (!GameUty.FileSystem.IsExistentFile(file_name))
- {
- return;
- }
- using (AFileBase afileBase2 = GameUty.FileSystem.FileOpen(file_name))
- {
- using (CsvParser csvParser2 = new CsvParser())
- {
- bool condition2 = csvParser2.Open(afileBase2);
- NDebug.Assert(condition2, file_name + "\nopen failed.");
- for (int m = 1; m < csvParser2.max_cell_y; m++)
- {
- if (csvParser2.IsCellToExistData(0, m))
- {
- int cellAsInteger2 = csvParser2.GetCellAsInteger(0, m);
- if (!enabled_id_list.Contains(cellAsInteger2))
- {
- enabled_id_list.Add(cellAsInteger2);
- }
- }
- }
- }
- }
- };
- action("dance_enabled_list");
- for (int i = 0; i < GameUty.PathList.Count; i++)
- {
- action("dance_enabled_list_" + GameUty.PathList[i]);
- }
- DanceSelect.dance_data_list_ = new List<DanceData>();
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen("dance_setting.nei"))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, "file open error[dance_setting.nei]");
- for (int j = 1; j < csvParser.max_cell_y; j++)
- {
- if (csvParser.IsCellToExistData(0, j))
- {
- int num = 0;
- int cellAsInteger = csvParser.GetCellAsInteger(num++, j);
- if (enabled_id_list.Contains(cellAsInteger))
- {
- DanceData danceData = new DanceData();
- danceData.ID = cellAsInteger;
- danceData.title = csvParser.GetCellAsString(num++, j);
- danceData.title = danceData.title.Replace("《改行》", "\n");
- danceData.title_font_size = csvParser.GetCellAsInteger(num++, j);
- danceData.title_offset_y = csvParser.GetCellAsInteger(num++, j);
- danceData.select_chara_num = csvParser.GetCellAsInteger(num++, j);
- danceData.scene_name = csvParser.GetCellAsString(num++, j);
- danceData.commentary_text = csvParser.GetCellAsString(num++, j);
- danceData.commentary_text = danceData.commentary_text.Replace("《改行》", "\n");
- danceData.sample_image_name = csvParser.GetCellAsString(num++, j);
- danceData.bgm_file_name = csvParser.GetCellAsString(num++, j);
- danceData.preset_name = new List<string>();
- for (int k = 0; k < danceData.select_chara_num; k++)
- {
- danceData.preset_name.Add(string.Empty);
- }
- string cellAsString = csvParser.GetCellAsString(num++, j);
- if (!string.IsNullOrEmpty(cellAsString))
- {
- string[] array = cellAsString.Split(new char[]
- {
- ','
- });
- NDebug.Assert(array.Length <= danceData.preset_name.Count, "ダンス[" + danceData.title + "]のプリセット人数設定が\n多すぎます");
- int num2 = 0;
- while (num2 < danceData.preset_name.Count && num2 < array.Length)
- {
- danceData.preset_name[num2] = array[num2].Trim();
- num2++;
- }
- }
- string cellAsString2 = csvParser.GetCellAsString(num++, j);
- if (!string.IsNullOrEmpty(cellAsString2))
- {
- danceData.scenario_progress = int.Parse(cellAsString2);
- }
- string cellAsString3 = csvParser.GetCellAsString(num++, j);
- if (!string.IsNullOrEmpty(cellAsString3))
- {
- danceData.Term = (DanceData.DanceTerm)Enum.Parse(typeof(DanceData.DanceTerm), cellAsString3);
- }
- danceData.AppealCutinName = csvParser.GetCellAsString(num++, j);
- danceData.ReversalCutinName = csvParser.GetCellAsString(num++, j);
- danceData.danceshow_scene = csvParser.GetCellAsString(num++, j);
- danceData.danceshow_image = csvParser.GetCellAsString(num++, j);
- string cellAsString4 = csvParser.GetCellAsString(num++, j);
- if (!string.IsNullOrEmpty(cellAsString4))
- {
- foreach (string text in cellAsString4.Split(new char[]
- {
- ','
- }))
- {
- string s = text.Split(new char[]
- {
- '='
- })[1].Split(new char[]
- {
- '_'
- })[1];
- danceData.maid_order.Add(int.Parse(s) - 1);
- }
- }
- danceData.bgType = ((!(csvParser.GetCellAsString(num++, j) == "ライブステージ")) ? DanceData.BgType.Theater : DanceData.BgType.LiveStage);
- danceData.InitialPlayable = csvParser.IsCellToExistData(num++, j);
- danceData.IsPlayable = danceData.InitialPlayable;
- DanceSelect.dance_data_list_.Add(danceData);
- }
- }
- }
- }
- }
- }
- public override void Awake()
- {
- DanceSelect.CreateDanceData();
- base.Awake();
- if (GameMain.Instance.ScriptMgr.adv_kag.tag_backup.ContainsKey("only_release"))
- {
- this.m_ExistOnlyRelease = true;
- this.m_OnlyRelease = int.Parse(GameMain.Instance.ScriptMgr.adv_kag.tag_backup["only_release"]);
- DanceSelect.m_SelectedDance.Clear();
- }
- this.m_ForceTheater = GameMain.Instance.ScriptMgr.adv_kag.tag_backup.ContainsKey("force_theater");
- this.m_ReleaseButton.gameObject.SetActive(false);
- EventDelegate.Add(this.OkButton.onClick, new EventDelegate.Callback(this.OnClickOkButton));
- EventDelegate.Add(this.CancelButton.onClick, new EventDelegate.Callback(this.OnClickCancelButton));
- GameObject gameObject = this.OkButton.transform.parent.gameObject;
- this.m_MainButtonPanel = gameObject.GetComponent<UIPanel>();
- EventDelegate.Add(this.m_SubOkButton.onClick, new EventDelegate.Callback(this.OnClickOkButton));
- EventDelegate.Add(this.m_SubCancelButton.onClick, new EventDelegate.Callback(this.OnClickCancelButton));
- GameObject gameObject2 = this.m_SubOkButton.transform.parent.gameObject;
- EventDelegate.Add(this.m_BackButton.onClick, new EventDelegate.Callback(this.OnClickCancelButton));
- EventDelegate.Add(this.m_ReleaseButton.onClick, new EventDelegate.Callback(this.SwitchAllRelease));
- this.m_DanceShowPanel.SetActive(false);
- this.m_DanceModePanel.gameObject.SetActive(false);
- switch (RhythmAction_Mgr.NowDance)
- {
- case RhythmAction_Mgr.DanceType.Free:
- case RhythmAction_Mgr.DanceType.View:
- case RhythmAction_Mgr.DanceType.Touch:
- case RhythmAction_Mgr.DanceType.VrDance:
- {
- gameObject2.SetActive(false);
- this.m_DanceModePanel.gameObject.SetActive(true);
- this.m_MainButtonPanel.alpha = 0f;
- Transform transform = this.m_DanceModePanel.transform.Find("ButtonGroup");
- bool flag = GameMain.Instance.VRMode && !GameMain.Instance.OvrMgr.OvrCamera.IsNoHandController;
- if (flag)
- {
- transform.localPosition = Vector3.zero;
- }
- IEnumerator enumerator = transform.GetEnumerator();
- try
- {
- while (enumerator.MoveNext())
- {
- object obj = enumerator.Current;
- Transform transform2 = (Transform)obj;
- if (!flag && transform2.name == "TouchMode")
- {
- transform2.gameObject.SetActive(false);
- }
- else
- {
- UIButton component = transform2.GetComponent<UIButton>();
- UILabel component2 = transform2.Find("Label").GetComponent<UILabel>();
- this.m_DanceModeButtonGroup.Add(component, component2);
- EventDelegate.Add(component.onClick, new EventDelegate.Callback(this.SetDanceMode));
- }
- }
- }
- finally
- {
- IDisposable disposable;
- if ((disposable = (enumerator as IDisposable)) != null)
- {
- disposable.Dispose();
- }
- }
- break;
- }
- case RhythmAction_Mgr.DanceType.Challenge:
- gameObject.transform.parent = this.CharaSelectPanel.ParentPanel.gameObject.transform;
- gameObject2.transform.parent = this.MusicSelectPanel.ParentPanel.gameObject.transform;
- UTY.GetChildObject(this.MusicSelectPanel.ParentPanel.gameObject, "SelectPanel", false).SetActive(false);
- this.m_DanceShowPanel.SetActive(true);
- break;
- case RhythmAction_Mgr.DanceType.VS:
- case RhythmAction_Mgr.DanceType.VS_Skip:
- gameObject.SetActive(false);
- this.m_SubCancelButton.gameObject.SetActive(false);
- break;
- }
- this.select_panelset_array_ = new DanceSelect.SelectPanelSet[]
- {
- this.CharaSelectPanel,
- this.MusicSelectPanel
- };
- for (int i = 0; i < this.select_panelset_array_.Length; i++)
- {
- NDebug.AssertNull(this.select_panelset_array_[i].ContentsPanel != null && this.select_panelset_array_[i].ParentPanel != null);
- }
- this.m_CharaSelectLabel = UTY.GetChildObject(this.CharaSelectPanel.ParentPanel.gameObject, "ExplanatoryText/Value", false).GetComponent<UILabel>();
- Localize component3 = this.m_CharaSelectLabel.GetComponent<Localize>();
- if (component3 != null)
- {
- UnityEngine.Object.DestroyImmediate(component3);
- }
- this.m_CharaSelectLabel.text = "ダンスを行うメイドを選択してください。";
- this.chara_select_mgr_ = this.CharaSelectPanel.ParentPanel.gameObject.GetComponentInChildren<CharacterSelectManager>();
- NDebug.AssertNull(this.chara_select_mgr_ != null);
- }
- private void CreateMusicPanel()
- {
- if (!RhythmAction_Mgr.IsVSDance || RhythmAction_Mgr.NowState != RhythmAction_Mgr.DanceState.Dance_Second)
- {
- DanceSelect.m_SelectedDance.Clear();
- }
- UIWFTabPanel uiwftabPanel = this.m_MusicUnitPanel.GetComponent<UIWFTabPanel>();
- if (!uiwftabPanel)
- {
- uiwftabPanel = this.m_MusicUnitPanel.AddComponent<UIWFTabPanel>();
- }
- GameObject gameObject = this.MusicSelectPanel.ContentsPanel.GetComponentInChildren<UIGrid>().gameObject;
- for (int i = 0; i < gameObject.transform.childCount; i++)
- {
- Transform child = gameObject.transform.GetChild(i);
- UnityEngine.Object.Destroy(child.gameObject);
- }
- gameObject.transform.DetachChildren();
- int musicReleaseFlag = RhythmAction_Mgr.MusicReleaseFlag;
- this.m_SecondDanceData = null;
- UIWFTabButton uiwftabButton = null;
- int j = 0;
- while (j < DanceSelect.dance_data_list_.Count)
- {
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Challenge)
- {
- break;
- }
- if (RhythmAction_Mgr.IsVSDance)
- {
- if (this.m_SecondDanceData == null && RhythmAction_Mgr.NowState == RhythmAction_Mgr.DanceState.Dance_First && VsDanceDataMgr.Instance.CurrentSetting.Music2ndID == DanceSelect.dance_data_list_[j].ID)
- {
- this.m_SecondDanceData = DanceSelect.dance_data_list_[j];
- }
- if (DanceSelect.dance_data_list_[j].Term != DanceData.DanceTerm.VS外 && !((!this.m_ForceTheater) ? (DanceSelect.dance_data_list_[j].bgType == DanceData.BgType.Theater) : (DanceSelect.dance_data_list_[j].bgType != DanceData.BgType.Theater)))
- {
- if (!this.m_ExistOnlyRelease || DanceSelect.dance_data_list_[j].scenario_progress == this.m_OnlyRelease)
- {
- if (this.m_ExistOnlyRelease || DanceSelect.dance_data_list_[j].IsPlayable)
- {
- goto IL_1EF;
- }
- }
- }
- }
- else if (this.m_AllRelease || DanceSelect.dance_data_list_[j].IsPlayable)
- {
- goto IL_1EF;
- }
- IL_339:
- j++;
- continue;
- IL_1EF:
- GameObject gameObject2 = Utility.CreatePrefab(gameObject, "SceneDanceSelect/Prefab/SongPlate", true);
- UTY.GetChildObject(gameObject2, "title", false).GetComponent<UILabel>().fontSize = DanceSelect.dance_data_list_[j].title_font_size;
- UTY.GetChildObject(gameObject2, "title", false).transform.localPosition = new Vector3(0f, (float)DanceSelect.dance_data_list_[j].title_offset_y, 0f);
- UTY.GetChildObject(gameObject2, "title", false).GetComponent<UILabel>().text = DanceSelect.dance_data_list_[j].title;
- gameObject2.name = DanceSelect.dance_data_list_[j].title;
- UIWFTabButton componentInChildren = gameObject2.GetComponentInChildren<UIWFTabButton>();
- if (!uiwftabButton)
- {
- uiwftabButton = componentInChildren;
- }
- if (RhythmAction_Mgr.IsVSDance)
- {
- if (DanceSelect.dance_data_list_[j].select_chara_num > GameMain.Instance.CharacterMgr.GetStockMaidCount())
- {
- componentInChildren.isEnabled = false;
- this.m_NotSelectDance.Add(componentInChildren);
- }
- this.m_SongPlatelUI.Add(componentInChildren);
- EventDelegate.Add(componentInChildren.onSelect, new EventDelegate.Callback(this.OnSelectSong));
- }
- EventDelegate.Add(componentInChildren.onSelect, new EventDelegate.Callback(this.OnSelectSong));
- goto IL_339;
- }
- gameObject.GetComponent<UIGrid>().repositionNow = true;
- this.MusicSelectPanel.ContentsPanel.GetComponent<UIScrollView>().ResetPosition();
- uiwftabPanel.UpdateChildren();
- if (RhythmAction_Mgr.IsVSDance && this.m_NotSelectDance.Count > 0)
- {
- foreach (UIWFTabButton uiwftabButton2 in this.m_SongPlatelUI)
- {
- EventDelegate.Add(uiwftabButton2.onClick, new EventDelegate.Callback(this.PlateDisable));
- }
- }
- if (this.music_info_ != null)
- {
- this.music_info_.Release();
- }
- GameObject childObject = UTY.GetChildObject(this.MusicSelectPanel.ParentPanel.gameObject, "MujicInfo", false);
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Challenge)
- {
- childObject.SetActive(false);
- this.music_info_ = new DanceSelectMusicInfo(this.m_DanceShowPanel);
- }
- else
- {
- this.music_info_ = new DanceSelectMusicInfo(childObject);
- }
- GameObject infoUI = this.music_info_.InfoUI;
- if (RhythmAction_Mgr.IsVSDance)
- {
- infoUI.SetActive(false);
- }
- if (uiwftabButton && DanceSelect.m_SelectedDance.Count == 0 && this.IsFreeDance())
- {
- uiwftabPanel.Select(uiwftabButton);
- }
- }
- private void PlateDisable()
- {
- foreach (UIWFSelectButton uiwfselectButton in this.m_NotSelectDance)
- {
- uiwfselectButton.isEnabled = false;
- }
- }
- private void SwitchAllRelease()
- {
- this.m_AllRelease = !this.m_AllRelease;
- this.m_ReleaseButton.defaultColor = (this.m_ReleaseButton.hover = ((!this.m_AllRelease) ? this.m_ReleaseOffCol : this.m_ReleaseOnCol));
- this.CreateMusicPanel();
- }
- public void Start()
- {
- this.CreateMusicPanel();
- this.Init();
- this.m_ReleaseButton.defaultColor = (this.m_ReleaseButton.hover = ((!this.m_AllRelease) ? this.m_ReleaseOffCol : this.m_ReleaseOnCol));
- if (!this.IsFreeDance())
- {
- this.m_SettingObj.SetUIMode(string.Empty);
- }
- this.m_WarningText.SetActive(false);
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Challenge)
- {
- if (DanceSelect.ChallengeDay < GameMain.Instance.CharacterMgr.status.days)
- {
- List<DanceData> list = (from e in DanceSelect.dance_data_list_
- where e.bgType == DanceData.BgType.Theater
- select e).ToList<DanceData>();
- if (!this.m_AllRelease)
- {
- list = (from e in list
- where e.IsPlayable
- select e).ToList<DanceData>();
- }
- int index = UnityEngine.Random.Range(0, list.Count);
- string title = list[index].title;
- for (int i = 0; i < list.Count; i++)
- {
- if (list[i].title == title)
- {
- DanceSelect.m_SelectedDance.Clear();
- DanceSelect.m_SelectedDance.Add(list[i]);
- DanceSelect.m_ChallengeDanceData = list[i];
- break;
- }
- }
- DanceSelect.ChallengeDay = GameMain.Instance.CharacterMgr.status.days;
- }
- else
- {
- DanceSelect.m_SelectedDance.Clear();
- DanceSelect.m_SelectedDance.Add(DanceSelect.m_ChallengeDanceData);
- }
- this.music_info_.SetDanceData(DanceSelect.m_SelectedDance.First<DanceData>());
- this.m_SubOkButton.isEnabled = (DanceSelect.m_ChallengeDanceData.select_chara_num <= GameMain.Instance.CharacterMgr.GetStockMaidCount());
- this.m_WarningText.SetActive(!this.m_SubOkButton.isEnabled);
- }
- }
- protected override void OnCall()
- {
- uGUITutorialPanel.OpenTutorial("SceneDanceSelect", null, false);
- GameMain.Instance.SysShortcut.strSceneHelpName = "SceneDanceSelect";
- CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
- characterMgr.DeactivateCharaAll();
- for (int i = 0; i < characterMgr.GetMaidCount(); i++)
- {
- if (characterMgr.GetMaid(i) != null)
- {
- characterMgr.Deactivate(i, false);
- }
- }
- GameMain.Instance.BgMgr.ChangeBg(this.m_BGName);
- GameMain.Instance.MainCamera.SetTargetPos(this.m_CamPos, true);
- GameMain.Instance.MainCamera.SetDistance(this.m_CamDistance, true);
- GameMain.Instance.MainCamera.SetAroundAngle(this.m_CamAngle, true);
- GameMain.Instance.SoundMgr.PlayBGM(this.m_BGM, 0.5f, true);
- this.Init();
- if (this.IsFreeDance())
- {
- this.CallDanceModeSelect();
- }
- else if (RhythmAction_Mgr.IsVSDance && DanceSelect.m_SelectedDance.Count > 0)
- {
- this.CallCharaSelect();
- }
- else
- {
- this.CallMusicSelect();
- }
- if (RhythmAction_Mgr.IsVSDance && DanceSelect.m_SelectedDance.Count == 0)
- {
- UIWFTabPanel componentInChildren = this.MusicSelectPanel.ContentsPanel.GetComponentInChildren<UIWFTabPanel>();
- componentInChildren.Select(this.MusicSelectPanel.ContentsPanel.GetComponentInChildren<UIGrid>().GetChild(0).GetComponentInChildren<UIWFTabButton>());
- }
- if (GameMain.Instance.VRMode)
- {
- UnityEngine.Object original = Resources.Load("OVR/DanceOVRDialog");
- GameObject gameObject = UnityEngine.Object.Instantiate(original) as GameObject;
- GameObject gameObject2 = GameObject.Find("/UI Root");
- gameObject.transform.SetParent(gameObject2.transform, false);
- gameObject.GetComponent<UIPanel>().depth = 250;
- this.ovr_dance_cam_dlg_ = gameObject.GetComponent<FFNameDialog>();
- this.ovr_dance_cam_dlg_.Init();
- gameObject.SetActive(false);
- }
- }
- public void OnDestroy()
- {
- if (this.music_info_ != null)
- {
- this.music_info_.Release();
- }
- }
- public override void Update()
- {
- base.Update();
- if (GameMain.Instance.MainCamera.IsFadeProc() || GameMain.Instance.MainCamera.IsFadeOut())
- {
- return;
- }
- if (this.m_ReleaseButton.gameObject.activeSelf)
- {
- return;
- }
- foreach (KeyCode key in this.m_ReleseShowKey)
- {
- if (!Input.GetKey(key))
- {
- return;
- }
- }
- this.m_ReleaseButton.gameObject.SetActive(true);
- }
- private void Init()
- {
- this.m_DanceModePanel.alpha = 0f;
- for (int i = 0; i < this.select_panelset_array_.Length; i++)
- {
- this.select_panelset_array_[i].ParentPanel.gameObject.SetActive(true);
- this.select_panelset_array_[i].ParentPanel.alpha = 0f;
- }
- DanceMain.KaraokeMode = false;
- UIRect danceModePanel = this.m_DanceModePanel;
- float num = 0f;
- this.MusicSelectPanel.ParentPanel.alpha = num;
- num = num;
- this.CharaSelectPanel.ParentPanel.alpha = num;
- danceModePanel.alpha = num;
- if (this.IsFreeDance())
- {
- this.m_DanceModePanel.alpha = 1f;
- }
- else if (RhythmAction_Mgr.IsVSDance && DanceSelect.m_SelectedDance.Count > 0)
- {
- this.CharaSelectPanel.ParentPanel.alpha = 1f;
- }
- else
- {
- this.MusicSelectPanel.ParentPanel.alpha = 1f;
- }
- }
- public void SetCancelLabel(string cancel_call_label)
- {
- this.cancel_call_label_ = cancel_call_label;
- }
- private void CallMusicSelect()
- {
- string normalSprite = "cm3d2_common_nextbuttom";
- if (this.IsFreeDance())
- {
- this.OkButton.normalSprite = normalSprite;
- this.OkButton.isEnabled = true;
- }
- else
- {
- this.m_SubOkButton.normalSprite = normalSprite;
- }
- this.status_ = DanceSelect.Status.MusicSelect;
- if (this.MusicSelectPanel.ParentPanel.alpha != 1f)
- {
- iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
- {
- "easetype",
- iTween.EaseType.easeOutQuad,
- "from",
- 0f,
- "to",
- 1f,
- "time",
- DanceSelect.kFadeTime,
- "delay",
- 0,
- "onUpdate",
- "OnUpdateFadeMusicPanel"
- }));
- if (this.CharaSelectPanel.ParentPanel.alpha != 0f)
- {
- iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
- {
- "easetype",
- iTween.EaseType.easeOutQuad,
- "from",
- 1f,
- "to",
- 0f,
- "time",
- DanceSelect.kFadeTime,
- "delay",
- 0,
- "onUpdate",
- "OnUpdateFadeCharaPanel"
- }));
- }
- else if (this.m_DanceModePanel.alpha != 0f)
- {
- iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
- {
- "easetype",
- iTween.EaseType.easeOutQuad,
- "from",
- 1f,
- "to",
- 0f,
- "time",
- DanceSelect.kFadeTime,
- "delay",
- 0,
- "onUpdate",
- "OnUpdateDanceModePanel"
- }));
- }
- }
- }
- private void CallCharaSelect()
- {
- string normalSprite = "cm3d2_common_okbuttom";
- if (RhythmAction_Mgr.IsVSDance)
- {
- this.m_SubOkButton.normalSprite = normalSprite;
- }
- else
- {
- this.OkButton.normalSprite = normalSprite;
- }
- this.status_ = DanceSelect.Status.CaharaSelect;
- DanceSelect.m_SelectedMaid.Clear();
- if (DanceSelect.m_SelectedDance.Count > 0)
- {
- int select_chara_num = DanceSelect.m_SelectedDance.First<DanceData>().select_chara_num;
- if (RhythmAction_Mgr.IsVSDance && this.m_SecondDanceData != null)
- {
- DanceSelect.m_SelectedDance.Add(this.m_SecondDanceData);
- }
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Challenge || RhythmAction_Mgr.IsVSDance)
- {
- this.m_CharaSelectLabel.text = "ダンスを行うメイドを" + select_chara_num + "人選択してください。";
- }
- if (1 < select_chara_num)
- {
- if (RhythmAction_Mgr.IsVSDance)
- {
- this.m_SubOkButton.isEnabled = false;
- }
- else
- {
- this.OkButton.isEnabled = false;
- }
- CharacterSelectManager.CallBackOnMultiSelect callBackOnMultiSelect = delegate(Maid[] maid_array)
- {
- DanceSelect.m_SelectedMaid.Clear();
- for (int j = 0; j < maid_array.Length; j++)
- {
- DanceSelect.m_SelectedMaid.Add(maid_array[j]);
- }
- if (RhythmAction_Mgr.IsVSDance)
- {
- this.m_SubOkButton.isEnabled = DanceSelect.m_SelectedMaid.All((Maid e) => e != null);
- }
- else if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Challenge)
- {
- this.OkButton.isEnabled = DanceSelect.m_SelectedMaid.All((Maid e) => e != null);
- }
- else
- {
- this.OkButton.isEnabled = DanceSelect.m_SelectedMaid.Any((Maid e) => e != null);
- }
- };
- this.chara_select_mgr_.SetCallBackOnMultiSelect(callBackOnMultiSelect);
- this.chara_select_mgr_.Create(CharacterSelectManager.Type.Multiple, select_chara_num, true);
- }
- else
- {
- CharacterSelectManager.CallBackOnSelect callBackCallBackOnSelect = delegate(Maid select_maid)
- {
- DanceSelect.m_SelectedMaid.Clear();
- DanceSelect.m_SelectedMaid.Add(select_maid);
- };
- this.chara_select_mgr_.SetCallBackCallBackOnSelect(callBackCallBackOnSelect);
- this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
- }
- if (RhythmAction_Mgr.IsVSDance)
- {
- for (int i = 0; i < GameMain.Instance.CharacterMgr.GetStockMaidCount(); i++)
- {
- Maid stockMaid = GameMain.Instance.CharacterMgr.GetStockMaid(i);
- if (!stockMaid.status.mainChara || stockMaid.status.heroineType != HeroineType.Original)
- {
- this.chara_select_mgr_.RemoveMaidPlate(stockMaid);
- }
- }
- }
- }
- if (this.CharaSelectPanel.ParentPanel.alpha != 1f)
- {
- iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
- {
- "easetype",
- iTween.EaseType.easeOutQuad,
- "from",
- 0f,
- "to",
- 1f,
- "time",
- DanceSelect.kFadeTime,
- "delay",
- 0,
- "onUpdate",
- "OnUpdateFadeCharaPanel"
- }));
- iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
- {
- "easetype",
- iTween.EaseType.easeOutQuad,
- "from",
- 1f,
- "to",
- 0f,
- "time",
- DanceSelect.kFadeTime,
- "delay",
- 0,
- "onUpdate",
- "OnUpdateFadeMusicPanel"
- }));
- }
- }
- private void CallDanceModeSelect()
- {
- this.status_ = DanceSelect.Status.DanceModeSelect;
- this.m_MainButtonFade = true;
- if (this.m_DanceModePanel.alpha != 1f)
- {
- iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
- {
- "easetype",
- iTween.EaseType.easeOutQuad,
- "from",
- 0f,
- "to",
- 1f,
- "time",
- DanceSelect.kFadeTime,
- "delay",
- 0,
- "onUpdate",
- "OnUpdateDanceModePanel"
- }));
- iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
- {
- "easetype",
- iTween.EaseType.easeOutQuad,
- "from",
- 1f,
- "to",
- 0f,
- "time",
- DanceSelect.kFadeTime,
- "delay",
- 0,
- "onUpdate",
- "OnUpdateFadeMusicPanel"
- }));
- }
- }
- private void OnUpdateFadeMusicPanel(float val)
- {
- this.MusicSelectPanel.ParentPanel.alpha = val;
- if (this.m_MainButtonFade)
- {
- this.m_MainButtonPanel.alpha = val;
- }
- }
- private void OnUpdateFadeCharaPanel(float val)
- {
- this.CharaSelectPanel.ParentPanel.alpha = val;
- }
- private void OnUpdateDanceModePanel(float val)
- {
- this.m_DanceModePanel.alpha = val;
- }
- private void OnSelectSong()
- {
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Challenge)
- {
- return;
- }
- string name = UIWFSelectButton.current.gameObject.transform.parent.name;
- if (!UIWFSelectButton.current.isSelected)
- {
- return;
- }
- for (int i = 0; i < DanceSelect.dance_data_list_.Count; i++)
- {
- if (DanceSelect.dance_data_list_[i].title == name)
- {
- DanceSelect.m_SelectedDance.Clear();
- DanceSelect.m_SelectedDance.Add(DanceSelect.dance_data_list_[i]);
- this.music_info_.SetDanceData(DanceSelect.m_SelectedDance.First<DanceData>());
- if (!this.music_info_.InfoUI.activeSelf)
- {
- this.music_info_.InfoUI.SetActive(true);
- }
- break;
- }
- }
- }
- private void OnClickOkButton()
- {
- if (DanceSelect.m_SelectedDance == null)
- {
- return;
- }
- if (this.status_ == DanceSelect.Status.MusicSelect)
- {
- if (this.MusicSelectPanel.ParentPanel.alpha != 1f)
- {
- return;
- }
- this.m_MainButtonFade = false;
- this.CallCharaSelect();
- }
- else if (this.status_ == DanceSelect.Status.CaharaSelect)
- {
- if (DanceSelect.m_SelectedDance.First<DanceData>().select_chara_num == 1 && DanceSelect.m_SelectedMaid.Count <= 0)
- {
- return;
- }
- if (this.CharaSelectPanel.ParentPanel.alpha != 1f)
- {
- return;
- }
- DanceMain.SelectDanceData = DanceSelect.m_SelectedDance.First<DanceData>();
- string str = DanceSelect.m_SelectedDance.First<DanceData>().scene_name;
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Challenge && !string.IsNullOrEmpty(DanceSelect.m_SelectedDance.First<DanceData>().danceshow_scene))
- {
- str = DanceSelect.m_SelectedDance.First<DanceData>().danceshow_scene;
- }
- GameMain.Instance.ScriptMgr.EvalScript("tf['dance_scene_name'] = '" + str + "';");
- foreach (Maid maid in DanceSelect.m_SelectedMaid)
- {
- if (maid)
- {
- DanceSelect.SelectTopMaid = maid;
- break;
- }
- }
- this.m_SettingObj.DisSelectable();
- if (!GameMain.Instance.VRMode)
- {
- this.Finish();
- }
- else if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Touch)
- {
- this.OnOvrCamFree();
- }
- else
- {
- this.ovr_dance_cam_dlg_.Show("カメラのタイプを選んで下さい。", "自由カメラ", new FFNameDialog.OnClick(this.OnOvrCamFree), "移動カメラ", new FFNameDialog.OnClick(this.OnOvrCamMove));
- }
- }
- }
- private void OnClickCancelButton()
- {
- switch (this.status_)
- {
- case DanceSelect.Status.MusicSelect:
- if (this.MusicSelectPanel.ParentPanel.alpha != 1f)
- {
- return;
- }
- if (this.IsFreeDance())
- {
- this.m_MainButtonFade = true;
- this.CallDanceModeSelect();
- }
- else if (!string.IsNullOrEmpty(this.cancel_call_label_))
- {
- this.CancelFinish();
- }
- break;
- case DanceSelect.Status.CaharaSelect:
- if (this.CharaSelectPanel.ParentPanel.alpha != 1f)
- {
- return;
- }
- this.m_MainButtonFade = false;
- this.CallMusicSelect();
- break;
- case DanceSelect.Status.DanceModeSelect:
- if (this.m_DanceModePanel.alpha != 1f)
- {
- return;
- }
- if (!string.IsNullOrEmpty(this.cancel_call_label_))
- {
- this.CancelFinish();
- }
- break;
- }
- }
- private void CancelFinish()
- {
- DanceSelectManager danceSelectManager = base.parent_mgr as DanceSelectManager;
- NDebug.AssertNull(danceSelectManager != null);
- danceSelectManager.move_screen.SetNextLabel(this.cancel_call_label_);
- DanceSelect.m_SelectedDance.Clear();
- this.Finish();
- }
- private void SetDanceMode()
- {
- if (this.m_DanceModePanel.alpha != 1f)
- {
- return;
- }
- RhythmAction_Mgr.DanceType nowDance = RhythmAction_Mgr.NowDance;
- if (this.m_DanceModeButtonGroup[UIButton.current].transform.parent.name == "GameMode")
- {
- RhythmAction_Mgr.SetDanceType(RhythmAction_Mgr.DanceType.Free);
- }
- else if (this.m_DanceModeButtonGroup[UIButton.current].transform.parent.name == "ViewMode")
- {
- RhythmAction_Mgr.SetDanceType(RhythmAction_Mgr.DanceType.View);
- }
- else if (this.m_DanceModeButtonGroup[UIButton.current].transform.parent.name == "TouchMode")
- {
- RhythmAction_Mgr.SetDanceType(RhythmAction_Mgr.DanceType.Touch);
- }
- this.m_SettingObj.SetUIMode(this.m_DanceModeButtonGroup[UIButton.current].text);
- this.CallMusicSelect();
- }
- private void OnOvrCamFree()
- {
- GameMain.Instance.CMSystem.SetTmpGenericFlag("ダンスOVRカメラタイプ", 0);
- this.Finish();
- }
- private void OnOvrCamMove()
- {
- GameMain.Instance.CMSystem.SetTmpGenericFlag("ダンスOVRカメラタイプ", 1);
- this.Finish();
- }
- private bool IsFreeDance()
- {
- bool flag = RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Free;
- flag |= (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.View);
- return flag | RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Touch;
- }
- public override bool Finish()
- {
- bool flag = base.Finish();
- if (flag && 0 < DanceSelect.m_SelectedMaid.Count && RhythmAction_Mgr.IsVSDance)
- {
- GameMain.Instance.SoundMgr.StopBGM(1.5f);
- }
- return flag;
- }
- protected override void OnFinish()
- {
- if (DanceSelect.m_SelectedDance.Count > 0)
- {
- DanceSelect.SelectMaidActive(DanceSelect.m_SelectedDance.First<DanceData>());
- }
- base.parent_mgr.CallScreen("Move");
- GameMain.Instance.LoadIcon.NextLoadIcontImmediatelyDisplay();
- }
- public static void BenchMarkInit()
- {
- DanceSelect.SelectTopMaid = null;
- DanceSelect.m_SelectedDance.Clear();
- DanceSelect.m_SelectedMaid.Clear();
- DanceSelect.CreateDanceData();
- DanceData danceData = DanceSelect.dance_data_list_.SingleOrDefault((DanceData e) => e.title == "Night Magic Fire");
- NDebug.Assert(danceData != null, "ダンス曲「Night Magic Fire」が存在してません");
- DanceMain.SelectDanceData = danceData;
- GameMain.Instance.ScriptMgr.EvalScript("tf['dance_scene_name'] = '" + danceData.scene_name + "';");
- }
- public static void TrialVsDanceInit()
- {
- }
- public static void SelectMaidActive(DanceData set_dance)
- {
- if (set_dance == null)
- {
- return;
- }
- CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
- characterMgr.DeactivateCharaAll();
- GameMain.Instance.CMSystem.SetTmpGenericFlag("ダンス設定人数", 0);
- if (0 < DanceSelect.m_SelectedMaid.Count)
- {
- int num = 0;
- for (int i = 0; i < set_dance.select_chara_num; i++)
- {
- if (i >= DanceSelect.m_SelectedMaid.Count)
- {
- break;
- }
- if (DanceSelect.m_SelectedMaid[i])
- {
- characterMgr.SetActiveMaid(DanceSelect.m_SelectedMaid[i], i);
- num++;
- }
- }
- GameMain.Instance.CMSystem.SetTmpGenericFlag("ダンス設定人数", num);
- }
- }
- public static void SetNextDance()
- {
- if (!RhythmAction_Mgr.IsVSDance || DanceMain.KaraokeMode)
- {
- DanceMain.SelectDanceData = null;
- return;
- }
- if (!DanceBattle_Mgr.Instance.IsWin() && RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.VS_Skip)
- {
- DanceMain.SelectDanceData = null;
- }
- else if (DanceSelect.m_SelectedDance.Count > 0)
- {
- DanceSelect.m_SelectedDance.RemoveAt(0);
- if (DanceSelect.m_SelectedDance.Count > 0)
- {
- DanceMain.SelectDanceData = DanceSelect.m_SelectedDance.First<DanceData>();
- }
- }
- }
- public static List<DanceData> GetDanceDataList()
- {
- DanceSelect.CreateDanceData();
- return DanceSelect.dance_data_list_;
- }
- public static List<Maid> SelectedMaid
- {
- get
- {
- return DanceSelect.m_SelectedMaid;
- }
- }
- public static Maid SelectTopMaid { get; private set; }
- private bool m_AllRelease
- {
- get
- {
- return DanceSetting.Settings.AllRelease;
- }
- set
- {
- DanceSetting.Settings.AllRelease = value;
- }
- }
- public static float kFadeTime = 0.3f;
- public static List<DanceData> dance_data_list_;
- private const int m_SongSelectMax = 2;
- private const string m_NMFtitle = "Night Magic Fire";
- private const string m_ETYLtitle = "entrance to you";
- private const string m_TutorialName = "SceneDanceSelect";
- public DanceSelect.SelectPanelSet CharaSelectPanel;
- public DanceSelect.SelectPanelSet MusicSelectPanel;
- public UIButton OkButton;
- public UIButton CancelButton;
- private UIPanel m_MainButtonPanel;
- private bool m_MainButtonFade;
- [SerializeField]
- [Header("背景名")]
- private string m_BGName = "LiveStage";
- [SerializeField]
- [Header("BGM名")]
- private string m_BGM = "BGM020.ogg";
- [SerializeField]
- private Vector3 m_CamPos = new Vector3(0.03458221f, 0.4823192f, 0.1880018f);
- [SerializeField]
- private float m_CamDistance = 7.199994f;
- [SerializeField]
- private Vector2 m_CamAngle = new Vector2(180.2993f, 21.18012f);
- [SerializeField]
- [Header("右下のOKボタン")]
- private UIButton m_SubOkButton;
- [SerializeField]
- [Header("右下のCancelボタン")]
- private UIButton m_SubCancelButton;
- [SerializeField]
- [Header("Backボタン")]
- private UIButton m_BackButton;
- [SerializeField]
- [Header("ダンスモード設定パネル")]
- private UIPanel m_DanceModePanel;
- [SerializeField]
- [Header("人数不足警告テキスト")]
- private GameObject m_WarningText;
- private Dictionary<UIButton, UILabel> m_DanceModeButtonGroup = new Dictionary<UIButton, UILabel>();
- [SerializeField]
- [Header("チャレンジ時の楽曲情報UIパネル")]
- private GameObject m_DanceShowPanel;
- [SerializeField]
- [Header("楽曲選択グリッド")]
- private GameObject m_MusicUnitPanel;
- [SerializeField]
- [Header("ダンス設定UI")]
- private DanceSetting m_SettingObj;
- [SerializeField]
- [Header("曲全解放ボタン")]
- private UIButton m_ReleaseButton;
- [SerializeField]
- private Color m_ReleaseOnCol;
- [SerializeField]
- private Color m_ReleaseOffCol;
- [SerializeField]
- [Header("全曲解放ボタンを表示する際のショートカットキー")]
- private List<KeyCode> m_ReleseShowKey = new List<KeyCode>
- {
- KeyCode.D,
- KeyCode.N,
- KeyCode.C
- };
- private UILabel m_CharaSelectLabel;
- private List<UIWFSelectButton> m_NotSelectDance = new List<UIWFSelectButton>();
- private List<UIWFTabButton> m_SongPlatelUI = new List<UIWFTabButton>();
- private static List<DanceData> m_SelectedDance = new List<DanceData>();
- private static List<Maid> m_SelectedMaid = new List<Maid>();
- private DanceData m_SecondDanceData;
- private static DanceData m_ChallengeDanceData = null;
- public static int ChallengeDay = 0;
- private bool m_ForceTheater;
- private bool m_ExistOnlyRelease;
- private int m_OnlyRelease = -1;
- private DanceSelectMusicInfo music_info_;
- private DanceSelect.SelectPanelSet[] select_panelset_array_;
- private CharacterSelectManager chara_select_mgr_;
- private DanceSelect.Status status_;
- private string cancel_call_label_;
- private FFNameDialog ovr_dance_cam_dlg_;
- [Serializable]
- public class SelectPanelSet
- {
- public UIPanel ParentPanel;
- public UIPanel ContentsPanel;
- }
- private enum Status
- {
- MusicSelect,
- CaharaSelect,
- DanceModeSelect
- }
- }
|