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.
1281 lines
42 KiB
C#
1281 lines
42 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Convention;
|
|
using Cute;
|
|
using UnityEngine;
|
|
using Wizard;
|
|
using Wizard.ErrorDialog;
|
|
using Wizard.RoomMatch;
|
|
|
|
public class MyPageItemArena : MyPageItem
|
|
{
|
|
private enum StartMenu
|
|
{
|
|
CARD_PANEL,
|
|
COLOSSEUM,
|
|
CONVENTION,
|
|
CHALLENGE,
|
|
GATHERING,
|
|
COMPETITION
|
|
}
|
|
|
|
private enum CONVENTION_START_BUTTON
|
|
{
|
|
HOLDING,
|
|
ENTRY,
|
|
HISTORY
|
|
}
|
|
|
|
private enum CONVENTION_JOING_BUTTON
|
|
{
|
|
JOING,
|
|
HISTORY
|
|
}
|
|
|
|
private readonly Vector3 CARD_POS_LEFT = new Vector3(-203f, 0f, 0f);
|
|
|
|
private readonly Vector3 CARD_POS_RIGHT = new Vector3(203f, 0f, 0f);
|
|
|
|
private readonly Vector3 CARD_POS_3_LEFT = new Vector3(-367f, 0f, 0f);
|
|
|
|
private readonly Vector3 CARD_POS_CENTER = new Vector3(0f, 20f, 0f);
|
|
|
|
private readonly Vector3 CARD_POS_3_RIGHT = new Vector3(367f, 0f, 0f);
|
|
|
|
private readonly Vector2 CARD_PANEL_LEFT_POS = new Vector2(-328f, 0f);
|
|
|
|
private const int HEROES_SKIP_PAGE = 2;
|
|
|
|
public const int ARENA_CONFIG_DIALOG_DEPTH = 100;
|
|
|
|
private List<EventDelegate> _conventionMenuStartBackEvent;
|
|
|
|
private List<string> _panelResources = new List<string>();
|
|
|
|
private bool _isSetConventionListMenuBackEvent;
|
|
|
|
private const int GATHERING_CREATE_OLD_TIME_ERROR = 5317;
|
|
|
|
private bool _goColosseumStartTask;
|
|
|
|
private StartMenu _startMenu;
|
|
|
|
private ConventionInfo _goConventionInfo;
|
|
|
|
[SerializeField]
|
|
private UIButton _conventionRoomJoinButton;
|
|
|
|
[SerializeField]
|
|
private UIButton _conventionRoomCreateButton;
|
|
|
|
[SerializeField]
|
|
private UIButton _conventionDeckViewButton;
|
|
|
|
[SerializeField]
|
|
private GameObject _conventionButtonBase;
|
|
|
|
[SerializeField]
|
|
private GameObject cardPanelRoot;
|
|
|
|
[SerializeField]
|
|
private GameObject conventionMenuRoot;
|
|
|
|
[SerializeField]
|
|
private MyPageCardPanel _challengeCardPanel;
|
|
|
|
[SerializeField]
|
|
public MyPageCardPanel _colosseumCardPanel;
|
|
|
|
[SerializeField]
|
|
private MyPageCardPanel _conventionCardPanel;
|
|
|
|
[SerializeField]
|
|
private MyPageCardPanel _competitonCardPanel;
|
|
|
|
[SerializeField]
|
|
private MyPageBattleCampaign _battleCampaignClass;
|
|
|
|
[SerializeField]
|
|
private GameObject _conventionBadge;
|
|
|
|
[SerializeField]
|
|
private UIButton _challengeCardPanelButton;
|
|
|
|
[SerializeField]
|
|
private GameObject _challengeMenuRoot;
|
|
|
|
[SerializeField]
|
|
private ArenaConfigDialog _arenaConfigDialog;
|
|
|
|
[SerializeField]
|
|
private GameObject _colosseumRoot;
|
|
|
|
[SerializeField]
|
|
private GameObject _colosseumEntryRoot;
|
|
|
|
[SerializeField]
|
|
private GameObject _competitionRoot;
|
|
|
|
[SerializeField]
|
|
private GameObject _competitionEntryRoot;
|
|
|
|
private bool _isPanelResourceLoaded;
|
|
|
|
[SerializeField]
|
|
private GameObject _conventionModeSelectRoot;
|
|
|
|
[SerializeField]
|
|
private UIButton _officialConventionButton;
|
|
|
|
[SerializeField]
|
|
private GameObject _conventionSelectGatheringInviteBadge;
|
|
|
|
[SerializeField]
|
|
private UIButton _gatheringButton;
|
|
|
|
[SerializeField]
|
|
private GameObject _gatheringActionSelectRoot;
|
|
|
|
[SerializeField]
|
|
private UIButton _gatheringCreateButton;
|
|
|
|
[SerializeField]
|
|
private UIButton _gatheringEntryButton;
|
|
|
|
[SerializeField]
|
|
private GameObject _gatheringRunnninRoot;
|
|
|
|
[SerializeField]
|
|
private GameObject _gatheringRunningBadge;
|
|
|
|
[SerializeField]
|
|
private UIButton _moveGatheringPageButton;
|
|
|
|
[SerializeField]
|
|
private GameObject _gatheringCreateDialogPrefab;
|
|
|
|
[SerializeField]
|
|
private GameObject _gatheringEntryBadge;
|
|
|
|
private bool _isCompetitionEntry;
|
|
|
|
[SerializeField]
|
|
private UILabel _conventionCardButtonTitle;
|
|
|
|
[SerializeField]
|
|
private UILabel _conventionCardButtonSubTitle;
|
|
|
|
[SerializeField]
|
|
private GameObject _deckEntryLimitRoot;
|
|
|
|
[SerializeField]
|
|
private UILabel _deckEntryLimitLabel;
|
|
|
|
[SerializeField]
|
|
private GameObject _gatheringEntryLimitRoot;
|
|
|
|
[SerializeField]
|
|
private UILabel _gatheringEntryLimitLabel;
|
|
|
|
[SerializeField]
|
|
private ConventionListUI _conventionListPrefab;
|
|
|
|
private ConventionListUI _conventionList;
|
|
|
|
private CardPanelMaintenancePlate _gatheringAllMaintenancePlate;
|
|
|
|
private CardPanelMaintenancePlate _gatheringCreateMaintenancePlate;
|
|
|
|
private MyPageMenu _myPageMenu;
|
|
|
|
private bool _firstCompetitionInitialize;
|
|
|
|
private bool IsEnableOfficialConvention
|
|
{
|
|
get
|
|
{
|
|
if (!Wizard.Data.MyPage.data._isJoinConvention)
|
|
{
|
|
return Wizard.Data.MyPage.data._isAdminWatcher;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public override void Initialize(MyPageMenu parent)
|
|
{
|
|
_myPageMenu = parent;
|
|
cardPanelRoot.SetActive(value: true);
|
|
SaveDefaultPosition(_challengeMenuRoot);
|
|
SaveDefaultPosition(_colosseumRoot);
|
|
SaveDefaultPosition(_competitionRoot);
|
|
SaveDefaultPosition(_conventionButtonBase);
|
|
SaveDefaultPosition(_conventionModeSelectRoot);
|
|
SaveDefaultPosition(_gatheringActionSelectRoot);
|
|
SaveDefaultPosition(_gatheringRunnninRoot);
|
|
_colosseumCardPanel.GetComponent<ColosseumCardPanel>().MyPageFreeEntryIcon = _colosseumEntryRoot.GetComponent<ColosseumEntry>()._freeEntryIcon;
|
|
_gatheringEntryLimitRoot.SetActive(value: false);
|
|
}
|
|
|
|
public void CardPanelInitialize()
|
|
{
|
|
ArenaCompetition competitionData = Wizard.Data.ArenaData.CompetitionData;
|
|
if (competitionData.IsCompetitionPeriod)
|
|
{
|
|
if (!_firstCompetitionInitialize)
|
|
{
|
|
_firstCompetitionInitialize = true;
|
|
_isCompetitionEntry = competitionData.IsEntry;
|
|
}
|
|
SetCardPanelList(new MyPageCardPanel[3] { _challengeCardPanel, _competitonCardPanel, _conventionCardPanel });
|
|
CompetitionCardPanel competitionCardPanel = _competitonCardPanel.GetComponent<CompetitionCardPanel>();
|
|
competitionCardPanel.IsEntry = competitionData.IsEntry;
|
|
_competitionEntryRoot.GetComponent<CompetitionEntry>().EntryAction = delegate
|
|
{
|
|
_isCompetitionEntry = true;
|
|
competitionCardPanel.IsEntry = _isCompetitionEntry;
|
|
competitionCardPanel.PanelImageUpdate(callEntryMenuUpdate: false);
|
|
};
|
|
}
|
|
else if (Wizard.Data.ArenaData.ColosseumData.IsColosseumPeriod)
|
|
{
|
|
SetCardPanelList(new MyPageCardPanel[3] { _challengeCardPanel, _colosseumCardPanel, _conventionCardPanel });
|
|
}
|
|
else
|
|
{
|
|
SetCardPanelList(new MyPageCardPanel[2] { _challengeCardPanel, _conventionCardPanel });
|
|
}
|
|
base.Initialize(_myPageMenu);
|
|
}
|
|
|
|
public override void Show(bool skipCardAnimation = false)
|
|
{
|
|
base.Show(skipCardAnimation);
|
|
if (_conventionList != null)
|
|
{
|
|
_conventionList.gameObject.SetActive(value: false);
|
|
}
|
|
conventionMenuRoot.SetActive(value: false);
|
|
_conventionCardPanel.gameObject.SetActive(value: false);
|
|
_competitionEntryRoot.gameObject.SetActive(value: false);
|
|
_conventionModeSelectRoot.gameObject.SetActive(value: false);
|
|
_gatheringActionSelectRoot.gameObject.SetActive(value: false);
|
|
_gatheringRunnninRoot.gameObject.SetActive(value: false);
|
|
_conventionBadge.gameObject.SetActive(value: false);
|
|
UIManager.GetInstance().StartCoroutine(ShowCoroutine());
|
|
}
|
|
|
|
private IEnumerator ShowCoroutine()
|
|
{
|
|
_challengeMenuRoot.SetActive(value: false);
|
|
_colosseumEntryRoot.SetActive(value: false);
|
|
_competitionEntryRoot.SetActive(value: false);
|
|
while (!MyPageMenu.IsMyPageRequestEnd)
|
|
{
|
|
yield return null;
|
|
}
|
|
CardPanelInitialize();
|
|
while (UIManager.GetInstance().IsLocked())
|
|
{
|
|
yield return null;
|
|
}
|
|
MyPageCardPanel[] cardPanelList;
|
|
if (!_isPanelResourceLoaded)
|
|
{
|
|
_isPanelResourceLoaded = true;
|
|
UIManager.GetInstance().createInSceneCenterLoading();
|
|
cardPanelList = base.CardPanelList;
|
|
foreach (MyPageCardPanel myPageCardPanel in cardPanelList)
|
|
{
|
|
_panelResources.Add(myPageCardPanel.GetResourcePath(isfetch: false));
|
|
}
|
|
yield return Toolbox.ResourcesManager.LoadAssetGroupSync(_panelResources, null);
|
|
cardPanelList = base.CardPanelList;
|
|
for (int i = 0; i < cardPanelList.Length; i++)
|
|
{
|
|
cardPanelList[i].AttachCardPanelTexture();
|
|
}
|
|
UIManager.GetInstance().closeInSceneCenterLoading();
|
|
}
|
|
cardPanelList = base.CardPanelList;
|
|
for (int i = 0; i < cardPanelList.Length; i++)
|
|
{
|
|
cardPanelList[i].gameObject.SetActive(value: false);
|
|
}
|
|
base.Show();
|
|
if (!IsEnableOfficialConvention)
|
|
{
|
|
_conventionCardPanel.MaintenanceType = NetworkDefine.MAINTENANCE_TYPE.GATHERING_ALL;
|
|
}
|
|
_conventionButtonBase.SetActive(value: false);
|
|
StartMenu saveStartMenu = _startMenu;
|
|
if (_startMenu == StartMenu.CHALLENGE)
|
|
{
|
|
_startMenu = StartMenu.CARD_PANEL;
|
|
SetCardPanelAnimation();
|
|
ShowChallengInfo();
|
|
}
|
|
else if (_startMenu == StartMenu.COLOSSEUM)
|
|
{
|
|
_startMenu = StartMenu.CARD_PANEL;
|
|
UITweenAlpha component = _colosseumCardPanel.gameObject.GetComponent<UITweenAlpha>();
|
|
if (component != null)
|
|
{
|
|
component.End();
|
|
}
|
|
if (_goColosseumStartTask)
|
|
{
|
|
ColosseumEntryInfoTask task = new ColosseumEntryInfoTask();
|
|
yield return UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, ColosseumEntryInfoTaskSuccess));
|
|
}
|
|
else
|
|
{
|
|
ColosseumEntryInfoTaskSuccess(NetworkTask.ResultCode.Success);
|
|
}
|
|
SetCardPanelAnimation();
|
|
base.CardAnimation.SetCardPanelAngle();
|
|
for (int j = 0; j < base.CardPanelList.Length; j++)
|
|
{
|
|
base.CardPanelList[j].gameObject.SetActive(value: false);
|
|
}
|
|
_colosseumCardPanel.gameObject.SetActive(value: true);
|
|
_colosseumCardPanel.gameObject.transform.localPosition = new Vector3(CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y);
|
|
_colosseumCardPanel.GetComponent<UIPanel>().alpha = 0f;
|
|
MyPageItem.FadeInObject(_colosseumCardPanel.gameObject.AddMissingComponent<UITweenAlpha>(), delegate
|
|
{
|
|
_colosseumCardPanel.EffectActive = true;
|
|
});
|
|
}
|
|
else if (_startMenu == StartMenu.CONVENTION)
|
|
{
|
|
_startMenu = StartMenu.CARD_PANEL;
|
|
ConventionInfoTask task2 = new ConventionInfoTask();
|
|
Action<NetworkTask.ResultCode> callbackOnSuccess = delegate
|
|
{
|
|
if (_goConventionInfo == null)
|
|
{
|
|
ShowConventionListMenu(task2);
|
|
UpdateConventionCardPanelLabelOnConventionSelect();
|
|
}
|
|
else
|
|
{
|
|
ShowConventionRoomMenu(task2, _goConventionInfo);
|
|
}
|
|
conventionMenuRoot.SetActive(value: true);
|
|
_conventionCardPanel.gameObject.SetActive(value: true);
|
|
TweenMoveTo(_conventionCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y);
|
|
base.IsEnableFooterCurrentMenu = true;
|
|
base.Parent.SetBackButtonEnable();
|
|
};
|
|
yield return StartCoroutine(Toolbox.NetworkManager.Connect(task2, callbackOnSuccess));
|
|
}
|
|
else if (_startMenu == StartMenu.GATHERING)
|
|
{
|
|
_startMenu = StartMenu.CARD_PANEL;
|
|
conventionMenuRoot.SetActive(value: true);
|
|
_conventionCardPanel.gameObject.SetActive(value: true);
|
|
base.IsEnableFooterCurrentMenu = true;
|
|
base.Parent.SetBackButtonEnable();
|
|
if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsEntry)
|
|
{
|
|
ShowGatheringActiveMenu();
|
|
}
|
|
else
|
|
{
|
|
ShowGatheringCreateOrEntry();
|
|
}
|
|
base.CardAnimation.StopMove();
|
|
TweenMoveTo(_conventionCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y);
|
|
}
|
|
else if (_startMenu == StartMenu.COMPETITION)
|
|
{
|
|
_startMenu = StartMenu.CARD_PANEL;
|
|
CompetitionDirectShow();
|
|
}
|
|
else
|
|
{
|
|
ShowCardPanel();
|
|
_conventionCardPanel.GetComponent<UIButton>().onClick.Clear();
|
|
_conventionCardPanel.GetComponent<UIButton>().onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickConventionCardPanel();
|
|
}));
|
|
}
|
|
ShowGatheringBadge();
|
|
Offline.IsConventionMode = false;
|
|
if (saveStartMenu != StartMenu.CONVENTION)
|
|
{
|
|
UpdateConventionCardPanelLabelOnConventionSelect();
|
|
}
|
|
StartCoroutine(_battleCampaignClass.Init());
|
|
}
|
|
|
|
public void CompetitionShow()
|
|
{
|
|
base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Competition_0006"));
|
|
}
|
|
|
|
public void CompetitionDirectShow()
|
|
{
|
|
CompetitionShow();
|
|
UITweenAlpha component = _competitonCardPanel.gameObject.GetComponent<UITweenAlpha>();
|
|
if (component != null)
|
|
{
|
|
component.End();
|
|
}
|
|
base.IsEnableFooterCurrentMenu = true;
|
|
base.Parent.SetBackButtonEnable();
|
|
FadeOutCardPanelAndNonActive(_competitonCardPanel);
|
|
_competitionEntryRoot.SetActive(value: true);
|
|
RestoreDefaultPosition(_competitionRoot);
|
|
AppearAnimation(_competitionRoot);
|
|
MyPageMenu.Instance.SetDefaultBackButtonHandler();
|
|
for (int i = 0; i < base.CardPanelList.Length; i++)
|
|
{
|
|
base.CardPanelList[i].gameObject.SetActive(value: false);
|
|
}
|
|
_competitonCardPanel.gameObject.SetActive(value: true);
|
|
RemoveITween(_competitonCardPanel.gameObject);
|
|
_competitonCardPanel.transform.localPosition = new Vector3(CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y);
|
|
_competitonCardPanel.GetComponent<UIPanel>().alpha = 0f;
|
|
MyPageItem.FadeInObject(_competitonCardPanel.gameObject.AddMissingComponent<UITweenAlpha>(), delegate
|
|
{
|
|
_competitonCardPanel.EffectActive = true;
|
|
});
|
|
}
|
|
|
|
private void OnClickConventionCardPanel()
|
|
{
|
|
if (base.CardAnimation.IsCardMoving)
|
|
{
|
|
return;
|
|
}
|
|
if (Wizard.Data.MyPage.data._isAdminWatcher)
|
|
{
|
|
OnClickConventionCardPanelForAdmin();
|
|
return;
|
|
}
|
|
conventionMenuRoot.SetActive(value: true);
|
|
base.Parent.SetDefaultBackButtonHandler();
|
|
base.Parent.SetBackButtonEnable();
|
|
base.IsEnableFooterCurrentMenu = true;
|
|
base.CardAnimation.OnClicked(_conventionCardPanel.Index);
|
|
_conventionCardPanel.GetComponent<UIButton>().onClick.Clear();
|
|
AllClickEventClear();
|
|
FadeOutCardPanelAndNonActive(_challengeCardPanel);
|
|
FadeOutCardPanelAndNonActive(_colosseumCardPanel);
|
|
FadeOutCardPanelAndNonActive(_competitonCardPanel);
|
|
TweenMoveTo(_conventionCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y);
|
|
if (Wizard.Data.MyPage.data._isJoinConvention)
|
|
{
|
|
ShowConventionSelectMenu();
|
|
}
|
|
else
|
|
{
|
|
OnClickGathering(playSe: false);
|
|
}
|
|
}
|
|
|
|
private void ShowConventionSelectMenu()
|
|
{
|
|
FadeUtility.ShowSoon(_gatheringButton.gameObject);
|
|
FadeUtility.ShowSoon(_officialConventionButton.gameObject);
|
|
RestoreDefaultPosition(_conventionModeSelectRoot);
|
|
AppearAnimationFromRight(_conventionModeSelectRoot);
|
|
base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("MyPage_0024"));
|
|
_conventionSelectGatheringInviteBadge.SetActive(Wizard.Data.MyPageNotifications.data.IsInviteGathering || Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification);
|
|
_gatheringButton.onClick.Clear();
|
|
_gatheringButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickGathering(playSe: true);
|
|
}));
|
|
_officialConventionButton.onClick.Clear();
|
|
_officialConventionButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickOfficialConvention();
|
|
}));
|
|
bool isMaintenance = Wizard.Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.GATHERING_ALL);
|
|
_gatheringAllMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance, _gatheringButton, _gatheringAllMaintenancePlate, _gatheringButton.GetComponentInChildren<UILabel>().depth + 1);
|
|
}
|
|
|
|
private void FadeOutConventionGatheringSelect()
|
|
{
|
|
FadeUtility.FadeOutObjectAndNonActive(_gatheringButton.gameObject);
|
|
FadeUtility.FadeOutObjectAndNonActive(_officialConventionButton.gameObject);
|
|
}
|
|
|
|
public void ShowGatheringBadge()
|
|
{
|
|
_conventionBadge.SetActive(Wizard.Data.MyPageNotifications.data.IsInviteGathering || Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification);
|
|
_gatheringEntryBadge.SetActive(Wizard.Data.MyPageNotifications.data.IsInviteGathering);
|
|
_gatheringRunningBadge.SetActive(Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification);
|
|
}
|
|
|
|
private void OnClickOfficialConvention()
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
FadeOutConventionGatheringSelect();
|
|
_conventionCardPanel.GetComponent<UIButton>().onClick.Clear();
|
|
OnClickConventionCardButtonNew();
|
|
}
|
|
|
|
private void OnClickGathering(bool playSe)
|
|
{
|
|
if (playSe)
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
}
|
|
base.IsEnableFooterCurrentMenu = true;
|
|
_gatheringButton.onClick.Clear();
|
|
FadeOutConventionGatheringSelect();
|
|
if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsEntry)
|
|
{
|
|
ShowGatheringActiveMenu();
|
|
}
|
|
else
|
|
{
|
|
ShowGatheringCreateOrEntry();
|
|
}
|
|
}
|
|
|
|
private void ShowGatheringCreateOrEntry()
|
|
{
|
|
base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Gathering_0002"));
|
|
_gatheringActionSelectRoot.SetActive(value: true);
|
|
RestoreDefaultPosition(_gatheringActionSelectRoot);
|
|
AppearAnimationFromRight(_gatheringActionSelectRoot);
|
|
FadeUtility.ShowSoon(_gatheringCreateButton.gameObject);
|
|
FadeUtility.ShowSoon(_gatheringEntryButton.gameObject);
|
|
_gatheringCreateButton.onClick.Clear();
|
|
_gatheringCreateButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickGatheringCreate();
|
|
}));
|
|
_gatheringEntryButton.onClick.Clear();
|
|
_gatheringEntryButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickGatheringEntry();
|
|
}));
|
|
bool isMaintenance = Wizard.Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.GATHERING_CREATE);
|
|
_gatheringCreateMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance, _gatheringCreateButton, _gatheringCreateMaintenancePlate, _gatheringCreateButton.GetComponentInChildren<UILabel>().depth + 1);
|
|
if (IsEnableOfficialConvention)
|
|
{
|
|
SetBackButtonHandler(delegate
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
FadeUtility.FadeOutObjectAndNonActive(_gatheringCreateButton.gameObject);
|
|
FadeUtility.FadeOutObjectAndNonActive(_gatheringEntryButton.gameObject);
|
|
ShowConventionSelectMenu();
|
|
});
|
|
}
|
|
else
|
|
{
|
|
base.Parent.SetDefaultBackButtonHandler();
|
|
}
|
|
}
|
|
|
|
private void ShowGatheringActiveMenu()
|
|
{
|
|
_gatheringRunnninRoot.SetActive(value: true);
|
|
RestoreDefaultPosition(_gatheringRunnninRoot);
|
|
AppearAnimationFromRight(_gatheringRunnninRoot);
|
|
base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Gathering_0002"));
|
|
FadeUtility.ShowSoon(_moveGatheringPageButton.gameObject);
|
|
_moveGatheringPageButton.onClick.Clear();
|
|
_moveGatheringPageButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickMoveGatheringPageButton();
|
|
}));
|
|
if (IsEnableOfficialConvention)
|
|
{
|
|
SetBackButtonHandler(delegate
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
FadeOutRunningGatheringActionMenu();
|
|
ShowConventionSelectMenu();
|
|
});
|
|
}
|
|
}
|
|
|
|
private void SetBackButtonHandler(Action onBackButton)
|
|
{
|
|
List<EventDelegate> originalBackEvent = new List<EventDelegate>(base.TopBar.BackButton.onClick);
|
|
base.TopBar.SetBackButtonEvent(null, UIManager.ViewScene.None, new EventDelegate(delegate
|
|
{
|
|
onBackButton();
|
|
base.TopBar.BackButton.onClick = originalBackEvent;
|
|
}));
|
|
}
|
|
|
|
private void FadeOutRunningGatheringActionMenu()
|
|
{
|
|
FadeUtility.FadeOutObjectAndNonActive(_moveGatheringPageButton.gameObject);
|
|
}
|
|
|
|
private void OnClickMoveGatheringPageButton()
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering);
|
|
}
|
|
|
|
private void OnClickGatheringCreate()
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
GatheringCreateDialog.Create(_gatheringCreateDialogPrefab).OnDecideRule = OnDecideGatheringRule;
|
|
}
|
|
|
|
private void OnDecideGatheringRule(GatheringRule rule)
|
|
{
|
|
if (rule.IsOwnerEntryBattle && rule.IsEntryDeckOnly)
|
|
{
|
|
ShowConfirmCreateDeck(rule);
|
|
}
|
|
else
|
|
{
|
|
CreateGathering(rule, null);
|
|
}
|
|
}
|
|
|
|
private void ShowConfirmCreateDeck(GatheringRule rule)
|
|
{
|
|
SystemText systemText = Wizard.Data.SystemText;
|
|
DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(systemText.Get("Gathering_0021"));
|
|
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
|
dialogBase.SetTitleLabel(systemText.Get("Gathering_0025"));
|
|
dialogBase.SetButtonText(systemText.Get("Gathering_0022"));
|
|
dialogBase.onPushButton1 = delegate
|
|
{
|
|
ShowDeckListDialog(rule);
|
|
};
|
|
}
|
|
|
|
private void ShowDeckListDialog(GatheringRule rule)
|
|
{
|
|
string deckListHeader = Wizard.Data.SystemText.Get("Gathering_0026");
|
|
MultiDeckSelectDialog.Create(RoomConnectController.RuleSelectDeckCount(rule.BattleParameterInstance.Rule), rule.BattleParameterInstance.DeckFormat, deckListHeader).OnDecide = delegate(List<DeckData> deckList)
|
|
{
|
|
OnDecideGatheringDeck(deckList, rule);
|
|
};
|
|
}
|
|
|
|
private void OnDecideGatheringDeck(List<DeckData> deckList, GatheringRule rule)
|
|
{
|
|
CreateGathering(rule, deckList);
|
|
}
|
|
|
|
private void CreateGathering(GatheringRule rule, List<DeckData> deckList)
|
|
{
|
|
if (rule.Type == GatheringRule.eType.FREE_BATTLE)
|
|
{
|
|
GatheringCreateTask gatheringCreateTask = new GatheringCreateTask();
|
|
gatheringCreateTask.SetParameter(rule, deckList);
|
|
gatheringCreateTask.AddSkipCuteCheckResultCode(5317);
|
|
StartCoroutine(Toolbox.NetworkManager.Connect(gatheringCreateTask, delegate
|
|
{
|
|
OnSuccessCreateGathering();
|
|
}, null, delegate(int errorCode)
|
|
{
|
|
OnCreateGatheringError(errorCode);
|
|
}));
|
|
}
|
|
else if (rule.Type == GatheringRule.eType.TOURNAMENT)
|
|
{
|
|
GatheringTornamentCreateTask gatheringTornamentCreateTask = new GatheringTornamentCreateTask();
|
|
gatheringTornamentCreateTask.SetParameter(rule, deckList);
|
|
gatheringTornamentCreateTask.AddSkipCuteCheckResultCode(5317);
|
|
StartCoroutine(Toolbox.NetworkManager.Connect(gatheringTornamentCreateTask, delegate
|
|
{
|
|
OnSuccessCreateGathering();
|
|
}, null, delegate(int errorCode)
|
|
{
|
|
OnCreateGatheringError(errorCode);
|
|
}));
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("大会方式が不正です " + rule.Type);
|
|
}
|
|
}
|
|
|
|
private void OnCreateGatheringError(int errorCode)
|
|
{
|
|
if (errorCode == 5317)
|
|
{
|
|
Dialog.Create(errorCode).OnClose = delegate
|
|
{
|
|
GatheringCreateDialog.Create(_gatheringCreateDialogPrefab).OnDecideRule = OnDecideGatheringRule;
|
|
};
|
|
}
|
|
}
|
|
|
|
private void OnSuccessCreateGathering()
|
|
{
|
|
GatheringChat.ResetLatestReadChatMessageId();
|
|
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering);
|
|
}
|
|
|
|
private void OnClickGatheringEntry()
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering);
|
|
}
|
|
|
|
private void UpdateConventionCardPanelLabelOnConventionSelect()
|
|
{
|
|
SystemText systemText = Wizard.Data.SystemText;
|
|
if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsEntry && Wizard.Data.MyPage.data._conventionBattleStartTime == null)
|
|
{
|
|
UpdateConventionCardPanelLabelGathering();
|
|
return;
|
|
}
|
|
_gatheringEntryLimitRoot.SetActive(value: false);
|
|
if (Wizard.Data.MyPage.data._conventionBattleStartTime != null && !Wizard.Data.MyPage.data._isAdminWatcher)
|
|
{
|
|
_deckEntryLimitRoot.SetActive(value: true);
|
|
_deckEntryLimitLabel.text = systemText.Get("Arena_0070", Wizard.Data.MyPage.data._conventionBattleStartTime);
|
|
}
|
|
else
|
|
{
|
|
_deckEntryLimitRoot.SetActive(value: false);
|
|
}
|
|
if (Wizard.Data.MyPage.data._isAdminWatcher)
|
|
{
|
|
_conventionCardButtonTitle.text = systemText.Get("Arena_0128");
|
|
_conventionCardButtonSubTitle.text = systemText.Get("Arena_0129");
|
|
}
|
|
else
|
|
{
|
|
_conventionCardButtonTitle.text = systemText.Get("MyPage_0024");
|
|
_conventionCardButtonSubTitle.text = systemText.Get("Arena_0127");
|
|
}
|
|
}
|
|
|
|
private void UpdateConventionCardPanelLabelGathering()
|
|
{
|
|
_deckEntryLimitRoot.SetActive(value: false);
|
|
_gatheringEntryLimitRoot.SetActive(value: true);
|
|
SystemText systemText = Wizard.Data.SystemText;
|
|
_conventionCardButtonTitle.text = systemText.Get("MyPage_0024");
|
|
_conventionCardButtonSubTitle.text = systemText.Get("Arena_0127");
|
|
if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsDeckEntry)
|
|
{
|
|
_gatheringEntryLimitLabel.text = systemText.Get("Gathering_0023", Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.DeckEntryFinishTime);
|
|
}
|
|
else if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsOpening)
|
|
{
|
|
_gatheringEntryLimitLabel.text = systemText.Get("Gathering_0032");
|
|
}
|
|
else
|
|
{
|
|
_gatheringEntryLimitLabel.text = systemText.Get("Gathering_0024", Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.FinishTime);
|
|
}
|
|
if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsBattleFinish)
|
|
{
|
|
_gatheringEntryLimitRoot.SetActive(value: false);
|
|
}
|
|
}
|
|
|
|
protected void OnDestroy()
|
|
{
|
|
Toolbox.ResourcesManager.RemoveAssetGroup(_panelResources);
|
|
_panelResources.Clear();
|
|
}
|
|
|
|
private void ShowCardPanel()
|
|
{
|
|
FadeUtility.RemoveFadeObject(_conventionCardPanel.gameObject);
|
|
FadeUtility.RemoveFadeObject(_colosseumCardPanel.gameObject);
|
|
FadeUtility.RemoveFadeObject(_challengeCardPanel.gameObject);
|
|
_colosseumCardPanel.GetComponent<ColosseumCardPanel>().SetIconDisplayPermission(isPermission: true);
|
|
UIButton component = _colosseumCardPanel.GetComponent<UIButton>();
|
|
_challengeCardPanelButton.onClick.Clear();
|
|
_challengeCardPanelButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickChallengeCardPanel();
|
|
}));
|
|
component.onClick.Clear();
|
|
component.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickColosseumCardButton();
|
|
}));
|
|
_colosseumRoot.SetActive(value: false);
|
|
UIButton component2 = _competitonCardPanel.GetComponent<UIButton>();
|
|
component2.onClick.Clear();
|
|
component2.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickCompetitionCardButton();
|
|
}));
|
|
_competitionRoot.SetActive(value: false);
|
|
_conventionCardPanel.GetComponent<UIButton>().enabled = true;
|
|
_challengeMenuRoot.SetActive(value: false);
|
|
SetCardPanelAnimation();
|
|
StartCardPanelAppearAnimation();
|
|
}
|
|
|
|
private void SetCardPanelAnimation()
|
|
{
|
|
for (int i = 0; i < base.CardPanelList.Length; i++)
|
|
{
|
|
MyPageCardPanel obj = base.CardPanelList[i];
|
|
obj.gameObject.SetActive(value: true);
|
|
obj.EffectActive = false;
|
|
obj.EffectActive = true;
|
|
obj.CheckMaintenanceType();
|
|
}
|
|
if (base.CardPanelList.Length == 2)
|
|
{
|
|
base.CardPanelList[0].transform.localPosition = CARD_POS_LEFT;
|
|
base.CardPanelList[1].transform.localPosition = CARD_POS_RIGHT;
|
|
}
|
|
else if (base.CardPanelList.Length == 3)
|
|
{
|
|
base.CardPanelList[0].transform.localPosition = CARD_POS_3_LEFT;
|
|
base.CardPanelList[1].transform.localPosition = CARD_POS_CENTER;
|
|
base.CardPanelList[2].transform.localPosition = CARD_POS_3_RIGHT;
|
|
}
|
|
List<GameObject> list = new List<GameObject>();
|
|
for (int j = 0; j < base.CardPanelList.Length; j++)
|
|
{
|
|
MyPageCardPanel myPageCardPanel = base.CardPanelList[j];
|
|
if (myPageCardPanel.isActiveAndEnabled)
|
|
{
|
|
list.Add(myPageCardPanel.gameObject);
|
|
}
|
|
}
|
|
SaveCardPanelDefaultPosition();
|
|
base.CardAnimation.PanelClear();
|
|
base.CardAnimation.SetCardPanelList(list.ToArray());
|
|
base.CardAnimation.SetCardPanelAngle();
|
|
}
|
|
|
|
public void GoToColosseum(bool isColosseumTask)
|
|
{
|
|
_startMenu = StartMenu.COLOSSEUM;
|
|
_goColosseumStartTask = isColosseumTask;
|
|
AllClickEventClear();
|
|
MyPageMenu.Instance.SetDefaultBackButtonHandler();
|
|
base.CardAnimation.SkipMoveAnimation();
|
|
}
|
|
|
|
public void GoToCompetition()
|
|
{
|
|
_startMenu = StartMenu.COMPETITION;
|
|
AllClickEventClear();
|
|
MyPageMenu.Instance.SetDefaultBackButtonHandler();
|
|
base.CardAnimation.SkipMoveAnimation();
|
|
UIManager.GetInstance().CheckFirstTips(CompetitionUtility.GetCompetitionTipsType(Wizard.Data.ArenaData.CompetitionData.Rule));
|
|
}
|
|
|
|
public void GoToConventionListMenu()
|
|
{
|
|
_startMenu = StartMenu.CONVENTION;
|
|
_goConventionInfo = null;
|
|
}
|
|
|
|
public void GoToConventionActionMenu(ConventionInfo conventionInfo)
|
|
{
|
|
_startMenu = StartMenu.CONVENTION;
|
|
_goConventionInfo = conventionInfo;
|
|
}
|
|
|
|
public void GoToGatheringMenu()
|
|
{
|
|
_startMenu = StartMenu.GATHERING;
|
|
_goConventionInfo = null;
|
|
}
|
|
|
|
public void AppearAnimation(GameObject obj, string completeMessage = "")
|
|
{
|
|
obj.gameObject.SetActive(value: true);
|
|
iTween component = obj.gameObject.GetComponent<iTween>();
|
|
if (component != null)
|
|
{
|
|
UnityEngine.Object.Destroy(component);
|
|
}
|
|
Hashtable hashtable = new Hashtable();
|
|
hashtable.Add("x", obj.transform.localPosition.x + 1000f);
|
|
hashtable.Add("time", 0.3f);
|
|
hashtable.Add("delay", 0.1f);
|
|
hashtable.Add("islocal", true);
|
|
hashtable.Add("easetype", iTween.EaseType.easeOutExpo);
|
|
if (completeMessage != "")
|
|
{
|
|
hashtable.Add("oncomplete", completeMessage);
|
|
hashtable.Add("oncompletetarget", _colosseumEntryRoot);
|
|
}
|
|
iTween.MoveFrom(obj, hashtable);
|
|
}
|
|
|
|
private void OnClickColosseumCardButton()
|
|
{
|
|
AllClickEventClear();
|
|
base.CardAnimation.OnClicked(_colosseumCardPanel.Index);
|
|
ColosseumEntryInfoTask task = new ColosseumEntryInfoTask();
|
|
StartCoroutine(Toolbox.NetworkManager.Connect(task, ColosseumEntryInfoTaskSuccess));
|
|
}
|
|
|
|
private void OnClickCompetitionCardButton()
|
|
{
|
|
AllClickEventClear();
|
|
base.CardAnimation.OnClicked(_competitonCardPanel.Index);
|
|
CompetitionEntryInfo();
|
|
}
|
|
|
|
private void ColosseumEntryInfoTaskSuccess(NetworkTask.ResultCode inResult)
|
|
{
|
|
base.IsEnableFooterCurrentMenu = true;
|
|
_colosseumCardPanel.GetComponent<ColosseumCardPanel>().SetIconDisplayPermission(isPermission: false);
|
|
_colosseumEntryRoot.SetActive(value: true);
|
|
base.Parent.SetBackButtonEnable();
|
|
base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Colosseum_0001"));
|
|
TweenMoveTo(_colosseumCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y);
|
|
_challengeCardPanel.EffectActive = false;
|
|
FadeOutCardPanelAndNonActive(_challengeCardPanel);
|
|
if (_conventionCardPanel.gameObject.activeSelf)
|
|
{
|
|
_conventionCardPanel.EffectActive = false;
|
|
FadeOutCardPanelAndNonActive(_conventionCardPanel);
|
|
}
|
|
RestoreDefaultPosition(_colosseumRoot);
|
|
if (Wizard.Data.ArenaData.ColosseumData.IsDeckDeleted)
|
|
{
|
|
AppearAnimation(_colosseumRoot, "ColosseumDeckDeletedDialogMessageReceiver");
|
|
}
|
|
else
|
|
{
|
|
AppearAnimation(_colosseumRoot);
|
|
}
|
|
_colosseumCardPanel.GetComponent<ColosseumCardPanel>().NowUpdate();
|
|
MyPageMenu.Instance.SetDefaultBackButtonHandler();
|
|
if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.Avatar)
|
|
{
|
|
CheckFirstTips(FirstTips.TipsType.HeroesGrandPrix, Wizard.Data.ArenaData.ColosseumData);
|
|
}
|
|
else if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.WindFall)
|
|
{
|
|
CheckFirstTips(FirstTips.TipsType.ColosseumWindFall, Wizard.Data.ArenaData.ColosseumData);
|
|
}
|
|
else if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.TwoPickChaos)
|
|
{
|
|
CheckFirstTips(FirstTips.TipsType.Colosseum2PickChaos, Wizard.Data.ArenaData.ColosseumData);
|
|
}
|
|
else
|
|
{
|
|
CheckFirstTips(FirstTips.TipsType.Colosseum, Wizard.Data.ArenaData.ColosseumData);
|
|
}
|
|
}
|
|
|
|
private void CheckFirstTips(FirstTips.TipsType tipsType, ArenaColosseum colosseumData)
|
|
{
|
|
if (!FirstTips.IsFirstTipsOpen(tipsType) && (!colosseumData.NeedsFirstTips || colosseumData.ColosseumId <= PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.FIRST_TIPS_COLOSSEUM_ID)))
|
|
{
|
|
return;
|
|
}
|
|
int startPage = 0;
|
|
if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.Avatar)
|
|
{
|
|
if (!FirstTips.IsFirstTipsOpen(FirstTips.TipsType.HeroesFreeMatch))
|
|
{
|
|
startPage = 2;
|
|
}
|
|
FirstTips.SaveFinishFirstTips(FirstTips.TipsType.HeroesFreeMatch);
|
|
}
|
|
UIManager.GetInstance().StartFirstTips(tipsType, null, startPage, Wizard.Data.ArenaData.ColosseumData.ChaoseTipsId);
|
|
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.FIRST_TIPS_COLOSSEUM_ID, colosseumData.ColosseumId);
|
|
}
|
|
|
|
public void CompetitionEntryInfo()
|
|
{
|
|
base.IsEnableFooterCurrentMenu = true;
|
|
_competitionEntryRoot.SetActive(value: true);
|
|
base.Parent.SetBackButtonEnable();
|
|
CompetitionShow();
|
|
TweenMoveTo(_competitonCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y);
|
|
_challengeCardPanel.EffectActive = false;
|
|
FadeOutCardPanelAndNonActive(_challengeCardPanel);
|
|
_conventionCardPanel.EffectActive = false;
|
|
FadeOutCardPanelAndNonActive(_conventionCardPanel);
|
|
MyPageMenu.Instance.SetDefaultBackButtonHandler();
|
|
AppearAnimation(_competitionRoot);
|
|
UIManager.GetInstance().CheckFirstTips(CompetitionUtility.GetCompetitionTipsType(Wizard.Data.ArenaData.CompetitionData.Rule));
|
|
}
|
|
|
|
private void SetFade(bool inDisp, GameObject inFadeObject, Action inFinishAction)
|
|
{
|
|
UITweenAlpha uITweenAlpha = inFadeObject.AddMissingComponent<UITweenAlpha>();
|
|
uITweenAlpha._from = 0f;
|
|
uITweenAlpha._to = 1f;
|
|
uITweenAlpha._curve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
|
|
uITweenAlpha._endTime = 0.1f;
|
|
if (inDisp)
|
|
{
|
|
uITweenAlpha._finishCallBack = delegate
|
|
{
|
|
inFadeObject.SetActive(value: true);
|
|
if (inFinishAction != null)
|
|
{
|
|
inFinishAction();
|
|
}
|
|
};
|
|
inFadeObject.SetActive(value: true);
|
|
uITweenAlpha.PlayForward(isReset: true);
|
|
return;
|
|
}
|
|
uITweenAlpha._finishCallBack = delegate
|
|
{
|
|
inFadeObject.SetActive(value: false);
|
|
if (inFinishAction != null)
|
|
{
|
|
inFinishAction();
|
|
}
|
|
};
|
|
uITweenAlpha.PlayReverse(isReset: true);
|
|
}
|
|
|
|
private void DetailStart()
|
|
{
|
|
ColosseumEntry component = _colosseumEntryRoot.GetComponent<ColosseumEntry>();
|
|
_challengeCardPanel.gameObject.SetActive(value: false);
|
|
_colosseumCardPanel.gameObject.SetActive(value: false);
|
|
_conventionCardPanel.gameObject.SetActive(value: false);
|
|
_colosseumRoot.SetActive(value: true);
|
|
_colosseumEntryRoot.SetActive(value: false);
|
|
component.OpenDetail();
|
|
base.Parent.SetBackButtonEnable();
|
|
base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Colosseum_0001"));
|
|
}
|
|
|
|
private void OnClickConventionCardPanelForAdmin()
|
|
{
|
|
IDInput.StartInputDialog(Wizard.Data.SystemText.Get("Arena_0130"), 5, OnDecideConventionId);
|
|
}
|
|
|
|
private void OnDecideConventionId(string conventionId)
|
|
{
|
|
Action<string> onDecide = delegate(string roomId)
|
|
{
|
|
OnDecideConventionWatch(conventionId, roomId);
|
|
};
|
|
IDInput.StartInputDialog(Wizard.Data.SystemText.Get("RoomBattle_0006"), 5, onDecide);
|
|
}
|
|
|
|
private void OnDecideConventionWatch(string conventionId, string roomId)
|
|
{
|
|
RoomConnectController.InitializeParameter initializeParameter = new RoomConnectController.InitializeParameter(RoomConnectController.PositionMode.WATCHER, new BattleParameter(NetworkDefine.ServerBattleType.Free, Format.Max, TwoPickFormat.None, RoomConnectController.BattleRule.Bo1, isOpenDeckRoom: false), roomId);
|
|
ConventionInfo conventionInfo = new ConventionInfo(conventionId);
|
|
initializeParameter.ConventionInfo = conventionInfo;
|
|
StartCoroutine(base.Parent.BattleMenu.JoinRoom(initializeParameter, isInvite: false));
|
|
}
|
|
|
|
private void OnClickConventionCardButtonNew()
|
|
{
|
|
AllClickEventClear();
|
|
FadeOutCardPanelAndNonActive(_challengeCardPanel);
|
|
FadeOutCardPanelAndNonActive(_colosseumCardPanel);
|
|
TweenMoveTo(_conventionCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y);
|
|
ConventionInfoTask task = new ConventionInfoTask();
|
|
Action<NetworkTask.ResultCode> callbackOnSuccess = delegate
|
|
{
|
|
ShowConventionListMenu(task);
|
|
};
|
|
StartCoroutine(Toolbox.NetworkManager.Connect(task, callbackOnSuccess));
|
|
}
|
|
|
|
private void ShowConventionListMenu(ConventionInfoTask task)
|
|
{
|
|
if (_conventionList != null)
|
|
{
|
|
UnityEngine.Object.Destroy(_conventionList.gameObject);
|
|
}
|
|
_conventionCardButtonTitle.text = Wizard.Data.SystemText.Get("MyPage_0024");
|
|
base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Gathering_0001"));
|
|
base.IsEnableFooterCurrentMenu = true;
|
|
_conventionList = NGUITools.AddChild(base.gameObject, _conventionListPrefab.gameObject).GetComponent<ConventionListUI>();
|
|
_conventionList.Show(task.OfflineConventionList);
|
|
AppearAnimationFromRight(_conventionList.gameObject);
|
|
_conventionList.OnSelect = delegate(ConventionInfo convention)
|
|
{
|
|
OnClickConvention(task, convention);
|
|
};
|
|
if (_isSetConventionListMenuBackEvent)
|
|
{
|
|
return;
|
|
}
|
|
_isSetConventionListMenuBackEvent = true;
|
|
SetBackButtonHandler(delegate
|
|
{
|
|
_isSetConventionListMenuBackEvent = false;
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
if (_conventionList != null)
|
|
{
|
|
UnityEngine.Object.Destroy(_conventionList.gameObject);
|
|
}
|
|
ShowConventionSelectMenu();
|
|
});
|
|
}
|
|
|
|
private void OnClickConvention(ConventionInfoTask task, ConventionInfo convention)
|
|
{
|
|
if (convention.Status == ConventionInfo.ConventionStatus.GameStart)
|
|
{
|
|
UIManager.GetInstance().CreatFadeClose(delegate
|
|
{
|
|
UIManager.GetInstance().CreatFadeOpen();
|
|
ShowConventionRoomMenu(task, convention);
|
|
if (_conventionList != null)
|
|
{
|
|
_conventionList.Hide();
|
|
}
|
|
});
|
|
}
|
|
else
|
|
{
|
|
Offline.IsConventionMode = true;
|
|
DeckListUI.ChangeSceneToDeckList(convention.BattleParameterInstance.DeckFormat, null, convention);
|
|
}
|
|
}
|
|
|
|
private void ShowConventionRoomMenu(ConventionInfoTask task, ConventionInfo data)
|
|
{
|
|
AllClickEventClear();
|
|
Wizard.Data.CurrentFormat = data.BattleParameterInstance.DeckFormat;
|
|
SystemText systemText = Wizard.Data.SystemText;
|
|
base.TopBar.SetTitleLabel(systemText.Get("MyPage_0042") + " " + UIUtil.GetFormatName(data.BattleParameterInstance.DeckFormat));
|
|
_conventionCardButtonTitle.text = systemText.Get("MyPage_0042");
|
|
_conventionCardButtonSubTitle.text = systemText.Get("MyPage_0044");
|
|
if (data.Status == ConventionInfo.ConventionStatus.DeckEntry)
|
|
{
|
|
_deckEntryLimitLabel.text = systemText.Get("Arena_0070", Wizard.Data.MyPage.data._conventionBattleStartTime);
|
|
_deckEntryLimitRoot.SetActive(value: true);
|
|
}
|
|
else
|
|
{
|
|
_deckEntryLimitRoot.SetActive(value: false);
|
|
}
|
|
_conventionButtonBase.SetActive(value: true);
|
|
_conventionCardPanel.GetComponent<UIButton>().onClick.Clear();
|
|
RestoreDefaultPosition(_conventionButtonBase);
|
|
AppearAnimation(_conventionButtonBase);
|
|
GameObject[] array = new GameObject[3] { _conventionRoomCreateButton.gameObject, _conventionRoomJoinButton.gameObject, _conventionRoomJoinButton.gameObject };
|
|
for (int i = 0; i < array.Length; i++)
|
|
{
|
|
array[i].SetActive(value: true);
|
|
ResetAlphaAndRemoveTween(array[i].GetComponent<UISprite>());
|
|
}
|
|
_conventionRoomCreateButton.onClick.Clear();
|
|
_conventionRoomCreateButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
RoomConnectController.InitializeParameter param = new RoomConnectController.InitializeParameter(RoomConnectController.PositionMode.OWNER, data.BattleParameterInstance, "")
|
|
{
|
|
IsEnableTurnSelect = data.IsSelectableTurn,
|
|
ConventionInfo = data
|
|
};
|
|
StartCoroutine(base.Parent.BattleMenu.JoinRoom(param, isInvite: false));
|
|
}));
|
|
_conventionRoomJoinButton.onClick.Clear();
|
|
_conventionRoomJoinButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
base.Parent.BattleMenu.StartRoomIDInput(isWatch: false, data);
|
|
}));
|
|
_conventionDeckViewButton.onClick.Clear();
|
|
_conventionDeckViewButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
Offline.IsConventionMode = true;
|
|
DeckListUI.ChangeSceneToDeckList(data.BattleParameterInstance.DeckFormat, null, data);
|
|
}));
|
|
SetBackButtonHandler(delegate
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
|
UIManager.GetInstance().CreatFadeClose(delegate
|
|
{
|
|
UIManager.GetInstance().CreatFadeOpen();
|
|
ShowConventionListMenu(task);
|
|
UpdateConventionCardPanelLabelOnConventionSelect();
|
|
_conventionButtonBase.SetActive(value: false);
|
|
});
|
|
});
|
|
}
|
|
|
|
private void AllClickEventClear()
|
|
{
|
|
MyPageCardPanel[] cardPanelList = base.CardPanelList;
|
|
for (int i = 0; i < cardPanelList.Length; i++)
|
|
{
|
|
cardPanelList[i].GetComponent<UIButton>().onClick.Clear();
|
|
}
|
|
}
|
|
|
|
public void GoToChallengeMenu()
|
|
{
|
|
_startMenu = StartMenu.CHALLENGE;
|
|
}
|
|
|
|
private void OnClickChallengeCardPanel()
|
|
{
|
|
if (!base.IsCardMoving)
|
|
{
|
|
AllClickEventClear();
|
|
base.CardAnimation.OnClicked(_challengeCardPanel.Index);
|
|
ShowChallengInfo();
|
|
}
|
|
}
|
|
|
|
private void ShowChallengInfo()
|
|
{
|
|
base.IsEnableFooterCurrentMenu = true;
|
|
base.Parent.SetBackButtonEnable();
|
|
base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Arena_NewMode"));
|
|
TweenMoveTo(_challengeCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y);
|
|
if (_conventionCardPanel.gameObject.activeSelf)
|
|
{
|
|
_conventionCardPanel.EffectActive = false;
|
|
FadeOutCardPanelAndNonActive(_conventionCardPanel);
|
|
}
|
|
if (_competitonCardPanel.gameObject.activeSelf)
|
|
{
|
|
_competitonCardPanel.EffectActive = false;
|
|
FadeOutCardPanelAndNonActive(_competitonCardPanel);
|
|
}
|
|
if (_colosseumCardPanel.gameObject.activeSelf)
|
|
{
|
|
_colosseumCardPanel.EffectActive = false;
|
|
FadeOutCardPanelAndNonActive(_colosseumCardPanel);
|
|
}
|
|
RestoreDefaultPosition(_challengeMenuRoot);
|
|
AppearAnimation(_challengeMenuRoot);
|
|
MyPageMenu.Instance.SetDefaultBackButtonHandler();
|
|
UIManager.GetInstance().CheckFirstTips(FirstTips.TipsType.Challenge);
|
|
}
|
|
|
|
private void OnClickArenaConfigButton()
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
|
CreateArenaConfigDialog();
|
|
}
|
|
|
|
private void CreateArenaConfigDialog()
|
|
{
|
|
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
|
dialogBase.SetSize(DialogBase.Size.M);
|
|
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Colosseum_0120"));
|
|
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
|
ArenaConfigDialog arenaConfigDialog = UnityEngine.Object.Instantiate(_arenaConfigDialog);
|
|
arenaConfigDialog.Initialize();
|
|
dialogBase.SetObj(arenaConfigDialog.gameObject);
|
|
dialogBase.SetPanelDepth(100);
|
|
dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate
|
|
{
|
|
arenaConfigDialog.Final();
|
|
});
|
|
}
|
|
|
|
public void RedrawBattleCampaign()
|
|
{
|
|
_battleCampaignClass.RedrawAfterSpecialWinRewardOpened();
|
|
}
|
|
}
|