From 4be630bd0947eacbe6a4b945d42319f7eb31ae4d Mon Sep 17 00:00:00 2001 From: gamer147 Date: Fri, 5 Jun 2026 22:33:37 -0400 Subject: [PATCH] feat(battle-engine): full-surface app-type god-object/manager stubs (1692->1586 true) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the minimal hand shims partial + generate full member surface for the manager/ task/controller god-objects (LoadingViewManager/DeckUpdateTask/MyPageTask/ReplayController/ PlayerControllerForWatching/WatchDataHandler/EvolutionTouchProcessor/StoryChapterSelection Utility/NonDialogPopup). NonDialogPopup given MonoBehaviour base + hand Close() removed (superseded by full surface). LoadTask dup deleted (already copied verbatim). RoomMatch watch/replay closure types stubbed. Copied 8 more closure files. CS0246-in-generated-signature masking note: 4 such errors were hiding ~1582 — generated CS0246 masks as hard as header CS0246; the real frontier is 1586 (CS7036 base-ctor + member-level), 0 structural. Co-Authored-By: Claude Opus 4.8 --- SVSim.BattleEngine/COPIED.manifest.tsv | 8 + SVSim.BattleEngine/Engine/LoadingDownLoad.cs | 399 +++++++++++ .../Engine/LoadingDownLoadCardView.cs | 447 ++++++++++++ .../Engine/TwoPickCardSelectBase.cs | 664 ++++++++++++++++++ .../Engine/TwoPickCardSelectView.cs | 24 + .../Engine/Wizard/LoadSceneStoryData.cs | 27 + .../Engine/Wizard/LoadingDownLoadStoryView.cs | 91 +++ .../Wizard/ResourceDownloadCardFactory.cs | 139 ++++ .../Engine/Wizard/RoomBattleWatchTaskBase.cs | 114 +++ .../Shim/Generated/DeckUpdateTask.g.cs | 17 + .../Generated/EvolutionTouchProcessor.g.cs | 38 + .../Shim/Generated/LoadingViewManager.g.cs | 40 ++ .../Shim/Generated/MyPageTask.g.cs | 19 + .../Shim/Generated/NonDialogPopup.g.cs | 12 + .../PlayerControllerForWatching.g.cs | 126 ++++ .../Shim/Generated/ReplayController.g.cs | 29 + .../StoryChapterSelectionUtility.g.cs | 27 + .../Shim/Generated/WatchDataHandler.g.cs | 43 ++ .../Shim/Generated/_BaseClauses.g.cs | 4 + .../Shim/GodObjects/GodObjects.cs | 6 +- SVSim.BattleEngine/Shim/View/ClosureStubs.cs | 7 + .../Shim/View/SettingsUiStubs.cs | 4 +- .../Shim/View/StoryWorldStubs.cs | 2 +- .../Shim/View/ViewUiTouchStubs.cs | 8 +- 24 files changed, 2285 insertions(+), 10 deletions(-) create mode 100644 SVSim.BattleEngine/Engine/LoadingDownLoad.cs create mode 100644 SVSim.BattleEngine/Engine/LoadingDownLoadCardView.cs create mode 100644 SVSim.BattleEngine/Engine/TwoPickCardSelectBase.cs create mode 100644 SVSim.BattleEngine/Engine/TwoPickCardSelectView.cs create mode 100644 SVSim.BattleEngine/Engine/Wizard/LoadSceneStoryData.cs create mode 100644 SVSim.BattleEngine/Engine/Wizard/LoadingDownLoadStoryView.cs create mode 100644 SVSim.BattleEngine/Engine/Wizard/ResourceDownloadCardFactory.cs create mode 100644 SVSim.BattleEngine/Engine/Wizard/RoomBattleWatchTaskBase.cs create mode 100644 SVSim.BattleEngine/Shim/Generated/DeckUpdateTask.g.cs create mode 100644 SVSim.BattleEngine/Shim/Generated/EvolutionTouchProcessor.g.cs create mode 100644 SVSim.BattleEngine/Shim/Generated/LoadingViewManager.g.cs create mode 100644 SVSim.BattleEngine/Shim/Generated/MyPageTask.g.cs create mode 100644 SVSim.BattleEngine/Shim/Generated/NonDialogPopup.g.cs create mode 100644 SVSim.BattleEngine/Shim/Generated/PlayerControllerForWatching.g.cs create mode 100644 SVSim.BattleEngine/Shim/Generated/ReplayController.g.cs create mode 100644 SVSim.BattleEngine/Shim/Generated/StoryChapterSelectionUtility.g.cs create mode 100644 SVSim.BattleEngine/Shim/Generated/WatchDataHandler.g.cs diff --git a/SVSim.BattleEngine/COPIED.manifest.tsv b/SVSim.BattleEngine/COPIED.manifest.tsv index d10ecd0..2c5e382 100644 --- a/SVSim.BattleEngine/COPIED.manifest.tsv +++ b/SVSim.BattleEngine/COPIED.manifest.tsv @@ -393,6 +393,8 @@ LitJson/WriterContext.cs LitJson/WriterContext.cs 39416dea3b7218c555f5988a5464a1 Load.cs Load.cs a68f95fd46d5b9961f8b40424d093ee3ab9a21e168992034c66f81adb66dcc1d 0 LoadDetail.cs LoadDetail.cs aa01efaaaca68bd8899b41ba90ef228c3d5b7f9ccaf9e7937b476a1bc9886342 0 LoadingBase.cs LoadingBase.cs 0f63fc8676b84b1b8c36bf51f41b241c74e236abbff1e07b2612233f3f4f04d2 0 +LoadingDownLoad.cs LoadingDownLoad.cs c6da17d0f0ee79b43446f4ee7134b3e212380ce30150a3e87e908e655b746d19 0 +LoadingDownLoadCardView.cs LoadingDownLoadCardView.cs 702c19ded4f568afdf58b16d30ad0d52c5c4567f549805d7b8bdf4b0b6ffadef 0 LoadingInScene.cs LoadingInScene.cs 9ae449b0ba5668e3d3d8d1d0ae340514617ac705d364c9be8993efe6afe4ddb1 0 LocalNotificationPriority.cs LocalNotificationPriority.cs ca3265d518980b3058603bcd1151b0ac7f934866f991ff967826870f4a9cb060 0 Localization.cs Localization.cs 07d154439612a9a8e6e49ec7edd9f5fc0a7af965d231291c96c0057d991e4a48 0 @@ -1385,6 +1387,8 @@ TweenPositionY.cs TweenPositionY.cs 526bfb20912ea1fe320ee386efcb268da8df01702d33 TweenRotation.cs TweenRotation.cs 840297b6cb3b51034b457fc3c4ae794ec3e76f9d75b2aeb9135ea2518e3a572e 0 TweenScale.cs TweenScale.cs dd50401e8ffca06da1d2ccaa9d21cccfef2007d8f786f0690b79880d13b5007d 0 Twitter.cs Twitter.cs 5abebbe6b3243fdd889d09fef67a248e683b1c84749789538a2a1a6d342d85b4 0 +TwoPickCardSelectBase.cs TwoPickCardSelectBase.cs f180f4e8798cc49a0bc516c9bd8f42cff26b5e95da3feefc617c6f6761717131 0 +TwoPickCardSelectView.cs TwoPickCardSelectView.cs adce68c3419ccd6c72bc84ee9cfc561f98929626b492aa65512c7947c8530a89 0 UI2DSprite.cs UI2DSprite.cs c0c50a2c03e76ab7ee5fc7b0bb6ede7462ca98cb338a3ac93d3310d6016e660c 0 UIAnchor.cs UIAnchor.cs ed46145415d1c7a0fef11d38de99b4b851e92044455ab3297d3e487c09e5f9b2 0 UIAtlas.cs UIAtlas.cs 7b4a3539816d0568b2175af231466e58b30e60596b5f0ff095e6781c37b6b6e6 0 @@ -2872,7 +2876,9 @@ Wizard\LeaveBonusTagCollection.cs Wizard\LeaveBonusTagCollection.cs 30e0c56bbe6b Wizard\LeaveTagCollection.cs Wizard\LeaveTagCollection.cs 11d8c7a49a83ae6032f77183b7e2e32d38ac4a9def2413cf64558a00fe53750e 0 Wizard\LifeRecord.cs Wizard\LifeRecord.cs dbb7e7c6532bf24174d3d958147309b1eb87faac12c57754e7282cf8ac5d8b50 0 Wizard\LoadQueue.cs Wizard\LoadQueue.cs a3bd987174d57f1e63dc59f67a02235addb16bd515d9d4fc995054949f4c898d 0 +Wizard\LoadSceneStoryData.cs Wizard\LoadSceneStoryData.cs 28456cdcdbc3a76e45d48f88133b868006e40ee12a26509e35707de3c5a0b18a 0 Wizard\LoadTask.cs Wizard\LoadTask.cs 6a096260ee3c7b9351e065adb1d491055638bd1646e04d90b203d803434de76e 0 +Wizard\LoadingDownLoadStoryView.cs Wizard\LoadingDownLoadStoryView.cs fce928ee1d58540944ceeeb774e8fad892bb968a3265d7a7bde5474574f63c8c 0 Wizard\LocalLog.cs Wizard\LocalLog.cs 991b50f5e128fd3b2368770fe7a7b7691ce4090bdaca5ae744d1f464572caab0 0 Wizard\LocalizeJson.cs Wizard\LocalizeJson.cs 4adf1a47af054dc08971d7e8d1574e8b8d7692c027182ff6c3d167164240f4ea 0 Wizard\LootBoxDialogUtility.cs Wizard\LootBoxDialogUtility.cs 8277f2e7dfbe98bc4e8790630c338d50a0e635f7566e9d1ee1cd22cd6b199237 0 @@ -3101,6 +3107,7 @@ Wizard\ReplayInfoItem.cs Wizard\ReplayInfoItem.cs f33d8625be78c3ff5edad57e4a9350 Wizard\ReplayInfoTask.cs Wizard\ReplayInfoTask.cs c3a2dd28d4b414bfb496d977c1caa207c9b8c12b3d2e601d001ca0868094d96c 0 Wizard\ReplaySkipAnimation.cs Wizard\ReplaySkipAnimation.cs 028d4fbc5d2ac366f5a90c86245482b36f37990c22eedd1f9b1109b5e673d346 0 Wizard\ResonanceTagCollection.cs Wizard\ResonanceTagCollection.cs 18e5ba29b08bf24bdf9b6f2078c6180099c9d468b1ab5c1fa05a0452199169ad 0 +Wizard\ResourceDownloadCardFactory.cs Wizard\ResourceDownloadCardFactory.cs d7685410348d88f3c7bbe387fe792432236a3e34c5a49da9519d64a04ee13080 0 Wizard\RewardBase.cs Wizard\RewardBase.cs ea35849169b3987c450abbaece54578234821d644bf3289fc0307fd8ca14fe23 0 Wizard\RewardConfirmDialog.cs Wizard\RewardConfirmDialog.cs 021ab951cdc0d5415fa633e3ae3baa4d455d7f58effe7cc50ab607cd366cc111 0 Wizard\RewardConfirmView.cs Wizard\RewardConfirmView.cs 10b0861af3584726436dbc8f2d1881984455c98878e9fe32731e5d73e2966e8b 0 @@ -3115,6 +3122,7 @@ Wizard\RoomBattleFinishTask.cs Wizard\RoomBattleFinishTask.cs c4fc3101dbb2ded83c Wizard\RoomBattleFinishTaskAvatar.cs Wizard\RoomBattleFinishTaskAvatar.cs 6ba849d2b1e50fca155fa795774bab8674a3036922ce4d8b4669b376ef1c0ab2 0 Wizard\RoomBattleFinishTaskHOF.cs Wizard\RoomBattleFinishTaskHOF.cs e023260976a1856c0387cd9a55d025c557e7df4a833220095708885c672e6ec6 0 Wizard\RoomBattleFinishTaskWindFall.cs Wizard\RoomBattleFinishTaskWindFall.cs 76b15e866a28db1664f4116da0ddb459071e11146b99f89b292bae34b2a7618d 0 +Wizard\RoomBattleWatchTaskBase.cs Wizard\RoomBattleWatchTaskBase.cs cb37a3042a58d48a995f8bc37a39aa4f6bac980477f59eefe7817cea052b56d1 0 Wizard\RoomNonPossessionCardCampaign.cs Wizard\RoomNonPossessionCardCampaign.cs c2a0ac27c8f58890764c6733cac8d4c73ecb67b27ebf4a4d18db2022980b0de4 0 Wizard\RoomRuleInfo.cs Wizard\RoomRuleInfo.cs 6ba79e521eaeba627b6ef48ac714180b870049479ed8690533f780c27c07cfcf 0 Wizard\RoomTwoPickApiVariation.cs Wizard\RoomTwoPickApiVariation.cs 5799f31e14cab116c99dbb6e694270075d0a4345fd03a21c84596e93d79991c7 0 diff --git a/SVSim.BattleEngine/Engine/LoadingDownLoad.cs b/SVSim.BattleEngine/Engine/LoadingDownLoad.cs new file mode 100644 index 0000000..dfe5df8 --- /dev/null +++ b/SVSim.BattleEngine/Engine/LoadingDownLoad.cs @@ -0,0 +1,399 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using Cute; +using UnityEngine; +using Wizard; + +public class LoadingDownLoad : LoadingBase +{ + private class ClassDetail + { + public Texture TextureBase; + + public string strName; + } + + private class ClassPack + { + public int ID = -1; + + public ClassDetail Detail; + } + + private enum eCharacterObjsIndex + { + Character + } + + public enum eType + { + CardDetail, + CharacterDetail, + StoryDetail + } + + private enum eSide + { + Left, + Right + } + + [SerializeField] + private BoxCollider[] _flickColliderArray; + + [SerializeField] + private LoadingDownLoadCardView _cardView; + + [SerializeField] + private LoadingDownLoadStoryView _storyView; + + [SerializeField] + private NguiObjs CharacterDetailObjs; + + [SerializeField] + private TweenPosition TweenPosCloseUpTexture; + + [SerializeField] + private TweenAlpha TweenAlphaName; + + [SerializeField] + private TweenAlpha TweenAlphaDescription; + + [SerializeField] + private UILabel LabelClassName; + + [SerializeField] + private UILabel LabelClassDesc; + + private readonly string[] CharacterTexturePath = new string[8] { "class_01_base", "class_02_base", "class_03_base", "class_04_base", "class_05_base", "class_06_base", "class_07_base", "class_08_base" }; + + private const string PREFIX_FILE_TARGET = "class_03_base"; + + [SerializeField] + private NguiObjs CharacterSelectCircle; + + public const string loadPrefix = "Images/Loading/"; + + private Dictionary m_DicPack; + + private Vector3 m_CharacterDefaultPos = new Vector3(0f, 0f, 0f); + + private Vector3 m_CharacterLeftFromPos = new Vector3(-50f, 0f, 0f); + + private Vector3 m_CharacterRightFromPos = new Vector3(50f, 0f, 0f); + + private int m_SelectCharacterIndex; + + private float _defaultEvoLineRootY; + + private const float CHARACTER_TWEEN_TIME = 0.1f; + + private const int CHARACTER_MAX = 9; + + private const int CHARACTER_ID_START = 1; + + private const int CHARACTER_ID_END = 8; + + [SerializeField] + private UIButton[] CursorButton; + + private eType Type; + + public eType LoadingDownLoadImageType; + + private bool _isAnimatingNowCharacterView; + + private bool _canFlick = true; + + protected override void Start() + { + setMaxAssetsNum(enable: true, Toolbox.ResourcesManager.GetDownloadMaxSize()); + base.Start(); + if (!Data.Load.data._userTutorial.NeedAllResource) + { + Type = eType.CharacterDetail; + } + else + { + Type = LoadingDownLoadImageType; + } + if (Type == eType.CardDetail && !_cardView.CanView()) + { + Type = eType.CharacterDetail; + } + isLabelUpdate = false; + LoadTitleLabel.text = Data.SystemText.Get("Load_0001"); + LoadTextLabel.text = Data.SystemText.Get("Load_0002"); + CursorButton[0].onClick.Add(new EventDelegate(delegate + { + ChangeInfoView(eSide.Left); + })); + CursorButton[1].onClick.Add(new EventDelegate(delegate + { + ChangeInfoView(eSide.Right); + })); + BoxCollider[] flickColliderArray = _flickColliderArray; + foreach (BoxCollider obj in flickColliderArray) + { + UIEventListener uIEventListener = UIEventListener.Get(obj.gameObject); + uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, new UIEventListener.VectorDelegate(OnDrag)); + UIEventListener uIEventListener2 = UIEventListener.Get(obj.gameObject); + uIEventListener2.onDragEnd = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onDragEnd, new UIEventListener.VoidDelegate(OnDragEnd)); + } + CharacterDetailObjs.gameObject.SetActive(value: false); + _storyView.gameObject.SetActive(value: false); + _cardView.gameObject.SetActive(value: false); + if (CustomPreference.GetTextLanguage() != Global.LANG_TYPE.Jpn.ToString() && Type == eType.CardDetail) + { + Type = eType.StoryDetail; + } + switch (Type) + { + case eType.CardDetail: + _cardView.gameObject.SetActive(value: true); + _cardView.Initialize(delegate + { + base.gameObject.SetActive(value: true); + }); + break; + case eType.CharacterDetail: + CharacterDetailObjs.gameObject.SetActive(value: true); + InitializeCharacterView(); + break; + case eType.StoryDetail: + _storyView.gameObject.SetActive(value: true); + _storyView.Initialize(); + break; + } + } + + private void OnDrag(GameObject g, Vector2 dir) + { + if (_canFlick && !_isAnimatingNowCharacterView && !_cardView.IsAnimatingNow) + { + if (dir.x >= 70f) + { + ChangeInfoView(eSide.Left); + _canFlick = false; + } + else if (dir.x <= -70f) + { + ChangeInfoView(eSide.Right); + _canFlick = false; + } + } + } + + private void OnDragEnd(GameObject go) + { + _canFlick = true; + } + + private void InitializeCharacterView() + { + m_SelectCharacterIndex = 1; + IList list = new List(); + for (int i = 1; i < 9; i++) + { + list.Add(i); + } + if (m_DicPack == null) + { + m_DicPack = new Dictionary(); + foreach (int item in list) + { + ClassPack classPack = new ClassPack(); + classPack.ID = item; + classPack.Detail = null; + m_DicPack.Add(item, classPack); + } + foreach (KeyValuePair item2 in m_DicPack) + { + ClassPack value = item2.Value; + ClassDetail classDetail = new ClassDetail + { + TextureBase = null, + strName = null + }; + int key = item2.Key; + string text = CharacterTexturePath[key - 1]; + if (text == "class_03_base") + { + text += "_1"; + } + classDetail.TextureBase = Resources.Load("Images/Loading/" + text); + classDetail.strName = getTextCharacterName(key); + value.Detail = classDetail; + } + } + SetCharacterDisp(m_DicPack[1]); + } + + protected override float CalculateProgress() + { + return Toolbox.ResourcesManager.GetDownloadCompletedSize() + (float)Toolbox.ResourcesManager.GetLoadingCompleted(); + } + + public override void fadeOutLoading() + { + base.fadeOutLoading(); + _cardView.FadeOutLoading(); + } + + protected override void OnDestroy() + { + base.OnDestroy(); + } + + private void ChangeInfoView(eSide side) + { + if (!UIManager.GetInstance().isOpenDialog()) + { + switch (Type) + { + case eType.CardDetail: + ChangeCardView(side); + break; + case eType.CharacterDetail: + ChangeCharacterView(side); + break; + case eType.StoryDetail: + ChangeStoryView(side); + break; + } + } + } + + private void ChangeCardView(eSide side) + { + switch (side) + { + case eSide.Right: + _cardView.Next(); + break; + case eSide.Left: + _cardView.Prev(); + break; + } + } + + private void ChangeStoryView(eSide side) + { + GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + _storyView.ChangeStoryImage(side == eSide.Right); + } + + private void ChangeCharacterView(eSide side) + { + bool isRight = side == eSide.Right; + StartCoroutine(ChangeCharacterAnm(isRight)); + } + + private IEnumerator ChangeCharacterAnm(bool isRight = true) + { + _isAnimatingNowCharacterView = true; + float time = 0f; + if (!isRight) + { + if (m_SelectCharacterIndex > 1) + { + m_SelectCharacterIndex--; + } + else + { + m_SelectCharacterIndex = 8; + } + } + else if (m_SelectCharacterIndex < 8) + { + m_SelectCharacterIndex++; + } + else + { + m_SelectCharacterIndex = 1; + } + ClassPack characterDisp = m_DicPack[m_SelectCharacterIndex]; + GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + SetCharacterDisp(characterDisp); + TweenPosition tweenPosCloseUpTexture = TweenPosCloseUpTexture; + if (isRight) + { + tweenPosCloseUpTexture.from = m_CharacterRightFromPos; + } + else + { + tweenPosCloseUpTexture.from = m_CharacterLeftFromPos; + } + tweenPosCloseUpTexture.to = m_CharacterDefaultPos; + tweenPosCloseUpTexture.duration = 0.1f; + tweenPosCloseUpTexture.ResetToBeginning(); + tweenPosCloseUpTexture.PlayForward(); + TweenAlpha tweenAlphaName = TweenAlphaName; + tweenAlphaName.from = 0f; + tweenAlphaName.to = 1f; + tweenAlphaName.duration = 0.1f; + tweenAlphaName.ResetToBeginning(); + tweenAlphaName.PlayForward(); + TweenAlpha tweenAlphaDescription = TweenAlphaDescription; + tweenAlphaDescription.from = 0f; + tweenAlphaDescription.to = 1f; + tweenAlphaDescription.duration = 0.1f; + tweenAlphaDescription.ResetToBeginning(); + tweenAlphaDescription.PlayForward(); + StartCoroutine(assetSetting()); + yield return null; + do + { + time += Time.deltaTime; + } + while (!(time >= 0.1f)); + _isAnimatingNowCharacterView = false; + } + + private void SetCharacterDisp(ClassPack in_Pack) + { + for (int i = 0; i < CharacterSelectCircle.objs.Count; i++) + { + CharacterSelectCircle.objs[i].SetActive(value: false); + } + CharacterSelectCircle.objs[m_SelectCharacterIndex - 1].SetActive(value: true); + CharacterDetailObjs.textures[0].mainTexture = in_Pack.Detail.TextureBase; + LabelClassName.text = in_Pack.Detail.strName; + LabelClassDesc.SetWrapText(getTextClassDescription(m_SelectCharacterIndex)); + } + + private string getTextClassDescription(int classID) + { + SystemText systemText = Data.SystemText; + return classID switch + { + 1 => systemText.Get("Load_0010"), + 2 => systemText.Get("Load_0011"), + 3 => systemText.Get("Load_0012"), + 4 => systemText.Get("Load_0013"), + 5 => systemText.Get("Load_0014"), + 6 => systemText.Get("Load_0015"), + 7 => systemText.Get("Load_0016"), + 8 => systemText.Get("Load_0018"), + _ => null, + }; + } + + private string getTextCharacterName(int classID) + { + SystemText systemText = Data.SystemText; + return classID switch + { + 1 => systemText.Get("Load_0003"), + 2 => systemText.Get("Load_0004"), + 3 => systemText.Get("Load_0005"), + 4 => systemText.Get("Load_0006"), + 5 => systemText.Get("Load_0007"), + 6 => systemText.Get("Load_0008"), + 7 => systemText.Get("Load_0009"), + 8 => systemText.Get("Load_0017"), + _ => null, + }; + } +} diff --git a/SVSim.BattleEngine/Engine/LoadingDownLoadCardView.cs b/SVSim.BattleEngine/Engine/LoadingDownLoadCardView.cs new file mode 100644 index 0000000..a420584 --- /dev/null +++ b/SVSim.BattleEngine/Engine/LoadingDownLoadCardView.cs @@ -0,0 +1,447 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Cute; +using UnityEngine; +using Wizard; + +public class LoadingDownLoadCardView : MonoBehaviour +{ + private class LoadSceneCardDataAccessor + { + public readonly int CardNum; + + private List _loadSceneCardDataList; + + public int CurrentIndex { get; private set; } + + public LoadSceneCardData CurrentCardData => _loadSceneCardDataList[CurrentIndex]; + + public LoadSceneCardDataAccessor(List cardIdList) + { + CardNum = cardIdList.Count; + _loadSceneCardDataList = new List(); + for (int i = 0; i < CardNum; i++) + { + _loadSceneCardDataList.Add(new LoadSceneCardData(i, cardIdList[i])); + } + } + + public void UpdateIndexToNext() + { + if (CurrentIndex < CardNum - 1) + { + CurrentIndex++; + } + else + { + CurrentIndex = 0; + } + } + + public void UpdateIndexToPrev() + { + if (CurrentIndex > 0) + { + CurrentIndex--; + } + else + { + CurrentIndex = CardNum - 1; + } + } + } + + private class LoadSceneCardData + { + private static readonly Color DEFAULT_EFFECT_COLOR = Color.white; + + public const string FORMAT_DESC_NORMAL = "CardDescN_{0}"; + + public const string FORMAT_DESC_EVO = "CardDescE_{0}"; + + private const string FORMAT_EFFECT_COLOR = "CardColor_{0}"; + + private Color _cardEffectColor; + + public CardParameter CardParam { get; private set; } + + public string CardName { get; private set; } + + public string CardNormalDesc { get; private set; } + + public string CardEvolDesc { get; private set; } + + public Color CardEffectColor => _cardEffectColor; + + public LoadSceneCardData(int index, int cardId) + { + SystemText systemText = Data.SystemText; + _ = Data.Load.data.ResourceDlViewID; + CardParam = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(cardId); + bool num = CardParam.CharType == CardBasePrm.CharaType.NORMAL; + CardName = systemText.Get($"LoadCard_{cardId}"); + CardNormalDesc = systemText.Get($"CardDescN_{cardId}"); + if (num) + { + CardEvolDesc = systemText.Get($"CardDescE_{cardId}"); + } + else + { + CardEvolDesc = ""; + } + if (!ColorUtility.TryParseHtmlString(systemText.Get($"CardColor_{(int)CardParam.Clan}"), out _cardEffectColor)) + { + _cardEffectColor = DEFAULT_EFFECT_COLOR; + } + } + } + + private static readonly Vector3 CARD_SCALE = new Vector3(0.022f, 0.017f, 1f); + + [SerializeField] + private Transform CardObjectTransform; + + [SerializeField] + private ParticleSystem[] LoadingEffects; + + [SerializeField] + private UIScrollView _cardDetailScrollView; + + [SerializeField] + private UILabel _cardNameLabel; + + [SerializeField] + private GameObject _followerDetailObjctRoot; + + [SerializeField] + private GameObject _spellOrAmuletDetailObjctRoot; + + [SerializeField] + private UILabel _followerNormalSkillLabel; + + [SerializeField] + private UILabel _followerNormalAtkLabel; + + [SerializeField] + private UILabel _followerNormalLifeLabel; + + [SerializeField] + private UILabel _followerEvoSkillLabel; + + [SerializeField] + private UILabel _followerEvoAtkLabel; + + [SerializeField] + private UILabel _followerEvoLifeLabel; + + [SerializeField] + private GameObject _followerEvoTopRootObj; + + [SerializeField] + private UILabel _spellOrAmuletSkillLabel; + + [SerializeField] + private UILabel _cardTypeLabel; + + [SerializeField] + private ResourceDownloadCardFactory _cardFactory; + + [SerializeField] + private UIPanel _cardPanel; + + [SerializeField] + private TextLineCreater _normalTextLineCreater; + + [SerializeField] + private TextLineCreater _evoTextLineCreater; + + [SerializeField] + private TextLineCreater _spellOrAmuletSkillTextLineCreater; + + [SerializeField] + private UIToggle indicatorBase; + + [SerializeField] + private GameObject _blackPanel; + + private Vector3 _defaultPosCardSprite = Vector3.zero; + + private Quaternion _defaultRotCardSprite = Quaternion.identity; + + private List _indicatorList = new List(); + + private LoadSceneCardDataAccessor _cardDataAccessor; + + private List _cardIdList; + + private List _cardList; + + public const string FORMAT_CARD_NAME = "LoadCard_{0}"; + + public bool IsAnimatingNow { get; private set; } + + public void Initialize(Action onReady) + { + LoadingEffects[2].gameObject.SetActive(value: false); + LoadingEffects[3].gameObject.SetActive(value: false); + LoadingEffects[4].gameObject.SetActive(value: false); + LoadingEffects[0].gameObject.SetActive(value: false); + LoadCardResource(delegate + { + _blackPanel.SetActive(value: false); + LoadingEffects[0].gameObject.SetActive(value: true); + TweenAlpha.Begin(CardObjectTransform.gameObject, 0f, 1f); + _cardDataAccessor = new LoadSceneCardDataAccessor(GetCardIdList()); + ChangeLoadCardInfo(_cardDataAccessor.CurrentCardData, _cardDataAccessor.CurrentIndex); + GameObject gameObject = indicatorBase.transform.parent.gameObject; + _indicatorList.Add(indicatorBase); + for (int i = 1; i < _cardDataAccessor.CardNum; i++) + { + _indicatorList.Add(NGUITools.AddChild(gameObject, indicatorBase.gameObject).GetComponent()); + } + gameObject.GetComponent().Reposition(); + UpdateIndicator(_cardDataAccessor.CurrentIndex); + onReady.Call(); + }); + } + + private List CreateCardIdList() + { + Dictionary> dictionary = LoadCardIdList(); + if (dictionary.TryGetValue(Data.Load.data.RotationLatestCardPackId, out var value)) + { + return value; + } + Debug.LogError($"カードパックID[{Data.Load.data.RotationLatestCardPackId}]が見つかりません"); + return dictionary.FirstOrDefault().Value; + } + + private Dictionary> LoadCardIdList() + { + List list = Utility.ConvertCSV_Array((Resources.Load("CSV/load_card") as TextAsset).ToString()); + Dictionary> dictionary = new Dictionary>(); + foreach (string[] item in list) + { + if (!int.TryParse(item[0], out var result)) + { + continue; + } + List list2 = new List(list.Count); + for (int i = 1; i < item.Length; i++) + { + if (int.TryParse(item[i], out var result2)) + { + list2.Add(result2); + } + } + dictionary[result] = list2; + } + return dictionary; + } + + private List GetCardIdList() + { + if (_cardIdList == null) + { + _cardIdList = CreateCardIdList(); + } + return _cardIdList; + } + + public bool CanView() + { + return _cardFactory.CanView(GetCardIdList()); + } + + private void LoadCardResource(Action onFinish) + { + _cardFactory.Load(GetCardIdList(), _cardPanel.gameObject, delegate(List cardList) + { + OnFinishCardLoad(cardList); + onFinish(); + }); + } + + private void OnFinishCardLoad(List cardList) + { + for (int i = 0; i < cardList.Count; i++) + { + CardListTemplate cardListTemplate = cardList[i]; + cardListTemplate.gameObject.SetActive(i == 0); + cardListTemplate.HideNum(); + cardListTemplate.transform.localScale = CARD_SCALE; + } + _cardList = cardList; + } + + public void FadeOutLoading() + { + TweenAlpha.Begin(CardObjectTransform.gameObject, 1f, 0f); + for (int i = 0; i < LoadingEffects.Length; i++) + { + LoadingEffects[i].Stop(); + LoadingEffects[i].Clear(); + } + } + + public void Next() + { + StartCoroutine(ChangeCardAnm(isRight: true)); + } + + public void Prev() + { + StartCoroutine(ChangeCardAnm(isRight: false)); + } + + private void ChangeLoadCardInfo(LoadSceneCardData cardData, int index) + { + foreach (CardListTemplate card in _cardList) + { + card.gameObject.SetActive(value: false); + } + _cardList[index].gameObject.SetActive(value: true); + SetCardDetailLabels(cardData, index); + ParticleSystem[] componentsInChildren = LoadingEffects[0].gameObject.GetComponentsInChildren(); + foreach (ParticleSystem obj in componentsInChildren) + { + ParticleSystem.MainModule main = obj.main; + main.startColor = cardData.CardEffectColor; + obj.Stop(); + obj.Play(); + } + componentsInChildren = LoadingEffects[1].gameObject.GetComponentsInChildren(); + foreach (ParticleSystem obj2 in componentsInChildren) + { + ParticleSystem.MainModule main2 = obj2.main; + main2.startColor = cardData.CardEffectColor; + obj2.Stop(); + obj2.Play(); + } + UpdateIndicator(_cardDataAccessor.CurrentIndex); + } + + private void SetCardDetailLabels(LoadSceneCardData cardData, int index) + { + _cardNameLabel.text = cardData.CardName; + _cardTypeLabel.text = GetCardTypeText(cardData); + SetCardSkillText(cardData, index); + _cardDetailScrollView.ResetPosition(); + _cardDetailScrollView.UpdateScrollbars(recalculateBounds: true); + } + + private string GetCardTypeText(LoadSceneCardData cardData) + { + return cardData.CardParam.CharType switch + { + CardBasePrm.CharaType.FIELD => Data.SystemText.Get("Card_0046"), + CardBasePrm.CharaType.SPELL => Data.SystemText.Get("Card_0045"), + _ => string.Empty, + }; + } + + private void SetCardSkillText(LoadSceneCardData cardData, int index) + { + int cardId = GetCardIdList()[index]; + CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(cardId); + if (cardParameterFromId.CharType == CardBasePrm.CharaType.NORMAL) + { + _followerDetailObjctRoot.SetActive(value: true); + _spellOrAmuletDetailObjctRoot.SetActive(value: false); + _followerNormalAtkLabel.text = cardParameterFromId.Atk.ToString(); + _followerNormalLifeLabel.text = cardParameterFromId.Life.ToString(); + _followerEvoAtkLabel.text = cardParameterFromId.EvoAtk.ToString(); + _followerEvoLifeLabel.text = cardParameterFromId.EvoLife.ToString(); + SetFollowerText(_cardDataAccessor.CurrentCardData, index); + } + else + { + _followerDetailObjctRoot.SetActive(value: false); + _spellOrAmuletDetailObjctRoot.SetActive(value: true); + SetViewCardText(cardData.CardNormalDesc, _spellOrAmuletSkillLabel, _spellOrAmuletSkillTextLineCreater); + } + } + + private void SetFollowerText(LoadSceneCardData cardData, int index) + { + if (_cardList != null) + { + SetViewCardText(cardData.CardNormalDesc, _followerNormalSkillLabel, _normalTextLineCreater); + SetViewCardText(cardData.CardEvolDesc, _followerEvoSkillLabel, _evoTextLineCreater); + float y = _followerNormalSkillLabel.transform.localPosition.y - (float)_followerNormalSkillLabel.height - 44f; + _followerEvoTopRootObj.transform.localPosition = new Vector3(_followerEvoTopRootObj.transform.localPosition.x, y); + } + } + + private void SetViewCardText(string cardText, UILabel textLabel, TextLineCreater lineCreater) + { + textLabel.overflowMethod = UILabel.Overflow.ResizeHeight; + textLabel.ProcessText(); + int textLineCount = Global.GetTextLineCount(Global.GetConvertWrapText(textLabel, cardText)); + lineCreater.ShowLines(textLineCount); + textLabel.SetWrapText(cardText); + } + + private IEnumerator ChangeCardAnm(bool isRight) + { + IsAnimatingNow = true; + CardListTemplate currentCard = _cardList[_cardDataAccessor.CurrentIndex]; + if (!isRight) + { + _cardDataAccessor.UpdateIndexToPrev(); + } + else + { + _cardDataAccessor.UpdateIndexToNext(); + } + GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + TweenPosition tp = CardObjectTransform.GetComponent(); + TweenRotation tr = CardObjectTransform.GetComponent(); + _defaultPosCardSprite = CardObjectTransform.transform.localPosition; + _defaultRotCardSprite = CardObjectTransform.transform.localRotation; + tp.enabled = false; + tr.enabled = false; + LoadingEffects[1].gameObject.SetActive(value: false); + LoadingEffects[2].gameObject.SetActive(value: false); + LoadingEffects[2].gameObject.SetActive(value: true); + TweenAlpha.Begin(CardObjectTransform.gameObject, 0.2f, 0f); + TweenAlpha.Begin(currentCard._nameLabel.gameObject, 0.2f, 0f); + if (isRight) + { + iTween.MoveTo(CardObjectTransform.gameObject, iTween.Hash("position", _defaultPosCardSprite + Vector3.left * 50f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); + } + else + { + iTween.MoveTo(CardObjectTransform.gameObject, iTween.Hash("position", _defaultPosCardSprite + Vector3.right * 50f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); + } + yield return new WaitForSeconds(0.2f); + GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DL_CARD_APPEAR); + LoadingEffects[1].gameObject.SetActive(value: true); + ChangeLoadCardInfo(_cardDataAccessor.CurrentCardData, _cardDataAccessor.CurrentIndex); + LoadingEffects[3].gameObject.SetActive(value: false); + LoadingEffects[3].gameObject.SetActive(value: true); + LoadingEffects[4].gameObject.SetActive(value: false); + LoadingEffects[4].gameObject.SetActive(value: true); + TweenAlpha.Begin(CardObjectTransform.gameObject, 0.2f, 1f); + TweenAlpha.Begin(currentCard._nameLabel.gameObject, 0.2f, 1f); + CardObjectTransform.transform.localPosition = _defaultPosCardSprite + Vector3.down * 20f; + CardObjectTransform.transform.localRotation = Quaternion.Euler(new Vector3(0f, 90f, 10f)); + iTween.MoveTo(CardObjectTransform.gameObject, iTween.Hash("position", _defaultPosCardSprite, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); + iTween.RotateTo(CardObjectTransform.gameObject, iTween.Hash("rotation", _defaultRotCardSprite.eulerAngles, "time", 0.2f, "easetype", iTween.EaseType.easeOutQuad)); + yield return new WaitForSeconds(0.2f); + CardObjectTransform.transform.localPosition = _defaultPosCardSprite; + tp.enabled = true; + tr.enabled = true; + IsAnimatingNow = false; + } + + private void UpdateIndicator(int index) + { + if (_indicatorList.Count > 1) + { + _indicatorList[index].value = true; + } + } +} diff --git a/SVSim.BattleEngine/Engine/TwoPickCardSelectBase.cs b/SVSim.BattleEngine/Engine/TwoPickCardSelectBase.cs new file mode 100644 index 0000000..fa78760 --- /dev/null +++ b/SVSim.BattleEngine/Engine/TwoPickCardSelectBase.cs @@ -0,0 +1,664 @@ +using System.Collections; +using System.Collections.Generic; +using Cute; +using UnityEngine; +using Wizard; +using Wizard.Scripts.Network.Data.TableData.Arena.TwoPick; +using Wizard.Scripts.Network.Data.TaskData.Arena.TwoPick; + +public abstract class TwoPickCardSelectBase : MonoBehaviour +{ + public enum MoveType + { + LEFT, + RIGHT, + UP, + DOWN + } + + public enum PICK_SIDE + { + LEFT, + RIGHT + } + + private class CardPosXInfo + { + public Transform Transform { get; private set; } + + public float PosX { get; private set; } + + public CardPosXInfo(Transform t, float posX) + { + Transform = t; + PosX = posX; + } + } + + public const int PICK_SIDE_NUM = 2; + + public const int PICK_CARD_NUM = 2; + + protected TwoPickCardSelectView _viewData; + + private int scene_layer = 24; + + private const int maxDrawCard = 4; + + private const float CARD_IN_ANIMATION_TIME = 0.5f; + + private IList LeftObjs = new List(); + + private IList RightObjs = new List(); + + private List cardObjList = new List(); + + private List cardObjListSpell = new List(); + + private List _loadAssetList = new List(); + + protected List _selectedCardList = new List(); + + private bool _bOnDestory; + + private int _lastTimeCardNum; + + protected int _followerNum; + + protected int _amuletNum; + + protected int _spellNum; + + private List _tweenObjectList = new List(); + + private List cardPosXInfoList = new List(); + + private bool isCardSetFirst = true; + + private const int DECK_INFO_ICON = 0; + + private const int DECK_INFO_CLASS_NAME = 0; + + private const int DECK_INFO_CARD_NUM = 1; + + private const int DECK_INFO_CARD_MAX = 2; + + private const int DECK_INFO_FOLLOWER_NUM = 3; + + private const int DECK_INFO_SPELL_NUM = 4; + + private const int DECK_INFO_AMULET_NUM = 5; + + private const float DECK_INFO_TWEEN_Y = -151f; + + private readonly Color EFFECT_COLOR_BLUE = new Color(0.2509804f, 0.5019608f, 1f); + + private readonly Color EFFECT_COLOR_ORANGE = new Color(1f, 32f / 85f, 0f); + + private List _effects = new List(); + + public UICardList UiCardList { get; set; } + + public CardDetailUI UiCardDetail { get; set; } + + public int SelectedClassId { get; set; } + + public bool IsButtonEnable { get; set; } + + public bool IsTitleEnable { get; set; } + + public bool IsFirstCardDisp { get; set; } + + protected virtual void Awake() + { + IsButtonEnable = true; + IsTitleEnable = true; + IsFirstCardDisp = false; + } + + public void Init() + { + isCardSetFirst = true; + _viewData = base.transform.GetComponent(); + _viewData.TitlePanel.gameObject.SetActive(IsTitleEnable); + _viewData.CostCurveClass.Initialize(FormatBehaviorManager.GetDefaultBehaviour(Format.Max).CardMasterId); + _viewData.DeckBtnObj.labels[0].text = Data.SystemText.Get("Arena_0009"); + _viewData.SelectBtnObjs[0].labels[0].text = Data.SystemText.Get("Arena_0029"); + _viewData.SelectBtnObjs[1].labels[0].text = Data.SystemText.Get("Arena_0029"); + for (int i = 0; i < 2; i++) + { + _viewData.SelectBtnObjs[i].buttons[0].onClick.Clear(); + _viewData.SelectBtnObjs[i].buttons[0].onClick.Add(new EventDelegate(delegate + { + OnClickSelectBtn(); + })); + } + _viewData.DeckBtnObj.buttons[0].onClick.Clear(); + _viewData.DeckBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate + { + DeckViewOpen(); + })); + UiCardList.SetClan(GetSelectedClassId()); + CardBasePrm.ClanType selectedClassId = GetSelectedClassId(); + _viewData.DeckInfoObjs.sprites[0].spriteName = ClassCharaPrm.GetIconSpriteName(selectedClassId); + _viewData.DeckInfoObjs.labels[0].text = ClassCharaPrm.GetNameText(selectedClassId); + ClassCharaPrm.SetClassLabelSetting(_viewData.DeckInfoObjs.labels[0], selectedClassId); + _viewData.DeckTypeNameLabel.gameObject.SetActive(value: false); + if (GetDeckInfo().cardIds.Length == 0) + { + _viewData.DeckInfoObjs.labels[1].text = "0"; + _viewData.DeckInfoObjs.labels[2].text = "/" + 30; + _viewData.DeckInfoObjs.labels[3].text = "0"; + _viewData.DeckInfoObjs.labels[4].text = "0"; + _viewData.DeckInfoObjs.labels[5].text = "0"; + } + _viewData.TitlePanel.alpha = 0f; + _viewData.DeckInfoObjs.GetComponent().alpha = 0f; + TweenAlpha.Begin(base.gameObject, 0f, 1f); + LeftObjs = new List(); + RightObjs = new List(); + Deck deckInfo = GetDeckInfo(); + _selectedCardList = new List(); + if (deckInfo.cardIds.Length != 0) + { + _selectedCardList.AddRange(deckInfo.cardIds); + } + for (int num = 0; num < _selectedCardList.Count; num++) + { + DeckInfoCardNumUpdate(_selectedCardList.Count, 30, _selectedCardList[num]); + } + if (_selectedCardList.Count == 0) + { + _viewData.DeckBtnObj.buttons[0].isEnabled = false; + _viewData.DeckBtnObj.labels[0].color = LabelDefine.TEXT_COLOR_BUTTON_DISABLE; + } + else + { + _viewData.DeckBtnObj.buttons[0].isEnabled = true; + _viewData.DeckBtnObj.labels[0].color = LabelDefine.TEXT_COLOR_BUTTON_ENABLE; + } + StartCoroutine(cardChoosePost_NonTask()); + _viewData.SelectBtnObjs[0].gameObject.SetActive(value: false); + _viewData.SelectBtnObjs[1].gameObject.SetActive(value: false); + _viewData.CardContainer[0].SetActive(value: false); + _viewData.CardContainer[1].SetActive(value: false); + TweenAlpha.Begin(_viewData.BaseObj, 0f, 0f); + _loadAssetList.Add(Toolbox.ResourcesManager.GetAssetTypePath(GetSelectedSkinId().ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase)); + _viewData.ClassObj.textures[0].mainTexture = null; + UIManager.GetInstance().createInSceneCenterLoading(); + UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadAssetList, delegate + { + UIManager.GetInstance().closeInSceneCenterLoading(); + if (!_bOnDestory) + { + Texture mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(GetSelectedSkinId().ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase, isfetch: true)) as Texture; + UITexture obj = _viewData.ClassObj.textures[0]; + obj.mainTexture = mainTexture; + obj.material = null; + TweenAlpha.Begin(_viewData.BaseObj, 0f, 1f); + } + })); + _viewData.TitlePanel.alpha = 0f; + TweenAlpha.Begin(_viewData.TitlePanel.transform.parent.gameObject, 0.5f, 1f); + StartCoroutine(ForceSetCardPosX()); + } + + public void SetDeckTypeName(string name) + { + _viewData.DeckTypeNameLabel.gameObject.SetActive(value: true); + _viewData.DeckTypeNameLabel.text = name; + ClassCharaPrm.SetClassLabelSetting(_viewData.DeckTypeNameLabel, GetSelectedClassId()); + _viewData.DeckInfoObjs.sprites[0].gameObject.SetActive(value: false); + _viewData.DeckInfoObjs.labels[0].gameObject.SetActive(value: false); + } + + public virtual void StartDestory() + { + Object.Destroy(base.gameObject); + } + + protected virtual void OnDestroy() + { + GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_ARENA_ARCANE_1); + GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_ARENA_ARCANE_2); + foreach (Effect effect in _effects) + { + effect.Stop(); + } + _effects.Clear(); + _bOnDestory = true; + UIManager.GetInstance().closeInSceneCenterLoading(); + } + + public void RemoveData() + { + for (int i = 0; i < LeftObjs.Count; i++) + { + Object.Destroy(LeftObjs[i]); + } + LeftObjs.Clear(); + for (int j = 0; j < RightObjs.Count; j++) + { + Object.Destroy(RightObjs[j]); + } + RightObjs.Clear(); + cardObjList.Clear(); + cardObjListSpell.Clear(); + Toolbox.ResourcesManager.RemoveAssetGroup(_loadAssetList); + _loadAssetList.Clear(); + } + + private IEnumerator cardChoosePost(int selectedId) + { + UIManager.GetInstance().createInSceneCenterLoading(); + yield return new WaitForSeconds(0.5f); + ConnectTask(selectedId); + } + + public void NextCardSelect(PICK_SIDE inPickSide) + { + _selectedCardList.Clear(); + _selectedCardList.AddRange(Data.RoomTwoPickInfo.deckData.cardIds); + _followerNum = 0; + _amuletNum = 0; + _spellNum = 0; + _viewData.CostCurveClass.Refresh(); + for (int i = 0; i < Data.RoomTwoPickInfo.deckData.cardIds.Length; i++) + { + DeckInfoCardNumUpdate(_selectedCardList.Count, 30, Data.RoomTwoPickInfo.deckData.cardIds[i]); + } + CardDecide(inPickSide, isCardListUpdate: false); + } + + private IEnumerator cardChoosePost_NonTask() + { + yield return new WaitForSeconds(0.5f); + returnPost(); + } + + private void returnPost() + { + UIManager.GetInstance().closeInSceneCenterLoading(); + StartCoroutine(CardSet()); + } + + private IEnumerator CardSet() + { + try + { + for (int i = 0; i < _tweenObjectList.Count; i++) + { + if (_tweenObjectList[i] != null) + { + iTween.Stop(_tweenObjectList[i]); + } + } + _tweenObjectList.Clear(); + } + catch + { + } + if (_selectedCardList.Count >= 30) + { + StartCoroutine(RunSceneNext()); + yield break; + } + LeftObjs.Clear(); + RightObjs.Clear(); + _viewData.CardContainer[0].SetActive(value: true); + _viewData.CardContainer[1].SetActive(value: true); + if (isCardSetFirst) + { + isCardSetFirst = false; + iTween.MoveTo(_viewData.DeckInfoObjs.gameObject, iTween.Hash("y", -151f, "time", 0.25f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); + TweenAlpha.Begin(_viewData.DeckInfoObjs.gameObject, 0.25f, 1f); + _tweenObjectList.Add(_viewData.DeckInfoObjs.gameObject); + } + for (int j = 0; j < cardObjList.Count; j++) + { + Object.Destroy(cardObjList[j].CardObj); + } + cardObjList.Clear(); + for (int k = 0; k < cardObjListSpell.Count; k++) + { + Object.Destroy(cardObjListSpell[k].CardObj); + } + cardObjListSpell.Clear(); + cardPosXInfoList.Clear(); + int[] downloadList = new int[4] + { + GetCardInfo().candidateCards[0].cardId1, + GetCardInfo().candidateCards[0].cardId2, + GetCardInfo().candidateCards[1].cardId1, + GetCardInfo().candidateCards[1].cardId2 + }; + UIManager.GetInstance().CardLoadSelect(base.gameObject, downloadList, scene_layer, is2D: false); + while (!UIManager.GetInstance().getUIBase_CardManager().getCreateEndFlag() || !UIManager.GetInstance().getUIBase_CardManager().isAssetAllReady) + { + yield return null; + } + cardObjList = UIManager.GetInstance().getSelectCardListObjs(); + _loadAssetList.AddRange(Toolbox.ResourcesManager.CardListAssetPathList); + Toolbox.ResourcesManager.CardListAssetPathList.Clear(); + for (int l = 0; l < 4; l++) + { + GameObject cardObj = cardObjList[l].CardObj; + cardObj.transform.parent = base.transform; + cardObj.GetComponent().SetCardId(downloadList[l]); + switch (l) + { + case 0: + case 1: + cardObj.transform.parent = _viewData.CardContainer[0].transform; + LeftObjs.Add(cardObj); + break; + case 2: + case 3: + cardObj.transform.parent = _viewData.CardContainer[1].transform; + RightObjs.Add(cardObj); + break; + } + cardObj.transform.localPosition = Vector3.up * 100f; + cardObj.transform.localRotation = Quaternion.Euler(Vector3.up * 90f); + cardObj.transform.localScale = new Vector3(50f, 50f, 50f); + cardObj.transform.Find("CardBase").gameObject.AddComponent().onClick.Add(CreateCardDetailEvent(cardObj)); + cardObj.SetActive(value: false); + } + StartCoroutine(RunCardIn()); + } + + private EventDelegate CreateCardDetailEvent(GameObject cardObject) + { + return new EventDelegate(delegate + { + UiCardDetail.OnPushCardDetailOn(cardObject); + }); + } + + private IEnumerator RunCardIn() + { + Vector3[] posList = new Vector3[4] + { + new Vector3(-100f, 200f, 0f), + new Vector3(110f, 160f, 100f), + new Vector3(110f, 200f, 0f), + new Vector3(-100f, 160f, 100f) + }; + Vector3[] rotList = new Vector3[4] + { + new Vector3(0f, 0f, 5f), + new Vector3(0f, 0f, -5f), + new Vector3(0f, 0f, -5f), + new Vector3(0f, 0f, 5f) + }; + GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DL_CARD_APPEAR); + GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_ARCANE_1, _viewData.CardContainer[0].transform.position); + GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_ARCANE_2, _viewData.CardContainer[1].transform.position); + int i = 0; + while (i < 4 && LeftObjs.Count != 0 && RightObjs.Count != 0) + { + GameObject gameObject; + Color color; + if (i < 2) + { + gameObject = LeftObjs[i]; + color = EFFECT_COLOR_BLUE; + } + else + { + gameObject = RightObjs[i % 2]; + color = EFFECT_COLOR_ORANGE; + } + gameObject.SetActive(value: true); + iTween.MoveTo(gameObject, iTween.Hash("position", posList[i], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); + iTween.RotateTo(gameObject, iTween.Hash("rotation", rotList[i], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo, "oncomplete", "")); + iTween.MoveAdd(gameObject, iTween.Hash("y", Random.value * 0.03f + 0.03f, "time", Random.value * 2f + 2f, "looptype", iTween.LoopType.pingPong, "easetype", iTween.EaseType.easeInOutQuad)); + StartCoroutine(CardInAnimationEndAction(gameObject, posList[i], rotList[i])); + Effect effect = ((cardObjList[i].cardType == CardBasePrm.CharaType.NORMAL) ? GameMgr.GetIns().GetEffectMgr().StartBuff(EffectMgr.EffectType.CMN_ARENA_FRAME_1, gameObject) : ((cardObjList[i].cardType != CardBasePrm.CharaType.SPELL) ? GameMgr.GetIns().GetEffectMgr().StartBuff(EffectMgr.EffectType.CMN_ARENA_FRAME_2, gameObject) : GameMgr.GetIns().GetEffectMgr().StartBuff(EffectMgr.EffectType.CMN_ARENA_FRAME_3, gameObject))); + if (effect == null) + { + break; + } + effect.ChangeParticleColor(color); + _effects.Add(effect); + if (i % 2 == 0) + { + yield return new WaitForSeconds(0.1f); + } + int num = i + 1; + i = num; + } + _viewData.SelectBtnObjs[0].gameObject.SetActive(IsButtonEnable); + _viewData.SelectBtnObjs[1].gameObject.SetActive(IsButtonEnable); + IsFirstCardDisp = true; + } + + private IEnumerator CardInAnimationEndAction(GameObject cardObject, Vector3 position, Vector3 rotation) + { + yield return new WaitForSeconds(0.5f); + if (cardObject != null) + { + cardObject.transform.localPosition = position; + TweenRotation tweenRotation = cardObject.AddComponent(); + tweenRotation.from = rotation; + float x = Random.value * 0.04f - 0.02f; + float y = Random.value * 0.08f - 0.04f; + float z = Random.value * 0.02f - 0.01f; + tweenRotation.to = new Vector3(x, y, z); + tweenRotation.style = UITweener.Style.PingPong; + tweenRotation.method = UITweener.Method.EaseInOut; + tweenRotation.duration = Random.value * 2f + 2f; + _tweenObjectList.Add(cardObject); + cardPosXInfoList.Add(new CardPosXInfo(cardObject.transform, position.x)); + } + } + + private IEnumerator RunCardOut(bool isLeft) + { + if (LeftObjs.Count == 0 || RightObjs.Count == 0) + { + yield break; + } + GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_ARENA_ARCANE_1); + GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_ARENA_ARCANE_2); + foreach (Effect effect in _effects) + { + effect.Stop(); + } + _effects.Clear(); + int i = 0; + while (i < 2) + { + if (i != 0) + { + yield return new WaitForSeconds(0.1f); + } + if (LeftObjs.Count == 0 || RightObjs.Count == 0) + { + break; + } + if (isLeft) + { + _viewData.CardTweenTarget[i].transform.SetParent(LeftObjs[i].transform.parent); + _viewData.CardTweenTarget[i].transform.localPosition = LeftObjs[i].transform.localPosition; + _viewData.CardTweenTarget[i].transform.rotation = LeftObjs[i].transform.rotation; + GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_1, _viewData.CardTweenTarget[i].transform.localPosition, _viewData.CardTweenTarget[i]); + GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_3, LeftObjs[i].transform.position); + GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_2, RightObjs[i].transform.position); + } + else + { + _viewData.CardTweenTarget[i].transform.SetParent(RightObjs[i].transform.parent); + _viewData.CardTweenTarget[i].transform.localPosition = RightObjs[i].transform.localPosition; + _viewData.CardTweenTarget[i].transform.rotation = RightObjs[i].transform.rotation; + GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_2, LeftObjs[i].transform.position); + GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_1, _viewData.CardTweenTarget[i].transform.localPosition, _viewData.CardTweenTarget[i]); + GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_3, RightObjs[i].transform.position); + } + LeftObjs[i].SetActive(value: false); + RightObjs[i].SetActive(value: false); + int num = i + 1; + i = num; + } + GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_2PICK_SELECT); + try + { + for (int j = 0; j < _tweenObjectList.Count; j++) + { + if (_tweenObjectList[j] != null) + { + iTween.Stop(_tweenObjectList[j]); + } + } + _tweenObjectList.Clear(); + } + catch + { + } + Vector3 vector = new Vector3(100f, 100f, 0f); + Vector3 p = new Vector3(340f, 140f, 0f); + if (!isLeft) + { + vector.x *= -1f; + p.x *= -1f; + } + for (int k = 0; k < 2; k++) + { + Vector3[] bezierQuad = MotionUtils.GetBezierQuad(_viewData.CardTweenTarget[k].transform.localPosition, _viewData.CardTweenTarget[k].transform.localPosition + vector, p, 10); + iTween.MoveTo(_viewData.CardTweenTarget[k], iTween.Hash("path", bezierQuad, "time", 0.25f, "islocal", true, "movetopath", false, "easetype", iTween.EaseType.linear)); + iTween.RotateTo(_viewData.CardTweenTarget[k], iTween.Hash("z", -180f, "time", 0.25f, "islocal", true, "easetype", iTween.EaseType.linear)); + _tweenObjectList.Add(_viewData.CardTweenTarget[k]); + } + GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECK_1, _viewData.DeckInfoObjs.transform.position); + } + + private IEnumerator RunSceneNext() + { + SetUiCardList(); + TweenAlpha.Begin(base.gameObject, 0.5f, 0f); + yield return new WaitForSeconds(0.5f); + base.gameObject.SetActive(value: false); + CardSelectEndAction(); + } + + public void DeckInfoCardNumUpdate(int deckNow, int deckMax, int inCardId) + { + _viewData.DeckInfoObjs.labels[1].text = deckNow.ToString(); + _viewData.DeckInfoObjs.labels[2].text = "/" + deckMax; + switch (CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(inCardId).CharType) + { + case CardBasePrm.CharaType.NORMAL: + _followerNum++; + break; + case CardBasePrm.CharaType.FIELD: + case CardBasePrm.CharaType.CHANT_FIELD: + _amuletNum++; + break; + default: + _spellNum++; + break; + } + _viewData.DeckInfoObjs.labels[3].text = _followerNum.ToString(); + _viewData.DeckInfoObjs.labels[4].text = _spellNum.ToString(); + _viewData.DeckInfoObjs.labels[5].text = _amuletNum.ToString(); + _viewData.CostCurveClass.Add(inCardId, withAnim: false); + } + + private void OnClickSelectBtn() + { + if (IsButtonEnable) + { + GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + PICK_SIDE inPickSide = ((!(UIButton.current.name == "SelectBtn0")) ? PICK_SIDE.RIGHT : PICK_SIDE.LEFT); + CardDecide(inPickSide, isCardListUpdate: true); + } + } + + protected void CardDecide(PICK_SIDE inPickSide, bool isCardListUpdate) + { + int num = 0; + int num2 = 0; + switch (inPickSide) + { + case PICK_SIDE.LEFT: + num = GetCardInfo().candidateCards[0].cardId1; + num2 = GetCardInfo().candidateCards[0].cardId2; + StartCoroutine(RunCardOut(isLeft: true)); + StartCoroutine(cardChoosePost(GetCardInfo().candidateCards[0].id)); + break; + case PICK_SIDE.RIGHT: + num = GetCardInfo().candidateCards[1].cardId1; + num2 = GetCardInfo().candidateCards[1].cardId2; + StartCoroutine(RunCardOut(isLeft: false)); + StartCoroutine(cardChoosePost(GetCardInfo().candidateCards[1].id)); + break; + } + if (isCardListUpdate) + { + _selectedCardList.Add(num); + _selectedCardList.Add(num2); + DeckInfoCardNumUpdate(_selectedCardList.Count, 30, num); + DeckInfoCardNumUpdate(_selectedCardList.Count, 30, num2); + } + _viewData.SelectBtnObjs[0].gameObject.SetActive(value: false); + _viewData.SelectBtnObjs[1].gameObject.SetActive(value: false); + _viewData.DeckBtnObj.buttons[0].isEnabled = true; + _viewData.DeckBtnObj.labels[0].color = LabelDefine.TEXT_COLOR_BUTTON_ENABLE; + } + + private IEnumerator ForceSetCardPosX() + { + while (true) + { + for (int i = 0; i < cardPosXInfoList.Count; i++) + { + CardPosXInfo cardPosXInfo = cardPosXInfoList[i]; + Transform transform = cardPosXInfo.Transform; + if (!(transform == null)) + { + Vector3 localPosition = transform.localPosition; + localPosition.x = cardPosXInfo.PosX; + transform.localPosition = localPosition; + } + } + yield return null; + } + } + + protected abstract CardBasePrm.ClanType GetSelectedClassId(); + + protected abstract int GetSelectedSkinId(); + + protected void DeckViewOpen() + { + GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + UiCardList.SetActive(in_Active: true); + SetUiCardList(); + UiCardList.ResetScroll(); + } + + protected void SetUiCardList() + { + if (_lastTimeCardNum != _selectedCardList.Count) + { + if (_selectedCardList.Count != 0) + { + UiCardList.RemoveData(); + } + _selectedCardList = UIManager.GetInstance().getUIBase_CardManager().SortIDList(_selectedCardList, CardMaster.CardMasterId.Default); + for (int i = 0; i < _selectedCardList.Count; i++) + { + UiCardList.addScrollItem(_selectedCardList[i]); + } + _lastTimeCardNum = _selectedCardList.Count; + } + } + + protected abstract Deck GetDeckInfo(); + + protected abstract CandidateCardInfo GetCardInfo(); + + protected abstract void CardSelectEndAction(); + + protected abstract void ConnectTask(int selectedCardId); +} diff --git a/SVSim.BattleEngine/Engine/TwoPickCardSelectView.cs b/SVSim.BattleEngine/Engine/TwoPickCardSelectView.cs new file mode 100644 index 0000000..0296278 --- /dev/null +++ b/SVSim.BattleEngine/Engine/TwoPickCardSelectView.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +public class TwoPickCardSelectView : MonoBehaviour +{ + public GameObject BaseObj; + + public NguiObjs ClassObj; + + public NguiObjs DeckBtnObj; + + public NguiObjs[] SelectBtnObjs; + + public GameObject[] CardContainer; + + public UIPanel TitlePanel; + + public NguiObjs DeckInfoObjs; + + public CostCurveUI CostCurveClass; + + public GameObject[] CardTweenTarget; + + public UILabel DeckTypeNameLabel; +} diff --git a/SVSim.BattleEngine/Engine/Wizard/LoadSceneStoryData.cs b/SVSim.BattleEngine/Engine/Wizard/LoadSceneStoryData.cs new file mode 100644 index 0000000..286d924 --- /dev/null +++ b/SVSim.BattleEngine/Engine/Wizard/LoadSceneStoryData.cs @@ -0,0 +1,27 @@ +namespace Wizard; + +public class LoadSceneStoryData +{ + private const string FORMAT_STORY_TITLE_NAME = "StoryTitle_{0:0000}_1"; + + private const string FORMAT_STORY_VALUE_NAME = "StoryText_{0:0000}_1"; + + private const string STILL_TEXTURE_NAME = "bg_story_section_{0}"; + + public int StoryId { get; private set; } + + public string StoryTitle { get; private set; } + + public string StoryValue { get; private set; } + + public string StillImageName { get; private set; } + + public LoadSceneStoryData(int _storyId) + { + StoryId = _storyId; + SystemText systemText = Data.SystemText; + StoryTitle = systemText.Get($"StoryTitle_{StoryId:0000}_1"); + StoryValue = systemText.Get($"StoryText_{StoryId:0000}_1"); + StillImageName = "Images/Loading/" + $"bg_story_section_{StoryId}"; + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard/LoadingDownLoadStoryView.cs b/SVSim.BattleEngine/Engine/Wizard/LoadingDownLoadStoryView.cs new file mode 100644 index 0000000..9ea571f --- /dev/null +++ b/SVSim.BattleEngine/Engine/Wizard/LoadingDownLoadStoryView.cs @@ -0,0 +1,91 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace Wizard; + +public class LoadingDownLoadStoryView : MonoBehaviour +{ + [SerializeField] + private UITexture _stillTexture; + + [SerializeField] + private UILabel _storyTitleLabel; + + [SerializeField] + private UILabel _storyValueLabel; + + [SerializeField] + private UIToggle _indicatorBase; + + private List _indicatorList = new List(); + + private List _loadSceneStoryDatas = new List(); + + private const string FORMAT_STORY_NUMBER = "LoadStory_Number_1"; + + private int _currentIndex; + + public void Initialize() + { + _ = Data.SystemText; + int result = 0; + int.TryParse(Data.SystemText.Get("LoadStory_Number_1"), out result); + GameObject gameObject = _indicatorBase.transform.parent.gameObject; + for (int i = 1; i <= result; i++) + { + _loadSceneStoryDatas.Add(new LoadSceneStoryData(i)); + _indicatorList.Add(NGUITools.AddChild(gameObject, _indicatorBase.gameObject).GetComponent()); + } + _indicatorBase.gameObject.SetActive(value: false); + gameObject.GetComponent().Reposition(); + SetStoryInfo(_currentIndex); + } + + private void SetStoryInfo(int index) + { + LoadSceneStoryData loadSceneStoryData = _loadSceneStoryDatas[index]; + _storyTitleLabel.text = loadSceneStoryData.StoryTitle; + _storyValueLabel.text = loadSceneStoryData.StoryValue; + _stillTexture.mainTexture = Resources.Load(loadSceneStoryData.StillImageName); + UpdateIndicator(index); + } + + public void ChangeStoryImage(bool isRight) + { + if (isRight) + { + UpdateIndexToNext(); + } + else + { + UpdateIndexToPrev(); + } + } + + private void UpdateIndexToNext() + { + _currentIndex = (_currentIndex + 1) % _loadSceneStoryDatas.Count; + SetStoryInfo(_currentIndex); + } + + private void UpdateIndexToPrev() + { + if (_currentIndex > 0) + { + _currentIndex--; + } + else + { + _currentIndex = _loadSceneStoryDatas.Count - 1; + } + SetStoryInfo(_currentIndex); + } + + private void UpdateIndicator(int index) + { + if (_indicatorList.Count > 1) + { + _indicatorList[index].value = true; + } + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard/ResourceDownloadCardFactory.cs b/SVSim.BattleEngine/Engine/Wizard/ResourceDownloadCardFactory.cs new file mode 100644 index 0000000..e7661d4 --- /dev/null +++ b/SVSim.BattleEngine/Engine/Wizard/ResourceDownloadCardFactory.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using Cute; +using UnityEngine; + +namespace Wizard; + +public class ResourceDownloadCardFactory : MonoBehaviour +{ + private List _loadFileList = new List(); + + private static string GetClassIconPath(CardBasePrm.ClanType classType, bool isFetch) + { + int num = (int)classType; + return Toolbox.ResourcesManager.GetAssetTypePath("class_card_" + num.ToString("00"), ResourcesManager.AssetLoadPathType.CardFrameClassIcon, isFetch); + } + + public bool CanView(List cardIdList) + { + foreach (string load in GetLoadList(cardIdList, needCardFrame: true)) + { + AssetHandle assetHandle = Toolbox.AssetManager.GetAssetHandle(load); + if (load == null) + { + return false; + } + if (assetHandle.isReDownloadAsset(CustomPreference.IsNormalResource)) + { + return false; + } + } + return true; + } + + private List GetLoadList(List cardIdList, bool needCardFrame) + { + List cardPath = GetCardPath(cardIdList); + if (needCardFrame) + { + cardPath.Add(UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.CardFrame)); + } + for (int i = 0; i < 9; i++) + { + cardPath.Add(GetClassIconPath((CardBasePrm.ClanType)i, isFetch: false)); + } + return cardPath; + } + + public void Load(List cardIdList, GameObject parent, Action> onFinish) + { + bool preferSynchronousLoad = true; + List loadList = GetLoadList(cardIdList, needCardFrame: false); + _loadFileList.AddRange(loadList); + loadList.Add(UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.CardFrame)); + UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroup(loadList, delegate + { + UIManager.GetInstance().AddResidentAtlas(UIAtlasManager.AssetBundleNames.CardFrame); + CreateAllCard(cardIdList, parent, onFinish); + }, isProgress: true, preferSynchronousLoad)); + } + + private List GetCardPath(List cardIdList) + { + CardMaster.CardMasterId cardMasterId = CardMaster.CardMasterId.Default; + List list = new List(); + foreach (int cardId in cardIdList) + { + CardParameter cardParameterFromId = CardMaster.GetInstance(cardMasterId).GetCardParameterFromId(cardId); + string requestPath = GetRequestPath(cardParameterFromId); + if (!string.IsNullOrEmpty(requestPath)) + { + list.Add(requestPath); + } + } + return list; + } + + private string GetRequestPath(CardParameter param) + { + int resourceCardId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(param.NormalCardId).ResourceCardId; + if (param.CharType == CardBasePrm.CharaType.NORMAL) + { + return Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.UnitCardMaterial); + } + return Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial); + } + + private void CreateAllCard(List cardIdList, GameObject parent, Action> onFinish) + { + GameObject prefab = Resources.Load("Prefab/Cards/CardListTemplate") as GameObject; + List list = new List(); + foreach (int cardId in cardIdList) + { + list.Add(CreateCard(cardId, parent, prefab)); + } + onFinish.Call(list); + } + + private CardListTemplate CreateCard(int cardId, GameObject parent, GameObject prefab) + { + CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(cardId); + CardListTemplate component = NGUITools.AddChild(parent, prefab).GetComponent(); + component.SetId(cardId); + string text = Data.SystemText.Get($"LoadCard_{cardId}"); + component._nameLabel.text = text; + component._newLabel.gameObject.SetActive(value: false); + component.RotationOnlyIconVisible = cardParameterFromId.IsResurgentCard; + if (cardParameterFromId.CharType == CardBasePrm.CharaType.NORMAL) + { + component._atkLabel.text = cardParameterFromId.Atk.ToString(); + component._lifeLabel.text = cardParameterFromId.Life.ToString(); + UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(component._atkLabel, cardParameterFromId.IsFoil); + UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(component._lifeLabel, cardParameterFromId.IsFoil); + } + component._costLabel.text = cardParameterFromId.Cost.ToString(); + UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(component._costLabel, cardParameterFromId.IsFoil); + component._cardTexture.material = UIBase_CardManager.Get2dCardMaterial(cardParameterFromId); + component._cardTexture.transform.localPosition += new Vector3(0f, 0f, 3f); + component._frameSprite.transform.localPosition += new Vector3(0f, 0f, 1f); + component._cardTexture.uvRect = Global.CARD_2D_UV_RECT; + component.SetFrame(cardParameterFromId); + Global.SetRepositionNameLabel(component._nameLabel, text, is2D: true); + UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(component._nameLabel, cardParameterFromId.IsFoil); + component._classIconTexture.mainTexture = ClassCharaPrm.GetClassIconTexture((int)cardParameterFromId.Clan); + component.SetBossRushIconSprite(string.Empty); + return component; + } + + private void OnDestroy() + { + Release(); + } + + public void Release() + { + Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); + _loadFileList.Clear(); + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleWatchTaskBase.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleWatchTaskBase.cs new file mode 100644 index 0000000..db0607c --- /dev/null +++ b/SVSim.BattleEngine/Engine/Wizard/RoomBattleWatchTaskBase.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using LitJson; + +namespace Wizard; + +public class RoomBattleWatchTaskBase : BaseTask +{ + public class UserInfo + { + public int battlePoint; + + public int degreeId; + + public long emblemId; + + public string countryCode; + + public int rank; + + public string userName; + + public int viewerId; + + public bool IsOfficialUser { get; set; } + + public UserInfo() + { + } + + public UserInfo(Dictionary data) + { + viewerId = Convert.ToInt32(data["viewerId"]); + countryCode = data["country_code"].ToString(); + userName = data["userName"].ToString(); + rank = Convert.ToInt32(data["rank"]); + battlePoint = Convert.ToInt32(data["battlePoint"]); + emblemId = Convert.ToInt32(data["emblemId"]); + degreeId = Convert.ToInt32(data["degreeId"]); + IsOfficialUser = Convert.ToInt32(data["isOfficial"]) == 1; + } + } + + public int result_reason; + + public string node_server_url; + + public UserInfo owner_info; + + public UserInfo visitor_info; + + public BattleParameter BattleParameterInstance { get; private set; } + + protected override int Parse() + { + int num = base.Parse(); + if (num != 1) + { + return num; + } + JsonData jsonData = base.ResponseData["data"]; + result_reason = jsonData["result_reason"].ToInt(); + if (result_reason == 0) + { + if (jsonData.Keys.Contains("owner_info")) + { + ParseUserInfo(jsonData["owner_info"], ref owner_info); + } + if (jsonData.Keys.Contains("visitor_info")) + { + ParseUserInfo(jsonData["visitor_info"], ref visitor_info); + } + node_server_url = jsonData["node_server_url"].ToString(); + } + if (jsonData.Keys.Contains("is_admin")) + { + bool flag = Convert.ToBoolean(jsonData["is_admin"].ToInt()); + GameMgr.GetIns().IsAdmin = flag; + GameMgr.GetIns().HasAuthAdmin = flag; + } + else + { + GameMgr.GetIns().IsAdmin = false; + GameMgr.GetIns().HasAuthAdmin = false; + } + BattleParameterInstance = BattleParameter.JsonToBattleParameter(base.ResponseData["data"]); + if (BattleParameterInstance.BattleType == NetworkDefine.ServerBattleType.RoomTwoPick) + { + GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomTwoPick; + GameMgr.GetIns().GetDataMgr().TwoPickFormat = BattleParameterInstance.TwoPickFormat; + } + else + { + GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomBattle; + } + return num; + } + + private void ParseUserInfo(JsonData receive, ref UserInfo info) + { + if (receive != null) + { + info = new UserInfo(); + info.viewerId = receive["viewer_id"].ToInt(); + info.battlePoint = receive["battlePoint"].ToInt(); + info.degreeId = receive["degreeId"].ToInt(); + info.emblemId = receive["emblemId"].ToLong(); + info.countryCode = receive["country_code"].ToString(); + info.rank = receive["rank"].ToInt(); + info.userName = receive["userName"].ToString(); + info.IsOfficialUser = receive["isOfficial"].ToInt() == 1; + } + } +} diff --git a/SVSim.BattleEngine/Shim/Generated/DeckUpdateTask.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckUpdateTask.g.cs new file mode 100644 index 0000000..9ba381d --- /dev/null +++ b/SVSim.BattleEngine/Shim/Generated/DeckUpdateTask.g.cs @@ -0,0 +1,17 @@ +// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard\DeckUpdateTask.cs +namespace Wizard +{ +public partial class DeckUpdateTask +{ + public partial class DeckUpdateTaskParam { } + public partial class DeckUpdateTaskParamWithSubClass { } + private const int IS_DECK_DELETE_OFF = 0; + private const int IS_DECK_DELETE_ON = 1; + private Format _updateDeckFormat; + public AchievedInfo AchievedInfo { get; set; } + public DeckUpdateTask() { } + public void SetParameter(int deck_no, int class_id, int leader_skin_id, bool isRandomLeaderSkin, int[] leaderSkinIdList, long sleeve_id, string deck_name, bool is_delete, int[] card_id_array, Format format, string myRotationId) { } + public void SetParameterWithSubClass(int deckNo, int classId, int subClassId, int leaderSkinId, bool isRandomLeaderSkin, int[] leaderSkinIdList, long sleeveId, string deckName, bool isDelete, int[] cardIdArray, Format format) { } + protected int Parse() => default!; +} +} diff --git a/SVSim.BattleEngine/Shim/Generated/EvolutionTouchProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/EvolutionTouchProcessor.g.cs new file mode 100644 index 0000000..e7cf71e --- /dev/null +++ b/SVSim.BattleEngine/Shim/Generated/EvolutionTouchProcessor.g.cs @@ -0,0 +1,38 @@ +// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.Touch\EvolutionTouchProcessor.cs +using System; +using System.Collections.Generic; +using System.Linq; +using Cute; +using UnityEngine; +using Wizard.Battle.Resource; +using Wizard.Battle.UI; +using Wizard.Battle.View.Vfx; +namespace Wizard.Battle.Touch +{ +public partial class EvolutionTouchProcessor +{ + private readonly BattleManagerBase _battleMgr; + private readonly BattlePlayer _battlePlayer; + private readonly IEnumerable _targetCards; + private GameObject _lastFocusedObject; + private BattleCardBase _lastFocusedCard; + private InputMgr _inputMgr; + private IBattleResourceMgr _resourceMgr; + private bool _isForceEnd; + private bool _isDetailPanelEvolution; + public Func OnAfterEvolveDragSelect; + private bool _stopSelectFlag; + private List _selectSkills; + private readonly Prediction _prediction; + private readonly Func, List, bool, SkillTargetSelectTouchProcessor> _getSkillTargetSelectTouchProcessorFunc; + public EvolutionTouchProcessor(BattleManagerBase battleMgr, InputMgr inputMgr, IBattleResourceMgr resourceMgr, bool inDetailPanelEvolution, Func, List, bool, SkillTargetSelectTouchProcessor> getSkillTargetSelectTouchProcessorFunc, Prediction prediction) { } + public VfxBase Start() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); + public VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); + public VfxWith End() => default!; + protected VfxBase CreateEvolutionSelectEndVfx(BattleCardBase targetCard) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); + private BattleCardBase GetBattleCardFromObject(GameObject cardObject) => default!; + public virtual VfxBase ShowEvolutionMessage() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); + public virtual bool CheckIsEnd() => default!; + public void SetStopSelectFlag() { } +} +} diff --git a/SVSim.BattleEngine/Shim/Generated/LoadingViewManager.g.cs b/SVSim.BattleEngine/Shim/Generated/LoadingViewManager.g.cs new file mode 100644 index 0000000..c701280 --- /dev/null +++ b/SVSim.BattleEngine/Shim/Generated/LoadingViewManager.g.cs @@ -0,0 +1,40 @@ +// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard\LoadingViewManager.cs +using Cute; +using UnityEngine; +namespace Wizard +{ +public partial class LoadingViewManager +{ + private LoadingInScene _lodingInSceneObj; + private bool _loadingInSceneForce; + private bool _loadingInSceneCenterForce; + private LoadingInScene _lodingInSceneCenterObj; + private LoadingInScene _lodingInSceneMatchingObj; + private LoadingInScene _lodingInSceneBattleObj; + private LoadingBase _loadingInDownLoad; + private LoadingInScene _loadingInNetworkOffline; + private GameObject _bgDownloadInfo; + private int _loadingCnt; + private const float LOADINGINSCENE_ALPHA = 1f; + private const float LOADINGINSCENE_PANELFADEINDUR = 0.1f; + public bool IsLoadingScene { get; set; } + public void CreateResourceDownload(LoadingDownLoad.eType Type) { } + public void FadeOutResourceDownload() { } + public void CloseResourceDownload() { } + public bool IsOpenAny() => default!; + public bool IsEnableInSceneCenterObj() => default!; + public void CreateInScene(bool notBlack = false, bool notCollider = false, bool force = true, int playIndex = -1) { } + public void CloseInScene(bool force = true) { } + public LoadingInScene CreateInSceneMatching(bool notBlack = false, bool notCollider = false) => default!; + public LoadingInScene CloseInSceneMatching() => default!; + public LoadingInScene CreateInSceneBattle(bool notBlack = false, bool notCollider = false) => default!; + public LoadingInScene CloseInSceneBattle() => default!; + public void CreateInSceneCenter(bool notBlack = false, bool notCollider = false, bool force = true, string overrideText = null) { } + public void CloseInSceneCenter(bool force = true, bool disableCollider = false) { } + public void CreateInSceneNetworkOffline() { } + public void CloseInSceneNotNetwork() { } + public void CreateBackgroundDownloadInfo() { } + public void DestroyBackgroundDownloadInfo() { } + public void UpdateLoadingNum(int percent) { } +} +} diff --git a/SVSim.BattleEngine/Shim/Generated/MyPageTask.g.cs b/SVSim.BattleEngine/Shim/Generated/MyPageTask.g.cs new file mode 100644 index 0000000..c2542ac --- /dev/null +++ b/SVSim.BattleEngine/Shim/Generated/MyPageTask.g.cs @@ -0,0 +1,19 @@ +// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard\MyPageTask.cs +using System; +using System.Collections.Generic; +using Cute; +using LitJson; +using UnityEngine; +using Wizard.Lottery; +namespace Wizard +{ +public partial class MyPageTask +{ + public partial class MyPageTaskParam { } + private const string MAINTENANCE_TIME_KEY = "maintenance_time"; + public MyPageTask() { } + public void SetParameter() { } + protected int Parse() => default!; + private void ShowNotification(JsonData responseData) { } +} +} diff --git a/SVSim.BattleEngine/Shim/Generated/NonDialogPopup.g.cs b/SVSim.BattleEngine/Shim/Generated/NonDialogPopup.g.cs new file mode 100644 index 0000000..e30b311 --- /dev/null +++ b/SVSim.BattleEngine/Shim/Generated/NonDialogPopup.g.cs @@ -0,0 +1,12 @@ +// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View\NonDialogPopup.cs +using System; +using UnityEngine; +namespace Wizard.Battle.View +{ +public partial class NonDialogPopup +{ + public Action OnClose; + public virtual void Close() { } + private void OnDestroy() { } +} +} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerControllerForWatching.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerControllerForWatching.g.cs new file mode 100644 index 0000000..990191a --- /dev/null +++ b/SVSim.BattleEngine/Shim/Generated/PlayerControllerForWatching.g.cs @@ -0,0 +1,126 @@ +// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.RoomMatch\PlayerControllerForWatching.cs +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Cute; +using LitJson; +using UnityEngine; +using Wizard.ErrorDialog; +using Wizard.Scripts.Network.Data.TableData.Arena.TwoPick; +namespace Wizard.RoomMatch +{ +public partial class PlayerControllerForWatching +{ + public partial struct TwoPickChoice { } + public enum SEND_PARAMETER + { + InitWatch, + Watch, + GetDeck, + users, + wSeq, + pRSeq + } + public enum STATE + { + INIT = -1, + PREPARATION = 200, + READY = 201, + LOAD = 202, + LOADEND = 310, + BATTLE = 400, + MAX = 400 + } + private const float WATCH_INTERVAL = 2f; + private const float ADMIN_WATCH_INTERVAL = 0.2f; + private const int LOADING_TIMER = 30; + protected const int ROOM_TIME_OUT = 30; + private const float INIT_WATCH_TIME_OUT_MILLI_SECOND = 15f; + public const string MULTI_DECK_KEY_REMATCH = "MultiDeckRematch"; + private bool _isBattleWatchStart; + private bool isExistBattle; + private bool isEmitEnterRoom; + private NetworkWatchBattleMgr _networkBattleMgr; + private WatchDataHandler _watchDataHandler; + private Coroutine _coroutineBeforeBattle; + private float _constWaitTime; + private Coroutine _timeOutCoroutine; + private Coroutine _timeOutResultCoroutine; + private int _currentState; + private float _roomTimeOutCounter; + protected bool _isTimeOutSelf; + private float _watchEmitInterval; + private bool _receivedBattleInfo; + private bool resetSeq; + public TwoPickWatchData TwoPickData; + public bool isRoomEmitWait; + private int _leaveCountOwner; + private int _leaveCountGuest; + private List _saveTwoPickDeck; + private List _selectPickSide; + public bool IsReceivedInitWatch { get; set; } + public int SeqenceNo { get; set; } + public bool IsExistBattleReceiver { get; set; } + public PlayerControllerForWatching(Player target, RoomConnectController room) { } + public void ResetWatchHandler() { } + public void ResetReceiveEvent() { } + public int GetCurrentState() => default!; + private IEnumerator StartWatch() => default!; + private Dictionary CreateInitWatchData() => default!; + public void Init(bool isRecovery) { } + public void EnterRoomBattleServer() { } + public void InitilizeRoomBattleServer(string roomId) { } + public void EnterRoomServer(string roomId) { } + private void OnSuccessWatchRoom(RoomBattleWatchTaskBase task, string roomId) { } + public void SetupUserInfo(RoomBattleWatchTaskBase.UserInfo receiveData, Player player) { } + private new void ConnectAPI(BaseTask task, Action callback) { } + private void ServerError(int in_ErrorNo) { } + public void OnGatheringError(int resultCode, UIManager.ViewScene scene) { } + public void OnGatheringError(string title, string text, UIManager.ViewScene scene) { } + private void ChangeViewScene(UIManager.ViewScene scene) { } + public void OnReceived(Dictionary received) { } + public void ReceiveLeaveCount(Dictionary received) { } + public void ReceiveWaitTime(float waitTime) { } + public void ReceiveBanDeckDecide(Dictionary received, bool enableEventCall) { } + public static bool IsChangeDeckList(List oldDeckData, List newDeckData) => default!; + public void ReceiveInitWatchDeckList(Dictionary received, bool enableEventCall) { } + private void ReceivedWatch(Dictionary received) { } + public void ReceiveOpponentBeginCreateDeck() { } + public void ReceiveTwoPickBeginCreateDeck(Dictionary getData) { } + public void ReceiveTwoPickSelectClass(Dictionary getData) { } + private void ReceivedGetDeck(Dictionary received) { } + private void StartTimeOut(int timer) { } + private void StopTimeOut() { } + private void StartResultTimeOut(int timer) { } + private void StopResultTimeOut() { } + private IEnumerator StartTimeOutCorutine(int timer) => default!; + private void ShowErrorDialog() { } + private void ReturnScene() { } + private void ChangeScene() { } + private IEnumerator BattleEndCoroutin(Action callback) => default!; + private IEnumerator WaitTillBattleCreate() => default!; + private int DecideFirstUser(int id) => default!; + private bool isOwner(int id) => default!; + private void ParseWatchData(Dictionary received, out int state) { state = default!; } + private void ParseLeaveCount(Dictionary received, int state, bool anyEntry) { } + public TwoPickCardSelectBase.PICK_SIDE GetTwoPickSelectSide(int pickTurn) => default!; + private void ParseTwoPickSelectCard(Dictionary getData) { } + private void Receive2PickSelectCardInfo(Dictionary deckInfo) { } + public void Receive2PickSelectCardSet(Dictionary getData) { } + public void Receive2PickDeckInfo(Dictionary deckInfo) { } + public void ReceiveDraftDeckCreate(Dictionary draftDeck) { } + private void Convert2PickDeckData(Dictionary draftDeck, out List classId, out List skinId, out List[] tempCardIdList) { classId = default!; skinId = default!; tempCardIdList = default!; } + protected void TwoPickCandidateCardSet(Dictionary inGetData) { } + public void TwoPickReset() { } + public void ReceiveTwoPickSelectedCardNumber(Dictionary getData) { } + public void ReceiveRoomNotify(Dictionary getData) { } + public void ReceiveChatStamp(Dictionary getData) { } + protected void TwoPickDeckReset() { } + public void ReceiveDeckEntry(Dictionary getData) { } + public void ReceiveRematch() { } + public void CreateRoomServer(RoomConnectController room) { } + public void EmitGetDeck(int viewerId) { } + public void OnLeaveGuest() { } +} +} diff --git a/SVSim.BattleEngine/Shim/Generated/ReplayController.g.cs b/SVSim.BattleEngine/Shim/Generated/ReplayController.g.cs new file mode 100644 index 0000000..d34c735 --- /dev/null +++ b/SVSim.BattleEngine/Shim/Generated/ReplayController.g.cs @@ -0,0 +1,29 @@ +// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Replay\ReplayController.cs +using System.Collections; +using System.Collections.Generic; +using Wizard.RoomMatch; +namespace Wizard.Replay +{ +public partial class ReplayController +{ + private NetworkReplayBattleMgr _networkBattleMgr; + private float _constWaitTime; + private Player OwnTarget; + private Player OppoTarget; + private Dictionary ReplayLog; + private Matching _matching; + public ReplayDataHandler _replayDataHandler { get; set; } + public static void StartPlayReplay(ReplayInfoItem replayInfo, UIManager.ViewScene backScene, UIManager.ChangeViewSceneParam backSceneParam = null) { } + public static void StartPlayReplay(UIManager.ViewScene backScene, UIManager.ChangeViewSceneParam backSceneParam = null, bool isNewReplay = false, string battleId = "") { } + private ReplayController(bool isNewReplay, string battleId) { } + private IEnumerator SetUpBattle(bool isNewReplay, string battleId) => default!; + private void SetupUserInfo(RoomBattleWatchTaskBase.UserInfo reveive, Player player) { } + private void SetupReplayData(bool isNewReplay, string battleId) { } + private IEnumerator WaitTillBattleCreate(bool isNewReplay, string battleId) => default!; + private void OnReplayReady() { } + private int DecideFirstUser(int id) => default!; + private bool IsOwner(int id) => default!; + private void ParseReplayData() { } + private Dictionary ParseData(Player player) => default!; +} +} diff --git a/SVSim.BattleEngine/Shim/Generated/StoryChapterSelectionUtility.g.cs b/SVSim.BattleEngine/Shim/Generated/StoryChapterSelectionUtility.g.cs new file mode 100644 index 0000000..1058de0 --- /dev/null +++ b/SVSim.BattleEngine/Shim/Generated/StoryChapterSelectionUtility.g.cs @@ -0,0 +1,27 @@ +// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection\StoryChapterSelectionUtility.cs +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Cute; +using UnityEngine; +namespace Wizard.Story.ChapterSelection +{ +public partial class StoryChapterSelectionUtility +{ + public static TopBar CreateTopBar(GameObject parent, SelectedStoryInfo storyInfo, UIManager.ChangeViewSceneParam changeViewSceneParam, int sortingOrder) => default!; + public static UIManager.ViewScene GetBackScene(SelectedStoryInfo storyInfo) => default!; + public static TitlePanelBase CreateTitlePanel(GameObject parent, CharaInfoPanel charaInfoPrefab, SectionInfoPanel sectionInfoPrefab, SelectedStoryInfo storyInfo) => default!; + private static TitlePanelBase CreateCharaInfoPanel(GameObject parent, CharaInfoPanel prefab, int charaId) => default!; + private static TitlePanelBase CreateSectionInfoPanel(GameObject parent, SectionInfoPanel prefab, string sectionName) => default!; + public static AreaSelInfo CreateChapterRewardPanel(GameObject parent, AreaSelInfo prefab) => default!; + public static IEnumerator StoryInfoTaskCoroutine(SelectedStoryInfo storyInfo) => default!; + public static IEnumerator LoadAiMasterCoroutine(IReadOnlyList chapterDatas) => default!; + private static List GetAiMasterLoadInfos(IReadOnlyList chapterDatas) => default!; + public static void RegisterMaintenanceChapters(IReadOnlyList chapterDatas) { } + private static void RegisterMaintenanceChapter(StoryChapterData chapterData) { } + private static bool IsMaintenanceChapter(StoryChapterData chapterData) => default!; + private static bool IsMaintenanceAiDeck(int aiId) => default!; + public static void RegisterStoryBattleDeck(DeckData deck) { } + public static void RegisterStoryBattleData(BattleSettingData data) { } +} +} diff --git a/SVSim.BattleEngine/Shim/Generated/WatchDataHandler.g.cs b/SVSim.BattleEngine/Shim/Generated/WatchDataHandler.g.cs new file mode 100644 index 0000000..bd93b1b --- /dev/null +++ b/SVSim.BattleEngine/Shim/Generated/WatchDataHandler.g.cs @@ -0,0 +1,43 @@ +// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.RoomMatch\WatchDataHandler.cs +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +namespace Wizard.RoomMatch +{ +public partial class WatchDataHandler +{ + protected bool isEmitEnterRoom; + protected NetworkWatchBattleMgr _networkBattleMgr; + protected RoomConnectController _room; + private PlayerControllerForWatching _controllerForWatching; + protected StockReceiveMgr stockReceiveMessageMgr; + protected bool _isNewReplay; + protected string _battleId; + protected Coroutine _coroutineInBattle; + protected const string DATA_PARAM_VID = "vid"; + protected const string DATA_PARAM_URI = "uri"; + protected const string DATA_PARAM_TIME = "time"; + protected const string DATA_PARAM_TYPE = "type"; + protected const string DATA_PARAM_VALUE = "value"; + protected const string DATA_PARAM_CHAT_STAMP = "chatStamp"; + protected float ConstWaitTime; + private bool isFirstSeqSetting; + public int receivedMaxSequenceNum { get; set; } + public bool IsSetFirstCards { get; set; } + public WatchDataHandler(NetworkWatchBattleMgr nBattleMgr, RoomConnectController room, float waitTime, bool isNewReplay = false, string battleId = "") { } + protected virtual void Setup(NetworkWatchBattleMgr nBattleMgr, RoomConnectController room, float waitTime) { } + public virtual void Stop() { } + protected virtual void CheckConnection() { } + public void OnBattleReceived(Dictionary received) { } + protected virtual void ParseBattleWatchData(Dictionary received) { } + private void SetFirstCardsFromDeal(Dictionary received) { } + protected bool IsBattleData(Dictionary data) => default!; + public int GetWatchSequenceNum() => default!; + public int GetCurrentSequenceNumber() => default!; + public bool IsIncludedUri(string uri) => default!; + protected virtual IEnumerator StockDataPlayer() => default!; + protected void NextStockReceive(Dictionary frontData, bool isUpdateSequence = true) { } + public bool isOwner(string idStr) => default!; +} +} diff --git a/SVSim.BattleEngine/Shim/Generated/_BaseClauses.g.cs b/SVSim.BattleEngine/Shim/Generated/_BaseClauses.g.cs index d20ac69..f0dc5a2 100644 --- a/SVSim.BattleEngine/Shim/Generated/_BaseClauses.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/_BaseClauses.g.cs @@ -35,6 +35,7 @@ namespace Wizard.Battle.View.Vfx { public partial class DeckOutWinVfx : Sequenti namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { public partial class DeckSelectionConfirmDialogDisplay : ProcessingBase { } } namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { public partial class DeckSelectionDialogDisplay : ProcessingBase { } } namespace Wizard.Battle.View.Vfx { public partial class DeckSelfSummonVfx : SequentialVfxPlayer { } } +namespace Wizard { public partial class DeckUpdateTask : BaseTask { } } namespace Wizard.Battle.View.Vfx { public partial class DefaultOpeningVfx : OpeningVfx { } } namespace Wizard.Battle.View.Vfx { public partial class DelaySetupVfx : VfxBase { } } namespace Wizard.Battle.View.Vfx { public partial class DestroyVfx : VfxWithLoadingSequential { } } @@ -82,10 +83,12 @@ namespace Wizard.Battle.View.Vfx { public partial class MetamorphoseHandCardVfx namespace Wizard.Battle.View.Vfx { public partial class MetamorphoseInPlayCardVfx : SequentialVfxPlayer { } } namespace Wizard.Battle.View.Vfx { public partial class MoveToDeckVfx : SequentialVfxPlayer { } } namespace Wizard.Battle.View.Vfx { public partial class MulliganEndVfx : SequentialVfxPlayer { } } +namespace Wizard { public partial class MyPageTask : BaseTask { } } namespace Wizard.Battle.UI { public partial class MyRotationBonusItem : MonoBehaviour { } } namespace Wizard.Battle.UI { public partial class NecromanceInfomationUI : ClassInfomationUIBase { } } namespace Wizard.Battle.View.Vfx { public partial class NecromanceSkillActivationVfx : LoadAndPlayEffectVfx { } } namespace Wizard.Battle.UI { public partial class NemesisInfomationUI : ClassInfomationUIBase { } } +namespace Wizard.Battle.View { public partial class NonDialogPopup : MonoBehaviour { } } namespace Wizard.Battle.View { public partial class NullClassBattleCardView : NullBattleCardView { } } namespace Wizard.Battle.View { public partial class NullEnemyBattleView : BattleEnemyView { } } namespace Wizard.Battle.View { public partial class NullFieldBattleCardView : FieldBattleCardView { } } @@ -105,6 +108,7 @@ namespace Wizard.Battle.View.Vfx { public partial class PlayerAndEnemyReadyVfx : namespace Wizard.Battle.View { public partial class PlayerClassBattleCardView : ClassBattleCardViewBase { } } namespace Wizard.Battle.View.Vfx { public partial class PlayerClassCardVfxCreator : ClassCardVfxCreatorBase { } } namespace Wizard.RoomMatch { public partial class PlayerControllerForOwn : PlayerController { } } +namespace Wizard.RoomMatch { public partial class PlayerControllerForWatching : PlayerController { } } namespace Wizard.Battle.View.Vfx { public partial class PlayerDeckOutVfx : SequentialVfxPlayer { } } namespace Wizard.Battle.View.Vfx { public partial class PlayerDrawCardVfx : SequentialVfxPlayer { } } namespace Wizard.Battle.View.Vfx { public partial class PlayerEndDrawVfx : SequentialVfxPlayer { } } diff --git a/SVSim.BattleEngine/Shim/GodObjects/GodObjects.cs b/SVSim.BattleEngine/Shim/GodObjects/GodObjects.cs index 497269f..76566ec 100644 --- a/SVSim.BattleEngine/Shim/GodObjects/GodObjects.cs +++ b/SVSim.BattleEngine/Shim/GodObjects/GodObjects.cs @@ -142,10 +142,10 @@ namespace Wizard // RankWinnerReward, CardDestructTask, CardCreateTask, MissionInfoTask already exist // in the copied set (declared in other files) -- only these three were missing. public partial class MailTopTask { } - public class MyPageTask { } - public class DeckUpdateTask { } + public partial class MyPageTask { } + public partial class DeckUpdateTask { } // UIManager no-op return types (empty stubs; methods returning them return null) - public class LoadingViewManager { } + public partial class LoadingViewManager { } public partial class AccountTransferHelper { } public class DialogManager { } public class ApplicationFinishManager { } diff --git a/SVSim.BattleEngine/Shim/View/ClosureStubs.cs b/SVSim.BattleEngine/Shim/View/ClosureStubs.cs index 18813b5..ecece54 100644 --- a/SVSim.BattleEngine/Shim/View/ClosureStubs.cs +++ b/SVSim.BattleEngine/Shim/View/ClosureStubs.cs @@ -28,6 +28,13 @@ namespace Wizard.RoomMatch public enum ROOM_URI { } } +namespace Wizard.RoomMatch +{ + // referenced as field/param types by the watch/replay controller shells (off battle path). + public class TwoPickWatchData { } + public class ReplayDataHandler { } +} + namespace Wizard.Battle.View.Vfx { // VfxBase subclass declared in StartPickCardVfx.cs (decomp); referenced as a type by StartSummonCardVfx shell. diff --git a/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs b/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs index a59e43a..0bc3f96 100644 --- a/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs +++ b/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs @@ -53,7 +53,7 @@ namespace Wizard.Battle.View namespace Wizard.Battle.View.Vfx { // Base of the copied PuzzleBattleManager.PuzzleOpeningVfx (ctor + abstract override). - public abstract class OpeningVfx : SequentialVfxPlayer + public abstract partial class OpeningVfx : SequentialVfxPlayer { protected OpeningVfx(BackGroundBase backGround) { } public abstract void RegisterOpeningVfx(ClassBattleCardBase playerClass, ClassBattleCardBase enemyClass); @@ -88,7 +88,7 @@ namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult namespace Wizard.RoomMatch { - public class PlayerControllerForWatching { } + public partial class PlayerControllerForWatching { } public partial class RoomRuleSetting { } } diff --git a/SVSim.BattleEngine/Shim/View/StoryWorldStubs.cs b/SVSim.BattleEngine/Shim/View/StoryWorldStubs.cs index 1beef42..5f25967 100644 --- a/SVSim.BattleEngine/Shim/View/StoryWorldStubs.cs +++ b/SVSim.BattleEngine/Shim/View/StoryWorldStubs.cs @@ -27,5 +27,5 @@ namespace Wizard.Story.ChapterSelection { public class SectionInfoPanel { } public class CharaInfoPanel { } - public class StoryChapterSelectionUtility { } + public partial class StoryChapterSelectionUtility { } } diff --git a/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs b/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs index 7026bae..01be934 100644 --- a/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs +++ b/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs @@ -13,7 +13,7 @@ namespace Wizard.Battle.View public class BuildInfo { } // AttackTargetSelectInfo provided by Generated/BattleCardView_AttackTargetSelectInfo.g.cs } - public class NonDialogPopup { public virtual void Close() { } } + public partial class NonDialogPopup : UnityEngine.MonoBehaviour { } // Close() in Generated/NonDialogPopup.g.cs public abstract class BattlePlayerViewBase { public enum BattleDialogItem { Menu, Retire } @@ -40,7 +40,7 @@ namespace Wizard.Battle.UI namespace Wizard.Battle.Touch { public class SkillTargetSelectTouchProcessor { } - public class EvolutionTouchProcessor { } + public partial class EvolutionTouchProcessor { } public class SetCardProcessor { } public class EvolutionSimpleProcessor { } public class EmotionTouchProcessor { } @@ -59,12 +59,12 @@ namespace Wizard.Battle.Replay namespace Wizard.Replay { - public class ReplayController { } + public partial class ReplayController { } } namespace Wizard.RoomMatch { - public class WatchDataHandler { } + public partial class WatchDataHandler { } // RoomConnectController (members + BattleRule/PositionMode enums + InitializeParameter) // provided by Generated/RoomConnectController*.g.cs }