Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/StarterClassSelectDialog.cs
gamer147 957af3d1ec 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.
2026-06-05 17:22:20 -04:00

85 lines
2.7 KiB
C#

using System;
using System.Collections.Generic;
using Cute;
using UnityEngine;
namespace Wizard;
public class StarterClassSelectDialog : MonoBehaviour
{
[SerializeField]
public GameObject StarterPurchaseConfirmationDialog;
[SerializeField]
private List<GameObject> _class;
private List<UISprite> _classSprites;
private int _selectedClassId = -1;
[SerializeField]
private GameObject _selectFrame;
[SerializeField]
private UITexture _logoTexture;
public void Init(DialogBase inDialog, PackConfig packConfig, PackChildGachaInfo info, int localSelectedClassId, Action<PackConfig, PackChildGachaInfo, int, int[], CardBasePrm.ClanType, int?> onPurchase, Action<int> onPushOk)
{
inDialog.SetSize(DialogBase.Size.M);
inDialog.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
inDialog.SetTitleLabel(Data.SystemText.Get("Shop_0239"));
inDialog.onPushButton1 = delegate
{
PackSetRotationStarterClassTask packSetRotationStarterClassTask = new PackSetRotationStarterClassTask();
packSetRotationStarterClassTask.SetParameter(packConfig.PackId, _selectedClassId);
StartCoroutine(Toolbox.NetworkManager.Connect(packSetRotationStarterClassTask, delegate
{
onPushOk.Call(_selectedClassId);
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
GameObject gameObject = UnityEngine.Object.Instantiate(StarterPurchaseConfirmationDialog);
dialogBase.SetObj(gameObject);
gameObject.GetComponent<StarterPurchaseConfirmationDialog>().Init(dialogBase, _selectedClassId, packConfig, info, onPurchase);
}));
};
_logoTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(packConfig.GetPackTitleLogoTexturePath(isFetch: true)) as Texture;
UIManager.GetInstance().AttachAtlas(_class);
_classSprites = new List<UISprite>();
for (int num = 0; num < _class.Count; num++)
{
_classSprites.Add(_class[num].GetComponent<UISprite>());
SetEventOnClickBtn(_class[num], num + 1);
}
int classId = ((localSelectedClassId == 10) ? packConfig.SelectedClassId : localSelectedClassId);
SelectClass(classId, playSE: false);
}
private void SetEventOnClickBtn(GameObject btn, int index)
{
UIEventListener.Get(btn).onClick = delegate
{
SelectClass(index);
};
}
private void SelectClass(int classId, bool playSE = true)
{
if (classId < 9 && classId >= 1)
{
if (playSE)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
}
if (classId != _selectedClassId)
{
_selectedClassId = classId;
SetSelectedFrame(_classSprites[classId - 1].gameObject);
}
}
}
private void SetSelectedFrame(GameObject selectedClass)
{
_selectFrame.transform.localPosition = selectedClass.transform.localPosition;
}
}