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:
@@ -17,18 +17,9 @@ public class FilterController : MonoBehaviour
|
||||
|
||||
private enum eFILTER_TYPE
|
||||
{
|
||||
COST,
|
||||
FAVORITE,
|
||||
RARITY,
|
||||
TYPE,
|
||||
FOIL,
|
||||
CLASS,
|
||||
FORMAT,
|
||||
ATTACK,
|
||||
LIFE,
|
||||
SPOT,
|
||||
MAX
|
||||
}
|
||||
LIFE}
|
||||
|
||||
[Serializable]
|
||||
public class ButtonArray
|
||||
@@ -50,30 +41,6 @@ public class FilterController : MonoBehaviour
|
||||
public int Length => array.Length;
|
||||
}
|
||||
|
||||
private const float MARGIN_CLASS_LINE = 50f;
|
||||
|
||||
private const float MARGIN_PACK_LINE = 38f;
|
||||
|
||||
private const int ALL_BTN_LABEL_HEIGHT = 26;
|
||||
|
||||
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_MIDDLE_ON = "pilltab_02_middle_on";
|
||||
|
||||
private const string FILTER_BTN_MIDDLE_OFF = "pilltab_02_middle_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 FILTER_BTN_SINGLE_ON = "pilltab_02_single_on";
|
||||
|
||||
private const string FILTER_BTN_SINGLE_OFF = "pilltab_02_single_off";
|
||||
|
||||
private const int ALL_BUTTON_INDEX = 0;
|
||||
|
||||
private IFormatBehavior _formatBehavior;
|
||||
|
||||
private int[] FlagsArray;
|
||||
@@ -90,87 +57,25 @@ public class FilterController : MonoBehaviour
|
||||
[SerializeField]
|
||||
private UIGrid _gridPack;
|
||||
|
||||
[SerializeField]
|
||||
private Transform _linePack;
|
||||
|
||||
private List<UIButton> _packBtnList = new List<UIButton>();
|
||||
|
||||
private List<bool> _packButtonFlagList = new List<bool>();
|
||||
|
||||
[SerializeField]
|
||||
private UIButton ResetBtn;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _gridClass;
|
||||
|
||||
[SerializeField]
|
||||
private Transform _lineClass;
|
||||
|
||||
[SerializeField]
|
||||
private UITable _tableRotationBtn;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelRotationBtn;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _spriteRotationBtn;
|
||||
|
||||
[SerializeField]
|
||||
private UITable _tableUnlimitedBtn;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelUnlimitedBtn;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _spriteUnlimitedBtn;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _basicFilterRoot;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _basicGrid;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _detailFilterEnableButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _detailFilterDisableButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _detailFilterRoot;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _detailGrid;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _detailFilterPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _keywordButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _typeButton;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _kewordListGrid;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _typeListGrid;
|
||||
|
||||
[SerializeField]
|
||||
private CardDetailFilterOffButton _filterOffButtonOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private TypeFilterDialog _typeFilterDialogPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _characterVoiceSearchRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UIInputWizard _characterVoiceSearchInput;
|
||||
|
||||
private CardDetailFilterDialog _keywordFilter;
|
||||
|
||||
private List<string> _keywordFilterList;
|
||||
|
||||
private List<CardBasePrm.TribeType> _filterTypeList = new List<CardBasePrm.TribeType>();
|
||||
@@ -185,8 +90,6 @@ public class FilterController : MonoBehaviour
|
||||
|
||||
private MyRotationInfo _myRotationInfo;
|
||||
|
||||
private static bool _isEnableDetailFilter;
|
||||
|
||||
private MyRotationFilterType _myRotationFilterType;
|
||||
|
||||
private bool _isMyRotationAllPackVisible;
|
||||
@@ -199,18 +102,6 @@ public class FilterController : MonoBehaviour
|
||||
|
||||
public bool IsShow { get; set; }
|
||||
|
||||
private bool EnableCharacterVoiceInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Jpn.ToString() || CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Cht.ToString() || CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Chs.ToString() || CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Kor.ToString())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public event Action OnValidate;
|
||||
|
||||
public void Initialize(IFormatBehavior formatBehavior)
|
||||
@@ -227,125 +118,6 @@ public class FilterController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
UIManager.GetInstance().AttachAtlas(base.gameObject, isTargetChildren: false);
|
||||
_filterOffButtonOriginal.gameObject.SetActive(value: false);
|
||||
for (int i = 0; i < BtnArray.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < BtnArray[i].Length; j++)
|
||||
{
|
||||
SetEventOnClickBtn(BtnArray[i][j].gameObject, (eFILTER_TYPE)i, j);
|
||||
}
|
||||
}
|
||||
UIEventListener.Get(ResetBtn.gameObject).onClick = OnClickResetBtn;
|
||||
UIEventListener.Get(BtnArray[6][1].gameObject).onPress = delegate(GameObject g, bool isPress)
|
||||
{
|
||||
if (isPress)
|
||||
{
|
||||
_spriteRotationBtn.spriteName = RenameSpriteString(_spriteRotationBtn.spriteName, isPress);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateFormatSprite(_spriteRotationBtn, BtnArray[6][1]);
|
||||
}
|
||||
};
|
||||
UIEventListener uIEventListener = UIEventListener.Get(BtnArray[6][1].gameObject);
|
||||
uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, (UIEventListener.VectorDelegate)delegate
|
||||
{
|
||||
UpdateFormatSprite(_spriteRotationBtn, BtnArray[6][1]);
|
||||
});
|
||||
UIEventListener uIEventListener2 = UIEventListener.Get(BtnArray[6][1].gameObject);
|
||||
uIEventListener2.onDragOut = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onDragOut, (UIEventListener.VoidDelegate)delegate
|
||||
{
|
||||
UpdateFormatSprite(_spriteRotationBtn, BtnArray[6][1]);
|
||||
});
|
||||
UIEventListener.Get(BtnArray[6][2].gameObject).onPress = delegate(GameObject g, bool isPress)
|
||||
{
|
||||
if (isPress)
|
||||
{
|
||||
_spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isPress);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateFormatSprite(_spriteUnlimitedBtn, BtnArray[6][2]);
|
||||
}
|
||||
};
|
||||
UIEventListener uIEventListener3 = UIEventListener.Get(BtnArray[6][2].gameObject);
|
||||
uIEventListener3.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener3.onDrag, (UIEventListener.VectorDelegate)delegate
|
||||
{
|
||||
UpdateFormatSprite(_spriteUnlimitedBtn, BtnArray[6][2]);
|
||||
});
|
||||
UIEventListener uIEventListener4 = UIEventListener.Get(BtnArray[6][2].gameObject);
|
||||
uIEventListener4.onDragOut = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener4.onDragOut, (UIEventListener.VoidDelegate)delegate
|
||||
{
|
||||
UpdateFormatSprite(_spriteUnlimitedBtn, BtnArray[6][2]);
|
||||
});
|
||||
UIEventListener.Get(_keywordButton.gameObject).onClick = delegate
|
||||
{
|
||||
OnClickKeyWord();
|
||||
};
|
||||
UIEventListener.Get(_typeButton.gameObject).onClick = delegate
|
||||
{
|
||||
OnClickTypeFilter();
|
||||
};
|
||||
_characterVoiceSearchInput.onSubmit.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnInputCharacterVoiceSearch();
|
||||
}));
|
||||
_characterVoiceSearchInput.onDeselect.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnInputCharacterVoiceSearch();
|
||||
}));
|
||||
RefreshDetailFilterToggleButton(_isEnableDetailFilter);
|
||||
UIEventListener.Get(_detailFilterEnableButton.gameObject).onClick = delegate
|
||||
{
|
||||
OnChangeDetailFilterEnable(isEnableDetailFilter: true);
|
||||
};
|
||||
UIEventListener.Get(_detailFilterDisableButton.gameObject).onClick = delegate
|
||||
{
|
||||
OnChangeDetailFilterEnable(isEnableDetailFilter: false);
|
||||
};
|
||||
_characterVoiceSearchRoot.SetActive(EnableCharacterVoiceInput);
|
||||
_detailGrid.Reposition();
|
||||
}
|
||||
|
||||
private void UpdateFormatSprite(UISprite iconSprite, UIButton button)
|
||||
{
|
||||
iconSprite.spriteName = RenameSpriteString(iconSprite.spriteName, button.gameObject.GetComponent<UISprite>().spriteName.EndsWith("on"));
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
UIManager.GetInstance().getUIBase_CardManager().ClearKeyWordCache();
|
||||
}
|
||||
|
||||
private void RefreshDetailFilterToggleButton(bool isEnableDetailFilter)
|
||||
{
|
||||
RenameBtnSprite(_detailFilterEnableButton, isEnableDetailFilter);
|
||||
RenameBtnSprite(_detailFilterDisableButton, !isEnableDetailFilter);
|
||||
_detailFilterRoot.SetActive(isEnableDetailFilter);
|
||||
_basicFilterRoot.SetActive(!isEnableDetailFilter);
|
||||
if (isEnableDetailFilter)
|
||||
{
|
||||
_detailGrid.Reposition();
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetBasicFilterLinePosition();
|
||||
_basicGrid.Reposition();
|
||||
}
|
||||
_scrollView.UpdateScrollbars();
|
||||
_scrollView.ResetPosition();
|
||||
}
|
||||
|
||||
private void OnChangeDetailFilterEnable(bool isEnableDetailFilter)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
RefreshDetailFilterToggleButton(isEnableDetailFilter);
|
||||
_isEnableDetailFilter = isEnableDetailFilter;
|
||||
}
|
||||
|
||||
public UIBase_CardManager.FilterParameter GetFilterParameter(UIBase_CardManager.FilterParameter param)
|
||||
{
|
||||
param.Cost = FlagsArray[0] >> 1;
|
||||
@@ -516,65 +288,6 @@ public class FilterController : MonoBehaviour
|
||||
return 1 << (int)classType;
|
||||
}
|
||||
|
||||
public void Show()
|
||||
{
|
||||
base.gameObject.SetActive(value: true);
|
||||
IsShow = true;
|
||||
_scrollView.ResetPosition();
|
||||
IFormatBehavior formatBehavior = _formatBehavior;
|
||||
SetFilterVisible(eFILTER_TYPE.FORMAT, formatBehavior.IsShowFormatFilter);
|
||||
if (formatBehavior.IsShowFormatFilter)
|
||||
{
|
||||
_labelRotationBtn.text = Data.SystemText.Get("Common_0154");
|
||||
_labelUnlimitedBtn.text = Data.SystemText.Get("Common_0155");
|
||||
_tableRotationBtn.Reposition();
|
||||
_tableUnlimitedBtn.Reposition();
|
||||
}
|
||||
SetFilterVisible(eFILTER_TYPE.FAVORITE, formatBehavior.IsShowFavoriteFilter);
|
||||
SetFilterVisible(eFILTER_TYPE.SPOT, formatBehavior.IsShowSpotCardFilter);
|
||||
if (ClassSet.MainClass != CardBasePrm.ClanType.ALL)
|
||||
{
|
||||
ButtonArray buttonArray = BtnArray[5];
|
||||
if (formatBehavior.UseSubClass)
|
||||
{
|
||||
for (int i = 2; i < buttonArray.Length; i++)
|
||||
{
|
||||
buttonArray[i].gameObject.SetActive(i == GetClassBtnIndex(ClassSet.MainClass) || i == GetClassBtnIndex(ClassSet.SubClass));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 2; j < buttonArray.Length; j++)
|
||||
{
|
||||
buttonArray[j].gameObject.SetActive(j == GetClassBtnIndex(ClassSet.MainClass));
|
||||
}
|
||||
}
|
||||
}
|
||||
SetPackButtons();
|
||||
ResetBasicFilterLinePosition();
|
||||
_basicGrid.Reposition();
|
||||
_scrollView.ResetPosition();
|
||||
_detailGrid.Reposition();
|
||||
}
|
||||
|
||||
private void ResetBasicFilterLinePosition()
|
||||
{
|
||||
RepositionLine(_linePack, _gridPack, 38f);
|
||||
RepositionLine(_lineClass, _gridClass, 50f);
|
||||
}
|
||||
|
||||
private void RepositionLine(Transform lineTransform, UIGrid grid, float margin)
|
||||
{
|
||||
grid.Reposition();
|
||||
int num = 0;
|
||||
if (grid.maxPerLine > 0 && grid.GetChildList().Count > 0)
|
||||
{
|
||||
num = (grid.GetChildList().Count - 1) / grid.maxPerLine;
|
||||
}
|
||||
float num2 = (float)num * grid.cellHeight + margin;
|
||||
lineTransform.localPosition = new Vector3(lineTransform.localPosition.x, 0f - num2, lineTransform.localPosition.z);
|
||||
}
|
||||
|
||||
public void Hide()
|
||||
{
|
||||
base.gameObject.SetActive(value: false);
|
||||
@@ -611,11 +324,6 @@ public class FilterController : MonoBehaviour
|
||||
_spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isEnable: false);
|
||||
}
|
||||
|
||||
private void SetFilterVisible(eFILTER_TYPE filterType, bool isVisible)
|
||||
{
|
||||
BtnArray[(int)filterType][0].transform.parent.gameObject.SetActive(isVisible);
|
||||
}
|
||||
|
||||
private int GetClassBtnIndex(CardBasePrm.ClanType ClassType)
|
||||
{
|
||||
return (int)(ClassType + 1);
|
||||
@@ -645,102 +353,6 @@ public class FilterController : MonoBehaviour
|
||||
return result;
|
||||
}
|
||||
|
||||
private void OnClickResetBtn(GameObject obj)
|
||||
{
|
||||
Reset();
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
}
|
||||
|
||||
private void SetEventOnClickBtn(GameObject btn, eFILTER_TYPE type, int index)
|
||||
{
|
||||
UIEventListener.Get(btn).onClick = delegate
|
||||
{
|
||||
OnClickBtn(type, index);
|
||||
};
|
||||
}
|
||||
|
||||
private void OnClickBtn(eFILTER_TYPE type, int index)
|
||||
{
|
||||
if (type == eFILTER_TYPE.FORMAT)
|
||||
{
|
||||
OnClickRadioBtn(type, index);
|
||||
UpdateFormatIconInBtn(GetFormatBtnState());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (index == 0)
|
||||
{
|
||||
FlagsArray[(int)type] = 1;
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableBit(ref FlagsArray[(int)type], 0);
|
||||
InvertBit(ref FlagsArray[(int)type], index);
|
||||
if (FlagsArray[(int)type] == 0)
|
||||
{
|
||||
FlagsArray[(int)type] = 1;
|
||||
}
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(IsEnableBit(ref FlagsArray[(int)type], index) ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF);
|
||||
}
|
||||
RenameSpriteArray(type, FlagsArray[(int)type]);
|
||||
}
|
||||
this.OnValidate.Call();
|
||||
}
|
||||
|
||||
private void UpdateFormatIconInBtn(Format inFormat)
|
||||
{
|
||||
switch (inFormat)
|
||||
{
|
||||
case Format.Rotation:
|
||||
_spriteRotationBtn.spriteName = RenameSpriteString(_spriteRotationBtn.spriteName, isEnable: true);
|
||||
_spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isEnable: false);
|
||||
break;
|
||||
case Format.Unlimited:
|
||||
_spriteRotationBtn.spriteName = RenameSpriteString(_spriteRotationBtn.spriteName, isEnable: false);
|
||||
_spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isEnable: true);
|
||||
break;
|
||||
default:
|
||||
_spriteRotationBtn.spriteName = RenameSpriteString(_spriteRotationBtn.spriteName, isEnable: false);
|
||||
_spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isEnable: false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClickRadioBtn(eFILTER_TYPE type, int index)
|
||||
{
|
||||
UpdateRadioBtn(type, index);
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
}
|
||||
|
||||
private void UpdateRadioBtn(eFILTER_TYPE type, int index)
|
||||
{
|
||||
if (!IsEnableBit(ref FlagsArray[(int)type], index))
|
||||
{
|
||||
FlagsArray[(int)type] = 0;
|
||||
InvertBit(ref FlagsArray[(int)type], index);
|
||||
RenameSpriteArray(type, FlagsArray[(int)type]);
|
||||
}
|
||||
}
|
||||
|
||||
private void EnableBit(ref int target, int index)
|
||||
{
|
||||
int num = 1 << index;
|
||||
target |= num;
|
||||
}
|
||||
|
||||
private void DisableBit(ref int target, int index)
|
||||
{
|
||||
int num = 1 << index;
|
||||
target &= ~num;
|
||||
}
|
||||
|
||||
private void InvertBit(ref int target, int index)
|
||||
{
|
||||
int num = 1 << index;
|
||||
target ^= num;
|
||||
}
|
||||
|
||||
private bool IsEnableBit(ref int target, int index)
|
||||
{
|
||||
int num = 1 << index;
|
||||
@@ -900,7 +512,7 @@ public class FilterController : MonoBehaviour
|
||||
if (index == 0)
|
||||
{
|
||||
ResetPackButtonFlags();
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -911,7 +523,7 @@ public class FilterController : MonoBehaviour
|
||||
_packButtonFlagList[0] = true;
|
||||
}
|
||||
bool flag = _packButtonFlagList[index];
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(flag ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF);
|
||||
|
||||
}
|
||||
UpdatePackButtonSprites();
|
||||
this.OnValidate.Call();
|
||||
@@ -939,69 +551,6 @@ public class FilterController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClickKeyWord()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
_keywordFilter = CardDetailFilterDialog.Create(_detailFilterPrefab, _keywordFilterList, _existKeyWordList);
|
||||
_keywordFilter.Dialog.OnClose = delegate
|
||||
{
|
||||
_keywordFilterList = _keywordFilter.GetFilterList();
|
||||
RefreshCurrentKeyWordList();
|
||||
_detailGrid.Reposition();
|
||||
};
|
||||
_keywordFilter.OnChange = delegate
|
||||
{
|
||||
_keywordFilterList = _keywordFilter.GetFilterList();
|
||||
this.OnValidate.Call();
|
||||
};
|
||||
}
|
||||
|
||||
private void OnClickTypeFilter()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
TypeFilterDialog typeFilter = TypeFilterDialog.Create(_typeFilterDialogPrefab.gameObject, _filterTypeList, _typeFilterList);
|
||||
typeFilter.Dialog.OnClose = delegate
|
||||
{
|
||||
RefreshCurrentTypeFilterList();
|
||||
};
|
||||
typeFilter.OnChange = delegate
|
||||
{
|
||||
_filterTypeList = typeFilter.GetAllSelectType();
|
||||
this.OnValidate.Call();
|
||||
};
|
||||
}
|
||||
|
||||
private void RefreshCurrentKeyWordList()
|
||||
{
|
||||
RemoveCurrentKeyWordList();
|
||||
if (_keywordFilterList == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (string keywordFilter in _keywordFilterList)
|
||||
{
|
||||
GameObject gameObject = NGUITools.AddChild(_kewordListGrid.gameObject, _filterOffButtonOriginal.gameObject);
|
||||
gameObject.name = keywordFilter;
|
||||
_currentFilterList.Add(gameObject);
|
||||
gameObject.SetActive(value: true);
|
||||
CardDetailFilterOffButton offButton = gameObject.GetComponent<CardDetailFilterOffButton>();
|
||||
offButton.Initialize(keywordFilter);
|
||||
offButton.OnClick = delegate(string keyword)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF);
|
||||
_currentFilterList.Remove(offButton.gameObject);
|
||||
UnityEngine.Object.DestroyImmediate(offButton.gameObject);
|
||||
_kewordListGrid.Reposition();
|
||||
_keywordFilterList.Remove(keyword);
|
||||
this.OnValidate.Call();
|
||||
_detailGrid.Reposition();
|
||||
OnUpdateTypeOrKeyWordFilter();
|
||||
};
|
||||
}
|
||||
_kewordListGrid.Reposition();
|
||||
OnUpdateTypeOrKeyWordFilter();
|
||||
}
|
||||
|
||||
private void RemoveCurrentKeyWordList()
|
||||
{
|
||||
foreach (GameObject currentFilter in _currentFilterList)
|
||||
@@ -1011,35 +560,6 @@ public class FilterController : MonoBehaviour
|
||||
_currentFilterList.Clear();
|
||||
}
|
||||
|
||||
private void RefreshCurrentTypeFilterList()
|
||||
{
|
||||
RemoveCurrentTypeFilterList();
|
||||
foreach (CardBasePrm.TribeType type in _filterTypeList)
|
||||
{
|
||||
string tribeNameByKey = DataMgr.GetTribeNameByKey((int)type);
|
||||
GameObject gameObject = NGUITools.AddChild(_typeListGrid.gameObject, _filterOffButtonOriginal.gameObject);
|
||||
gameObject.name = tribeNameByKey;
|
||||
_currentTypeFilterList.Add(gameObject);
|
||||
gameObject.SetActive(value: true);
|
||||
CardDetailFilterOffButton offButton = gameObject.GetComponent<CardDetailFilterOffButton>();
|
||||
offButton.Initialize(tribeNameByKey);
|
||||
offButton.OnClick = delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF);
|
||||
_currentTypeFilterList.Remove(offButton.gameObject);
|
||||
_filterTypeList.Remove(type);
|
||||
UnityEngine.Object.DestroyImmediate(offButton.gameObject);
|
||||
this.OnValidate.Call();
|
||||
_typeListGrid.Reposition();
|
||||
_detailGrid.Reposition();
|
||||
OnUpdateTypeOrKeyWordFilter();
|
||||
};
|
||||
}
|
||||
_typeListGrid.Reposition();
|
||||
_detailGrid.Reposition();
|
||||
OnUpdateTypeOrKeyWordFilter();
|
||||
}
|
||||
|
||||
private void OnUpdateTypeOrKeyWordFilter()
|
||||
{
|
||||
_scrollView.RestrictWithinBounds(instant: false);
|
||||
@@ -1129,25 +649,6 @@ public class FilterController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeFilterForAllCardList(MyRotationInfo myRotationInfo)
|
||||
{
|
||||
List<int> cardPool = UIManager.GetInstance().getUIBase_CardManager().SortIDList(CardMaster.GetInstance(_formatBehavior.CardMasterId).GetAllCardIds(), _formatBehavior.CardMasterId);
|
||||
cardPool = RemoveTokenCard(cardPool);
|
||||
UIBase_CardManager.FilterParameter filterParameter = new UIBase_CardManager.FilterParameter();
|
||||
filterParameter.Craftable = 1;
|
||||
filterParameter.TypeFilter = new List<CardBasePrm.TribeType>();
|
||||
ClassSet = new ClassSet(CardBasePrm.ClanType.ALL);
|
||||
UpdateAllSelectableKeyWord(UIManager.GetInstance().getUIBase_CardManager().SelectCardIDInConditionMask(cardPool, filterParameter, _formatBehavior, myRotationInfo, alreadySorted: true));
|
||||
SetTypeFilterSetting(cardPool, filterParameter, MyRotationFilterType.None);
|
||||
UIManager.GetInstance().getUIBase_CardManager().AddKeyWordCache(cardPool, _formatBehavior.CardMasterId);
|
||||
}
|
||||
|
||||
public void InitializeForCardDestruct(IFormatBehavior formatBehavior, MyRotationInfo myRotationInfo)
|
||||
{
|
||||
Initialize(formatBehavior);
|
||||
InitializeFilterForAllCardList(myRotationInfo);
|
||||
}
|
||||
|
||||
public void UpdateTypeFilterForDeckEdit(List<int> cardPool, ClassSet classSet, Format format, MyRotationInfo myRotationInfo, MyRotationFilterType myRotationFilterType)
|
||||
{
|
||||
InitializeFilterForDeckEdit(cardPool, classSet, format, myRotationInfo, myRotationFilterType);
|
||||
@@ -1193,9 +694,4 @@ public class FilterController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInputCharacterVoiceSearch()
|
||||
{
|
||||
this.OnValidate.Call();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user