engine cleanup passes 4-7 + multi-instancing ambient rip

Squashes 146 commits from battle-engine-extraction. Net: 2,045 files changed,
+11,896 / -158,687 lines. Ships engine passes 4-7 (dead-code cull, view-layer
stub, receive-path shrink) plus the Phase-5 AsyncLocal ambient deletion that
turns concurrent battles into a type-system property rather than a scope
contract.

## What landed

**Passes 4-7 (chunks 1-34):** Extended the Phase-4 const-false collapse into a
cascading cull across the skill graph, view layer, and receive-path periphery.
Six mode flags (IsWatchBattle/IsReplayBattle/IsAdmin/IsAdminWatch/IsPuzzleQuest/
IsAINetwork) became `const false`, every guarded block deleted. Field*.cs
subclass ctors + BackGroundBase + ObjectChecker culled to no-ops. Mulligan
family reworked to take a mgr param through IMulliganMgr.InitMulligan.
Emotion/Recovery/Resource clusters null-stubbed. Prediction/OperationSimulator/
skill filters converted from static ambient reads to per-mgr reads via
SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr / ins.BattleMgr / this.BattleMgr.

**Phase-5 ambient rip (chunks 35-47):** Deleted BattleAmbient / BattleAmbient-
Context / TestBattleScope in full. Every per-battle mutable slot now lives on
the mgr instance itself:
  mgr.InstanceIsForecast / InstanceIsRandomDraw / InstanceRecoveryInfo /
  InstanceViewerId / InstanceNetworkAgent / GameMgr
BattleManagerBase.GetIns() returns null unconditionally; the residual static
flags + 3 façades (Certification.ViewerId, Data.BattleRecoveryInfo,
ToolboxGame.RealTimeNetworkAgent) are null-tolerant defaults kept for the
handful of engine-internal readers that still reference their types. Zero
BattleAmbient references anywhere in engine + node + tests.

Added pre-seeded GameMgr ctor overload threaded through the mgr chain
(BattleManagerBase → SingleBattleMgr / NetworkBattleManagerBase → NetworkStandard-
BattleMgr → HeadlessBattleMgr / HeadlessNetworkBattleMgr). Fixtures build a
GameMgr, seed it via HeadlessEngineEnv.SeedCharaIds/SeedNetUser, and pass it
to the mgr's ctor — no ambient reach.

Node side (SVSim.BattleNode/SessionBattleEngine): _ctx replaced with a plain
GameMgr field; 34 `using var _ambient = BattleAmbient.Enter(_ctx)` scope wraps
ripped from every accessor and mutator; EngineGlobalInit.WirePerSessionGameMgr
takes GameMgr as a param and runs from SessionBattleEngine.SetupInternal
BEFORE mgr construction.

Test side: TestBattleScope deleted; 18 fixture [SetUp]s migrated to
`HeadlessEngineEnv.EnsureProcessGlobals()`; MultiInstanceEngineTests rewritten
around per-mgr construction (GetIns() → null is the pinned invariant).

## Regression fixes

- **chunk-48** (MulliganCtrl): chunk-35's `= null` stubs on card lookups broke
  the live receive-driven Deal path (BattlePlayerBase.DrawCard NRE'd downstream
  of NetworkPlayerMulliganCtrl.StartMulliganVfx). Restored the three lookups
  via `_battlePlayer.BattleMgr.GetBattleCardIdx`. Engine tests were satisfied
  by the WireMulliganPhase seam; unit tests exposed the live-path gap.

## Ship state

- SVSim.BattleEngine.Tests: 56/56 pass, 2 skip
- SVSim.UnitTests: 1554/1554 pass (was 1523/31-fail before chunk 48)
- Solution build: 0 source warnings (40 pre-existing NU1902 MessagePack CVEs
  in SVSim.EmulatedEntrypoint, unrelated)
- Sequential PVP smoke: verified live (two back-to-back battles, no regression
  on cleanup/spinup)
- Concurrent PVP smoke: verified live

