feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)
Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
This commit is contained in:
122
SVSim.BattleEngine/Engine/Wizard/DeckCopyDialog.cs
Normal file
122
SVSim.BattleEngine/Engine/Wizard/DeckCopyDialog.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using UnityEngine;
|
||||
using Wizard.DeckCardEdit;
|
||||
using Wizard.Dialog.Setting;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckCopyDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _textLabel;
|
||||
|
||||
[SerializeField]
|
||||
private ItemToggle _sleeveAndLeaderSkinRootItemToggle;
|
||||
|
||||
[SerializeField]
|
||||
private ItemToggle _subClassOptionRootItemToggle;
|
||||
|
||||
[SerializeField]
|
||||
private ItemToggle _foilPreferredItemToggle;
|
||||
|
||||
[SerializeField]
|
||||
private ItemToggle _prizePreferredItemToggle;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts _selectClassInfo;
|
||||
|
||||
[SerializeField]
|
||||
private CenteringUIWidget _centeringUIWidget;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _flexibleGrid;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (_sleeveAndLeaderSkinRootItemToggle != null)
|
||||
{
|
||||
_sleeveAndLeaderSkinRootItemToggle.SetTitleLabel(Data.SystemText.Get("Card_0181"));
|
||||
_sleeveAndLeaderSkinRootItemToggle.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SLEEVE_AND_SKIN));
|
||||
_sleeveAndLeaderSkinRootItemToggle.AddChangeCallback(delegate
|
||||
{
|
||||
PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.IS_COPY_SLEEVE_AND_SKIN, _sleeveAndLeaderSkinRootItemToggle.GetValue());
|
||||
});
|
||||
}
|
||||
if (_subClassOptionRootItemToggle != null)
|
||||
{
|
||||
_subClassOptionRootItemToggle.SetTitleLabel("Card_0281");
|
||||
_subClassOptionRootItemToggle.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS));
|
||||
_subClassOptionRootItemToggle.AddChangeCallback(delegate
|
||||
{
|
||||
PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS, _subClassOptionRootItemToggle.GetValue());
|
||||
});
|
||||
}
|
||||
if (_foilPreferredItemToggle != null)
|
||||
{
|
||||
_foilPreferredItemToggle.SetValue(Data.Load.data._userConfig.IsFoilPreferred);
|
||||
_foilPreferredItemToggle.AddChangeCallback(delegate
|
||||
{
|
||||
DeckCardEditUI.SendConfigUpdateFoilPreferred(_foilPreferredItemToggle.GetValue());
|
||||
});
|
||||
}
|
||||
if (_prizePreferredItemToggle != null)
|
||||
{
|
||||
_prizePreferredItemToggle.SetValue(Data.Load.data._userConfig.IsPrizePreferred);
|
||||
_prizePreferredItemToggle.AddChangeCallback(delegate
|
||||
{
|
||||
DeckCardEditUI.SendConfigUpdatePrizePreferred(_prizePreferredItemToggle.GetValue());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void SetText(string text)
|
||||
{
|
||||
_textLabel.text = text;
|
||||
}
|
||||
|
||||
private void SetClassesIconAndName(DeckData scrDeck)
|
||||
{
|
||||
if (!(_selectClassInfo == null) && !(_flexibleGrid == null) && !(_centeringUIWidget == null))
|
||||
{
|
||||
int skinId = scrDeck.GetSkinId();
|
||||
_selectClassInfo.InitBySkinId(skinId);
|
||||
_selectClassInfo.SetSubClass((CardBasePrm.ClanType)scrDeck.GetDeckSubClassID());
|
||||
_flexibleGrid.Reposition();
|
||||
_centeringUIWidget.Reposition();
|
||||
StartCoroutine(_flexibleGrid.RepositionNextFrame());
|
||||
}
|
||||
}
|
||||
|
||||
private static DialogBase CreateDialog(DeckCopyDialog dialogParts, DeckData srcDeck)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogParts.SetText(systemText.Get("Card_0112", srcDeck.GetDeckName()));
|
||||
dialogBase.SetTitleLabel(systemText.Get("Card_0121"));
|
||||
dialogBase.SetObj(dialogParts.gameObject);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(systemText.Get("Card_0122"));
|
||||
return dialogBase;
|
||||
}
|
||||
|
||||
public static DialogBase CreateDeckCopyDialog(DeckCopyDialog deckCopyDialogPrefab, DeckData srcDeck)
|
||||
{
|
||||
return CreateDialog(Object.Instantiate(deckCopyDialogPrefab.gameObject).GetComponent<DeckCopyDialog>(), srcDeck);
|
||||
}
|
||||
|
||||
public static DialogBase CreateDeckCopyDialogForMyRotation(DeckCopyDialog deckCopyDialogPrefab, DeckData srcDeck)
|
||||
{
|
||||
DeckCopyDialog component = Object.Instantiate(deckCopyDialogPrefab.gameObject).GetComponent<DeckCopyDialog>();
|
||||
DialogBase result = CreateDialog(component, srcDeck);
|
||||
component.SetText(Data.SystemText.Get("MyRotation_ID_06", srcDeck.GetDeckName()));
|
||||
return result;
|
||||
}
|
||||
|
||||
public static DialogBase CreateDeckCopyDialogUseSubClass(DeckCopyDialog useSubClassDeckCopyDialogPrefab, DeckData srcDeck)
|
||||
{
|
||||
DeckCopyDialog component = Object.Instantiate(useSubClassDeckCopyDialogPrefab.gameObject).GetComponent<DeckCopyDialog>();
|
||||
DialogBase dialogBase = CreateDialog(component, srcDeck);
|
||||
component.SetClassesIconAndName(srcDeck);
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
return dialogBase;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user