Files
SVSimServer/SVSim.BattleEngine/Engine/MyPageBattleCampaign.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

106 lines
3.2 KiB
C#

using System.Collections;
using UnityEngine;
using Wizard;
public class MyPageBattleCampaign : MonoBehaviour
{
[SerializeField]
private UILabel _timeLabel;
[SerializeField]
private GameObject _boxRoot;
[SerializeField]
private UILabel _boxLabel;
[SerializeField]
private UISprite _boxSprite;
[SerializeField]
private UILabel _specialBoxLabel;
[SerializeField]
private UISprite _specialBoxSprite;
private const int SECONDS_PER_MINUTE = 60;
private const string BOX_SPRITE_NAME = "box_campaign_";
private const int BOX_NONE_LABEL_WIDTH = 50;
private const int BOX_LABEL_WIDTH = 150;
private const float NORMAL_BOXROOT_ORIGIN_POSITION = -5.8f;
private const float NORMAL_BOXROOT_POSITION = -90f;
private float _updateTimer;
public IEnumerator Init()
{
base.gameObject.SetActive(value: false);
while (Data.MyPage.data == null)
{
yield return null;
}
_specialBoxLabel.gameObject.SetActive(value: false);
_specialBoxSprite.gameObject.SetActive(value: false);
CampaignBattleWin campaignBattleWin = Data.MyPageNotifications.data.CampaignBattleWin;
if (campaignBattleWin.IsInSessionCampaign)
{
base.gameObject.SetActive(value: true);
_timeLabel.text = Data.SystemText.Get("MyPage_0048", ConvertTime.ToLocal(ConvertTime.UnixTimeToDateTime(campaignBattleWin.EndUnixTime)));
if (campaignBattleWin.BoxGrade == CampaignBattleWin.eBoxGrade.None)
{
_boxLabel.width = 50;
_boxLabel.text = Data.SystemText.Get("MyPage_0046", campaignBattleWin.GetBoxNum.ToString(), campaignBattleWin.MaxBoxNum.ToString());
_boxSprite.spriteName = "box_campaign_00";
if (campaignBattleWin.IsHaveSpecialWinReward && !campaignBattleWin.SpecialTreasureInfo.IsGotSpecialTreasureBox)
{
_boxRoot.transform.localPosition = new Vector3(-90f, _boxRoot.transform.localPosition.y, _boxRoot.transform.localPosition.z);
_specialBoxLabel.gameObject.SetActive(value: true);
_specialBoxSprite.gameObject.SetActive(value: true);
}
}
else
{
_boxLabel.width = 150;
_boxLabel.text = Data.SystemText.Get("MyPage_0047");
_boxSprite.spriteName = "box_campaign_" + ((int)(campaignBattleWin.BoxGrade - 1)).ToString("00");
}
}
else
{
base.gameObject.SetActive(value: false);
}
}
public void RedrawAfterSpecialWinRewardOpened()
{
_ = Data.MyPageNotifications.data.CampaignBattleWin;
_specialBoxLabel.gameObject.SetActive(value: false);
_specialBoxSprite.gameObject.SetActive(value: false);
_boxRoot.transform.localPosition = new Vector3(-5.8f, _boxRoot.transform.localPosition.y, _boxRoot.transform.localPosition.z);
}
private void Update()
{
if (Data.MyPage.data == null)
{
return;
}
_updateTimer -= Time.deltaTime;
if (_updateTimer < 0f)
{
CampaignBattleWin campaignBattleWin = Data.MyPageNotifications.data.CampaignBattleWin;
double num = Data.MyPage.data.ServerUnixTime + (double)Time.realtimeSinceStartup - (double)Data.MyPage.data.SinceTime;
_updateTimer = (float)(60.0 - num % 60.0);
if (num > (double)Data.MyPageNotifications.data.CampaignBattleWin.EndUnixTime)
{
campaignBattleWin.OnFinishCanpaignTime();
base.gameObject.SetActive(value: false);
}
}
}
}