Adds tools/engine-port/ClosureAnalyzer/ — the Roslyn transitive-type-closure
analyzer needed to make future cascade cleanup safe (per feedback memory
"Engine cleanup needs closure tool" from the 2026-06-28 pass-3 failure).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-03 19:18:54 -04:00
parent 5c1db83967
commit 2d9a6eea4b
2045 changed files with 11704 additions and 158495 deletions

View File

@@ -8,15 +8,6 @@ using Wizard.DeckCardEdit;
public class UICardList : MonoBehaviour
{
private const string FILTER_BTN_LEFT_ON = "pilltab_02_left_on";
private const string FILTER_BTN_LEFT_OFF = "pilltab_02_left_off";
private const string FILTER_BTN_RIGHT_ON = "pilltab_02_right_on";
private const string FILTER_BTN_RIGHT_OFF = "pilltab_02_right_off";
private const string PREMIUM_SELECT_PREFAB_PATH = "UI/DeckList/DeckIntroductionPreferSelect";
private readonly Vector3 MY_ROTATION_FORMAT_ICON_POSITION = new Vector3(167f, 0f, 0f);
@@ -26,10 +17,6 @@ public class UICardList : MonoBehaviour
private readonly Vector3 MY_ROTATION_CARD_NUMBER_MAX_POSITION = new Vector3(59f, 0f, 0f);
private const int MY_ROTATION_CLASS_NAME_WIDTH = 110;
private const int MY_ROTATION_CLASS_NAME_UNDER_LINE_WIDTH = 182;
[SerializeField]
private GameObject _cardListTemplatePrefab;
@@ -41,9 +28,6 @@ public class UICardList : MonoBehaviour
[SerializeField]
private UIScrollView scrollView;
[SerializeField]
private UIScrollBar ScrollBar;
[SerializeField]
private CostCurveUI CostCurve;
@@ -59,12 +43,6 @@ public class UICardList : MonoBehaviour
[SerializeField]
private UIPanel _rootPanel;
[SerializeField]
private UIPanel _scrollPanel;
[SerializeField]
private UIPanel _costCurvePanel;
[SerializeField]
private UILabel _deckClassLabel;
@@ -101,71 +79,15 @@ public class UICardList : MonoBehaviour
[SerializeField]
private UITexture _qrCodeSmallTexture;
[SerializeField]
private UISprite _qrCodeMaintenance;
[SerializeField]
private GameObject _keyboardCloseSelectEffect;
[SerializeField]
private GameObject _deckIntroductionRoot;
[SerializeField]
private GameObject _qrCodeRoot;
[SerializeField]
private UIButton _deckIntroductionRedEtherOffButton;
[SerializeField]
private UIButton _deckIntroductionRedEtherOnButton;
[SerializeField]
private UISprite _deckIntroductionRedEtherOffSprite;
[SerializeField]
private UISprite _deckIntroductionRedEtherOnSprite;
[SerializeField]
private UIButton _redUtilButton;
[SerializeField]
private UILabel _redUtilButtonLabel;
private bool _isEnableShortageCardVisible;
[SerializeField]
private UIButton _deckIntroductionCopyButton;
[SerializeField]
private GameObject _cardEnoughRoot;
[SerializeField]
private GameObject _redEtherEnoughRoot;
[SerializeField]
private GameObject _redEtherNotEnoughRoot;
[SerializeField]
private GameObject _redEtherRoot;
[SerializeField]
private UILabel _useRedEther;
[SerializeField]
private UILabel _haveRedEther;
[SerializeField]
private UILabel _haveRedEtherEnoughCard;
[SerializeField]
private UILabel _haveRedEtherEnough;
[SerializeField]
private UILabel _redEtherAfter;
[SerializeField]
private UILabel _notEnoughRedEther;
[SerializeField]
private GameObject _blueUtilButtonRoot;
@@ -208,12 +130,6 @@ public class UICardList : MonoBehaviour
[SerializeField]
private UISprite _useSubClassFormatIconSprite;
[SerializeField]
private DeckCopyDialog _useSubClassDeckCopyDialog3OptionsPrefab;
[SerializeField]
private SubClassSelectDialog _subClassSelectDialogPrefab;
[SerializeField]
private GameObject _myRotationIconOriginal;
@@ -244,10 +160,6 @@ public class UICardList : MonoBehaviour
[NonSerialized]
public GenerateDeckCodeTask.SubmitDeckType SubmitDeckType = GenerateDeckCodeTask.SubmitDeckType.NORMAL;
private DialogBase _qrCodeDialog;
private static int UpdateCounter;
private List<int> PlayerDataIds;
private Dictionary<int, CardListTemplate> PlayerDataIdDict;
@@ -268,8 +180,6 @@ public class UICardList : MonoBehaviour
private DeckData _deck;
private Dictionary<int, int> _shortageBasicCardIdList = new Dictionary<int, int>();
private Format _format = Format.Max;
private IFormatBehavior _formatBehavior;
@@ -284,23 +194,9 @@ public class UICardList : MonoBehaviour
private bool _isLabelMoved;
private int _selectedSubClass = 10;
private const int DISP_MAX_CARD_TYPE_NUM = 16;
private const int RESET_WAIT_COUNT = 2;
private const float CardSizeScale = 0.65f;
private const float MOVE_BLUE_BUTTON_DISTANCE = 630f;
private bool _isSelectCloseButton;
[NonSerialized]
public bool _loadingEnd;
public bool IsEnableShortageCardVisible => _isEnableShortageCardVisible;
public Action OnCardDetailOpen { get; set; }
public Action OnCardDetailClose { get; set; }
@@ -309,10 +205,6 @@ public class UICardList : MonoBehaviour
public bool IsEnableMyRotationDisplay { get; set; } = true;
public bool IsEnableAvatarBattleDisplay { get; set; } = true;
public bool IsConventionDeckIntroduction { get; set; }
private bool _isShareButtonUse { get; set; }
private void Awake()
@@ -332,40 +224,6 @@ public class UICardList : MonoBehaviour
CostCurve.Initialize(_formatBehavior.CardMasterId);
}
private void Start()
{
_deckIntroductionCopyButton.onClick.Add(new EventDelegate(delegate
{
OnClickDeckCopy();
}));
_deckIntroductionRedEtherOffButton.onClick.Add(new EventDelegate(delegate
{
OnClickShortageCardVisibleButton(visible: false);
}));
_deckIntroductionRedEtherOnButton.onClick.Add(new EventDelegate(delegate
{
OnClickShortageCardVisibleButton(visible: true);
}));
_myRotationIconOriginal.SetActive(value: false);
SetShortageCardVisible(visible: false);
}
private void Update()
{
if (m_ResetFlg)
{
if (UpdateCounter >= 2)
{
ResetScrollImmediately();
}
else
{
UpdateCounter++;
}
}
KeyboardUpdate();
}
private void OnEnable()
{
if (!_isActive)
@@ -382,14 +240,6 @@ public class UICardList : MonoBehaviour
}
}
private void OnDestroy()
{
if (_qrCodeDialog != null)
{
UnityEngine.Object.Destroy(_qrCodeDialog.gameObject);
}
}
public void Init(GameObject in_ParentObject, CardDetailUI in_CardDetail, string in_DeckName, Action in_CloseButtonEvent, string in_LayerName = "Detail", bool in_DetailCameraUse = false, CardBasePrm.ClanType? clan = null, int in_MaxCardNum = 0)
{
RemoveData();
@@ -425,7 +275,7 @@ public class UICardList : MonoBehaviour
CloseBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate
{
in_CloseButtonEvent();
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL);
}));
}
else
@@ -433,7 +283,7 @@ public class UICardList : MonoBehaviour
CloseBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate
{
SetActive(in_Active: false);
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL);
}));
}
SetShareButton(clan);
@@ -441,14 +291,6 @@ public class UICardList : MonoBehaviour
SetEnableBlueButton(isEnable: false);
}
public void SetCameraEnable(bool enable)
{
if (_detailCamera != null)
{
_detailCamera.gameObject.SetActive(enable);
}
}
public void SetFormat(Format inFormat, ConventionDeckList conventionDeckList)
{
_formatBehavior = FormatBehaviorManager.Create(inFormat, conventionDeckList);
@@ -464,16 +306,6 @@ public class UICardList : MonoBehaviour
UpdateDeckInfo();
}
public void SetFormatIcon(string iconSpriteName)
{
if (!(iconSpriteName == _formatIcon.spriteName))
{
_formatIcon.spriteName = iconSpriteName;
_formatIcon.gameObject.SetActive(value: true);
UpdateDeckInfo();
}
}
public void SetLabelPositionToNoDeckName()
{
if (!_isLabelMoved)
@@ -513,17 +345,6 @@ public class UICardList : MonoBehaviour
InitUseSubClassDisplay();
}
public void SetClassName(string name)
{
_deckClassLabel.text = name;
}
public void SetChaosDeckName(string name)
{
SetClassName(name);
_deckClassLabel.width = 136;
}
public void SetDeckName(string in_DeckName)
{
_deckName = in_DeckName;
@@ -555,15 +376,6 @@ public class UICardList : MonoBehaviour
}
}
public void SetPanelDepthOffset(int offsetDepth)
{
UIPanel[] componentsInChildren = base.transform.GetComponentsInChildren<UIPanel>(includeInactive: true);
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].depth += offsetDepth;
}
}
public List<string> GetLoadFileList(List<int> inCardIdList)
{
List<string> list = new List<string>();
@@ -621,11 +433,6 @@ public class UICardList : MonoBehaviour
UpdateDeckInfo();
}
public int getCardNum()
{
return CardCount;
}
public void SetDeck(DeckData deck, ConventionDeckList conventionDeckList, bool isSortIdList = false)
{
_deck = deck;
@@ -681,20 +488,8 @@ public class UICardList : MonoBehaviour
{
return;
}
GameMgr.GetIns().GetDataMgr().SetPlayerAvatarBattleInfo(deck.GetSkinId().ToString());
if (GameMgr.GetIns().GetDataMgr().TryGetPlayerAvatarBattleInfo(out var avatarBattleInfo))
{
SetEnableBlueButton(isEnable: false);
_avatarAbilityButton.onClick.Clear();
_avatarAbilityButton.onClick.Add(new EventDelegate(delegate
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
AvatarAbilityDetailDialog.Create(avatarBattleInfo, deck);
}));
CardDetail.IsShowEvolutionButton = false;
CardDetail.IsShowVoiceButton = false;
CardDetail.IsShowFlavorTextButton = false;
}
// Pre-Phase-5b: SetPlayerAvatarBattleInfo + TryGetPlayerAvatarBattleInfo dropped;
// headless has no avatar battle info to display.
}
public void SetMyRotationInfo(int classId, MyRotationInfo myRotationInfo)
@@ -713,58 +508,6 @@ public class UICardList : MonoBehaviour
_myRotationGrid.Reposition();
}
public void UpdateShortageRedEther()
{
if (_deck == null)
{
return;
}
_shortageBasicCardIdList.Clear();
DeckCardEditUI.ClassSet = _classSet;
MyRotationInfo myRotationInfo = null;
if (_deck != null)
{
myRotationInfo = Data.MyRotationAllInfo.Get(_deck.MyRotationId);
}
List<int> shortageCardList = DeckCardEditUI.GetShortageCardList(_deck.GetCardIdList(), _deck.DeckCopyFormat, _formatBehavior, myRotationInfo);
int num = 0;
foreach (int item in shortageCardList)
{
CardParameter cardParameterFromId = CardMaster.GetInstance(_formatBehavior.CardMasterId).GetCardParameterFromId(item);
num += cardParameterFromId.UseRedEther;
int baseCardId = cardParameterFromId.BaseCardId;
if (_shortageBasicCardIdList.ContainsKey(baseCardId))
{
_shortageBasicCardIdList[baseCardId]++;
}
else
{
_shortageBasicCardIdList[baseCardId] = 1;
}
}
int userRedEtherCount = PlayerStaticData.UserRedEtherCount;
int num2 = num - userRedEtherCount;
_useRedEther.text = num.ToString();
_haveRedEther.text = userRedEtherCount.ToString();
_haveRedEtherEnoughCard.text = userRedEtherCount.ToString();
_haveRedEtherEnough.text = userRedEtherCount.ToString();
_notEnoughRedEther.text = Data.SystemText.Get("Card_0208", num2.ToString());
_redEtherAfter.text = Data.SystemText.Get("Card_0094", (userRedEtherCount - num).ToString());
if (_shortageBasicCardIdList.Count == 0)
{
_cardEnoughRoot.SetActive(value: true);
_redEtherEnoughRoot.gameObject.SetActive(value: false);
_redEtherNotEnoughRoot.gameObject.SetActive(value: false);
}
else
{
_cardEnoughRoot.SetActive(value: false);
bool flag = userRedEtherCount >= num;
_redEtherEnoughRoot.gameObject.SetActive(flag);
_redEtherNotEnoughRoot.gameObject.SetActive(!flag);
}
}
public void addScrollItem(int inCardId)
{
CardBasePrm.CharaType charType = CardMaster.GetInstance(_formatBehavior.CardMasterId).GetCardParameterFromId(inCardId).CharType;
@@ -891,23 +634,6 @@ public class UICardList : MonoBehaviour
}
}
public void ResetScrollImmediately()
{
if (PlayerDataIdDict.Count > 16)
{
scrollView.ResetPosition();
ScrollBar.value = 1f;
ScrollBar.value = 0f;
}
else
{
scrollView.ResetPosition();
}
UpdateCounter = 0;
m_ResetFlg = false;
scrollView.GetComponent<UIPanel>().alpha = 1f;
}
public void SetShareButtonUse(bool isUse)
{
_isShareButtonUse = isUse;
@@ -968,7 +694,7 @@ public class UICardList : MonoBehaviour
_qrCodeRoot.gameObject.SetActive(value: false);
_showQRCodeButton.onClick.Add(new EventDelegate(delegate
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
ShowQRCode();
}));
}
@@ -1001,28 +727,6 @@ public class UICardList : MonoBehaviour
private void ShowQRCode()
{
_qrCodeRoot.gameObject.SetActive(value: true);
if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.DECK_QR_CODE))
{
_qrCodeMaintenance.gameObject.SetActive(value: true);
return;
}
string qrCodeText = QRCodeUtility.GenerateQRCodeText(PlayerDataIds, _clanType, _classSet, _formatBehavior, _format, _myRotationInfo);
_qrCodeSmallTexture.GetComponent<UITexture>().mainTexture = QRCodeUtility.CreateQrCodeTexture(207, 207, qrCodeText);
_showQRCodeButton.gameObject.SetActive(value: false);
UIEventListener.Get(_qrCodeSmallTexture.gameObject).onClick = delegate
{
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
dialogBase.SetSize(DialogBase.Size.XL);
dialogBase.SetTitleLabel(string.Format(Data.SystemText.Get("Card_0265"), _deckName));
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
GameObject gameObject = new GameObject("QRCodeBigTexture");
UITexture uITexture = gameObject.AddComponent<UITexture>();
uITexture.SetRect(0f, 0f, 400f, 400f);
uITexture.mainTexture = QRCodeUtility.CreateQrCodeTexture(508, 508, qrCodeText);
dialogBase.SetObj(gameObject);
_qrCodeDialog = dialogBase;
};
}
private void CheckEnableShareButton()
@@ -1073,37 +777,6 @@ public class UICardList : MonoBehaviour
return false;
}
public void SetActiveDeckIntroductionObj(bool isActive)
{
_deckIntroductionRoot.gameObject.SetActive(isActive);
SetGrayOutDeckIntroductionObj(isActive);
}
public void SetGrayOutDeckIntroductionObj(bool isActive)
{
bool flag = isActive && _deck.IsOutOfRotationFormat && _deck.HasResurgentCard() && !Data.MyRotationAllInfo.IsWithinCopyDeckIntroductionPeriod;
UIManager.SetObjectToGrey(_deckIntroductionRoot, flag);
if (flag)
{
SetShortageCardDisableDefault();
}
}
public void SetRedButtonOnClickCallBack(string btnNameText, Action onClickCallback)
{
_redUtilButtonLabel.text = btnNameText;
_redUtilButton.onClick.Clear();
_redUtilButton.onClick.Add(new EventDelegate(delegate
{
onClickCallback.Call();
}));
}
public void SetEnableRedButton(bool isEnable)
{
_redUtilButton.gameObject.SetActive(isEnable);
}
public void SetEnableBlueButton(bool isEnable, string label = null, Action onClickCallback = null)
{
_blueUtilButtonRoot.SetActive(isEnable);
@@ -1129,241 +802,6 @@ public class UICardList : MonoBehaviour
_blueUtilButtonRoot.transform.localPosition = localPosition;
}
private void OnClickDeckCopy()
{
if (_deck == null)
{
return;
}
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
_selectedSubClass = 10;
DialogBase dialog;
if (_formatBehavior.UseSubClass && FormatBehaviorManager.GetDefaultBehaviour(_deck.Format).UseSubClass)
{
dialog = DeckCopyDialog.CreateDeckCopyDialogUseSubClass(_useSubClassDeckCopyDialog3OptionsPrefab, _deck);
}
else
{
dialog = CreateDeckCopyDialog();
}
dialog.onPushButton1 = delegate
{
if (!_formatBehavior.UseSubClass)
{
DeckIntroductionCopyDialog componentInChildren = dialog.GetComponentInChildren<DeckIntroductionCopyDialog>();
ExecEmptyDeckInfoTask(componentInChildren.IsCopyToMyRotation || componentInChildren.IsResurgentToMyRotationDeck);
}
else if (FormatBehaviorManager.GetDefaultBehaviour(_deck.Format).UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS))
{
ExecEmptyDeckInfoTask(isCopyMyRotation: false);
}
else
{
dialog.Close();
SubClassSelectDialog.Create(_deck, _subClassSelectDialogPrefab, new List<int>(), delegate(int subClassId)
{
_selectedSubClass = subClassId;
ExecEmptyDeckInfoTask(isCopyMyRotation: false);
});
}
};
}
private void ExecEmptyDeckInfoTask(bool isCopyMyRotation)
{
EmptyDeckInfoTask emptyDeckInfoTask = new EmptyDeckInfoTask();
Format parameter = _deck.DeckCopyFormat;
if (isCopyMyRotation)
{
parameter = Format.MyRotation;
}
emptyDeckInfoTask.SetParameter(parameter);
StartCoroutine(Toolbox.NetworkManager.Connect(emptyDeckInfoTask, delegate
{
OnSuccessEmptyDeckInfoTask(isCopyMyRotation);
}));
}
private static bool IsTimeSlipRotationDeck(DeckData deck)
{
if (deck.RotationId == null)
{
CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default);
using List<int>.Enumerator enumerator = deck.GetCardIdList().GetEnumerator();
if (enumerator.MoveNext())
{
int current = enumerator.Current;
if (!instance.GetCardParameterFromId(current).IsAvailableFormat(Format.Rotation, ClassType.None))
{
return false;
}
return true;
}
}
return deck.RotationId == Data.Load.data.RotationLatestCardPackId.ToString();
}
private DialogBase CreateDeckCopyDialog()
{
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
dialogBase.SetSize(DialogBase.Size.M);
DeckIntroductionCopyDialog deckIntroductionCopyDialog = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject<DeckIntroductionCopyDialog>("UI/DeckList/DeckIntroductionPreferSelect", isServerResources: false));
deckIntroductionCopyDialog.Initialize(IsTimeSlipRotationDeck(_deck));
if (Data.MyRotationAllInfo.Get(_deck.MyRotationId) == null && IsConventionDeckIntroduction)
{
deckIntroductionCopyDialog.IsDisableMyRotation = true;
}
deckIntroductionCopyDialog.IsMyRotationDeck = _deck.Format == Format.MyRotation;
dialogBase.SetObj(deckIntroductionCopyDialog.gameObject);
dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0121"));
string labelCopyConfirm = Data.SystemText.Get("Card_0112", _deck.GetDeckName());
string labelHint;
if (!Data.MyRotationAllInfo.IsWithinCopyDeckIntroductionPeriod || deckIntroductionCopyDialog.IsDisableMyRotation)
{
labelHint = ((!IsTimeSlipRotationDeck(_deck)) ? Data.SystemText.Get("Card_0222") : "");
}
else if (_deck.Format == Format.Unlimited)
{
labelHint = string.Empty;
deckIntroductionCopyDialog.IsDisableMyRotation = true;
}
else if (_deck.Format == Format.MyRotation)
{
labelHint = string.Empty;
}
else if (IsTimeSlipRotationDeck(_deck))
{
labelHint = Data.SystemText.Get("Card_0303");
}
else if (_deck.HasResurgentCard())
{
labelHint = Data.SystemText.Get("MyRotation_ID_24");
deckIntroductionCopyDialog.IsResurgentToMyRotationDeck = true;
}
else
{
labelHint = Data.SystemText.Get("MyRotation_ID_05");
}
deckIntroductionCopyDialog.LabelCopyConfirm = labelCopyConfirm;
deckIntroductionCopyDialog.LabelHint = labelHint;
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
dialogBase.SetButtonText(Data.SystemText.Get("Card_0122"));
return dialogBase;
}
private void OnSuccessEmptyDeckInfoTask(bool isCopyMyRotation)
{
if (Data.EmptyDeckInfo.EmptyDeckID < 0)
{
ShowEmptyDeckNotFoundDialog(isCopyMyRotation);
return;
}
Data.CurrentFormat = _deck.DeckCopyFormat;
ShowCopySceneChangeMessag(isCopyMyRotation);
}
private void ShowCopySceneChangeMessag(bool isCopyMyRotation)
{
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0214"));
dialogBase.SetText(Data.SystemText.Get("Card_0215"));
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
dialogBase.onCloseWithoutSelect = delegate
{
_selectedSubClass = 10;
};
dialogBase.onPushButton1 = delegate
{
bool num = _selectedSubClass != 10;
bool flag = _formatBehavior.UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS);
if (num && !flag)
{
_deck.SetDeckSubClassID(_selectedSubClass);
}
Format format = _deck.DeckCopyFormat;
MyRotationInfo myRotationInfo = null;
if (isCopyMyRotation)
{
format = Format.MyRotation;
myRotationInfo = ((_deck.Format != Format.MyRotation) ? _deck.GetMyRotationInfoFromCardList() : Data.MyRotationAllInfo.Get(_deck.MyRotationId));
}
DeckData deckData = new DeckData(format, DeckAttributeType.CustomDeck);
deckData.SetDeckID(Data.EmptyDeckInfo.EmptyDeckID);
DeckCardEditUI.SetDeckCopyParameterForDeckIntroduction(deckData, _deck, myRotationInfo);
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.DeckCardEdit);
};
}
private void ShowEmptyDeckNotFoundDialog(bool isCopyMyRotation)
{
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
SystemText systemText = Data.SystemText;
string formatName = FormatBehaviorManager.GetFormatName(isCopyMyRotation ? Format.MyRotation : _deck.DeckCopyFormat);
dialogBase.SetTitleLabel(systemText.Get("Card_0212"));
dialogBase.SetText(systemText.Get("Card_0213", formatName));
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
}
private void OnClickShortageCardVisibleButton(bool visible)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
SetShortageCardVisible(visible);
}
public void SetShortageCardVisible(bool visible)
{
_isEnableShortageCardVisible = visible;
_redEtherRoot.gameObject.SetActive(visible);
_deckIntroductionRedEtherOffButton.enabled = visible;
_deckIntroductionRedEtherOnButton.enabled = !visible;
_deckIntroductionRedEtherOffSprite.spriteName = (visible ? "pilltab_02_left_off" : "pilltab_02_left_on");
_deckIntroductionRedEtherOnSprite.spriteName = (visible ? "pilltab_02_right_on" : "pilltab_02_right_off");
foreach (CardListTemplate scrollItem in scrollItems)
{
CardParameter cardParameterFromId = CardMaster.GetInstance(_formatBehavior.CardMasterId).GetCardParameterFromId(scrollItem.GetId());
bool flag = _shortageBasicCardIdList.ContainsKey(cardParameterFromId.BaseCardId);
if (visible && flag)
{
string infoLabelText = Data.SystemText.Get("Card_0209", _shortageBasicCardIdList[cardParameterFromId.BaseCardId].ToString());
if (cardParameterFromId.IsPreReleaseCard)
{
infoLabelText = Data.SystemText.Get("Card_0245");
scrollItem.SetInfoLabelTextColor(LabelDefine.TEXT_COLOR_RED);
}
else if (cardParameterFromId.IsBasicCard)
{
infoLabelText = Data.SystemText.Get("Card_0160");
scrollItem.SetInfoLabelTextColor(LabelDefine.TEXT_COLOR_RED);
}
else
{
scrollItem.SetInfoLabelTextColor(LabelDefine.TEXT_COLOR_NORMAL);
}
scrollItem.AttachGrayShader();
scrollItem.SetInfoVisible(visible: true);
scrollItem.SetInfoLabelText(infoLabelText);
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._atkLabel, inIsPremiere: false);
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._costLabel, inIsPremiere: false);
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._lifeLabel, inIsPremiere: false);
}
else
{
scrollItem.AttachShaders(_formatBehavior.CardMasterId);
scrollItem.SetInfoVisible(visible: false);
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._atkLabel, cardParameterFromId.IsFoil);
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._costLabel, cardParameterFromId.IsFoil);
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._lifeLabel, cardParameterFromId.IsFoil);
}
}
}
private void SetShortageCardDisableDefault()
{
bool isEnableShortageCardVisible = _isEnableShortageCardVisible;
SetShortageCardVisible(visible: false);
_isEnableShortageCardVisible = isEnableShortageCardVisible;
}
private void InitUseSubClassDisplay()
{
if (!_formatBehavior.UseSubClass)
@@ -1391,40 +829,4 @@ public class UICardList : MonoBehaviour
_useSubClassFormatIconSprite.spriteName = _formatBehavior.SmallIconSpriteName;
}
}
public bool IsDeckNull()
{
return _deck == null;
}
public void ReSearchUIRoot()
{
GetComponent<UIRect>().ReSearchUIRoot();
}
public void SetPanelSortOrder(int sortOrder)
{
_rootPanel.sortingOrder = sortOrder;
_scrollPanel.sortingOrder = sortOrder + 1;
_costCurvePanel.sortingOrder = sortOrder + 2;
}
private void KeyboardUpdate()
{
DataMgr.BattleType battleType = GameMgr.GetIns().GetDataMgr().m_BattleType;
if ((battleType == DataMgr.BattleType.FreeBattle || battleType == DataMgr.BattleType.RankBattle) && _loadingEnd && !UIManager.GetInstance().LoadingViewManager.IsEnableInSceneCenterObj() && InputMgr.KeyboardControl)
{
if (GameMgr.GetIns().GetInputMgr().IsKeyboardLeftArrow() || GameMgr.GetIns().GetInputMgr().IsKeyboardRightArrow())
{
_isSelectCloseButton = true;
_keyboardCloseSelectEffect.SetActive(value: true);
}
if ((GameMgr.GetIns().GetInputMgr().IsKeyboardEnter() && _isSelectCloseButton) || GameMgr.GetIns().GetInputMgr().IsKeyboardCancel())
{
_isSelectCloseButton = false;
_keyboardCloseSelectEffect.SetActive(value: false);
CloseBtnObj.gameObject.SendMessage("OnClick");
}
}
}
}