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/QuestPuzzleSelectionButton.cs
Normal file
122
SVSim.BattleEngine/Engine/Wizard/QuestPuzzleSelectionButton.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class QuestPuzzleSelectionButton : QuestSelectionButtonBase
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _puzzleQuestClearNumLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _additionalPuzzleLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _puzzleLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _texture;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _button;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _charaNameLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _clearLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _missionLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _noticeLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _questButtonRoot;
|
||||
|
||||
private PuzzleQuestInfo _buttonData;
|
||||
|
||||
public override void Initialize(QuestSelectionButtonData data, bool isOpenExtra, bool isLastDay, Action onClick = null)
|
||||
{
|
||||
_buttonData = data.PuzzleData;
|
||||
InitializePuzzleQuest(_buttonData, onClick);
|
||||
}
|
||||
|
||||
public void InitializePuzzleQuest(PuzzleQuestInfo info, Action onClick = null)
|
||||
{
|
||||
if (onClick != null)
|
||||
{
|
||||
UIEventListener.Get(_button.gameObject).onClick = delegate
|
||||
{
|
||||
onClick();
|
||||
};
|
||||
}
|
||||
ClassCharacterMasterData charaPrmByCharaId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(info.CharaId);
|
||||
_charaNameLabel.text = charaPrmByCharaId.chara_name;
|
||||
_puzzleLabel.text = Data.SystemText.Get("Puzzle_QuestSelect_0002");
|
||||
SetTexture(info.CharaId.ToString());
|
||||
int num = info.DisplayDatas.Count((PuzzleQuestSelectDialog.DisplayData data) => data.IsCleared);
|
||||
int count = info.DisplayDatas.Count;
|
||||
if (num == count)
|
||||
{
|
||||
_missionLabel.gameObject.SetActive(value: false);
|
||||
_puzzleQuestClearNumLabel.gameObject.SetActive(value: false);
|
||||
_clearLabel.gameObject.SetActive(value: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_missionLabel.gameObject.SetActive(value: true);
|
||||
_missionLabel.GetComponent<StaticTextForUILabel>().enabled = false;
|
||||
_missionLabel.text = Data.SystemText.Get("Puzzle_QuestSelect_0003");
|
||||
_puzzleQuestClearNumLabel.gameObject.SetActive(value: true);
|
||||
_puzzleQuestClearNumLabel.text = $"{num}/{count}";
|
||||
_clearLabel.gameObject.SetActive(value: false);
|
||||
}
|
||||
SetNoticeLabel(null);
|
||||
SetAdditionalPuzzleLabel(info);
|
||||
SetButtonRootToGrey(isGrey: false);
|
||||
}
|
||||
|
||||
private void SetAdditionalPuzzleLabel(PuzzleQuestInfo info)
|
||||
{
|
||||
bool flag = info?.DisplayDatas.Any((PuzzleQuestSelectDialog.DisplayData x) => x.IsAdditional && !x.IsCleared) ?? false;
|
||||
_additionalPuzzleLabel.gameObject.SetActive(flag);
|
||||
if (flag)
|
||||
{
|
||||
_additionalPuzzleLabel.text = Data.SystemText.Get("Puzzle_QuestSelect_0004");
|
||||
}
|
||||
}
|
||||
|
||||
private void SetNoticeLabel(QuestOpponentData data)
|
||||
{
|
||||
bool flag = data != null && data.IsPlayable && data.NoticeLabel != null;
|
||||
_noticeLabel.gameObject.SetActive(flag);
|
||||
if (flag)
|
||||
{
|
||||
_noticeLabel.text = data.NoticeLabel;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetTexture(string textureId)
|
||||
{
|
||||
_texture.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(textureId, ResourcesManager.AssetLoadPathType.ClassCharaWideThumbnail, isfetch: true));
|
||||
}
|
||||
|
||||
protected override void SetButtonRootToGrey(bool isGrey)
|
||||
{
|
||||
UIManager.SetObjectToGrey(_questButtonRoot.gameObject, isGrey, null, AllLabelColorChanger.COLOR_TABLE_QUEST_BUTTON);
|
||||
}
|
||||
|
||||
public override void SelectChara()
|
||||
{
|
||||
_questSelectionPage.SelectCharaPuzzleButton(_buttonData);
|
||||
}
|
||||
|
||||
public override void OnDecideButtonClick()
|
||||
{
|
||||
_questSelectionPage.OnPuzzleDecideButtonClick();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user