feat(battle-engine): EffectType full enum + collection/card/vfx extension copies
Replaces partial EffectMgr.EffectType with all 226 decomp values; copies the IsNotNullOrEmpty/EquelsID/FindFromCardId/GetAllFuncVfxResults extension files + UI extensions; adds Renderer/MeshFilter shared-material/mesh/sortingOrder. Compile loop then closed the revealed deps (3242 files). 9.1k -> 18 errors.
This commit is contained in:
127
SVSim.BattleEngine/Engine/AreaBGInfoSection20.cs
Normal file
127
SVSim.BattleEngine/Engine/AreaBGInfoSection20.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
|
||||
public class AreaBGInfoSection20
|
||||
{
|
||||
public const int SECTION_ID = 20;
|
||||
|
||||
public const int WERUSA_START = 10;
|
||||
|
||||
private const int WERUSA_END = 17;
|
||||
|
||||
private const int WERUSA_BG_SECTION_ID = 12;
|
||||
|
||||
private const int LEVIRU_START = 18;
|
||||
|
||||
private const int LEVIRU_END = 25;
|
||||
|
||||
private const int LEVIRU_BG_SECTION_ID = 10;
|
||||
|
||||
private const int IZUNIA_CHANGE_TEXTURE_START = 3;
|
||||
|
||||
private const int IZUNIA_END = 9;
|
||||
|
||||
private const int IZUNIA_BG_SECTION_ID = 2;
|
||||
|
||||
public const int NATERA_START = 26;
|
||||
|
||||
private const int NATERA_END = 33;
|
||||
|
||||
private const int NATERA_BG_SECTION_ID = 9;
|
||||
|
||||
private const int LAST_BATTLE_START = 34;
|
||||
|
||||
private const int LAST_BATTLE_END = 40;
|
||||
|
||||
private const int LAST_BATTLE_BG_SECTION_ID = 20;
|
||||
|
||||
public static List<ChapterExtraData> GetChapterExtraDatas()
|
||||
{
|
||||
List<ChapterExtraData> list = new List<ChapterExtraData>();
|
||||
list.AddRange(Chapter1_2());
|
||||
list.AddRange(Chapter3_9());
|
||||
list.AddRange(OtherWorldChapters(10, 17, 12, new List<int> { 1, 2, 6, 7 }, addTreeEffect: true));
|
||||
list.AddRange(OtherWorldChapters(18, 25, 10, new List<int> { 1, 2 }, addTreeEffect: true));
|
||||
list.AddRange(OtherWorldChapters(26, 33, 9, new List<int> { 2, 3, 4, 7, 8, 9 }, addTreeEffect: true));
|
||||
list.AddRange(OtherWorldChapters(34, 40, 20, null, addTreeEffect: false));
|
||||
return list;
|
||||
}
|
||||
|
||||
private static List<ChapterExtraData> OtherWorldChapters(int start, int end, int section, List<int> extraTextureIndex, bool addTreeEffect)
|
||||
{
|
||||
List<ChapterExtraData> list = new List<ChapterExtraData>();
|
||||
for (int i = start; i <= end; i++)
|
||||
{
|
||||
ChapterExtraData chapterExtraData = new ChapterExtraData
|
||||
{
|
||||
SectionId = 20,
|
||||
ExtraTextureChapter = i,
|
||||
BGSectionId = section
|
||||
};
|
||||
chapterExtraData.AddTreeEffect = addTreeEffect;
|
||||
if (i == 17 || i == 25 || i == 33)
|
||||
{
|
||||
chapterExtraData.BGExtraEffectPath = "scn_map_change_9";
|
||||
chapterExtraData.SeType = Se.TYPE.SE_MAP_SECTION9_CHANGE_CHAPTER;
|
||||
}
|
||||
if (extraTextureIndex.IsNotNullOrEmpty())
|
||||
{
|
||||
chapterExtraData.ExtraTextureIndex = extraTextureIndex;
|
||||
chapterExtraData.BGSuffix = "b";
|
||||
}
|
||||
list.Add(chapterExtraData);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private static List<ChapterExtraData> Chapter1_2()
|
||||
{
|
||||
return new List<ChapterExtraData>
|
||||
{
|
||||
new ChapterExtraData
|
||||
{
|
||||
SectionId = 20,
|
||||
ExtraTextureChapter = 1,
|
||||
BGExtraEffectPath = "scn_map_change_9",
|
||||
SeType = Se.TYPE.SE_MAP_SECTION20_CHANGE_CHAPTER1
|
||||
},
|
||||
new ChapterExtraData
|
||||
{
|
||||
SectionId = 20,
|
||||
ExtraTextureChapter = 2,
|
||||
BGExtraEffectPath = "scn_map_change_8",
|
||||
AttachExtraEffectToBgRoot = true,
|
||||
SeType = Se.TYPE.SE_MAP_TREE_EFFECT
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static List<ChapterExtraData> Chapter3_9()
|
||||
{
|
||||
List<ChapterExtraData> list = new List<ChapterExtraData>();
|
||||
for (int i = 3; i <= 9; i++)
|
||||
{
|
||||
ChapterExtraData chapterExtraData = new ChapterExtraData
|
||||
{
|
||||
SectionId = 20,
|
||||
ExtraTextureChapter = i,
|
||||
ExtraTextureIndex = { 1, 2, 6 },
|
||||
BGSectionId = 2,
|
||||
BGSuffix = "b"
|
||||
};
|
||||
if (i == 9)
|
||||
{
|
||||
chapterExtraData.BGExtraEffectPath = "scn_map_change_9";
|
||||
chapterExtraData.SeType = Se.TYPE.SE_MAP_SECTION9_CHANGE_CHAPTER;
|
||||
}
|
||||
list.Add(chapterExtraData);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static bool IsSpeedUpParticleTransition(int previousChapter, int nextChapter)
|
||||
{
|
||||
bool flag = previousChapter == 33 && nextChapter == 32;
|
||||
return previousChapter == 0 || flag;
|
||||
}
|
||||
}
|
||||
39
SVSim.BattleEngine/Engine/AreaSelectUtility.cs
Normal file
39
SVSim.BattleEngine/Engine/AreaSelectUtility.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class AreaSelectUtility
|
||||
{
|
||||
public const string BTN_IMAGE_NAME_SUFFIX_OFF = "{0}_off";
|
||||
|
||||
public const string BTN_IMAGE_NAME_SUFFIX_ON = "{0}_on";
|
||||
|
||||
public static readonly string ChapterSelectBtnPathPrefix = "btn_story_select";
|
||||
|
||||
public static readonly Color32 CLEAR_LABEL_COLOR_CLEARD_GRADIENT_TOP = new Color32(byte.MaxValue, 245, 161, byte.MaxValue);
|
||||
|
||||
public static readonly Color32 CLEAR_LABEL_COLOR_CLEARD_GRADIENT_BUTTOM = new Color32(byte.MaxValue, 209, 71, byte.MaxValue);
|
||||
|
||||
public static readonly Color32 CLEAR_LABEL_COLOR_CLEARD_EFFECT_OUTLINE8 = new Color32(94, 67, 31, byte.MaxValue);
|
||||
|
||||
public static readonly Color32 CLEAR_LABEL_COLOR_ALREADY_READ_GRADIENT_TOP = new Color32(245, 249, byte.MaxValue, byte.MaxValue);
|
||||
|
||||
public static readonly Color32 CLEAR_LABEL_COLOR_ALREADY_READ_GRADIENT_BUTTOM = new Color32(190, 218, 242, byte.MaxValue);
|
||||
|
||||
public static readonly Color32 CLEAR_LABEL_COLOR_ALREADY_READ_EFFECT_OUTLINE8 = new Color32(60, 73, 96, byte.MaxValue);
|
||||
|
||||
public static void SetClearLabelColor(UILabel clearLabel, StoryChapterData.ChapterClearStatus clearState)
|
||||
{
|
||||
switch (clearState)
|
||||
{
|
||||
case StoryChapterData.ChapterClearStatus.Cleared:
|
||||
clearLabel.gradientTop = CLEAR_LABEL_COLOR_CLEARD_GRADIENT_TOP;
|
||||
clearLabel.gradientBottom = CLEAR_LABEL_COLOR_CLEARD_GRADIENT_BUTTOM;
|
||||
clearLabel.effectColor = CLEAR_LABEL_COLOR_CLEARD_EFFECT_OUTLINE8;
|
||||
break;
|
||||
case StoryChapterData.ChapterClearStatus.AlreadyRead:
|
||||
clearLabel.gradientTop = CLEAR_LABEL_COLOR_ALREADY_READ_GRADIENT_TOP;
|
||||
clearLabel.gradientBottom = CLEAR_LABEL_COLOR_ALREADY_READ_GRADIENT_BUTTOM;
|
||||
clearLabel.effectColor = CLEAR_LABEL_COLOR_ALREADY_READ_EFFECT_OUTLINE8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
175
SVSim.BattleEngine/Engine/ArenaEntryDialogBase.cs
Normal file
175
SVSim.BattleEngine/Engine/ArenaEntryDialogBase.cs
Normal file
@@ -0,0 +1,175 @@
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public abstract class ArenaEntryDialogBase : MonoBehaviour
|
||||
{
|
||||
protected Se.TYPE _entryButtonSe = Se.TYPE.SYS_BTN_DECIDE_TRANS;
|
||||
|
||||
private const int CHECK_DIALOG_DEPTH = 10;
|
||||
|
||||
private ArenaEntryDataBase _entryData;
|
||||
|
||||
private ArenaEntryDialogData _dialogData;
|
||||
|
||||
protected ArenaData.eARENA_PAY _payType;
|
||||
|
||||
public bool IsCompetition;
|
||||
|
||||
protected string _mainTextId;
|
||||
|
||||
protected string _ticketSpriteName;
|
||||
|
||||
protected string _arenaNameTextId;
|
||||
|
||||
public DialogBase ParentDialog { get; set; }
|
||||
|
||||
protected abstract void Init();
|
||||
|
||||
protected abstract int GetTicketNum();
|
||||
|
||||
protected abstract ArenaEntryDataBase GetEntryData();
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Init();
|
||||
_entryData = GetEntryData();
|
||||
_dialogData = GetComponent<ArenaEntryDialogData>();
|
||||
SystemText systemText = Data.SystemText;
|
||||
if (_dialogData._mainText != null)
|
||||
{
|
||||
_dialogData._mainText.text = systemText.Get(_mainTextId);
|
||||
}
|
||||
if (_dialogData._ticketHaveTitle != null)
|
||||
{
|
||||
_dialogData._ticketHaveTitle.text = systemText.Get("Arena_0037");
|
||||
_dialogData._ticketHaveNum.text = GetTicketNum().ToString();
|
||||
_dialogData._ticketHaveUnit.text = systemText.Get("Common_0117");
|
||||
_dialogData._ticketButtonTitle.text = systemText.Get("Arena_0004");
|
||||
_dialogData._ticketButtonSubTitle.text = systemText.Get("Arena_0038");
|
||||
_dialogData._ticketButtonUseNum.text = _entryData.ticketCost.ToString();
|
||||
_dialogData._ticketSprite.spriteName = _ticketSpriteName;
|
||||
_dialogData._ticketButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
if (ParentDialog.GetNowScene() == DialogBase.DialogScene.WAIT)
|
||||
{
|
||||
OnClickTicketEntryButton();
|
||||
}
|
||||
}));
|
||||
}
|
||||
if (_dialogData._rupyHaveTitle != null)
|
||||
{
|
||||
_dialogData._rupyHaveTitle.text = systemText.Get("Shop_0065");
|
||||
_dialogData._rupyHaveNum.text = PlayerStaticData.UserRupyCount.ToString();
|
||||
_dialogData._rupyHaveUnit.text = systemText.Get("Common_0120");
|
||||
_dialogData._rupyButtonTitle.text = (IsCompetition ? systemText.Get("Competition_0067") : systemText.Get("Arena_0036"));
|
||||
_dialogData._rupyButtonSubTitle.text = systemText.Get("Shop_0062");
|
||||
_dialogData._rupyButtonUseNum.text = _entryData.rupyCost.ToString();
|
||||
_dialogData._rupyButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
if (ParentDialog.GetNowScene() == DialogBase.DialogScene.WAIT)
|
||||
{
|
||||
OnClickRupyEntryButton();
|
||||
}
|
||||
}));
|
||||
}
|
||||
_dialogData._crystalHaveTitle.text = systemText.Get("Shop_0064");
|
||||
_dialogData._crystalHaveNum.text = PlayerStaticData.UserCrystalCount.ToString();
|
||||
_dialogData._crystalHaveUnit.text = systemText.Get("Common_0116");
|
||||
_dialogData._crystalButtonTitle.text = (IsCompetition ? systemText.Get("Competition_0046") : systemText.Get("Arena_0023"));
|
||||
_dialogData._crystalButtonSubTitle.text = systemText.Get("Shop_0061");
|
||||
_dialogData._crystalButtonUseNum.text = _entryData.crystalCost.ToString();
|
||||
if (_entryData.ticketCost > GetTicketNum())
|
||||
{
|
||||
SetButtonDisable(_dialogData._ticketButton, _dialogData._ticketButtonTitle);
|
||||
}
|
||||
if (_entryData.rupyCost > PlayerStaticData.UserRupyCount)
|
||||
{
|
||||
SetButtonDisable(_dialogData._rupyButton, _dialogData._rupyButtonTitle);
|
||||
}
|
||||
_dialogData._crystalButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
if (ParentDialog.GetNowScene() == DialogBase.DialogScene.WAIT)
|
||||
{
|
||||
OnClickCrystalEntryButton();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private void SetButtonDisable(UIButton in_Button, UILabel in_Label)
|
||||
{
|
||||
in_Button.GetComponent<UIButton>().isEnabled = false;
|
||||
in_Label.color = LabelDefine.TEXT_COLOR_BUTTON_DISABLE;
|
||||
in_Button.GetComponent<TweenColor>().duration = 0f;
|
||||
}
|
||||
|
||||
private void OnClickTicketEntryButton()
|
||||
{
|
||||
int ticketNum = GetTicketNum();
|
||||
SystemText systemText = Data.SystemText;
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetTitleLabel(systemText.Get("Arena_0005"));
|
||||
dialogBase.SetPanelDepth(10);
|
||||
ArenaBuyDialog component = Object.Instantiate(_dialogData.BuyDialogObject).GetComponent<ArenaBuyDialog>();
|
||||
dialogBase.SetObj(component.gameObject);
|
||||
component.SetTicketConfirmDialog(_entryData.ticketCost, ticketNum, _arenaNameTextId, _ticketSpriteName);
|
||||
dialogBase.onPushButton1 = Entry;
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(systemText.Get("Dia_Arena_003_Button"));
|
||||
dialogBase.ClickSe_Btn1 = _entryButtonSe;
|
||||
_payType = ArenaData.eARENA_PAY.Ticket;
|
||||
}
|
||||
|
||||
private void OnClickCrystalEntryButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
if (PlayerStaticData.IsLootBoxRegulation(_entryData.LootBoxType))
|
||||
{
|
||||
LootBoxDialogUtility.CreateLootBoxRegulationDialog(_entryData.LootBoxType);
|
||||
return;
|
||||
}
|
||||
if (_entryData.crystalCost > PlayerStaticData.UserCrystalCount)
|
||||
{
|
||||
ShopCommonUtility.CreateCrystalShortagePopup();
|
||||
return;
|
||||
}
|
||||
int userCrystalCount = PlayerStaticData.UserCrystalCount;
|
||||
SystemText systemText = Data.SystemText;
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetTitleLabel(systemText.Get("Arena_0005"));
|
||||
dialogBase.SetPanelDepth(10);
|
||||
ArenaBuyDialog component = Object.Instantiate(_dialogData.BuyDialogObject).GetComponent<ArenaBuyDialog>();
|
||||
dialogBase.SetObj(component.gameObject);
|
||||
component.SetClystalConfirmDialog(_entryData.crystalCost, userCrystalCount, _arenaNameTextId, _entryData.ExpirtyInfo);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
string text_btn = (IsCompetition ? systemText.Get("Competition_0036") : systemText.Get("Dia_Arena_004_Button"));
|
||||
dialogBase.SetButtonText(text_btn);
|
||||
dialogBase.ClickSe_Btn1 = _entryButtonSe;
|
||||
dialogBase.onPushButton1 = Entry;
|
||||
_payType = ArenaData.eARENA_PAY.Crystal;
|
||||
}
|
||||
|
||||
private void OnClickRupyEntryButton()
|
||||
{
|
||||
int userRupyCount = PlayerStaticData.UserRupyCount;
|
||||
SystemText systemText = Data.SystemText;
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetTitleLabel(systemText.Get("Arena_0005"));
|
||||
dialogBase.SetPanelDepth(10);
|
||||
ArenaBuyDialog component = Object.Instantiate(_dialogData.BuyDialogObject).GetComponent<ArenaBuyDialog>();
|
||||
dialogBase.SetObj(component.gameObject);
|
||||
component.SetRupyConfirmDialog(_entryData.rupyCost, userRupyCount, _arenaNameTextId);
|
||||
dialogBase.onPushButton1 = Entry;
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
string text_btn = (IsCompetition ? systemText.Get("Competition_0036") : systemText.Get("Dia_Arena_005_Button"));
|
||||
dialogBase.SetButtonText(text_btn);
|
||||
dialogBase.ClickSe_Btn1 = _entryButtonSe;
|
||||
_payType = ArenaData.eARENA_PAY.Rupy;
|
||||
}
|
||||
|
||||
protected virtual void Entry()
|
||||
{
|
||||
ParentDialog.CloseWithoutSelect();
|
||||
}
|
||||
}
|
||||
52
SVSim.BattleEngine/Engine/ArenaEntryDialogData.cs
Normal file
52
SVSim.BattleEngine/Engine/ArenaEntryDialogData.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ArenaEntryDialogData : MonoBehaviour
|
||||
{
|
||||
public GameObject BuyDialogObject;
|
||||
|
||||
public UILabel _mainText;
|
||||
|
||||
public UISprite _ticketSprite;
|
||||
|
||||
public UIButton _ticketButton;
|
||||
|
||||
public UIButton _rupyButton;
|
||||
|
||||
public UIButton _crystalButton;
|
||||
|
||||
public UILabel _ticketHaveTitle;
|
||||
|
||||
public UILabel _ticketHaveNum;
|
||||
|
||||
public UILabel _ticketHaveUnit;
|
||||
|
||||
public UILabel _ticketButtonTitle;
|
||||
|
||||
public UILabel _ticketButtonSubTitle;
|
||||
|
||||
public UILabel _ticketButtonUseNum;
|
||||
|
||||
public UILabel _rupyHaveTitle;
|
||||
|
||||
public UILabel _rupyHaveNum;
|
||||
|
||||
public UILabel _rupyHaveUnit;
|
||||
|
||||
public UILabel _rupyButtonTitle;
|
||||
|
||||
public UILabel _rupyButtonSubTitle;
|
||||
|
||||
public UILabel _rupyButtonUseNum;
|
||||
|
||||
public UILabel _crystalHaveTitle;
|
||||
|
||||
public UILabel _crystalHaveNum;
|
||||
|
||||
public UILabel _crystalHaveUnit;
|
||||
|
||||
public UILabel _crystalButtonTitle;
|
||||
|
||||
public UILabel _crystalButtonSubTitle;
|
||||
|
||||
public UILabel _crystalButtonUseNum;
|
||||
}
|
||||
29
SVSim.BattleEngine/Engine/BattleCardBaseExtensions.cs
Normal file
29
SVSim.BattleEngine/Engine/BattleCardBaseExtensions.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard.Battle;
|
||||
using Wizard.Battle.View;
|
||||
|
||||
public static class BattleCardBaseExtensions
|
||||
{
|
||||
public static List<IBattleCardView> ConvertToViewList(this IList<BattleCardBase> battleCardBaseList)
|
||||
{
|
||||
return battleCardBaseList?.Select((BattleCardBase c) => c.BattleCardView).ToList();
|
||||
}
|
||||
|
||||
public static BattleCardBase FindFromCardId(this IList<BattleCardBase> battleCardBaseList, IBattleCardUniqueID cardId)
|
||||
{
|
||||
if (battleCardBaseList == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
for (int i = 0; i < battleCardBaseList.Count; i++)
|
||||
{
|
||||
BattleCardBase battleCardBase = battleCardBaseList[i];
|
||||
if (battleCardBase.EquelsID(cardId))
|
||||
{
|
||||
return battleCardBase;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
125
SVSim.BattleEngine/Engine/BattleFinishResponsProcessing.cs
Normal file
125
SVSim.BattleEngine/Engine/BattleFinishResponsProcessing.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using LitJson;
|
||||
using Wizard;
|
||||
|
||||
public class BattleFinishResponsProcessing
|
||||
{
|
||||
public void Processing(JsonData ResponseData, MatchFinishBase matchFinishData)
|
||||
{
|
||||
matchFinishData.IsProcessed = true;
|
||||
if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.RankBattle && Data.CurrentFormat != Format.Crossover)
|
||||
{
|
||||
if (ResponseData["data"].Keys.Contains("target_grand_master_point"))
|
||||
{
|
||||
UserRank.IsGrandMasterAvailability = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
UserRank.IsGrandMasterAvailability = false;
|
||||
}
|
||||
}
|
||||
Data.RedEtherCampaignResultData = null;
|
||||
if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumNormal || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumTwoPick || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumHof || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumWindFall || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumAvatar)
|
||||
{
|
||||
Data.ArenaData.ColosseumData.ResultEffect = ArenaColosseum.eResultEffect.None;
|
||||
}
|
||||
RankMatchFinishDetail rankMatchFinishDetail = matchFinishData as RankMatchFinishDetail;
|
||||
matchFinishData._responseData = ResponseData;
|
||||
JsonData jsonData = ResponseData["data"];
|
||||
foreach (string key in jsonData.Keys)
|
||||
{
|
||||
JsonData jsonData2 = jsonData[key.ToString()];
|
||||
if (jsonData2 == null)
|
||||
{
|
||||
if (key.ToString() == "user_promotion_match" && UserRank.IsGrandMasterAvailability && PlayerStaticData.IsMasterRankCurrentFormat())
|
||||
{
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.is_promotion = false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
switch (key.ToString())
|
||||
{
|
||||
case "battle_result":
|
||||
switch (jsonData2.ToInt())
|
||||
{
|
||||
case 0:
|
||||
matchFinishData.battleResult = BattleManagerBase.BATTLE_RESULT_TYPE.LOSE;
|
||||
break;
|
||||
case 1:
|
||||
matchFinishData.battleResult = BattleManagerBase.BATTLE_RESULT_TYPE.WIN;
|
||||
break;
|
||||
case 2:
|
||||
matchFinishData.battleResult = BattleManagerBase.BATTLE_RESULT_TYPE.CONSISTENCY;
|
||||
break;
|
||||
}
|
||||
(BattleManagerBase.GetIns() as NetworkBattleManagerBase).BattleResultType = matchFinishData.battleResult;
|
||||
break;
|
||||
case "get_class_experience":
|
||||
matchFinishData.get_class_chara_experience = jsonData2.ToInt();
|
||||
break;
|
||||
case "class_experience":
|
||||
matchFinishData.class_chara_experience = jsonData2.ToInt();
|
||||
break;
|
||||
case "class_level":
|
||||
matchFinishData.class_chara_level = jsonData2.ToInt();
|
||||
break;
|
||||
case "achieved_info":
|
||||
matchFinishData.AchievedInfo.Read(jsonData2);
|
||||
break;
|
||||
case "is_master_rank":
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].is_master_rank = jsonData2.ToInt() != 0;
|
||||
break;
|
||||
case "is_grand_master_rank":
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].is_grand_master_rank = jsonData2.ToInt() != 0;
|
||||
break;
|
||||
case "user_promotion_match":
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.match_count = jsonData2["match_count"].ToInt();
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.battle_result = jsonData2["battle_result"].ToInt();
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.win = jsonData2["win"].ToInt();
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.lose = jsonData2["lose"].ToInt();
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.is_promotion = jsonData2["is_promotion"].ToBoolean();
|
||||
break;
|
||||
case "current_grand_master_point":
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].grandMasterData.currentMasterPoint = jsonData2.ToInt();
|
||||
UserRank.IsGrandMasterAvailability = true;
|
||||
break;
|
||||
case "target_grand_master_point":
|
||||
Data.Load.data._userRank[(int)Data.CurrentFormat].grandMasterData.targetMasterPoint = jsonData2.ToInt();
|
||||
UserRank.IsGrandMasterAvailability = true;
|
||||
break;
|
||||
case "reward_list":
|
||||
PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(jsonData2);
|
||||
break;
|
||||
case "colosseum_special_params":
|
||||
if (jsonData2.Keys.Contains("next_round"))
|
||||
{
|
||||
Data.ArenaData.ColosseumData.ResultEffect = ArenaColosseum.eResultEffect.None;
|
||||
if (jsonData2["next_round"].ToInt() == 2)
|
||||
{
|
||||
Data.ArenaData.ColosseumData.ResultEffect = ArenaColosseum.eResultEffect.GroupA;
|
||||
}
|
||||
else if (jsonData2["next_round"].ToInt() == 3)
|
||||
{
|
||||
Data.ArenaData.ColosseumData.ResultEffect = ArenaColosseum.eResultEffect.Final;
|
||||
}
|
||||
}
|
||||
else if (jsonData2.Keys.Contains("is_champion") && jsonData2["is_champion"].ToBoolean())
|
||||
{
|
||||
Data.ArenaData.ColosseumData.ResultEffect = ArenaColosseum.eResultEffect.Clear;
|
||||
}
|
||||
break;
|
||||
case "red_ether_campagin_info":
|
||||
Data.RedEtherCampaignResultData = new RedEtherCampaignResultData(jsonData2);
|
||||
break;
|
||||
case "battle_dialog_list":
|
||||
if (rankMatchFinishDetail != null)
|
||||
{
|
||||
rankMatchFinishDetail.HomeDialogData = new MyPageHomeDialogData(ResponseData["data"], "battle_dialog_list");
|
||||
}
|
||||
break;
|
||||
case "upgrade_treasure_box_info":
|
||||
matchFinishData.TreasureBoxCpResultInfo.Parse(jsonData2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
SVSim.BattleEngine/Engine/BattlePlayersExtension.cs
Normal file
21
SVSim.BattleEngine/Engine/BattlePlayersExtension.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using Wizard.Battle;
|
||||
|
||||
public static class BattlePlayersExtension
|
||||
{
|
||||
public static IEnumerable<IReadOnlyBattleCardInfo> AllCards(this IEnumerable<IBattlePlayerReadOnlyInfo> battlePlayerInfos)
|
||||
{
|
||||
List<IReadOnlyBattleCardInfo> list = new List<IReadOnlyBattleCardInfo>();
|
||||
foreach (IBattlePlayerReadOnlyInfo battlePlayerInfo in battlePlayerInfos)
|
||||
{
|
||||
list.Add(battlePlayerInfo.SkillInfoClass);
|
||||
list.AddRange(battlePlayerInfo.SkillInfoHandCards);
|
||||
list.AddRange(battlePlayerInfo.SkillInfoDeckCards);
|
||||
list.AddRange(battlePlayerInfo.SkillInfoInPlayCards);
|
||||
list.AddRange(battlePlayerInfo.SkillInfoCemeterys);
|
||||
list.AddRange(battlePlayerInfo.SkillInfoBanishCards);
|
||||
list.AddRange(battlePlayerInfo.SkillInfoNecromanceZoneCards);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
116
SVSim.BattleEngine/Engine/BuyCrystal.cs
Normal file
116
SVSim.BattleEngine/Engine/BuyCrystal.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class BuyCrystal : MonoBehaviour
|
||||
{
|
||||
public static void CreateBuyCrystal(bool isPlaySe = true, string scrollToProductId = null, bool onlyInputBirthday = false, Action onCancel = null, Action onFinish = null, bool isSpecialCrystal = false)
|
||||
{
|
||||
if (isPlaySe)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
}
|
||||
if (!onlyInputBirthday && Data.Load.data._userCrystalCount.EnableSpecialCrystal)
|
||||
{
|
||||
SpecialCrystalDialog.Create(UIManager.GetInstance().LegendCrystalBuyDialogPrefab, scrollToProductId, onCancel, onFinish);
|
||||
}
|
||||
else
|
||||
{
|
||||
InstantiateCrystalDialog(scrollToProductId, onlyInputBirthday, onCancel, onFinish, isSpecialCrystal);
|
||||
}
|
||||
}
|
||||
|
||||
public static void InstantiateCrystalDialog(string scrollToProductId = null, bool onlyInputBirthday = false, Action onCancel = null, Action onFinish = null, bool isSpecialCrystal = false)
|
||||
{
|
||||
PaymentPC instance = PaymentPC.GetInstance();
|
||||
instance.initialize();
|
||||
instance.ProductListFailed += PaymentListErrorDialog;
|
||||
instance.ProductListSucceeded += delegate
|
||||
{
|
||||
OpenItemList(scrollToProductId, onlyInputBirthday, onCancel, onFinish, isSpecialCrystal);
|
||||
};
|
||||
}
|
||||
|
||||
private static void CheckVideoHostingRunningAndOpenItemList(string scrollToProductid, bool onlyInputBirthday = false, Action onCancel = null, Action onFinish = null, bool isSpecialCrystal = false)
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording() || SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublising())
|
||||
{
|
||||
VideoHostingUtil.CreateDialogPrivacyBuyCrystalEnter(delegate
|
||||
{
|
||||
OpenItemList(scrollToProductid, onlyInputBirthday, onCancel, onFinish, isSpecialCrystal);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenItemList(scrollToProductid, onlyInputBirthday, onCancel, onFinish, isSpecialCrystal);
|
||||
}
|
||||
}
|
||||
|
||||
private static void OpenItemList(string scrollToProductId, bool onlyInputBirthday = false, Action onCancel = null, Action onFinish = null, bool isSpecialCrystal = false)
|
||||
{
|
||||
BuyCrystal buyCrystal = UnityEngine.Object.Instantiate(UIManager.GetInstance().BuyCrystalPrefab);
|
||||
UIManager.GetInstance().IsCrystalDialogExe = true;
|
||||
DialogBase dialog = UIManager.GetInstance().CreateDialogClose();
|
||||
dialog.SetSize(DialogBase.Size.M);
|
||||
dialog.SetTitleLabel(Data.SystemText.Get("Shop_0003"));
|
||||
dialog.SetObj(buyCrystal.gameObject);
|
||||
dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialog.isNotCloseWindowButton1 = true;
|
||||
dialog.SetButtonText(Data.SystemText.Get("Dia_BuyCrystal_001_Button"));
|
||||
dialog.OnClose = delegate
|
||||
{
|
||||
if (!isSpecialCrystal || !onlyInputBirthday)
|
||||
{
|
||||
PaymentImpl.GetInstance().finalize();
|
||||
}
|
||||
if (VideoHostingUtil.IsAutoPauseRecording() || VideoHostingUtil.IsAutoPausePublishing())
|
||||
{
|
||||
VideoHostingUtil.CreateDialogPrivacyBuyCrystalExit();
|
||||
}
|
||||
UIManager.GetInstance().IsCrystalDialogExe = false;
|
||||
};
|
||||
UIManager.GetInstance().closeInSceneLoading();
|
||||
CreateItemList item_list = buyCrystal.gameObject.GetComponent<CreateItemList>();
|
||||
item_list.ParentDialogBase = dialog;
|
||||
item_list.ScrollToProductId = scrollToProductId;
|
||||
item_list.IsOnlyInputBirthday = onlyInputBirthday;
|
||||
item_list.OnFinishUpdateBirthday = delegate
|
||||
{
|
||||
onFinish.Call();
|
||||
if (onlyInputBirthday)
|
||||
{
|
||||
dialog.Close();
|
||||
}
|
||||
};
|
||||
dialog.onPushButton1 = delegate
|
||||
{
|
||||
item_list.BirthUpdateButtonClickCallBack();
|
||||
};
|
||||
dialog.onPushButton2 = delegate
|
||||
{
|
||||
item_list.BirthCancelButtonClickCallBack();
|
||||
};
|
||||
dialog.onCloseWithoutSelect = delegate
|
||||
{
|
||||
onCancel.Call();
|
||||
};
|
||||
}
|
||||
|
||||
public static void PaymentListErrorDialog()
|
||||
{
|
||||
if (BattleManagerBase.GetIns() == null)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Shop_0094"));
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetText(Data.SystemText.Get("Shop_0093"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.SetPanelDepth(100);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClickCredit()
|
||||
{
|
||||
}
|
||||
}
|
||||
51
SVSim.BattleEngine/Engine/ColosseumEntryDialog.cs
Normal file
51
SVSim.BattleEngine/Engine/ColosseumEntryDialog.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using Cute;
|
||||
using Wizard;
|
||||
|
||||
public class ColosseumEntryDialog : ArenaEntryDialogBase
|
||||
{
|
||||
public ColosseumEntry ColosseumEntryClass { get; set; }
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
_mainTextId = "Colosseum_0004";
|
||||
_ticketSpriteName = "icon_colosseum_s";
|
||||
_arenaNameTextId = "Colosseum_0006";
|
||||
_entryButtonSe = Se.TYPE.SYS_BTN_DECIDE;
|
||||
}
|
||||
|
||||
protected override int GetTicketNum()
|
||||
{
|
||||
return PlayerStaticData.UserColosseumTicketNum;
|
||||
}
|
||||
|
||||
protected override ArenaEntryDataBase GetEntryData()
|
||||
{
|
||||
return Data.ArenaData.ColosseumData;
|
||||
}
|
||||
|
||||
protected override void Entry()
|
||||
{
|
||||
base.Entry();
|
||||
ColosseumEntryTask colosseumEntryTask = new ColosseumEntryTask();
|
||||
colosseumEntryTask.SetParameter(_payType);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(colosseumEntryTask, EntryTaskSuccess));
|
||||
}
|
||||
|
||||
private void EntryTaskSuccess(NetworkTask.ResultCode inResult)
|
||||
{
|
||||
base.ParentDialog.CloseWithoutSelect();
|
||||
ColosseumEntryClass.EntryTaskSuccess(inResult);
|
||||
}
|
||||
|
||||
private void DeckSetAndMoveColosseum(DeckData inDeckData, bool isBattleEnd)
|
||||
{
|
||||
Data.ArenaData.ColosseumData.DeckList.Clear();
|
||||
Data.ArenaData.ColosseumData.DeckList.Add(inDeckData);
|
||||
ColosseumDeckEntryTask colosseumDeckEntryTask = new ColosseumDeckEntryTask();
|
||||
colosseumDeckEntryTask.SetParameter(Data.ArenaData.ColosseumData.DeckList, isPublished: false);
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(colosseumDeckEntryTask, delegate
|
||||
{
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Colosseum);
|
||||
}));
|
||||
}
|
||||
}
|
||||
51
SVSim.BattleEngine/Engine/ColosseumHeadLine.cs
Normal file
51
SVSim.BattleEngine/Engine/ColosseumHeadLine.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class ColosseumHeadLine : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _ticketNum;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _ticketCost;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _rupyNum;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _rupyCost;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _crystalNum;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _crystalCost;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
UpdateHeadLine();
|
||||
}
|
||||
|
||||
public void UpdateHeadLine()
|
||||
{
|
||||
int ticketCost = Data.ArenaData.ColosseumData.ticketCost;
|
||||
int rupyCost = Data.ArenaData.ColosseumData.rupyCost;
|
||||
int crystalCost = Data.ArenaData.ColosseumData.crystalCost;
|
||||
SystemText systemText = Data.SystemText;
|
||||
if (_ticketNum != null)
|
||||
{
|
||||
_ticketNum.text = PlayerStaticData.UserColosseumTicketNum.ToString();
|
||||
_ticketCost.text = systemText.Get("Arena_0045", ticketCost.ToString());
|
||||
}
|
||||
if (_rupyNum != null)
|
||||
{
|
||||
_rupyNum.text = PlayerStaticData.UserRupyCount.ToString();
|
||||
_rupyCost.text = systemText.Get("Arena_0047", rupyCost.ToString());
|
||||
}
|
||||
if (_crystalNum != null)
|
||||
{
|
||||
_crystalNum.text = PlayerStaticData.UserCrystalCount.ToString();
|
||||
_crystalCost.text = systemText.Get("Arena_0046", crystalCost.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
27
SVSim.BattleEngine/Engine/ConventionDeckDeleteTask.cs
Normal file
27
SVSim.BattleEngine/Engine/ConventionDeckDeleteTask.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Wizard;
|
||||
|
||||
public class ConventionDeckDeleteTask : BaseTask
|
||||
{
|
||||
public class ConventionDeckDeleteTaskParam : BaseParam
|
||||
{
|
||||
public string tournament_id;
|
||||
|
||||
public int[] deck_no_list;
|
||||
|
||||
public int deck_format;
|
||||
}
|
||||
|
||||
public ConventionDeckDeleteTask()
|
||||
{
|
||||
base.type = ApiType.Type.ConventionDeckDelete;
|
||||
}
|
||||
|
||||
public void SetParameter(string tournament_id, int[] deck_no, Format format)
|
||||
{
|
||||
ConventionDeckDeleteTaskParam conventionDeckDeleteTaskParam = new ConventionDeckDeleteTaskParam();
|
||||
conventionDeckDeleteTaskParam.tournament_id = tournament_id;
|
||||
conventionDeckDeleteTaskParam.deck_no_list = deck_no;
|
||||
conventionDeckDeleteTaskParam.deck_format = Data.FormatConvertApi(format);
|
||||
base.Params = conventionDeckDeleteTaskParam;
|
||||
}
|
||||
}
|
||||
30
SVSim.BattleEngine/Engine/Cute.Payment/StringExtensions.cs
Normal file
30
SVSim.BattleEngine/Engine/Cute.Payment/StringExtensions.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Cute.Payment;
|
||||
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static string[] SubstringAtCount(this string self, int count)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
int num = (int)Math.Ceiling((double)self.Length / (double)count);
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
int num2 = count * i;
|
||||
if (self.Length <= num2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (self.Length < num2 + count)
|
||||
{
|
||||
list.Add(self.Substring(num2));
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(self.Substring(num2, count));
|
||||
}
|
||||
}
|
||||
return list.ToArray();
|
||||
}
|
||||
}
|
||||
12
SVSim.BattleEngine/Engine/Cute/IEnumerableExtensions.cs
Normal file
12
SVSim.BattleEngine/Engine/Cute/IEnumerableExtensions.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public static class IEnumerableExtensions
|
||||
{
|
||||
public static bool IsNotNullOrEmpty<T>(this IEnumerable<T> enumerable)
|
||||
{
|
||||
return enumerable?.Any() ?? false;
|
||||
}
|
||||
}
|
||||
199
SVSim.BattleEngine/Engine/Cute/NativePluginWrapper.cs
Normal file
199
SVSim.BattleEngine/Engine/Cute/NativePluginWrapper.cs
Normal file
@@ -0,0 +1,199 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public static class NativePluginWrapper
|
||||
{
|
||||
public enum BatteryState
|
||||
{
|
||||
UNKNOWN,
|
||||
DISCHARGING,
|
||||
CHARGING,
|
||||
FULL
|
||||
}
|
||||
|
||||
public enum NetworkMode
|
||||
{
|
||||
UNCONNECTED,
|
||||
WIFI,
|
||||
MOBILE
|
||||
}
|
||||
|
||||
public static void DeviceInit()
|
||||
{
|
||||
}
|
||||
|
||||
public static int GetUseResidentMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetUseVirtualMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetDeviceFreeMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetVmUseMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetVmFreeMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void SetStringToClipboard(string copyText)
|
||||
{
|
||||
ClipboardHelper.Clipboard = copyText;
|
||||
}
|
||||
|
||||
public static int GetAccelerometerRotation()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static void RequestAudioFocus()
|
||||
{
|
||||
}
|
||||
|
||||
public static void AbandonAudioFocus()
|
||||
{
|
||||
}
|
||||
|
||||
public static string GetMacAddressByName(string devicename)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void DispStatusBar(bool isDisp)
|
||||
{
|
||||
if (isDisp)
|
||||
{
|
||||
Screen.fullScreen = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Screen.fullScreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void RegistPhoneStateListener()
|
||||
{
|
||||
}
|
||||
|
||||
public static void UnregistPhoneStateListener()
|
||||
{
|
||||
}
|
||||
|
||||
public static int GetBatteryLevel()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static BatteryState GetBatteryState()
|
||||
{
|
||||
return BatteryState.UNKNOWN;
|
||||
}
|
||||
|
||||
public static int GetWifiAntenaLevel()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static NetworkMode GetNetworkMode()
|
||||
{
|
||||
return NetworkMode.UNCONNECTED;
|
||||
}
|
||||
|
||||
public static bool IsAirplaneMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetCdmaDbm()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCdmaEcio()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetEvdoDbm()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetEvdoEcio()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetDescriveContents()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static bool IsGsm()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetSignalHashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetGsmSignalStrength()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetGsmBitErrorRate()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void ShowToast(string text)
|
||||
{
|
||||
}
|
||||
|
||||
public static void DumpWWWCache()
|
||||
{
|
||||
}
|
||||
|
||||
public static void SetCacheMemorySize(int nMemSize)
|
||||
{
|
||||
}
|
||||
|
||||
public static int GetCacheDiskUsage()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCacheDiskCapacity()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCacheCurrentMemoryUsage()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCacheCurrentMemoryCapacity()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void ClearWWWCache()
|
||||
{
|
||||
}
|
||||
}
|
||||
23
SVSim.BattleEngine/Engine/Cute/PaymentCancelTask.cs
Normal file
23
SVSim.BattleEngine/Engine/Cute/PaymentCancelTask.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentCancelTask : NetworkTask
|
||||
{
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentCancel;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(PaymentSkuInfo skuInfo, string errorMessage)
|
||||
{
|
||||
PaymentStartCancelParams paymentStartCancelParams = new PaymentStartCancelParams();
|
||||
paymentStartCancelParams.payment.product_id = skuInfo.productId;
|
||||
paymentStartCancelParams.payment.currency_code = skuInfo.currencyCode;
|
||||
paymentStartCancelParams.payment.price = skuInfo.price;
|
||||
paymentStartCancelParams.error.message = errorMessage;
|
||||
base.Params = paymentStartCancelParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
return base.Parse();
|
||||
}
|
||||
}
|
||||
64
SVSim.BattleEngine/Engine/Cute/PaymentItemListTask.cs
Normal file
64
SVSim.BattleEngine/Engine/Cute/PaymentItemListTask.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentItemListTask : NetworkTask
|
||||
{
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentItemList;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
PaymentImpl instance = PaymentImpl.GetInstance();
|
||||
resultCode = (int)base.ResponseData["data_headers"]["result_code"];
|
||||
if (resultCode != 1)
|
||||
{
|
||||
return resultCode;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
instance.ProductIdList.Clear();
|
||||
instance.IdList.Clear();
|
||||
instance.ProductNameList.Clear();
|
||||
instance.ProductPriceList.Clear();
|
||||
instance.ProductTextList.Clear();
|
||||
instance.ProductPurchaseLimitList.Clear();
|
||||
instance.ProductPurchaseNumberList.Clear();
|
||||
instance.FormatProductPriceList.Clear();
|
||||
instance.ProductCsvIdList.Clear();
|
||||
instance.ProductImageNameList.Clear();
|
||||
instance.ProductIsSpecialShop.Clear();
|
||||
instance.ProductCurrentPurchaseCount.Clear();
|
||||
instance.ProductPurchaseLimitCount.Clear();
|
||||
instance.ProductEndTime.Clear();
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
JsonData jsonData2 = jsonData[i];
|
||||
string text = jsonData2["store_product_id"].ToString();
|
||||
string value = jsonData2["name"].ToString().Replace("\\n", "\n");
|
||||
string value2 = jsonData2["text"].ToString();
|
||||
string text2 = jsonData2["purchase_limit"].ToString();
|
||||
string text3 = jsonData2["id"].ToString();
|
||||
string value3 = jsonData2["image_name"].ToString();
|
||||
string value4 = jsonData2["end_time"].ToString();
|
||||
bool value5 = ((jsonData2["special_shop_flag"].ToInt() != 0) ? true : false);
|
||||
instance.ProductIdList.Add(text);
|
||||
instance.IdList.Add(text3);
|
||||
instance.ProductNameList.Add(text, value);
|
||||
instance.ProductTextList.Add(text, value2);
|
||||
instance.ProductPurchaseLimitList.Add(text3, text2);
|
||||
instance.ProductPurchaseLimitCount.Add(text, int.Parse(text2));
|
||||
instance.ProductImageNameList.Add(text, value3);
|
||||
if (jsonData2.Keys.Contains("number_of_product_purchased") && jsonData2["number_of_product_purchased"] != null)
|
||||
{
|
||||
string text4 = jsonData2["number_of_product_purchased"].ToString();
|
||||
instance.ProductPurchaseNumberList.Add(text3, text4);
|
||||
instance.ProductCurrentPurchaseCount.Add(text, int.Parse(text4));
|
||||
}
|
||||
instance.ProductCsvIdList.Add(text, text3);
|
||||
instance.ProductIsSpecialShop.Add(text, value5);
|
||||
instance.ProductEndTime.Add(text, value4);
|
||||
}
|
||||
return resultCode;
|
||||
}
|
||||
}
|
||||
61
SVSim.BattleEngine/Engine/Cute/PaymentPCItemListTask.cs
Normal file
61
SVSim.BattleEngine/Engine/Cute/PaymentPCItemListTask.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentPCItemListTask : NetworkTask
|
||||
{
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentPCItemList;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
PaymentPC instance = PaymentPC.GetInstance();
|
||||
resultCode = (int)base.ResponseData["data_headers"]["result_code"];
|
||||
if (resultCode != 1)
|
||||
{
|
||||
return resultCode;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
instance.ProductIdList.Clear();
|
||||
instance.IdList.Clear();
|
||||
instance.ProductNameList.Clear();
|
||||
instance.ProductPriceList.Clear();
|
||||
instance.ProductTextList.Clear();
|
||||
instance.ProductPurchaseLimitList.Clear();
|
||||
instance.FormatProductPriceList.Clear();
|
||||
instance.ProductCsvIdList.Clear();
|
||||
instance.ProductImageNameList.Clear();
|
||||
instance.ProductIsSpecialShop.Clear();
|
||||
instance.ProductCurrentPurchaseCount.Clear();
|
||||
instance.ProductEndTime.Clear();
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
JsonData jsonData2 = jsonData[i];
|
||||
string text = jsonData2["store_product_id"].ToString();
|
||||
string value = jsonData2["name"].ToString().Replace("\\n", "\n");
|
||||
string value2 = jsonData2["text"].ToString();
|
||||
string value3 = jsonData2["price"].ToString();
|
||||
string text2 = jsonData2["purchase_limit"].ToString();
|
||||
string text3 = jsonData2["id"].ToString();
|
||||
string value4 = jsonData2["image_name"].ToString();
|
||||
string value5 = jsonData2["end_time"].ToString();
|
||||
bool value6 = ((jsonData2["special_shop_flag"].ToInt() != 0) ? true : false);
|
||||
int value7 = jsonData2["purchase_num_current"].ToInt();
|
||||
instance.ProductIdList.Add(text);
|
||||
instance.IdList.Add(text3);
|
||||
instance.ProductNameList.Add(text, value);
|
||||
instance.ProductPriceList.Add(text, value3);
|
||||
instance.FormatProductPriceList.Add(text, value3);
|
||||
instance.ProductTextList.Add(text, value2);
|
||||
instance.ProductPurchaseLimitList.Add(text3, text2);
|
||||
instance.ProductCsvIdList.Add(text, text3);
|
||||
instance.ProductImageNameList.Add(text, value4);
|
||||
instance.ProductIsSpecialShop.Add(text, value6);
|
||||
instance.ProductCurrentPurchaseCount.Add(text, value7);
|
||||
instance.ProductPurchaseLimitCount.Add(text, int.Parse(text2));
|
||||
instance.ProductEndTime.Add(text, value5);
|
||||
}
|
||||
return resultCode;
|
||||
}
|
||||
}
|
||||
32
SVSim.BattleEngine/Engine/Cute/PaymentStartTask.cs
Normal file
32
SVSim.BattleEngine/Engine/Cute/PaymentStartTask.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentStartTask : NetworkTask
|
||||
{
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentStart;
|
||||
|
||||
public PaymentBase.RefundWarningType NeedRefundWarningType { get; private set; }
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(PaymentSkuInfo skuInfo, bool isAlertAgree, bool isAlertActive)
|
||||
{
|
||||
PaymentStartCancelParams paymentStartCancelParams = new PaymentStartCancelParams();
|
||||
paymentStartCancelParams.payment.product_id = skuInfo.productId;
|
||||
paymentStartCancelParams.payment.currency_code = skuInfo.currencyCode;
|
||||
paymentStartCancelParams.payment.price = skuInfo.price;
|
||||
paymentStartCancelParams.payment.isalertagree = (isAlertAgree ? 1 : 0);
|
||||
paymentStartCancelParams.payment.isalertactive = (isAlertActive ? 1 : 0);
|
||||
base.Params = paymentStartCancelParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
NeedRefundWarningType = (PaymentBase.RefundWarningType)base.ResponseData["data"]["refund_penalty_type"].ToInt();
|
||||
return num;
|
||||
}
|
||||
}
|
||||
14
SVSim.BattleEngine/Engine/Cute/SceneType.cs
Normal file
14
SVSim.BattleEngine/Engine/Cute/SceneType.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Cute;
|
||||
|
||||
public enum SceneType
|
||||
{
|
||||
None,
|
||||
_Splash,
|
||||
GameTitle,
|
||||
Title,
|
||||
Battle,
|
||||
CardList,
|
||||
GAMESCENE_TYPE_MAX,
|
||||
_SoftwareReset,
|
||||
TYPE_MAX
|
||||
}
|
||||
34
SVSim.BattleEngine/Engine/Cute/UpdateBirthTask.cs
Normal file
34
SVSim.BattleEngine/Engine/Cute/UpdateBirthTask.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class UpdateBirthTask : NetworkTask
|
||||
{
|
||||
private class UpdateBirthPostParams : PostParams
|
||||
{
|
||||
public string birth = "";
|
||||
}
|
||||
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.BirthUpdate;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(string birth)
|
||||
{
|
||||
UpdateBirthPostParams updateBirthPostParams = new UpdateBirthPostParams();
|
||||
updateBirthPostParams.birth = birth;
|
||||
base.Params = updateBirthPostParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
CreateItemList.BirthDayUpdateServerTime = base.ResponseData["data_headers"]["servertime"].ToInt();
|
||||
CreateItemList.BirthDayUpdateRealTime = Time.realtimeSinceStartup;
|
||||
return num;
|
||||
}
|
||||
}
|
||||
21
SVSim.BattleEngine/Engine/DeckDecisionColosseum.cs
Normal file
21
SVSim.BattleEngine/Engine/DeckDecisionColosseum.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class DeckDecisionColosseum : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _descTextLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _deckNameTextLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _descText2Label;
|
||||
|
||||
public void Init(DeckData inDeck)
|
||||
{
|
||||
_descTextLabel.text = Data.SystemText.Get("Card_0006");
|
||||
_deckNameTextLabel.text = Data.SystemText.Get("Card_0299", inDeck.GetDeckName());
|
||||
_descText2Label.text = Data.SystemText.Get("Colosseum_0081");
|
||||
}
|
||||
}
|
||||
41
SVSim.BattleEngine/Engine/DeckDecisionCompetition.cs
Normal file
41
SVSim.BattleEngine/Engine/DeckDecisionCompetition.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Dialog.Setting;
|
||||
|
||||
public class DeckDecisionCompetition : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _descTextLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _deckNameTextLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _descText2Label;
|
||||
|
||||
[SerializeField]
|
||||
private ItemToggle _toggle;
|
||||
|
||||
public void Init(DeckData inDeck)
|
||||
{
|
||||
_descTextLabel.text = Data.SystemText.Get("Card_0006");
|
||||
_deckNameTextLabel.text = Data.SystemText.Get("Card_0299", inDeck.GetDeckName());
|
||||
_descText2Label.text = Data.SystemText.Get("Colosseum_0081");
|
||||
SettingToggle();
|
||||
}
|
||||
|
||||
protected ItemToggle SettingToggle()
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = _toggle;
|
||||
item.SetTitleLabel(systemText.Get("Colosseum_0085"));
|
||||
item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.COMPETITION_PUBLISHED_SETTING));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
bool value = item.GetValue();
|
||||
PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.COMPETITION_PUBLISHED_SETTING, value);
|
||||
});
|
||||
item.SetActive_SeparatorLine(isActive: true);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
38
SVSim.BattleEngine/Engine/DeckDeleteTask.cs
Normal file
38
SVSim.BattleEngine/Engine/DeckDeleteTask.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Wizard;
|
||||
|
||||
public class DeckDeleteTask : BaseTask
|
||||
{
|
||||
public class DeckDeleteTaskParam : BaseParam
|
||||
{
|
||||
public int[] deck_no_list;
|
||||
|
||||
public int deck_format;
|
||||
}
|
||||
|
||||
private Format _updateDeckFormat;
|
||||
|
||||
public DeckDeleteTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckDelete;
|
||||
}
|
||||
|
||||
public void SetParameter(int[] deck_no, Format format)
|
||||
{
|
||||
DeckDeleteTaskParam deckDeleteTaskParam = new DeckDeleteTaskParam();
|
||||
deckDeleteTaskParam.deck_no_list = deck_no;
|
||||
deckDeleteTaskParam.deck_format = Data.FormatConvertApi(format);
|
||||
base.Params = deckDeleteTaskParam;
|
||||
_updateDeckFormat = format;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
DeckListUtility.ParseDeckInfoResponceData(base.ResponseData["data"], _updateDeckFormat);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
380
SVSim.BattleEngine/Engine/DeckSortDragDrop.cs
Normal file
380
SVSim.BattleEngine/Engine/DeckSortDragDrop.cs
Normal file
@@ -0,0 +1,380 @@
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class DeckSortDragDrop : UIDragDropItem
|
||||
{
|
||||
protected enum DropType
|
||||
{
|
||||
None,
|
||||
Sort,
|
||||
Add
|
||||
}
|
||||
|
||||
private const int UIPANEL_DEPTH = 50;
|
||||
|
||||
private const float DRAG_OBJECT_ALPHA = 0.5f;
|
||||
|
||||
private const float SORT_DELTA_UNDER = 5f;
|
||||
|
||||
private const float PAGE_CHANGE_INTERVAL_TIME = 0.75f;
|
||||
|
||||
public DeckListMenuUI DeckListMenuClass;
|
||||
|
||||
protected Vector3 _defaultPosition;
|
||||
|
||||
protected Transform _defaultParentTransform;
|
||||
|
||||
protected UIPanel _uiPanel;
|
||||
|
||||
protected Camera _deckListCamera;
|
||||
|
||||
protected string _sortExecTargetName;
|
||||
|
||||
protected bool _isHighSpeedCheck;
|
||||
|
||||
protected Vector3 _oldMousePosition;
|
||||
|
||||
protected bool _isDragStart;
|
||||
|
||||
protected bool _isPress;
|
||||
|
||||
protected bool _isSortExecEvenOnce;
|
||||
|
||||
protected float _pageChangeIntervalTime;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
IsGridRepositionUse = false;
|
||||
_deckListCamera = UIManager.GetInstance().transform.Find("UIRoot/CameraUI").GetComponent<Camera>();
|
||||
_pageChangeIntervalTime = 0f;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
if (_isHighSpeedCheck)
|
||||
{
|
||||
if (IsSortDrag() && !DeckListMenuClass.IsPlayingSortAnimation)
|
||||
{
|
||||
if ((_oldMousePosition - Input.mousePosition).magnitude == 0f)
|
||||
{
|
||||
bool isDrop = true;
|
||||
if (_isPress)
|
||||
{
|
||||
isDrop = false;
|
||||
}
|
||||
CurrentTouchPositionSort(isDrop);
|
||||
_isHighSpeedCheck = false;
|
||||
}
|
||||
_oldMousePosition = Input.mousePosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
_isHighSpeedCheck = false;
|
||||
}
|
||||
}
|
||||
if (_isDragStart && !DeckListMenuClass.IsPlayingSortAnimation)
|
||||
{
|
||||
_pageChangeIntervalTime += Time.deltaTime;
|
||||
PageChangeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPress(bool isPressed)
|
||||
{
|
||||
if (_isPress != isPressed && DeckListMenuClass.IsSortMode)
|
||||
{
|
||||
if (isPressed && !DeckListMenuClass.IsSortDragging)
|
||||
{
|
||||
if (!DeckListMenuClass.IsPlayingSortAnimation)
|
||||
{
|
||||
base.OnPress(isPressed);
|
||||
DragDropStart();
|
||||
}
|
||||
}
|
||||
else if (IsSortDrag())
|
||||
{
|
||||
base.OnPress(isPressed);
|
||||
SetDragStatus(isDrag: false);
|
||||
Object.Destroy(_uiPanel);
|
||||
CurrentTouchPositionSort(isDrop: true);
|
||||
if (_isSortExecEvenOnce)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
}
|
||||
_isSortExecEvenOnce = false;
|
||||
_isDragStart = false;
|
||||
}
|
||||
}
|
||||
_isPress = isPressed;
|
||||
}
|
||||
|
||||
protected override void OnDragStart()
|
||||
{
|
||||
if (!DeckListMenuClass.IsPlayingSortAnimation)
|
||||
{
|
||||
base.OnDragStart();
|
||||
}
|
||||
}
|
||||
|
||||
protected void DragDropStart()
|
||||
{
|
||||
if (DeckListMenuClass.IsSortMode && !IsSortDrag())
|
||||
{
|
||||
SetDragStatus(isDrag: true);
|
||||
mTrans = base.transform;
|
||||
base.transform.parent.GetComponent<UIGrid>().Reposition();
|
||||
_defaultParentTransform = base.transform.parent;
|
||||
_defaultPosition = base.transform.localPosition;
|
||||
base.transform.parent = _deckListCamera.transform;
|
||||
base.transform.gameObject.GetComponent<BoxCollider>().enabled = false;
|
||||
_uiPanel = base.gameObject.AddComponent<UIPanel>();
|
||||
_uiPanel.depth = 50;
|
||||
base.gameObject.GetComponent<DeckUI>().UpdateUIAlpha(0.5f);
|
||||
base.transform.position = _deckListCamera.ScreenToWorldPoint(Input.mousePosition);
|
||||
_isDragStart = true;
|
||||
_isSortExecEvenOnce = false;
|
||||
_pageChangeIntervalTime = 0.75f;
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDragDropMove(Vector2 delta)
|
||||
{
|
||||
base.transform.position = _deckListCamera.ScreenToWorldPoint(Input.mousePosition);
|
||||
if (!DeckListMenuClass.IsSortMode || DeckListMenuClass.IsPlayingSortAnimation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch (UICamera.hoveredObject.name)
|
||||
{
|
||||
case "LeftDragArea":
|
||||
return;
|
||||
case "LeftArrow":
|
||||
return;
|
||||
case "RightArrow":
|
||||
return;
|
||||
case "RightDragArea":
|
||||
return;
|
||||
}
|
||||
if (delta.magnitude < 5f)
|
||||
{
|
||||
DeckFrame inRetObject = null;
|
||||
switch (GetSortTaget(UICamera.hoveredObject, out inRetObject))
|
||||
{
|
||||
case DropType.Sort:
|
||||
DeckSort(inRetObject.Transform.gameObject, inDrop: false);
|
||||
break;
|
||||
case DropType.Add:
|
||||
AddExec(inRetObject, inDrop: false);
|
||||
break;
|
||||
}
|
||||
_isHighSpeedCheck = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_isHighSpeedCheck = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected void DeckSort(GameObject inDropObject, bool inDrop)
|
||||
{
|
||||
bool flag = false;
|
||||
if (inDropObject != null)
|
||||
{
|
||||
if (inDropObject.GetComponent<DeckSortDragDrop>() != null)
|
||||
{
|
||||
if (_sortExecTargetName != inDropObject.name)
|
||||
{
|
||||
flag = true;
|
||||
if (DeckListMenuClass.DeckSort(inDropObject.name, base.name, ref _defaultPosition))
|
||||
{
|
||||
_defaultParentTransform = base.gameObject.transform.parent;
|
||||
base.transform.parent = _deckListCamera.transform;
|
||||
}
|
||||
if (inDrop)
|
||||
{
|
||||
MoveReset();
|
||||
}
|
||||
else
|
||||
{
|
||||
base.transform.position = _deckListCamera.ScreenToWorldPoint(Input.mousePosition);
|
||||
}
|
||||
_sortExecTargetName = inDropObject.name;
|
||||
}
|
||||
}
|
||||
else if (inDrop)
|
||||
{
|
||||
MoveReset();
|
||||
}
|
||||
}
|
||||
else if (inDrop)
|
||||
{
|
||||
MoveReset();
|
||||
}
|
||||
_sortExecTargetName = string.Empty;
|
||||
if (flag)
|
||||
{
|
||||
_isSortExecEvenOnce = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected void AddExec(DeckFrame inAddObject, bool inDrop)
|
||||
{
|
||||
DeckListMenuClass.DeckSortAddLast(inAddObject);
|
||||
_defaultParentTransform = base.gameObject.transform.parent;
|
||||
_defaultPosition = base.transform.localPosition;
|
||||
if (!inDrop)
|
||||
{
|
||||
base.transform.parent = _deckListCamera.transform;
|
||||
base.transform.position = _deckListCamera.ScreenToWorldPoint(Input.mousePosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveReset();
|
||||
}
|
||||
_isSortExecEvenOnce = true;
|
||||
}
|
||||
|
||||
protected DropType GetSortTaget(GameObject inDropObject, out DeckFrame inRetObject)
|
||||
{
|
||||
inRetObject = new DeckFrame();
|
||||
if (inDropObject.GetComponent<DeckSortDragDrop>() != null)
|
||||
{
|
||||
string text = ((!(inDropObject.transform.position.x > _deckListCamera.ScreenToWorldPoint(Input.mousePosition).x)) ? (int.Parse(inDropObject.transform.name) + 1).ToString() : inDropObject.transform.name);
|
||||
Transform transform = null;
|
||||
for (int i = 0; i < DeckListMenuClass.DeckPageList.Count; i++)
|
||||
{
|
||||
transform = DeckListMenuClass.DeckPageList[i].transform.Find(text);
|
||||
if (transform != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (text == base.gameObject.name)
|
||||
{
|
||||
return DropType.None;
|
||||
}
|
||||
if (transform == null || transform.GetComponent<DeckSortDragDrop>() == null)
|
||||
{
|
||||
inRetObject.Transform = base.gameObject.transform;
|
||||
inRetObject.DeckId = DeckListMenuClass.GetDeckNoFromGameObject(inRetObject.Transform.gameObject);
|
||||
return DropType.Add;
|
||||
}
|
||||
inRetObject.Transform = transform.gameObject.transform;
|
||||
inRetObject.DeckId = DeckListMenuClass.GetDeckNoFromGameObject(inRetObject.Transform.gameObject);
|
||||
return DropType.Sort;
|
||||
}
|
||||
return DropType.None;
|
||||
}
|
||||
|
||||
protected void CurrentTouchPositionSort(bool isDrop)
|
||||
{
|
||||
DeckFrame inRetObject = new DeckFrame();
|
||||
GameObject gameObject = null;
|
||||
BetterList<UICamera.DepthEntry> hitsList = UICamera.GetHitsList();
|
||||
for (int i = 0; i < hitsList.buffer.Length; i++)
|
||||
{
|
||||
if (hitsList.buffer[i].go != null && (bool)hitsList.buffer[i].go.GetComponent<DeckSortDragDrop>())
|
||||
{
|
||||
gameObject = hitsList[i].go;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (gameObject != null)
|
||||
{
|
||||
switch (GetSortTaget(gameObject, out inRetObject))
|
||||
{
|
||||
case DropType.Sort:
|
||||
DeckSort(inRetObject.Transform.gameObject, isDrop);
|
||||
break;
|
||||
case DropType.Add:
|
||||
AddExec(inRetObject, isDrop);
|
||||
break;
|
||||
default:
|
||||
DeckSort(null, isDrop);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DeckSort(null, isDrop);
|
||||
}
|
||||
}
|
||||
|
||||
public void SortAnimeComplete()
|
||||
{
|
||||
base.gameObject.GetComponent<BoxCollider>().enabled = true;
|
||||
}
|
||||
|
||||
protected void MoveReset()
|
||||
{
|
||||
mParent = _defaultParentTransform;
|
||||
base.transform.SetParent(_defaultParentTransform);
|
||||
base.transform.localPosition = _defaultPosition;
|
||||
base.gameObject.GetComponent<DeckUI>().UpdateUIAlpha(1f);
|
||||
base.transform.gameObject.GetComponent<BoxCollider>().enabled = true;
|
||||
}
|
||||
|
||||
private void OnApplicationPause(bool paused)
|
||||
{
|
||||
if (_isPress && paused)
|
||||
{
|
||||
OnPress(isPressed: false);
|
||||
StopDragging(UICamera.hoveredObject);
|
||||
mPressed = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void PageChangeUpdate()
|
||||
{
|
||||
BetterList<UICamera.DepthEntry> hitsList = UICamera.GetHitsList();
|
||||
for (int i = 0; i < hitsList.buffer.Length; i++)
|
||||
{
|
||||
if (!(hitsList.buffer[i].go != null))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (hitsList.buffer[i].go.name == "LeftDragArea")
|
||||
{
|
||||
if (_pageChangeIntervalTime > 0.75f)
|
||||
{
|
||||
DeckListMenuClass.PrevPage();
|
||||
_pageChangeIntervalTime = 0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (hitsList.buffer[i].go.name == "RightDragArea")
|
||||
{
|
||||
if (_pageChangeIntervalTime > 0.75f)
|
||||
{
|
||||
DeckListMenuClass.NextPage();
|
||||
_pageChangeIntervalTime = 0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsSortDrag()
|
||||
{
|
||||
if (DeckListMenuClass.IsSortDragging && DeckListMenuClass.SortDragObject == base.gameObject)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void SetDragStatus(bool isDrag)
|
||||
{
|
||||
if (isDrag)
|
||||
{
|
||||
DeckListMenuClass.IsSortDragging = true;
|
||||
DeckListMenuClass.SortDragObject = base.gameObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
DeckListMenuClass.IsSortDragging = false;
|
||||
DeckListMenuClass.SortDragObject = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
103
SVSim.BattleEngine/Engine/DialogRewardScroll.cs
Normal file
103
SVSim.BattleEngine/Engine/DialogRewardScroll.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Wizard.Scripts.Network.Data.TableData;
|
||||
|
||||
public class DialogRewardScroll : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIWrapContentWizard WrapContent;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject Item;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollBarWrapContent ScrollBar;
|
||||
|
||||
[SerializeField]
|
||||
private WrapContentsScrollBarSize WrapScrollbar;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollView ScrollView;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _emptyLabel;
|
||||
|
||||
private const int SCROLL_ITEM_COUNT = 10;
|
||||
|
||||
private const int HISTORY_ITEM_SPRITE_WIDTH = 800;
|
||||
|
||||
private GameObject[] Items;
|
||||
|
||||
private List<ItemAcquireHistory> _currentList;
|
||||
|
||||
public List<ItemAcquireHistory> CurrentList
|
||||
{
|
||||
get
|
||||
{
|
||||
return _currentList;
|
||||
}
|
||||
set
|
||||
{
|
||||
_currentList = value;
|
||||
_emptyLabel.gameObject.SetActive(_currentList.Count == 0);
|
||||
}
|
||||
}
|
||||
|
||||
public ResourceHandler Handler { get; set; }
|
||||
|
||||
public void Start()
|
||||
{
|
||||
CreateSomeItems();
|
||||
WrapContent.onInitializeItem = InitScrollItem;
|
||||
ScrollBar.m_WrapContents = WrapContent;
|
||||
}
|
||||
|
||||
public void resetScrollWrap()
|
||||
{
|
||||
WrapContent.minIndex = -(CurrentList.Count - 1);
|
||||
WrapContent.maxIndex = 0;
|
||||
ScrollView.ResetPosition();
|
||||
WrapContent.resetItems();
|
||||
WrapScrollbar.ContentUpdate();
|
||||
ScrollView.ResetPosition();
|
||||
ScrollBar.gameObject.SetActive(value: true);
|
||||
ScrollView.UpdateScrollbars();
|
||||
}
|
||||
|
||||
private void InitScrollItem(GameObject obj, int wrapIndex, int realIndex)
|
||||
{
|
||||
GameObject gameObject = obj.transform.GetChild(0).gameObject;
|
||||
if (-realIndex < 0 || -realIndex >= CurrentList.Count)
|
||||
{
|
||||
gameObject.SetActive(value: false);
|
||||
return;
|
||||
}
|
||||
gameObject.SetActive(value: true);
|
||||
int num = -realIndex;
|
||||
SetHistoryItem(gameObject, CurrentList[num], num == CurrentList.Count - 1);
|
||||
}
|
||||
|
||||
private void SetHistoryItem(GameObject item, ItemAcquireHistory history, bool isLastItem)
|
||||
{
|
||||
item.GetComponent<UISprite>().width = 800;
|
||||
item.GetComponent<AchievementWindowBase>().SetHistoryItem(history, !isLastItem, Handler);
|
||||
}
|
||||
|
||||
private void CreateSomeItems()
|
||||
{
|
||||
Items = new GameObject[10];
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
GameObject gameObject = new GameObject();
|
||||
Transform obj = gameObject.transform;
|
||||
obj.parent = WrapContent.transform;
|
||||
obj.localPosition = Vector3.zero;
|
||||
obj.localRotation = Quaternion.identity;
|
||||
obj.localScale = Vector3.one;
|
||||
gameObject.layer = WrapContent.gameObject.layer;
|
||||
NGUITools.AddChild(gameObject, Item).SetActive(value: true);
|
||||
gameObject.SetActive(value: true);
|
||||
Items[i] = gameObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
566
SVSim.BattleEngine/Engine/Mail.cs
Normal file
566
SVSim.BattleEngine/Engine/Mail.cs
Normal file
@@ -0,0 +1,566 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.ErrorDialog;
|
||||
|
||||
public class Mail : UIBase
|
||||
{
|
||||
private enum TAB_TYPE
|
||||
{
|
||||
NONE,
|
||||
GIFT,
|
||||
HISTORY
|
||||
}
|
||||
|
||||
private enum MAIL_ACTION_TYPE
|
||||
{
|
||||
NONE,
|
||||
READ,
|
||||
READALL
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private NguiObjs HistoryButton;
|
||||
|
||||
[SerializeField]
|
||||
private NguiObjs GiftButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel GiftInfoLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _giftTabButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _historyTabButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _allReceiveButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel MailEmptyLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIWrapContentWizard WrapContent;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject MailTemplate;
|
||||
|
||||
[SerializeField]
|
||||
private NguiObjs ReadAllMailButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject MailReceive;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollBarWrapContent ScrollBar;
|
||||
|
||||
[SerializeField]
|
||||
private WrapContentsScrollBarSize WrapScrollbar;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollView ScrollView;
|
||||
|
||||
private const int SCROLL_ITEM_COUNT = 5;
|
||||
|
||||
private List<GameObject> _scrollItems = new List<GameObject>();
|
||||
|
||||
private const int MaxMailObjIndex = 100;
|
||||
|
||||
private int _readMailID;
|
||||
|
||||
private List<MailData> _currentList;
|
||||
|
||||
private TopBar _topBar;
|
||||
|
||||
private TAB_TYPE _tabType;
|
||||
|
||||
private MAIL_ACTION_TYPE _mailActionType = MAIL_ACTION_TYPE.READ;
|
||||
|
||||
private const int HISTORY_MAX = 500;
|
||||
|
||||
private int _lastHistoryCount;
|
||||
|
||||
private List<string> _assetList = new List<string>();
|
||||
|
||||
private ResourceHandler _resourceHandler;
|
||||
|
||||
private bool IsTutorial => Wizard.Data.Load.data._userTutorial.TutorialStep != 100;
|
||||
|
||||
private void SetLanguage()
|
||||
{
|
||||
SystemText systemText = Wizard.Data.SystemText;
|
||||
HistoryButton.labels[0].text = systemText.Get("Mail_0024");
|
||||
GiftButton.labels[0].text = systemText.Get("Mail_0002");
|
||||
ReadAllMailButton.labels[0].text = systemText.Get("Mail_0004");
|
||||
MailEmptyLabel.text = systemText.Get("Mail_0006");
|
||||
}
|
||||
|
||||
public override void onFirstStart()
|
||||
{
|
||||
base.IsShowFooterMenu = true;
|
||||
base.onFirstStart();
|
||||
_topBar = UIManager.GetInstance().CreateTopBar(base.gameObject, Wizard.Data.SystemText.Get("Mail_0002"), UIManager.ViewScene.MyPage);
|
||||
SetLanguage();
|
||||
WrapContent.EnableNoLimit = false;
|
||||
WrapContent.onInitializeItem = InitScrollItem;
|
||||
ScrollBar.m_WrapContents = WrapContent;
|
||||
HistoryButton.buttons[0].onClick.Clear();
|
||||
HistoryButton.buttons[0].onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
GiftInfoLabel.text = Wizard.Data.SystemText.Get("Mail_0028", 100.ToString());
|
||||
ChangeHistory();
|
||||
}));
|
||||
GiftButton.buttons[0].onClick.Clear();
|
||||
GiftButton.buttons[0].onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
GiftInfoLabel.text = Wizard.Data.SystemText.Get("Mail_0027", 100.ToString());
|
||||
ChangeGift();
|
||||
}));
|
||||
UIEventListener.Get(ReadAllMailButton.gameObject).onClick = OnReadAllMail;
|
||||
ChangeGift();
|
||||
UIManager.GetInstance().SetLayerRecursive(base.transform, LayerMask.NameToLayer("MyPage"));
|
||||
_resourceHandler = base.gameObject.AddMissingComponent<ResourceHandler>();
|
||||
if (IsTutorial)
|
||||
{
|
||||
SetTutorialMode();
|
||||
ShowTutorialDialog();
|
||||
LoadTutorialResource();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadTutorialResource()
|
||||
{
|
||||
UIManager uiManager = UIManager.GetInstance();
|
||||
uiManager.Force_Increment_LockCountChangeView();
|
||||
_assetList.AddRange(GameMgr.GetIns().GetEffectMgr().InitCommonEffect("Json/EffectTutorialData", isBattle: true, isField: false, isBattleEffect: false, delegate
|
||||
{
|
||||
uiManager.Force_Decrement_LockCountChangeView();
|
||||
}));
|
||||
}
|
||||
|
||||
private void ShowTutorialDialog()
|
||||
{
|
||||
DialogBase dialogBase = MyPageMenu.CreateDialogForTutorial();
|
||||
dialogBase.SetText(Wizard.Data.SystemText.Get("Tutorial_0011"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
MyPageMenu.Instance.SetGuideToOkOnlyDialog(dialogBase);
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
MyPageMenu.Instance.SetGuideEffect(_allReceiveButton.transform, Vector3.zero, 0f);
|
||||
};
|
||||
}
|
||||
|
||||
private void SetTutorialMode()
|
||||
{
|
||||
UIManager.SetObjectToGrey(_historyTabButton.gameObject, b: true);
|
||||
UIManager.SetObjectToGrey(_giftTabButton.gameObject, b: true);
|
||||
_topBar.SetBackButtonEnable(enable: false);
|
||||
UIManager.SetObjectToGrey(_topBar.BuyCrystalButton.gameObject, b: true);
|
||||
_topBar.BuyCrystalButton.isEnabled = false;
|
||||
}
|
||||
|
||||
protected override void onOpen()
|
||||
{
|
||||
base.onOpen();
|
||||
_currentList = Wizard.Data.MailTop.data.mail_data_list;
|
||||
ResetScrollWrap();
|
||||
_tabType = TAB_TYPE.NONE;
|
||||
ChangeGift();
|
||||
GiftInfoLabel.text = Wizard.Data.SystemText.Get("Mail_0027", 100.ToString());
|
||||
if (Wizard.Data.MailTop.data.limitOverPresentDeleted)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Mail_0066"));
|
||||
dialogBase.SetText(Wizard.Data.SystemText.Get("Mail_0067"));
|
||||
dialogBase.SetSize(DialogBase.Size.S);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
}
|
||||
UIManager.GetInstance().OnReadyViewScene(isFadein: true);
|
||||
}
|
||||
|
||||
private void ResetScrollWrap()
|
||||
{
|
||||
CreateItems(_currentList.Count);
|
||||
WrapContent.minIndex = -(_currentList.Count - 1);
|
||||
WrapContent.maxIndex = 0;
|
||||
WrapScrollbar.ContentUpdate();
|
||||
WrapContent.SortBasedOnScrollMovement();
|
||||
ScrollView.ResetPosition();
|
||||
ScrollBar.gameObject.SetActive(value: true);
|
||||
ScrollView.UpdateScrollbars();
|
||||
}
|
||||
|
||||
private void InitScrollItem(GameObject obj, int wrapIndex, int realIndex)
|
||||
{
|
||||
GameObject gameObject = obj.transform.GetChild(0).gameObject;
|
||||
if (-realIndex < 0 || -realIndex >= _currentList.Count)
|
||||
{
|
||||
gameObject.SetActive(value: false);
|
||||
return;
|
||||
}
|
||||
gameObject.SetActive(value: true);
|
||||
int num = -realIndex;
|
||||
MailData mailData = _currentList[num];
|
||||
if (_tabType == TAB_TYPE.GIFT)
|
||||
{
|
||||
SetMailData(gameObject, mailData);
|
||||
}
|
||||
else if (_tabType == TAB_TYPE.HISTORY)
|
||||
{
|
||||
SetHistoryData(gameObject, mailData);
|
||||
}
|
||||
if (num < _currentList.Count - 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (_tabType == TAB_TYPE.GIFT)
|
||||
{
|
||||
MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask();
|
||||
if (Wizard.Data.MyPage.data.unread_mail_count > mailTopTask.LastPageRead * 100)
|
||||
{
|
||||
LoadNextPage();
|
||||
}
|
||||
}
|
||||
else if (_tabType == TAB_TYPE.HISTORY)
|
||||
{
|
||||
int count = Wizard.Data.MailTop.data.mail_history_list.Count;
|
||||
if (count >= 100 && count < 500 && _lastHistoryCount < 500)
|
||||
{
|
||||
LoadNextPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetMailData(GameObject item, MailData mailData)
|
||||
{
|
||||
item.name = mailData.mail_id.ToString();
|
||||
AchievementWindowBase component = item.GetComponent<AchievementWindowBase>();
|
||||
component.SetMail(mailData, OnReadMail, _resourceHandler);
|
||||
if (IsTutorial)
|
||||
{
|
||||
component.SetGetButtonToGreyOut();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsUseCommonBackground()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private void ChangeHistory()
|
||||
{
|
||||
if (_tabType != TAB_TYPE.HISTORY)
|
||||
{
|
||||
_tabType = TAB_TYPE.HISTORY;
|
||||
_currentList = Wizard.Data.MailTop.data.mail_history_list;
|
||||
_lastHistoryCount = _currentList.Count;
|
||||
ReadAllMailButton.gameObject.SetActive(value: false);
|
||||
MailEmptyLabel.gameObject.SetActive(_currentList.Count == 0);
|
||||
MailEmptyLabel.text = Wizard.Data.SystemText.Get("Mail_0029");
|
||||
HistoryButton.buttons[0].isEnabled = false;
|
||||
GiftButton.buttons[0].isEnabled = true;
|
||||
ResetScrollWrap();
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeGift()
|
||||
{
|
||||
if (_tabType != TAB_TYPE.GIFT)
|
||||
{
|
||||
_tabType = TAB_TYPE.GIFT;
|
||||
_currentList = Wizard.Data.MailTop.data.mail_data_list;
|
||||
ReadAllMailButton.gameObject.SetActive(value: true);
|
||||
bool flag = _currentList.Count == 0;
|
||||
UIManager.SetObjectToGrey(ReadAllMailButton.gameObject, flag);
|
||||
MailEmptyLabel.gameObject.SetActive(flag);
|
||||
MailEmptyLabel.text = Wizard.Data.SystemText.Get("Mail_0006");
|
||||
HistoryButton.buttons[0].isEnabled = true;
|
||||
GiftButton.buttons[0].isEnabled = false;
|
||||
ResetScrollWrap();
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateItems(int requiredCount)
|
||||
{
|
||||
for (int i = 0; i < _scrollItems.Count; i++)
|
||||
{
|
||||
UnityEngine.Object.DestroyImmediate(_scrollItems[i]);
|
||||
}
|
||||
_scrollItems.Clear();
|
||||
requiredCount = Mathf.Min(requiredCount, 5);
|
||||
for (int j = 0; j < requiredCount; j++)
|
||||
{
|
||||
GameObject gameObject = NGUITools.AddChild(WrapContent.gameObject);
|
||||
NGUITools.AddChild(gameObject, MailTemplate);
|
||||
gameObject.SetActive(value: true);
|
||||
_scrollItems.Add(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenReadAllDialog(GameObject g)
|
||||
{
|
||||
SystemText systemText = Wizard.Data.SystemText;
|
||||
DialogBase dialogBase = (IsTutorial ? MyPageMenu.CreateDialogForTutorial() : UIManager.GetInstance().CreateDialogClose());
|
||||
dialogBase.SetTitleLabel(systemText.Get("Mail_0011"));
|
||||
dialogBase.SetText(systemText.Get("Mail_0017"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(systemText.Get("Dia_Gift_001_Button"));
|
||||
dialogBase.onPushButton1 = StartReadRequest;
|
||||
if (IsTutorial)
|
||||
{
|
||||
dialogBase.Button2Grey = true;
|
||||
dialogBase.SetDialogNoClose();
|
||||
MyPageMenu.Instance.SetGuideToOkOnlyDialog(dialogBase);
|
||||
}
|
||||
}
|
||||
|
||||
private void PrepareReceiveSingleMail(int mail_index, int mail_id)
|
||||
{
|
||||
_readMailID = mail_id;
|
||||
}
|
||||
|
||||
private void StartReadRequest()
|
||||
{
|
||||
switch (_mailActionType)
|
||||
{
|
||||
case MAIL_ACTION_TYPE.READ:
|
||||
{
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
MailReadTask mailReadTask2 = new MailReadTask(1);
|
||||
mailReadTask2.SetParameter(new string[1] { _readMailID.ToString() }, 1, IsTutorial);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(mailReadTask2, OnRequestMailRead, delegate(NetworkTask.ResultCode error)
|
||||
{
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
BaseTask.OnRequestFailed(error);
|
||||
}, delegate(int error)
|
||||
{
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
BaseTask.OnFailedErrorCode(error);
|
||||
CheckAndRemoveExpiredMail();
|
||||
}));
|
||||
break;
|
||||
}
|
||||
case MAIL_ACTION_TYPE.READALL:
|
||||
{
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
MailReadTask mailReadTask = new MailReadTask(1);
|
||||
int num = ((_currentList.Count > 100) ? 100 : _currentList.Count);
|
||||
string[] array = new string[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
MailData mailData = _currentList[i];
|
||||
array[i] = mailData.mail_id.ToString();
|
||||
}
|
||||
mailReadTask.SetParameter(array, 1, IsTutorial);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(mailReadTask, OnRequestMailRead, delegate(NetworkTask.ResultCode error)
|
||||
{
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
BaseTask.OnRequestFailed(error);
|
||||
}, delegate(int error)
|
||||
{
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
BaseTask.OnFailedErrorCode(error);
|
||||
}));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnReadMail(int mail_index, int mail_id)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
_mailActionType = MAIL_ACTION_TYPE.READ;
|
||||
PrepareReceiveSingleMail(mail_index, mail_id);
|
||||
StartReadRequest();
|
||||
}
|
||||
|
||||
private void OnReadAllMail(GameObject g)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
_mailActionType = MAIL_ACTION_TYPE.READALL;
|
||||
OpenReadAllDialog(g);
|
||||
}
|
||||
|
||||
private void ShowReadDialog()
|
||||
{
|
||||
ReceiveReward receiveReward = base.gameObject.AddMissingComponent<ReceiveReward>();
|
||||
DialogBase dialogBase = receiveReward.ShowReadDialog(Wizard.Data.ReadMail.data.total_recieve_count_list, MailReceive, base.gameObject, _resourceHandler);
|
||||
if (IsTutorial)
|
||||
{
|
||||
MyPageMenu.Instance.SetGuideToOkOnlyDialog(dialogBase);
|
||||
receiveReward.SetAllButtonDisable();
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
ShowMoveToCardPackDialog();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowMoveToCardPackDialog()
|
||||
{
|
||||
SystemText systemText = Wizard.Data.SystemText;
|
||||
DialogBase dialogBase = MyPageMenu.CreateDialogForTutorial();
|
||||
dialogBase.SetText(systemText.Get("Tutorial_0012"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
MyPageMenu.Instance.SetGuideToOkOnlyDialog(dialogBase);
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
Footer footer = UIManager.GetInstance()._Footer;
|
||||
for (int i = 0; i < footer._underButtons.Length; i++)
|
||||
{
|
||||
footer.SetButtonEnableColorChange(i, i == 5);
|
||||
}
|
||||
MyPageMenu.Instance.SetGuideEffect(footer._underButtons[5].transform, MyPageItemHome.TUTORIAL_OFFSET_FOOTER, 180f);
|
||||
};
|
||||
}
|
||||
|
||||
private void OnRequestMailRead(NetworkTask.ResultCode error)
|
||||
{
|
||||
MyPageMenu.Instance.OnReadGift();
|
||||
_currentList = Wizard.Data.MailTop.data.mail_data_list;
|
||||
ResetScrollWrap();
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
bool flag = _currentList.Count == 0;
|
||||
UIManager.SetObjectToGrey(ReadAllMailButton.gameObject, flag);
|
||||
MailEmptyLabel.gameObject.SetActive(flag);
|
||||
if (Wizard.Data.ReadMail.data.is_unreceived_present)
|
||||
{
|
||||
DialogBase dialogBase = Dialog.Create(1601);
|
||||
if (_mailActionType != MAIL_ACTION_TYPE.READ)
|
||||
{
|
||||
dialogBase.SetText(Wizard.Data.SystemText.Get("Mail_0049"));
|
||||
}
|
||||
if (Wizard.Data.ReadMail.data.total_recieve_count_list.Count > 0)
|
||||
{
|
||||
dialogBase.OnClose = ShowReadDialog;
|
||||
}
|
||||
}
|
||||
else if (Wizard.Data.ReadMail.data.total_recieve_count_list.Count == 0)
|
||||
{
|
||||
SystemText systemText = Wizard.Data.SystemText;
|
||||
DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase2.CloseOnOff(flag: false);
|
||||
dialogBase2.SetSize(DialogBase.Size.M);
|
||||
dialogBase2.SetTitleLabel(systemText.Get("ErrorHeader_1601"));
|
||||
dialogBase2.SetText(systemText.Get("Mail_0053"));
|
||||
dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowReadDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetHistoryData(GameObject item, MailData mailData)
|
||||
{
|
||||
item.name = mailData.mail_id.ToString();
|
||||
item.GetComponent<AchievementWindowBase>().SetHistoryMail(mailData, _resourceHandler);
|
||||
}
|
||||
|
||||
public static string GetTimeLeft(long seconds_since_unix)
|
||||
{
|
||||
SystemText systemText = Wizard.Data.SystemText;
|
||||
MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask();
|
||||
long num = (long)Time.realtimeSinceStartup - mailTopTask.RequestTime;
|
||||
long num2 = mailTopTask.ServerTime + num;
|
||||
TimeSpan timeSpan = TimeSpan.FromSeconds(seconds_since_unix - num2);
|
||||
if (timeSpan.TotalDays >= 1.0)
|
||||
{
|
||||
return systemText.Get("Mail_0047", ((int)timeSpan.TotalDays).ToString());
|
||||
}
|
||||
if (timeSpan.TotalHours >= 1.0)
|
||||
{
|
||||
return systemText.Get("Mail_0046", ((int)timeSpan.TotalHours).ToString());
|
||||
}
|
||||
int num3 = (int)timeSpan.TotalMinutes;
|
||||
num3 = ((num3 > 0) ? ((num3 <= 1) ? 1 : num3) : 0);
|
||||
return systemText.Get("Mail_0048", num3.ToString());
|
||||
}
|
||||
|
||||
private void OnRequestMailList(NetworkTask.ResultCode error)
|
||||
{
|
||||
if (_tabType == TAB_TYPE.GIFT)
|
||||
{
|
||||
_currentList = Wizard.Data.MailTop.data.mail_data_list;
|
||||
}
|
||||
else if (_tabType == TAB_TYPE.HISTORY)
|
||||
{
|
||||
_currentList = Wizard.Data.MailTop.data.mail_history_list;
|
||||
}
|
||||
int count = Wizard.Data.MailTop.data.mail_history_list.Count;
|
||||
if (count == _lastHistoryCount)
|
||||
{
|
||||
_lastHistoryCount = 500;
|
||||
}
|
||||
else
|
||||
{
|
||||
_lastHistoryCount = count;
|
||||
}
|
||||
if (GameMgr.GetIns().GetMailTopTask().LastPageRead == 1)
|
||||
{
|
||||
ResetScrollWrap();
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateScrollSize();
|
||||
}
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}
|
||||
|
||||
private void LoadNextPage()
|
||||
{
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask();
|
||||
mailTopTask.SetParameterToNextPage();
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(mailTopTask, OnRequestMailList, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode));
|
||||
}
|
||||
|
||||
private void UpdateScrollSize()
|
||||
{
|
||||
WrapContent.minIndex = -(_currentList.Count - 1);
|
||||
WrapScrollbar.ContentUpdate();
|
||||
ScrollView.UpdateScrollbars();
|
||||
}
|
||||
|
||||
protected override void onClose()
|
||||
{
|
||||
base.onClose();
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_assetList);
|
||||
_assetList.Clear();
|
||||
_resourceHandler.UnloadAll();
|
||||
}
|
||||
|
||||
private void CheckAndRemoveExpiredMail()
|
||||
{
|
||||
bool flag = false;
|
||||
for (int num = _currentList.Count - 1; num >= 0; num--)
|
||||
{
|
||||
MailData mailData = _currentList[num];
|
||||
if (mailData.limit_type == 1 && IsExpired(mailData.reward_limit_time))
|
||||
{
|
||||
_currentList.RemoveAt(num);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
ResetScrollWrap();
|
||||
bool flag2 = _currentList.Count == 0;
|
||||
UIManager.SetObjectToGrey(ReadAllMailButton.gameObject, flag2);
|
||||
MailEmptyLabel.gameObject.SetActive(flag2);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsExpired(long seconds_since_unix)
|
||||
{
|
||||
MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask();
|
||||
long num = (long)Time.realtimeSinceStartup - mailTopTask.RequestTime;
|
||||
long num2 = mailTopTask.ServerTime + num;
|
||||
return TimeSpan.FromSeconds(seconds_since_unix - num2).TotalSeconds <= 0.0;
|
||||
}
|
||||
}
|
||||
46
SVSim.BattleEngine/Engine/OmoteLog.cs
Normal file
46
SVSim.BattleEngine/Engine/OmoteLog.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
internal class OmoteLog
|
||||
{
|
||||
private static bool mEnabled;
|
||||
|
||||
protected OmoteLog()
|
||||
{
|
||||
}
|
||||
|
||||
public static void SetEnable(bool enabled)
|
||||
{
|
||||
mEnabled = enabled;
|
||||
}
|
||||
|
||||
public static void Info(string format, params object[] args)
|
||||
{
|
||||
_ = mEnabled;
|
||||
}
|
||||
|
||||
public static void Warn(string format, params object[] args)
|
||||
{
|
||||
_ = mEnabled;
|
||||
}
|
||||
|
||||
public static void WarnUnless(bool assertion, string format, params object[] args)
|
||||
{
|
||||
if (!mEnabled)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static void Error(string format, params object[] args)
|
||||
{
|
||||
if (mEnabled)
|
||||
{
|
||||
Debug.LogError(string.Format(format, args));
|
||||
}
|
||||
}
|
||||
|
||||
public static void ErrorUnless(bool assertion, string format, params object[] args)
|
||||
{
|
||||
if (mEnabled && !assertion)
|
||||
{
|
||||
Debug.LogError(string.Format(format, args));
|
||||
}
|
||||
}
|
||||
}
|
||||
40
SVSim.BattleEngine/Engine/RoomInviteFriendColum.cs
Normal file
40
SVSim.BattleEngine/Engine/RoomInviteFriendColum.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Wizard.UIFriend;
|
||||
|
||||
public class RoomInviteFriendColum : FriendDataBase
|
||||
{
|
||||
[SerializeField]
|
||||
public UIButton ButtonObject;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _guildIcon;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _friendIcon;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel ButtonLabel;
|
||||
|
||||
[SerializeField]
|
||||
public GameObject UnderLineObject;
|
||||
|
||||
protected int EmblemId;
|
||||
|
||||
protected int DegreeId;
|
||||
|
||||
protected int RankId;
|
||||
|
||||
public override void SetPlayerData(Friend.PlayerData inPlayerData, List<string> inLoadList)
|
||||
{
|
||||
base.SetPlayerData(inPlayerData, inLoadList);
|
||||
if (_guildIcon != null)
|
||||
{
|
||||
_guildIcon.gameObject.SetActive(inPlayerData.IsSameGuildMember);
|
||||
}
|
||||
if (_friendIcon != null)
|
||||
{
|
||||
_friendIcon.gameObject.SetActive(inPlayerData.isFriend);
|
||||
}
|
||||
}
|
||||
}
|
||||
26
SVSim.BattleEngine/Engine/SetDataTranslateTask.cs
Normal file
26
SVSim.BattleEngine/Engine/SetDataTranslateTask.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Cute;
|
||||
using Wizard;
|
||||
|
||||
public class SetDataTranslateTask : NetworkTask
|
||||
{
|
||||
public class SetDataTranslateTaskParam : BaseParam
|
||||
{
|
||||
public string email_address;
|
||||
}
|
||||
|
||||
public override string Url => NtDataTranslateManager.GetInstance().GetSetTranslateInfoUrl();
|
||||
|
||||
public void SetParameter(string address)
|
||||
{
|
||||
SetDataTranslateTaskParam setDataTranslateTaskParam = new SetDataTranslateTaskParam();
|
||||
setDataTranslateTaskParam.email_address = address;
|
||||
base.Params = setDataTranslateTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int result = base.Parse();
|
||||
_ = 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
125
SVSim.BattleEngine/Engine/SpecialCrystalBuyFinishDialog.cs
Normal file
125
SVSim.BattleEngine/Engine/SpecialCrystalBuyFinishDialog.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class SpecialCrystalBuyFinishDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _label;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _tipsTexture;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _begginerRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _goToShopButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _goToShopButton2;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _nextSceneLabel;
|
||||
|
||||
private List<string> _assetList = new List<string>();
|
||||
|
||||
private SpecialCrystalInfo _specialCrystalInfo;
|
||||
|
||||
private DialogBase _dialog;
|
||||
|
||||
private string _productName;
|
||||
|
||||
private static bool NeedExtraResultDialog(SpecialCrystalInfo info)
|
||||
{
|
||||
if (!info.EnableExtraResult)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return info.ExtraResultPurchaseCount == info.AvailablePurchaseCount;
|
||||
}
|
||||
|
||||
public static void Create(GameObject prefab, SpecialCrystalInfo info, string productName)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
SystemText systemText = Data.SystemText;
|
||||
dialogBase.SetTitleLabel(systemText.Get("MyPage_0051"));
|
||||
if (NeedExtraResultDialog(info))
|
||||
{
|
||||
SpecialCrystalBuyFinishDialog component = Object.Instantiate(prefab).GetComponent<SpecialCrystalBuyFinishDialog>();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
ReloadMyPage();
|
||||
};
|
||||
dialogBase.SetObj(component.gameObject);
|
||||
component._dialog = dialogBase;
|
||||
component._specialCrystalInfo = info;
|
||||
component._productName = productName;
|
||||
}
|
||||
else
|
||||
{
|
||||
dialogBase.SetSize(DialogBase.Size.S);
|
||||
if (info.Status.StartsWith("80"))
|
||||
{
|
||||
dialogBase.SetText(Data.SystemText.Get("MyPage_0116", productName));
|
||||
}
|
||||
else
|
||||
{
|
||||
dialogBase.SetText(Data.SystemText.Get("MyPage_0059", productName));
|
||||
}
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
ReloadMyPage();
|
||||
};
|
||||
}
|
||||
dialogBase.onCloseWithoutSelect = delegate
|
||||
{
|
||||
ReloadMyPage();
|
||||
};
|
||||
}
|
||||
|
||||
public static void ReloadMyPage()
|
||||
{
|
||||
if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.MyPage)
|
||||
{
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
_label.text = Data.SystemText.Get("MyPage_0059", _productName);
|
||||
_nextSceneLabel.text = SceneTransition.TransitionData.GetTransitionText(_specialCrystalInfo.ResultDialogNextSceneClick);
|
||||
ResourcesManager resourceManager = Toolbox.ResourcesManager;
|
||||
string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(_specialCrystalInfo.ExtraResultDialogBGImageFileName, ResourcesManager.AssetLoadPathType.SpecialCrystal);
|
||||
_assetList.Add(assetTypePath);
|
||||
yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(assetTypePath, null));
|
||||
_tipsTexture.mainTexture = resourceManager.LoadObject(resourceManager.GetAssetTypePath(_specialCrystalInfo.ExtraResultDialogBGImageFileName, ResourcesManager.AssetLoadPathType.SpecialCrystal, isfetch: true)) as Texture;
|
||||
UIEventListener.Get(_goToShopButton.gameObject).onClick = delegate
|
||||
{
|
||||
OnClickNextSceneButton();
|
||||
};
|
||||
UIEventListener.Get(_goToShopButton2.gameObject).onClick = delegate
|
||||
{
|
||||
OnClickNextSceneButton();
|
||||
};
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_assetList);
|
||||
_assetList.Clear();
|
||||
}
|
||||
|
||||
private void OnClickNextSceneButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
MyPageBannerBase.SceneChangeBySetting(_specialCrystalInfo.ResultDialogNextSceneClick, _specialCrystalInfo.ResultDialogNextSceneStatus);
|
||||
_dialog.Close();
|
||||
}
|
||||
}
|
||||
122
SVSim.BattleEngine/Engine/SteamManager.cs
Normal file
122
SVSim.BattleEngine/Engine/SteamManager.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using AOT;
|
||||
using Steamworks;
|
||||
using UnityEngine;
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public class SteamManager : MonoBehaviour
|
||||
{
|
||||
protected static bool s_EverInitialized;
|
||||
|
||||
protected static SteamManager s_instance;
|
||||
|
||||
protected bool m_bInitialized;
|
||||
|
||||
protected SteamAPIWarningMessageHook_t m_SteamAPIWarningMessageHook;
|
||||
|
||||
protected static SteamManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_instance == null)
|
||||
{
|
||||
return new GameObject("SteamManager").AddComponent<SteamManager>();
|
||||
}
|
||||
return s_instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Initialized => Instance.m_bInitialized;
|
||||
|
||||
[MonoPInvokeCallback(typeof(SteamAPIWarningMessageHook_t))]
|
||||
protected static void SteamAPIDebugTextHook(int nSeverity, StringBuilder pchDebugText)
|
||||
{
|
||||
}
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
private static void InitOnPlayMode()
|
||||
{
|
||||
s_EverInitialized = false;
|
||||
s_instance = null;
|
||||
}
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
if (s_instance != null)
|
||||
{
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
return;
|
||||
}
|
||||
s_instance = this;
|
||||
if (s_EverInitialized)
|
||||
{
|
||||
throw new Exception("Tried to Initialize the SteamAPI twice in one session!");
|
||||
}
|
||||
UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
|
||||
if (!Packsize.Test())
|
||||
{
|
||||
Debug.LogError("[Steamworks.NET] Packsize Test returned false, the wrong version of Steamworks.NET is being run in this platform.", this);
|
||||
}
|
||||
if (!DllCheck.Test())
|
||||
{
|
||||
Debug.LogError("[Steamworks.NET] DllCheck Test returned false, One or more of the Steamworks binaries seems to be the wrong version.", this);
|
||||
}
|
||||
try
|
||||
{
|
||||
if (SteamAPI.RestartAppIfNecessary((AppId_t)453480u))
|
||||
{
|
||||
Application.Quit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (DllNotFoundException ex)
|
||||
{
|
||||
Debug.LogError("[Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + ex, this);
|
||||
Application.Quit();
|
||||
return;
|
||||
}
|
||||
m_bInitialized = SteamAPI.Init();
|
||||
if (!m_bInitialized)
|
||||
{
|
||||
Debug.LogError("[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.", this);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_EverInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
if (s_instance == null)
|
||||
{
|
||||
s_instance = this;
|
||||
}
|
||||
if (m_bInitialized && m_SteamAPIWarningMessageHook == null)
|
||||
{
|
||||
m_SteamAPIWarningMessageHook = SteamAPIDebugTextHook;
|
||||
SteamClient.SetWarningMessageHook(m_SteamAPIWarningMessageHook);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
{
|
||||
if (!(s_instance != this))
|
||||
{
|
||||
s_instance = null;
|
||||
if (m_bInitialized)
|
||||
{
|
||||
SteamAPI.Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
if (m_bInitialized)
|
||||
{
|
||||
SteamAPI.RunCallbacks();
|
||||
}
|
||||
}
|
||||
}
|
||||
85
SVSim.BattleEngine/Engine/TitleMenu.cs
Normal file
85
SVSim.BattleEngine/Engine/TitleMenu.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class TitleMenu : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
protected UIButton BtnCacheClear;
|
||||
|
||||
[SerializeField]
|
||||
protected UIButton BtnNewInfo;
|
||||
|
||||
[SerializeField]
|
||||
protected UIButton BtnCs;
|
||||
|
||||
[SerializeField]
|
||||
protected UIButton _quitBtn;
|
||||
|
||||
[SerializeField]
|
||||
protected UIButton _deleteUserDataButton;
|
||||
|
||||
public GameObject ParentObject;
|
||||
|
||||
private DialogBase dia;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
EventDelegate.Add(BtnCacheClear.onClick, ShowCacheClearInfo);
|
||||
EventDelegate.Add(BtnNewInfo.onClick, ShowWebViewInfo);
|
||||
EventDelegate.Add(BtnCs.onClick, ShowFAQInfo);
|
||||
_quitBtn.gameObject.SetActive(value: true);
|
||||
EventDelegate.Add(_quitBtn.onClick, Application.Quit);
|
||||
_deleteUserDataButton.gameObject.SetActive(value: false);
|
||||
}
|
||||
|
||||
public void ShowWebViewInfo()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.INFO);
|
||||
}
|
||||
|
||||
private void ShowFAQInfo()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
DialogSupport.Create();
|
||||
}
|
||||
|
||||
private void ShowCacheClearInfo()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
SystemText systemText = Data.SystemText;
|
||||
dia = UIManager.GetInstance().CreateDialogClose();
|
||||
dia.SetSize(DialogBase.Size.M);
|
||||
dia.SetTitleLabel(systemText.Get("Title_0007"));
|
||||
dia.SetText(systemText.Get("Title_0008"));
|
||||
dia.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dia.SetButtonText(systemText.Get("Dia_Title_001_Button"));
|
||||
dia.SetReturnMsg(ParentObject, "ClearCache");
|
||||
dia.SetPanelDepth(3000);
|
||||
}
|
||||
|
||||
private void OnClickDeleteUserDataButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Title_0046"));
|
||||
dialogBase.SetText(Data.SystemText.Get("Title_0047"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(Data.SystemText.Get("Title_0048"));
|
||||
dialogBase.onPushButton1 = OpenDeleteUserDataConfirmDialog;
|
||||
dialogBase.SetPanelDepth(3000);
|
||||
}
|
||||
|
||||
private void OpenDeleteUserDataConfirmDialog()
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Title_0051"));
|
||||
dialogBase.SetText(Data.SystemText.Get("Title_0049"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(Data.SystemText.Get("Title_0048"));
|
||||
dialogBase.SetReturnMsg(ParentObject, "DeleteUserData");
|
||||
dialogBase.SetPanelDepth(3000);
|
||||
}
|
||||
}
|
||||
21
SVSim.BattleEngine/Engine/TweenAlphaExtension.cs
Normal file
21
SVSim.BattleEngine/Engine/TweenAlphaExtension.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using AnimationOrTween;
|
||||
|
||||
public static class TweenAlphaExtension
|
||||
{
|
||||
public static void PlayPingPong(this TweenAlpha tweenAlpha, bool isIncreaseAlpha)
|
||||
{
|
||||
float num = tweenAlpha.from;
|
||||
float num2 = tweenAlpha.to;
|
||||
if ((isIncreaseAlpha && num > num2) || (!isIncreaseAlpha && num < num2))
|
||||
{
|
||||
float num3 = num;
|
||||
num = num2;
|
||||
num2 = num3;
|
||||
}
|
||||
bool flag = tweenAlpha.direction == Direction.Forward;
|
||||
tweenAlpha.from = (flag ? num : num2);
|
||||
tweenAlpha.to = (flag ? num2 : num);
|
||||
tweenAlpha.ResetToBeginning();
|
||||
tweenAlpha.PlayForward();
|
||||
}
|
||||
}
|
||||
20
SVSim.BattleEngine/Engine/UIButtonExtension.cs
Normal file
20
SVSim.BattleEngine/Engine/UIButtonExtension.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
public static class UIButtonExtension
|
||||
{
|
||||
public static void CopyButtonParameters(this UIButton dst, UIButton src)
|
||||
{
|
||||
dst.tweenTarget = src.tweenTarget;
|
||||
dst.hover = src.hover;
|
||||
dst.pressed = src.pressed;
|
||||
dst.disabledColor = src.disabledColor;
|
||||
dst.duration = src.duration;
|
||||
dst.dragHighlight = src.dragHighlight;
|
||||
dst.hoverSprite = src.hoverSprite;
|
||||
dst.pressedSprite = src.pressedSprite;
|
||||
dst.disabledSprite = src.disabledSprite;
|
||||
dst.hoverSprite2D = src.hoverSprite2D;
|
||||
dst.pressedSprite2D = src.pressedSprite2D;
|
||||
dst.disabledSprite2D = src.disabledSprite2D;
|
||||
dst.pixelSnap = src.pixelSnap;
|
||||
dst.onClick = src.onClick;
|
||||
}
|
||||
}
|
||||
360
SVSim.BattleEngine/Engine/UIDragDropItem.cs
Normal file
360
SVSim.BattleEngine/Engine/UIDragDropItem.cs
Normal file
@@ -0,0 +1,360 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[AddComponentMenu("NGUI/Interaction/Drag and Drop Item")]
|
||||
public class UIDragDropItem : MonoBehaviour
|
||||
{
|
||||
public enum Restriction
|
||||
{
|
||||
None,
|
||||
Horizontal,
|
||||
Vertical,
|
||||
PressAndHold
|
||||
}
|
||||
|
||||
public Restriction restriction;
|
||||
|
||||
public bool cloneOnDrag;
|
||||
|
||||
[HideInInspector]
|
||||
public float pressAndHoldDelay = 1f;
|
||||
|
||||
public bool interactable = true;
|
||||
|
||||
public bool IsGridRepositionUse = true;
|
||||
|
||||
[NonSerialized]
|
||||
protected Transform mTrans;
|
||||
|
||||
[NonSerialized]
|
||||
protected Transform mParent;
|
||||
|
||||
[NonSerialized]
|
||||
protected Collider mCollider;
|
||||
|
||||
[NonSerialized]
|
||||
protected Collider2D mCollider2D;
|
||||
|
||||
[NonSerialized]
|
||||
protected UIButton mButton;
|
||||
|
||||
[NonSerialized]
|
||||
protected UIRoot mRoot;
|
||||
|
||||
[NonSerialized]
|
||||
protected UIGrid mGrid;
|
||||
|
||||
[NonSerialized]
|
||||
protected UITable mTable;
|
||||
|
||||
[NonSerialized]
|
||||
protected float mDragStartTime;
|
||||
|
||||
[NonSerialized]
|
||||
protected UIDragScrollView mDragScrollView;
|
||||
|
||||
[NonSerialized]
|
||||
protected bool mPressed;
|
||||
|
||||
[NonSerialized]
|
||||
protected bool mDragging;
|
||||
|
||||
[NonSerialized]
|
||||
protected UICamera.MouseOrTouch mTouch;
|
||||
|
||||
public static List<UIDragDropItem> draggedItems = new List<UIDragDropItem>();
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
mTrans = base.transform;
|
||||
mCollider = base.gameObject.GetComponent<Collider>();
|
||||
mCollider2D = base.gameObject.GetComponent<Collider2D>();
|
||||
}
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void OnDisable()
|
||||
{
|
||||
if (mDragging)
|
||||
{
|
||||
StopDragging(UICamera.hoveredObject);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
mButton = GetComponent<UIButton>();
|
||||
mDragScrollView = GetComponent<UIDragScrollView>();
|
||||
}
|
||||
|
||||
protected virtual void OnPress(bool isPressed)
|
||||
{
|
||||
if (!interactable || UICamera.currentTouchID == -2 || UICamera.currentTouchID == -3)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (isPressed)
|
||||
{
|
||||
if (!mPressed)
|
||||
{
|
||||
mTouch = UICamera.currentTouch;
|
||||
mDragStartTime = RealTime.time + pressAndHoldDelay;
|
||||
mPressed = true;
|
||||
}
|
||||
}
|
||||
else if (mPressed && mTouch == UICamera.currentTouch)
|
||||
{
|
||||
mPressed = false;
|
||||
mTouch = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
if (restriction == Restriction.PressAndHold && mPressed && !mDragging && mDragStartTime < RealTime.time)
|
||||
{
|
||||
StartDragging();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnDragStart()
|
||||
{
|
||||
if (!interactable || !base.enabled || mTouch != UICamera.currentTouch)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (restriction != Restriction.None)
|
||||
{
|
||||
if (restriction == Restriction.Horizontal)
|
||||
{
|
||||
Vector2 totalDelta = mTouch.totalDelta;
|
||||
if (Mathf.Abs(totalDelta.x) < Mathf.Abs(totalDelta.y))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (restriction == Restriction.Vertical)
|
||||
{
|
||||
Vector2 totalDelta2 = mTouch.totalDelta;
|
||||
if (Mathf.Abs(totalDelta2.x) > Mathf.Abs(totalDelta2.y))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (restriction == Restriction.PressAndHold)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
StartDragging();
|
||||
}
|
||||
|
||||
public virtual void StartDragging()
|
||||
{
|
||||
if (!interactable || mDragging)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (cloneOnDrag)
|
||||
{
|
||||
mPressed = false;
|
||||
GameObject gameObject = NGUITools.AddChild(base.transform.parent.gameObject, base.gameObject);
|
||||
gameObject.transform.localPosition = base.transform.localPosition;
|
||||
gameObject.transform.localRotation = base.transform.localRotation;
|
||||
gameObject.transform.localScale = base.transform.localScale;
|
||||
UIButtonColor component = gameObject.GetComponent<UIButtonColor>();
|
||||
if (component != null)
|
||||
{
|
||||
component.defaultColor = GetComponent<UIButtonColor>().defaultColor;
|
||||
}
|
||||
if (mTouch != null && mTouch.pressed == base.gameObject)
|
||||
{
|
||||
mTouch.current = gameObject;
|
||||
mTouch.pressed = gameObject;
|
||||
mTouch.dragged = gameObject;
|
||||
mTouch.last = gameObject;
|
||||
}
|
||||
UIDragDropItem component2 = gameObject.GetComponent<UIDragDropItem>();
|
||||
component2.mTouch = mTouch;
|
||||
component2.mPressed = true;
|
||||
component2.mDragging = true;
|
||||
component2.Start();
|
||||
component2.OnClone(base.gameObject);
|
||||
component2.OnDragDropStart();
|
||||
if (UICamera.currentTouch == null)
|
||||
{
|
||||
UICamera.currentTouch = mTouch;
|
||||
}
|
||||
mTouch = null;
|
||||
UICamera.Notify(base.gameObject, "OnPress", false);
|
||||
UICamera.Notify(base.gameObject, "OnHover", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
mDragging = true;
|
||||
OnDragDropStart();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnClone(GameObject original)
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void OnDrag(Vector2 delta)
|
||||
{
|
||||
if (interactable && mDragging && base.enabled && mTouch == UICamera.currentTouch)
|
||||
{
|
||||
OnDragDropMove(delta * mRoot.pixelSizeAdjustment);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnDragEnd()
|
||||
{
|
||||
if (interactable && base.enabled && mTouch == UICamera.currentTouch)
|
||||
{
|
||||
StopDragging(UICamera.hoveredObject);
|
||||
}
|
||||
}
|
||||
|
||||
public void StopDragging(GameObject go)
|
||||
{
|
||||
if (mDragging)
|
||||
{
|
||||
mDragging = false;
|
||||
OnDragDropRelease(go);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnDragDropStart()
|
||||
{
|
||||
if (!draggedItems.Contains(this))
|
||||
{
|
||||
draggedItems.Add(this);
|
||||
}
|
||||
if (mDragScrollView != null)
|
||||
{
|
||||
mDragScrollView.enabled = false;
|
||||
}
|
||||
if (mButton != null)
|
||||
{
|
||||
mButton.isEnabled = false;
|
||||
}
|
||||
else if (mCollider != null)
|
||||
{
|
||||
mCollider.enabled = false;
|
||||
}
|
||||
else if (mCollider2D != null)
|
||||
{
|
||||
mCollider2D.enabled = false;
|
||||
}
|
||||
mParent = mTrans.parent;
|
||||
mRoot = NGUITools.FindInParents<UIRoot>(mParent);
|
||||
mGrid = NGUITools.FindInParents<UIGrid>(mParent);
|
||||
mTable = NGUITools.FindInParents<UITable>(mParent);
|
||||
if (UIDragDropRoot.root != null)
|
||||
{
|
||||
mTrans.parent = UIDragDropRoot.root;
|
||||
}
|
||||
Vector3 localPosition = mTrans.localPosition;
|
||||
localPosition.z = 0f;
|
||||
mTrans.localPosition = localPosition;
|
||||
TweenPosition component = GetComponent<TweenPosition>();
|
||||
if (component != null)
|
||||
{
|
||||
component.enabled = false;
|
||||
}
|
||||
SpringPosition component2 = GetComponent<SpringPosition>();
|
||||
if (component2 != null)
|
||||
{
|
||||
component2.enabled = false;
|
||||
}
|
||||
NGUITools.MarkParentAsChanged(base.gameObject);
|
||||
if (mTable != null)
|
||||
{
|
||||
mTable.repositionNow = true;
|
||||
}
|
||||
if (mGrid != null)
|
||||
{
|
||||
mGrid.repositionNow = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnDragDropMove(Vector2 delta)
|
||||
{
|
||||
mTrans.localPosition += (Vector3)delta;
|
||||
}
|
||||
|
||||
protected virtual void OnDragDropRelease(GameObject surface)
|
||||
{
|
||||
if (!cloneOnDrag)
|
||||
{
|
||||
if (mButton != null)
|
||||
{
|
||||
mButton.isEnabled = true;
|
||||
}
|
||||
else if (mCollider != null)
|
||||
{
|
||||
mCollider.enabled = true;
|
||||
}
|
||||
else if (mCollider2D != null)
|
||||
{
|
||||
mCollider2D.enabled = true;
|
||||
}
|
||||
UIDragDropContainer uIDragDropContainer = (surface ? NGUITools.FindInParents<UIDragDropContainer>(surface) : null);
|
||||
if (uIDragDropContainer != null)
|
||||
{
|
||||
mTrans.parent = ((uIDragDropContainer.reparentTarget != null) ? uIDragDropContainer.reparentTarget : uIDragDropContainer.transform);
|
||||
Vector3 localPosition = mTrans.localPosition;
|
||||
localPosition.z = 0f;
|
||||
mTrans.localPosition = localPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
mTrans.parent = mParent;
|
||||
}
|
||||
mParent = mTrans.parent;
|
||||
mGrid = NGUITools.FindInParents<UIGrid>(mParent);
|
||||
mTable = NGUITools.FindInParents<UITable>(mParent);
|
||||
if (mDragScrollView != null)
|
||||
{
|
||||
StartCoroutine(EnableDragScrollView());
|
||||
}
|
||||
NGUITools.MarkParentAsChanged(base.gameObject);
|
||||
if (mTable != null)
|
||||
{
|
||||
mTable.repositionNow = true;
|
||||
}
|
||||
if (!IsGridRepositionUse)
|
||||
{
|
||||
mGrid = null;
|
||||
}
|
||||
if (mGrid != null)
|
||||
{
|
||||
mGrid.repositionNow = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NGUITools.Destroy(base.gameObject);
|
||||
}
|
||||
OnDragDropEnd();
|
||||
}
|
||||
|
||||
protected virtual void OnDragDropEnd()
|
||||
{
|
||||
draggedItems.Remove(this);
|
||||
}
|
||||
|
||||
protected IEnumerator EnableDragScrollView()
|
||||
{
|
||||
yield return new WaitForEndOfFrame();
|
||||
if (mDragScrollView != null)
|
||||
{
|
||||
mDragScrollView.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
19
SVSim.BattleEngine/Engine/UISpriteExtension.cs
Normal file
19
SVSim.BattleEngine/Engine/UISpriteExtension.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
public static class UISpriteExtension
|
||||
{
|
||||
public static void CopySpriteParameters(this UISprite dst, UISprite src)
|
||||
{
|
||||
dst.type = src.type;
|
||||
dst.flip = src.flip;
|
||||
dst.border = src.border;
|
||||
dst.centerType = src.centerType;
|
||||
dst.fillDirection = src.fillDirection;
|
||||
dst.fillAmount = src.fillAmount;
|
||||
dst.invert = src.invert;
|
||||
dst.leftType = src.leftType;
|
||||
dst.rightType = src.rightType;
|
||||
dst.topType = src.topType;
|
||||
dst.bottomType = src.bottomType;
|
||||
dst.atlas = src.atlas;
|
||||
dst.spriteName = src.spriteName;
|
||||
}
|
||||
}
|
||||
169
SVSim.BattleEngine/Engine/UITweenPosition.cs
Normal file
169
SVSim.BattleEngine/Engine/UITweenPosition.cs
Normal file
@@ -0,0 +1,169 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class UITweenPosition : MonoBehaviour
|
||||
{
|
||||
public delegate void FinishCallBack(UITweenPosition in_FadeObject);
|
||||
|
||||
[SerializeField]
|
||||
public AnimationCurve Curve;
|
||||
|
||||
public Vector2 From;
|
||||
|
||||
public Vector2 To;
|
||||
|
||||
private Vector2 _fromStart;
|
||||
|
||||
private Vector2 _toStart;
|
||||
|
||||
public float DelayTime;
|
||||
|
||||
public float EndTime;
|
||||
|
||||
private UIPanel _getPanel;
|
||||
|
||||
private UIWidget _getWidget;
|
||||
|
||||
private UIRect _getRect;
|
||||
|
||||
private bool _isEnd;
|
||||
|
||||
private float _timer;
|
||||
|
||||
public Vector2 Value { get; set; }
|
||||
|
||||
public FinishCallBack OnFinishCallBack { get; set; }
|
||||
|
||||
public bool IsPlay { get; protected set; }
|
||||
|
||||
public bool IsPlayFoward { get; set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_getPanel = base.gameObject.GetComponent<UIPanel>();
|
||||
if (_getPanel != null)
|
||||
{
|
||||
_getRect = _getPanel;
|
||||
}
|
||||
else
|
||||
{
|
||||
_getWidget = base.gameObject.GetComponent<UIWidget>();
|
||||
if (_getWidget == null && _getPanel == null)
|
||||
{
|
||||
_getWidget = base.gameObject.AddComponent<UIWidget>();
|
||||
}
|
||||
_getRect = _getWidget;
|
||||
}
|
||||
IsPlay = false;
|
||||
Curve.postWrapMode = WrapMode.Once;
|
||||
Curve.preWrapMode = WrapMode.Once;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (IsPlay)
|
||||
{
|
||||
_timer += Time.deltaTime;
|
||||
if (_timer >= DelayTime)
|
||||
{
|
||||
float b = (_timer - DelayTime) / (Curve.keys[Curve.length - 1].time * EndTime);
|
||||
b = Mathf.Min(Curve.keys[Curve.length - 1].time, b);
|
||||
float x;
|
||||
float y;
|
||||
if (IsPlayFoward)
|
||||
{
|
||||
x = _fromStart.x + (To.x - _fromStart.x) * Curve.Evaluate(b);
|
||||
y = _fromStart.y + (To.y - _fromStart.y) * Curve.Evaluate(b);
|
||||
}
|
||||
else
|
||||
{
|
||||
x = From.x + (_toStart.x - From.x) * Curve.Evaluate(Curve.keys[Curve.length - 1].time - b);
|
||||
y = From.y + (_toStart.y - From.y) * Curve.Evaluate(Curve.keys[Curve.length - 1].time - b);
|
||||
}
|
||||
Value = new Vector2(x, y);
|
||||
base.gameObject.transform.localPosition = Value;
|
||||
if (b >= Curve.keys[Curve.length - 1].time)
|
||||
{
|
||||
if (IsPlayFoward)
|
||||
{
|
||||
base.gameObject.transform.localPosition = To;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.gameObject.transform.localPosition = From;
|
||||
}
|
||||
IsPlay = false;
|
||||
_isEnd = true;
|
||||
_getRect.gameObject.SetActive(value: false);
|
||||
_getRect.gameObject.SetActive(value: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_isEnd)
|
||||
{
|
||||
if (OnFinishCallBack != null)
|
||||
{
|
||||
OnFinishCallBack(this);
|
||||
}
|
||||
_isEnd = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Cancel(bool setFrom = false, bool setTo = false)
|
||||
{
|
||||
IsPlay = false;
|
||||
if (setFrom)
|
||||
{
|
||||
base.gameObject.transform.localPosition = new Vector2(From.x, From.y);
|
||||
}
|
||||
else if (setTo)
|
||||
{
|
||||
base.gameObject.transform.localPosition = new Vector2(To.x, To.y);
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayForward(bool resetFlag = false)
|
||||
{
|
||||
IsPlayFoward = true;
|
||||
if (resetFlag)
|
||||
{
|
||||
_fromStart = From;
|
||||
}
|
||||
else
|
||||
{
|
||||
_fromStart = new Vector2(base.transform.localPosition.x, base.transform.localPosition.y);
|
||||
}
|
||||
if (base.gameObject.transform.localPosition.x != To.x || base.gameObject.transform.localPosition.y != To.y || resetFlag)
|
||||
{
|
||||
IsPlay = true;
|
||||
_timer = 0f;
|
||||
Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
_isEnd = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayReverse(bool resetFlag = false)
|
||||
{
|
||||
IsPlayFoward = false;
|
||||
if (resetFlag)
|
||||
{
|
||||
_toStart = To;
|
||||
}
|
||||
else
|
||||
{
|
||||
_toStart = new Vector2(base.transform.localPosition.x, base.transform.localPosition.y);
|
||||
}
|
||||
if (base.gameObject.transform.localPosition.x != From.x || base.gameObject.transform.localPosition.y != From.y || resetFlag)
|
||||
{
|
||||
IsPlay = true;
|
||||
_timer = 0f;
|
||||
Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
_isEnd = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
20
SVSim.BattleEngine/Engine/UIWidgetExtension.cs
Normal file
20
SVSim.BattleEngine/Engine/UIWidgetExtension.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
public static class UIWidgetExtension
|
||||
{
|
||||
public static void CopyWidgetParameters(this UIWidget dst, UIWidget src)
|
||||
{
|
||||
dst.leftAnchor = src.leftAnchor;
|
||||
dst.rightAnchor = src.rightAnchor;
|
||||
dst.topAnchor = src.topAnchor;
|
||||
dst.bottomAnchor = src.bottomAnchor;
|
||||
dst.updateAnchors = src.updateAnchors;
|
||||
dst.drawRegion = src.drawRegion;
|
||||
dst.width = src.width;
|
||||
dst.height = src.height;
|
||||
dst.color = src.color;
|
||||
dst.pivot = src.pivot;
|
||||
dst.depth = src.depth;
|
||||
dst.aspectRatio = src.aspectRatio;
|
||||
dst.keepAspectRatio = src.keepAspectRatio;
|
||||
dst.autoResizeBoxCollider = src.autoResizeBoxCollider;
|
||||
}
|
||||
}
|
||||
7
SVSim.BattleEngine/Engine/UIWrapContentWizard.cs
Normal file
7
SVSim.BattleEngine/Engine/UIWrapContentWizard.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
public class UIWrapContentWizard : UIWrapContent
|
||||
{
|
||||
public void resetItems()
|
||||
{
|
||||
ResetChildPositions();
|
||||
}
|
||||
}
|
||||
163
SVSim.BattleEngine/Engine/UserTicketCountContents.cs
Normal file
163
SVSim.BattleEngine/Engine/UserTicketCountContents.cs
Normal file
@@ -0,0 +1,163 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class UserTicketCountContents : MonoBehaviour
|
||||
{
|
||||
public struct ItemColumn
|
||||
{
|
||||
public int UserGoodsId;
|
||||
|
||||
public string IconTextureName;
|
||||
|
||||
public int PossetionNumber;
|
||||
|
||||
public string unitFormat;
|
||||
|
||||
public string TimeLimit { get; set; }
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private UIButton ButtonChangeScene;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel ButtonLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel ItemNameLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel InfoLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture IconTexture;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _timeLimitLabel;
|
||||
|
||||
public void SetData(ItemColumn item, Action onClick)
|
||||
{
|
||||
int userGoodsId = item.UserGoodsId;
|
||||
IconTexture.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(item.IconTextureName, ResourcesManager.AssetLoadPathType.Item, isfetch: true));
|
||||
ItemNameLabel.text = string.Format(item.unitFormat, UserGoods.getUserGoodsName(UserGoods.Type.Item, item.UserGoodsId), item.PossetionNumber.ToString());
|
||||
InfoLabel.text = Data.Master.GetItemText("ITI_" + userGoodsId);
|
||||
if (string.IsNullOrEmpty(item.TimeLimit))
|
||||
{
|
||||
_timeLimitLabel.gameObject.SetActive(value: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_timeLimitLabel.gameObject.SetActive(value: true);
|
||||
_timeLimitLabel.text = Data.SystemText.Get("Shop_0193", item.TimeLimit);
|
||||
}
|
||||
UIManager.SetObjectToGrey(ButtonChangeScene.gameObject, b: false);
|
||||
ButtonChangeScene.gameObject.SetActive(value: true);
|
||||
ButtonChangeScene.onClick.Clear();
|
||||
SceneTransition.TransitionData transitionData;
|
||||
switch (userGoodsId)
|
||||
{
|
||||
case 1:
|
||||
ButtonLabel.text = Data.SystemText.Get("Arena_NewMode");
|
||||
ButtonChangeScene.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
transitionData = new SceneTransition.TransitionData("2pick");
|
||||
SceneTransition.ChangeScene(transitionData, null);
|
||||
}));
|
||||
break;
|
||||
case 2:
|
||||
ButtonLabel.text = Data.SystemText.Get("Colosseum_0001");
|
||||
if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.COLOSSEUM))
|
||||
{
|
||||
UIManager.SetObjectToGrey(ButtonChangeScene.gameObject, b: true);
|
||||
}
|
||||
else if (Data.ArenaData.ColosseumData.IsColosseumPeriod)
|
||||
{
|
||||
ButtonChangeScene.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
transitionData = new SceneTransition.TransitionData("colosseum");
|
||||
SceneTransition.ChangeScene(transitionData, null);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.SetObjectToGrey(ButtonChangeScene.gameObject, b: true);
|
||||
}
|
||||
break;
|
||||
case 2001:
|
||||
case 2002:
|
||||
case 2004:
|
||||
ButtonLabel.text = Data.SystemText.Get("Bingo_0023");
|
||||
ButtonChangeScene.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Bingo);
|
||||
}));
|
||||
break;
|
||||
default:
|
||||
if (Data.Load.data.UserItemNotStartList.Contains(userGoodsId))
|
||||
{
|
||||
ButtonChangeScene.gameObject.SetActive(value: false);
|
||||
}
|
||||
if (Item.IsSpotCardBuildDeckTicket(userGoodsId))
|
||||
{
|
||||
ButtonLabel.text = Data.SystemText.Get("Shop_0200");
|
||||
GiftTransition giftTransition = Data.Master.GiftTransitionList.Find((GiftTransition data) => data._rewardType == 4 && data._rewardDetailId == userGoodsId);
|
||||
if (giftTransition != null)
|
||||
{
|
||||
ButtonChangeScene.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
transitionData = new SceneTransition.TransitionData("deck_pack");
|
||||
transitionData.Status = giftTransition._buttons[0]._transitionData.Status;
|
||||
SceneTransition.ChangeScene(transitionData, null);
|
||||
}));
|
||||
}
|
||||
}
|
||||
else if (Item.IsLeaderSkinTicket(userGoodsId))
|
||||
{
|
||||
ButtonLabel.text = Data.SystemText.Get("Shop_0192");
|
||||
GiftTransition giftTransition2 = Data.Master.GiftTransitionList.Find((GiftTransition data) => data._rewardType == 4 && data._rewardDetailId == userGoodsId);
|
||||
if (giftTransition2 != null)
|
||||
{
|
||||
ButtonChangeScene.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
transitionData = new SceneTransition.TransitionData("leader_skin");
|
||||
transitionData.Status = giftTransition2._buttons[0]._transitionData.Status;
|
||||
SceneTransition.ChangeScene(transitionData, null);
|
||||
}));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (userGoodsId < 10001)
|
||||
{
|
||||
break;
|
||||
}
|
||||
ButtonLabel.text = Data.SystemText.Get("Mail_0022");
|
||||
if (Data.Master.GiftTransitionList.Find((GiftTransition data) => data._rewardType == 4 && data._rewardDetailId == userGoodsId) != null)
|
||||
{
|
||||
if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_CARDPACK_MAINTENANCE))
|
||||
{
|
||||
UIManager.SetObjectToGrey(ButtonChangeScene.gameObject, b: true);
|
||||
break;
|
||||
}
|
||||
ButtonChangeScene.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
transitionData = new SceneTransition.TransitionData("card_pack");
|
||||
transitionData.Status = userGoodsId;
|
||||
SceneTransition.ChangeScene(transitionData, null);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
ButtonChangeScene.gameObject.SetActive(value: false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
ButtonChangeScene.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
onClick.Call();
|
||||
}));
|
||||
}
|
||||
}
|
||||
127
SVSim.BattleEngine/Engine/UserTicketCountDialog.cs
Normal file
127
SVSim.BattleEngine/Engine/UserTicketCountDialog.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class UserTicketCountDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIWrapContent _wrapContents;
|
||||
|
||||
[SerializeField]
|
||||
private WrapContentsScrollBarSize _wrapScrollbarSize;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollBarWrapContent _wrapScrollbarContents;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _noItemObject;
|
||||
|
||||
private List<string> _loadFileList = new List<string>();
|
||||
|
||||
private DialogBase _parentDialog;
|
||||
|
||||
private List<UserTicketCountContents.ItemColumn> _itemList = new List<UserTicketCountContents.ItemColumn>();
|
||||
|
||||
public void Init(DialogBase parentDialog)
|
||||
{
|
||||
_parentDialog = parentDialog;
|
||||
UserTicketCountContents.ItemColumn item = default(UserTicketCountContents.ItemColumn);
|
||||
for (int i = 0; i < Data.Master.ItemList.Count; i++)
|
||||
{
|
||||
int itemNum = PlayerStaticData.GetItemNum(Data.Master.ItemList[i].UserGoodsId);
|
||||
if (itemNum > 0 && Item.IsTicket(UserGoods.Type.Item, Data.Master.ItemList[i].UserGoodsId))
|
||||
{
|
||||
item.UserGoodsId = Data.Master.ItemList[i].UserGoodsId;
|
||||
item.IconTextureName = Data.Master.ItemList[i].thumbnail;
|
||||
item.PossetionNumber = itemNum;
|
||||
item.unitFormat = Data.Master.ItemList[i].unitFormat;
|
||||
string value = null;
|
||||
Data.Load.data.UserItemExpireTimeDictionary.TryGetValue(item.UserGoodsId, out value);
|
||||
item.TimeLimit = value;
|
||||
_itemList.Add(item);
|
||||
_loadFileList.Add(Toolbox.ResourcesManager.GetAssetTypePath(item.IconTextureName, ResourcesManager.AssetLoadPathType.Item));
|
||||
}
|
||||
}
|
||||
if (_itemList.Count == 0)
|
||||
{
|
||||
_noItemObject.SetActive(value: true);
|
||||
_wrapContents.gameObject.SetActive(value: false);
|
||||
_wrapScrollbarContents.gameObject.SetActive(value: false);
|
||||
return;
|
||||
}
|
||||
UIScrollView component = _wrapContents.transform.parent.GetComponent<UIScrollView>();
|
||||
UIPanel component2 = component.GetComponent<UIPanel>();
|
||||
_noItemObject.SetActive(value: false);
|
||||
_wrapContents.gameObject.SetActive(value: true);
|
||||
_wrapScrollbarContents.gameObject.SetActive(value: true);
|
||||
_wrapContents.onInitializeItem = _OnInitializeItem;
|
||||
_wrapContents.maxIndex = 0;
|
||||
_wrapScrollbarContents.m_WrapContents = _wrapContents;
|
||||
_wrapContents.minIndex = -(_itemList.Count - 1);
|
||||
component.ResetPosition();
|
||||
if (component2.height > (float)(_itemList.Count * _wrapContents.itemSize))
|
||||
{
|
||||
component.verticalScrollBar.gameObject.SetActive(value: false);
|
||||
component.enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
component.verticalScrollBar.gameObject.SetActive(value: true);
|
||||
component.enabled = true;
|
||||
}
|
||||
parentDialog.SetActive(inActive: false);
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadFileList, delegate
|
||||
{
|
||||
parentDialog.SetActive(inActive: true);
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
_wrapScrollbarSize.ContentUpdate();
|
||||
_wrapContents.SortBasedOnScrollMovement();
|
||||
}));
|
||||
}
|
||||
|
||||
private void _OnInitializeItem(GameObject go, int wrapIndex, int realIndex)
|
||||
{
|
||||
int num = realIndex * -1;
|
||||
go.name = num.ToString();
|
||||
Transform[] componentsInChildren = go.GetComponentsInChildren<Transform>(includeInactive: true);
|
||||
Transform[] array;
|
||||
if (num >= _itemList.Count || num < 0)
|
||||
{
|
||||
array = componentsInChildren;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
array[i].gameObject.SetActive(value: false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
array = componentsInChildren;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
array[i].gameObject.SetActive(value: true);
|
||||
}
|
||||
SetContents(num, go.GetComponent<UserTicketCountContents>());
|
||||
}
|
||||
|
||||
private void SetContents(int ItemListIndex, UserTicketCountContents contents)
|
||||
{
|
||||
Action onClick = delegate
|
||||
{
|
||||
MoveSceneAction();
|
||||
};
|
||||
contents.SetData(_itemList[ItemListIndex], onClick);
|
||||
}
|
||||
|
||||
private void MoveSceneAction()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
_parentDialog.Close();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList);
|
||||
}
|
||||
}
|
||||
3
SVSim.BattleEngine/Engine/VideoHostingImplNull.cs
Normal file
3
SVSim.BattleEngine/Engine/VideoHostingImplNull.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
public class VideoHostingImplNull : VideoHostingImplBase
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Wizard.Battle.Operation;
|
||||
using Wizard.Battle.Resource;
|
||||
using Wizard.Battle.View;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
namespace Wizard.Battle.Card;
|
||||
|
||||
public class VirtualSpecialSkillBattleCard : SpecialSkillBattleCard, IVirtualBattleCard
|
||||
{
|
||||
public bool UsedRandomSkill { get; set; }
|
||||
|
||||
public VirtualSpecialSkillBattleCard(BossRushSpecialSkill skill, BuildInfo buildInfo)
|
||||
: base(skill, buildInfo)
|
||||
{
|
||||
}
|
||||
|
||||
protected override IBattleCardView CreateView(BattleCardView.BuildInfo buildInfo, bool isNullView)
|
||||
{
|
||||
return new NullBattleCardView(buildInfo);
|
||||
}
|
||||
|
||||
protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView)
|
||||
{
|
||||
return NullCardVfxCreator.GetInstance();
|
||||
}
|
||||
|
||||
public override SkillCreator CreateSkillCreator(BattlePlayerBase selfBattlPlayer, BattlePlayerBase opponentBattlePlayer, IBattleResourceMgr resourceMgr)
|
||||
{
|
||||
return new SimulateSkillCreator(this, selfBattlPlayer, opponentBattlePlayer, _buildInfo.ResourceMgr);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using Wizard.Battle.Card;
|
||||
using Wizard.Battle.Resource;
|
||||
|
||||
namespace Wizard.Battle.Operation;
|
||||
|
||||
public class SimulateSkillCreator : SkillCreator
|
||||
{
|
||||
public SimulateSkillCreator(BattleCardBase ownerCard, BattlePlayerBase selfBattlePlayer, BattlePlayerBase opponentBattlePlayer, IBattleResourceMgr battleResourceMgr)
|
||||
: base(ownerCard, selfBattlePlayer, opponentBattlePlayer, battleResourceMgr)
|
||||
{
|
||||
}
|
||||
|
||||
protected override ISkillSelectFilter CreateRandomSelectFilter(string count)
|
||||
{
|
||||
return new SimulateRandomSelectFilter((IVirtualBattleCard)_ownerCard, count);
|
||||
}
|
||||
|
||||
protected override ISkillSelectFilter CreateIdNoDuplicationRandomSelectFilter(string count)
|
||||
{
|
||||
return new SimulateIdNoDuplicationRandomSelectFilter((IVirtualBattleCard)_ownerCard, count);
|
||||
}
|
||||
|
||||
protected override ISkillSelectFilter CreateCostNoDuplicationRandomSelectFilter(string count)
|
||||
{
|
||||
return new SimulateCostNoDuplicationRandomSelectFilter((IVirtualBattleCard)_ownerCard, count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Wizard.Battle.Phase;
|
||||
|
||||
public class NetworkBattlePhaseCreator : PhaseCreatorBase
|
||||
{
|
||||
protected readonly NetworkBattleManagerBase _networkBattleManager;
|
||||
|
||||
public NetworkBattlePhaseCreator(NetworkBattleManagerBase battleMgr)
|
||||
: base(battleMgr)
|
||||
{
|
||||
_networkBattleManager = battleMgr;
|
||||
}
|
||||
|
||||
public override IPhase CreateMulliganPhase()
|
||||
{
|
||||
return new NetworkMulliganPhase(_networkBattleManager, _networkBattleManager.NetworkSender);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace Wizard.Battle.Phase;
|
||||
|
||||
public class RecoveryNetworkBattleMainPhaseCreator : NetworkBattlePhaseCreator
|
||||
{
|
||||
public RecoveryNetworkBattleMainPhaseCreator(NetworkBattleManagerBase battleMgr)
|
||||
: base(battleMgr)
|
||||
{
|
||||
}
|
||||
|
||||
public override IPhase CreateMulliganPhase()
|
||||
{
|
||||
return new RecoveryNetworkAfterSubmitMulliganPhase(_networkBattleManager, _networkBattleManager.NetworkSender);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace Wizard.Battle.Phase;
|
||||
|
||||
public class RecoveryNetworkBattleMulliganPhaseCreator : NetworkBattlePhaseCreator
|
||||
{
|
||||
public RecoveryNetworkBattleMulliganPhaseCreator(NetworkBattleManagerBase battleMgr)
|
||||
: base(battleMgr)
|
||||
{
|
||||
}
|
||||
|
||||
public override IPhase CreateMulliganPhase()
|
||||
{
|
||||
return new RecoveryNetworkBeforeSubmitMulliganPhase(_networkBattleManager, _networkBattleManager.NetworkSender);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Wizard.Battle.Player.ClassCharacter;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
namespace Wizard.Battle.Player.Emotion;
|
||||
|
||||
public class EnemyAIEmotion : EnemyEmotionBase
|
||||
{
|
||||
private IEnemyAI _enemyAI;
|
||||
|
||||
public EnemyAIEmotion(string emotionId, IClassCharacter classCharacter, IEnemyAI enemyAI)
|
||||
: base(emotionId, classCharacter)
|
||||
{
|
||||
_enemyAI = enemyAI;
|
||||
}
|
||||
|
||||
public override VfxBase ReceiveOpponentEmotion(ClassCharaPrm.EmotionType emotionType)
|
||||
{
|
||||
return _enemyAI.GetEmote(AIEmoteCmdType.ON_RECEIVE, null, emotionType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using Wizard.Battle.Mulligan;
|
||||
|
||||
namespace Wizard.Battle.Recovery;
|
||||
|
||||
public class AINetworkBattleRecoveryRecordManager : RecoveryRecordManagerBase
|
||||
{
|
||||
protected override string DefaultRecoveryFileName => "recovery_ai_network.json";
|
||||
|
||||
public AINetworkBattleRecoveryRecordManager()
|
||||
{
|
||||
}
|
||||
|
||||
public AINetworkBattleRecoveryRecordManager(string filePath)
|
||||
: base(filePath)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetupRecording(BattleManagerBase battleMgr, DataMgr.BattleType battleType, int randomSeed, int backGroundId, string bgmId = "NONE")
|
||||
{
|
||||
base.SetupRecording(battleMgr, battleType, randomSeed, backGroundId, bgmId);
|
||||
RecordAINetworkBattleSettings(_recorder, battleType, randomSeed, backGroundId, bgmId);
|
||||
}
|
||||
|
||||
protected override OperationRecorderBase CreateOperationRecorder()
|
||||
{
|
||||
return new AINetworkBattleOperationRecorder(_recoveryFilePath);
|
||||
}
|
||||
|
||||
protected override void SetupRecorderEvents(OperationRecorderBase operationRecorder, BattleManagerBase battleMgr)
|
||||
{
|
||||
base.SetupRecorderEvents(operationRecorder, battleMgr);
|
||||
BattlePlayer battlePlayer = battleMgr.BattlePlayer;
|
||||
battlePlayer.OnTurnStartComplete = (Action)Delegate.Combine(battlePlayer.OnTurnStartComplete, new Action(operationRecorder.RecordTurnStart));
|
||||
BattleEnemy battleEnemy = battleMgr.BattleEnemy;
|
||||
battleEnemy.OnTurnStartComplete = (Action)Delegate.Combine(battleEnemy.OnTurnStartComplete, new Action(operationRecorder.RecordTurnStart));
|
||||
battleMgr.OperateMgr.OnTurnEnd += operationRecorder.RecordTurnEnd;
|
||||
}
|
||||
|
||||
public override void SetupMulliganStartTimeRecorderEvent(BattleManagerBase battleMgr)
|
||||
{
|
||||
PlayerMulliganCtrl playerMlgCtrl = battleMgr.MulliganMgr.PlayerMlgCtrl;
|
||||
playerMlgCtrl.OnMulliganLaunchComplete = (Action)Delegate.Combine(playerMlgCtrl.OnMulliganLaunchComplete, new Action(_recorder.RecordMulliganStart));
|
||||
}
|
||||
|
||||
protected void RecordAINetworkBattleSettings(OperationRecorderBase operationRecorder, DataMgr.BattleType battleType, int randomSeed, int backGroundId, string bgmId)
|
||||
{
|
||||
DataMgr dataMgr = _gameMgr.GetDataMgr();
|
||||
operationRecorder.RecordBattleType(battleType);
|
||||
operationRecorder.RecordRandomSeed(randomSeed);
|
||||
operationRecorder.RecordBackGroundId(backGroundId);
|
||||
operationRecorder.RecordBgmId(bgmId);
|
||||
operationRecorder.RecordClass("player", dataMgr.GetPlayerClassId());
|
||||
operationRecorder.RecordSubClass("player", dataMgr.GetPlayerSubClassId());
|
||||
if (dataMgr.TryGetPlayerMyRotationInfo(out var myRotationInfo))
|
||||
{
|
||||
operationRecorder.RecordMyRotationId("player", myRotationInfo.Id);
|
||||
}
|
||||
operationRecorder.RecordClass("enemy", dataMgr.GetEnemyClassId());
|
||||
operationRecorder.RecordSubClass("enemy", dataMgr.GetEnemySubClassId());
|
||||
if (dataMgr.TryGetEnemyMyRotationInfo(out var myRotationInfo2))
|
||||
{
|
||||
operationRecorder.RecordMyRotationId("enemy", myRotationInfo2.Id);
|
||||
}
|
||||
operationRecorder.RecordChara("player", dataMgr.GetPlayerCharaId());
|
||||
operationRecorder.RecordChara("enemy", dataMgr.GetEnemyCharaId());
|
||||
operationRecorder.RecordSleeve("player", dataMgr.GetPlayerSleeveId());
|
||||
operationRecorder.RecordSleeve("enemy", dataMgr.GetEnemySleeveId());
|
||||
operationRecorder.RecordDeck("player", 'p', dataMgr.GetCurrentDeckData());
|
||||
operationRecorder.RecordDeck("enemy", 'e', dataMgr.GetCurrentEnemyDeckData());
|
||||
operationRecorder.RecordEnemyAIDifficulty(dataMgr.m_EnemyAIDifficulty);
|
||||
operationRecorder.RecordEnemyAILogicLevel(dataMgr.m_EnemyAILogicLevel);
|
||||
operationRecorder.RecordEnemyAIMaxLife(dataMgr.m_EnemyAIMaxLife);
|
||||
operationRecorder.RecordEnemyAIDeckId(dataMgr.m_EnemyAIDeckId);
|
||||
operationRecorder.RecordEnemyAIStyleId(dataMgr.m_EnemyAIStyleId);
|
||||
operationRecorder.RecordEnemyAIEmoteId(dataMgr.m_EnemyAIEmoteId);
|
||||
operationRecorder.RecordEnemyAIUseInnerEmote(dataMgr.m_EnemyAIUseInnerEmote);
|
||||
operationRecorder.RecordPracticeDifficultyDegreeId(dataMgr.PracticeDifficultyDegreeId);
|
||||
operationRecorder.RecordIsPreBuildDeck(dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.BuildDeck));
|
||||
operationRecorder.RecordIsTrialDeck(dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.TrialDeck));
|
||||
}
|
||||
|
||||
public void RecordChangeAI(string logicName, int operationQueueCount)
|
||||
{
|
||||
if (_recorder is SingleBattleOperationRecorder singleBattleOperationRecorder)
|
||||
{
|
||||
singleBattleOperationRecorder.RecordChangeAI(logicName, operationQueueCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
namespace Wizard.Battle.Recovery;
|
||||
|
||||
public class NetworkBattleRecoveryManager : RecoveryNetworkManagerBase
|
||||
{
|
||||
public override VfxBase Recovery(BattlePlayer battlePlayer, BattleEnemy battleEnemy, Func<IEnumerator, Coroutine> startCoroutine)
|
||||
{
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public override VfxBase UpdateRecovery()
|
||||
{
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Wizard.Battle.Recovery;
|
||||
|
||||
public class NetworkBattleRecoveryRecordManager : RecoveryRecordManagerBase
|
||||
{
|
||||
protected override string DefaultRecoveryFileName => "recovery_network.json";
|
||||
|
||||
protected override OperationRecorderBase CreateOperationRecorder()
|
||||
{
|
||||
return new NetworkBattleOperationRecorder(_recoveryFilePath);
|
||||
}
|
||||
|
||||
protected override void SetupRecorderEvents(OperationRecorderBase operationRecorder, BattleManagerBase battleMgr)
|
||||
{
|
||||
base.SetupRecorderEvents(operationRecorder, battleMgr);
|
||||
battleMgr.OperateMgr.OnBeforePlayerTurnEnd += operationRecorder.RecordTurnEnd;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
namespace Wizard.Battle.Recovery;
|
||||
|
||||
public abstract class RecoveryNetworkManagerBase : IRecoveryManager
|
||||
{
|
||||
protected readonly RecoveryOperationInfo _operationInfo;
|
||||
|
||||
protected bool _needUpdate;
|
||||
|
||||
private readonly Queue<string> _skillTargetNameQueue;
|
||||
|
||||
protected Action StartRecoveryEvent;
|
||||
|
||||
protected Action EndDataRecoveryEvent;
|
||||
|
||||
protected Action EndRecoveryEvent;
|
||||
|
||||
public DataMgr.BattleType BattleType => _operationInfo.BattleType;
|
||||
|
||||
public bool? DidPlayerGoFirst => Data.BattleRecoveryInfo.first_turn == PlayerStaticData.UserViewerID;
|
||||
|
||||
public int RandomSeed => Data.BattleRecoveryInfo.seed;
|
||||
|
||||
public bool HasMulliganInfo => false;
|
||||
|
||||
public int BackGroundId => Data.BattleRecoveryInfo.field_id;
|
||||
|
||||
public string BgmId => "NONE";
|
||||
|
||||
public long RecordTime => long.Parse(DateTime.Now.ToLongTimeString());
|
||||
|
||||
public int IdxChangeSeed => Data.BattleRecoveryInfo.IdxChangeSeed;
|
||||
|
||||
public static bool failedRecoveryFlag { get; private set; }
|
||||
|
||||
public event Action OnStartRecovery
|
||||
{
|
||||
add
|
||||
{
|
||||
StartRecoveryEvent = (Action)Delegate.Combine(StartRecoveryEvent, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
StartRecoveryEvent = (Action)Delegate.Remove(StartRecoveryEvent, value);
|
||||
}
|
||||
}
|
||||
|
||||
public event Action OnEndDataRecovery
|
||||
{
|
||||
add
|
||||
{
|
||||
EndDataRecoveryEvent = (Action)Delegate.Combine(EndDataRecoveryEvent, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
EndDataRecoveryEvent = (Action)Delegate.Remove(EndDataRecoveryEvent, value);
|
||||
}
|
||||
}
|
||||
|
||||
public event Action OnEndRecovery
|
||||
{
|
||||
add
|
||||
{
|
||||
EndRecoveryEvent = (Action)Delegate.Combine(EndRecoveryEvent, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
EndRecoveryEvent = (Action)Delegate.Remove(EndRecoveryEvent, value);
|
||||
}
|
||||
}
|
||||
|
||||
public RecoveryNetworkManagerBase()
|
||||
{
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
dataMgr.SetPlayerCharaId(Data.BattleRecoveryInfo.chara_id);
|
||||
dataMgr.SetEnemyCharaId(Data.BattleRecoveryInfo.opponent_chara_id);
|
||||
}
|
||||
|
||||
public abstract VfxBase Recovery(BattlePlayer battlePlayer, BattleEnemy battleEnemy, Func<IEnumerator, Coroutine> startCoroutine);
|
||||
|
||||
public abstract VfxBase UpdateRecovery();
|
||||
|
||||
public virtual void RecoveryBeforeMulligan()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual VfxBase RecoveryMulligan(BattlePlayer battlePlayer, BattleEnemy battleEnemy)
|
||||
{
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public virtual string RecoveryPopSkillTargetCardName()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,580 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
using Wizard.Story;
|
||||
|
||||
namespace Wizard.Battle.Recovery;
|
||||
|
||||
public class SingleBattleOperationRecorder : OperationRecorderBase
|
||||
{
|
||||
protected DataMgr.BattleType _battleType;
|
||||
|
||||
protected JsonData _setupJsonData = new JsonData();
|
||||
|
||||
protected string _tempRecoveryFilePath = "";
|
||||
|
||||
public SingleBattleOperationRecorder(string filePath, string tempFilePath = "")
|
||||
: base(filePath)
|
||||
{
|
||||
_tempRecoveryFilePath = tempFilePath;
|
||||
_setupJsonData["player"] = new JsonData();
|
||||
_setupJsonData["player"].SetJsonType(JsonType.Object);
|
||||
_setupJsonData["enemy"] = new JsonData();
|
||||
_setupJsonData["enemy"].SetJsonType(JsonType.Object);
|
||||
DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo;
|
||||
if (specialBattleSettingInfo != null)
|
||||
{
|
||||
RecordSpecialBattleSetting(specialBattleSettingInfo);
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public void ClearTempRecoveryFilePath()
|
||||
{
|
||||
_tempRecoveryFilePath = string.Empty;
|
||||
}
|
||||
|
||||
public override void RecordBattleType(DataMgr.BattleType battleType)
|
||||
{
|
||||
_battleType = battleType;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordRandomSeed(int randomSeed)
|
||||
{
|
||||
_setupJsonData["random_seed"] = randomSeed;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordBackGroundId(int backGroundId)
|
||||
{
|
||||
_setupJsonData["background_id"] = backGroundId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordBgmId(string bgmId)
|
||||
{
|
||||
_setupJsonData["bgm_id"] = bgmId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordClass(string playerName, int clanType)
|
||||
{
|
||||
_setupJsonData[playerName]["clan_type"] = clanType;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordSubClass(string playerName, int clanType)
|
||||
{
|
||||
_setupJsonData[playerName]["sub_class_type"] = clanType;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordMyRotationId(string playerName, string myRotationId)
|
||||
{
|
||||
_setupJsonData[playerName]["my_rotation_id"] = myRotationId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordSleeve(string playerName, long sleeveId)
|
||||
{
|
||||
_setupJsonData[playerName]["sleeve_id"] = sleeveId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordChara(string playerName, int charaId)
|
||||
{
|
||||
_setupJsonData[playerName]["chara_id"] = charaId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordDeck(string playerName, char indexHeadChar, IEnumerable<int> cardIds)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
_setupJsonData[playerName]["deck"] = jsonData;
|
||||
jsonData.SetJsonType(JsonType.Array);
|
||||
int num = 1;
|
||||
foreach (int cardId in cardIds)
|
||||
{
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Object);
|
||||
jsonData2["index"] = indexHeadChar.ToString() + num;
|
||||
jsonData2["id"] = cardId;
|
||||
jsonData2["name"] = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardId).CardName;
|
||||
jsonData.Add(jsonData2);
|
||||
num++;
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIDifficulty(int level)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_difficulty"] = level;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAILogicLevel(int level)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_logic_level"] = level;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIMaxLife(int life)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_max_life"] = life;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIDeckId(int deckId)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_deck_id"] = deckId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIStyleId(int styleId)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_style_id"] = styleId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIEmoteId(int emoteId)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_emote_id"] = emoteId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIUseInnerEmote(bool useInnerEmote)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_use_inner_emote"] = useInnerEmote;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordStartTurnIsPlayer(bool startTurnIsPlayer)
|
||||
{
|
||||
_setupJsonData["player_start_turn"] = startTurnIsPlayer;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordPracticeDifficultyDegreeId(int degreeId)
|
||||
{
|
||||
_setupJsonData["practice_difficulty_degree_id"] = degreeId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordIsPreBuildDeck(bool isPreBuildDeck)
|
||||
{
|
||||
_setupJsonData["is_prebuild_deck"] = isPreBuildDeck;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordIsTrialDeck(bool isTrialDeck)
|
||||
{
|
||||
_setupJsonData["is_trial_deck"] = isTrialDeck;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordIsDefaultDeck(bool isDefaultDeck)
|
||||
{
|
||||
_setupJsonData["is_default_deck"] = isDefaultDeck;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestStageId(int id)
|
||||
{
|
||||
_setupJsonData["quest_stage_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyAiId(int id)
|
||||
{
|
||||
_setupJsonData["quest_enemy_ai_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyEmblemId(int id)
|
||||
{
|
||||
_setupJsonData["quest_enemy_emblem_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyDegreeId(int id)
|
||||
{
|
||||
_setupJsonData["quest_enemy_degree_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyEmotionOverride(int id)
|
||||
{
|
||||
_setupJsonData["quest_enemy_emotion_override"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestPlayerEmotionOverride(int id)
|
||||
{
|
||||
_setupJsonData["quest_player_emotion_override"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestRecoveryPoint(int recoveryPoint)
|
||||
{
|
||||
_setupJsonData["recovery_point"] = recoveryPoint;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestPlayerSkillList(List<BossRushSpecialSkill> skills)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
_setupJsonData["quest_player_skill_list"] = jsonData;
|
||||
jsonData.SetJsonType(JsonType.Array);
|
||||
foreach (BossRushSpecialSkill skill in skills)
|
||||
{
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Object);
|
||||
jsonData2["original_card_id"] = skill.OriginalCardId;
|
||||
jsonData2["name"] = skill.Name;
|
||||
jsonData2["skill_text"] = skill.SkillText;
|
||||
jsonData2["skill_desc_text"] = skill.SkillDescText;
|
||||
jsonData2["is_foil"] = skill.IsFoil;
|
||||
jsonData.Add(jsonData2);
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemySkill(BossRushSpecialSkill skill)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData.SetJsonType(JsonType.Object);
|
||||
jsonData["original_card_id"] = skill.OriginalCardId;
|
||||
jsonData["name"] = skill.Name;
|
||||
jsonData["skill_text"] = skill.SkillText;
|
||||
jsonData["skill_desc_text"] = skill.SkillDescText;
|
||||
jsonData["is_foil"] = skill.IsFoil;
|
||||
_setupJsonData["quest_enemy_skill"] = jsonData;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestMaxBattleCount(int maxBattleCount)
|
||||
{
|
||||
_setupJsonData["quest_max_battle_count"] = maxBattleCount;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestCurrentWinCount(int currentWinCount)
|
||||
{
|
||||
_setupJsonData["quest_current_win_count"] = currentWinCount;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestIsExtra(bool isExtra)
|
||||
{
|
||||
_setupJsonData["quest_is_extra"] = isExtra;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestIsMockBattle(bool isMockBattle)
|
||||
{
|
||||
_setupJsonData["quest_is_mock_battle"] = isMockBattle;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestExtraDeckScheduleId(int id)
|
||||
{
|
||||
_setupJsonData["quest_extra_deck_schedule_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordMissionNecessaryInformation(BattleManagerBase.MissionNecessaryInformation missionNecessaryInformation)
|
||||
{
|
||||
_setupJsonData["mission_necessary_information"] = new JsonData();
|
||||
_setupJsonData["mission_necessary_information"].SetJsonType(JsonType.Object);
|
||||
foreach (KeyValuePair<string, string> item in missionNecessaryInformation.GetOriginalTargetDictionary())
|
||||
{
|
||||
_setupJsonData["mission_necessary_information"][item.Key] = item.Value;
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordStoryData()
|
||||
{
|
||||
JsonData jsonData = new StoryRecoveryData(Data.SelectedStoryInfo).ToJsonData();
|
||||
foreach (string key in jsonData.Keys)
|
||||
{
|
||||
_setupJsonData[key] = jsonData[key];
|
||||
}
|
||||
_setupJsonData["scenario_deck_is_pre_build"] = Data.StoryInfo.IsPreBuildDeck;
|
||||
_setupJsonData["scenario_deck_is_trial"] = Data.StoryInfo.IsTrialDeck;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordMulliganStart()
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordPractice3DFieldId(int id)
|
||||
{
|
||||
_setupJsonData["practice_3d_field_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordPlayerMulliganReplaceCards(IEnumerable<BattleCardBase> replaceCards, IEnumerable<int> completeCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData.SetJsonType(JsonType.Array);
|
||||
foreach (BattleCardBase replaceCard in replaceCards)
|
||||
{
|
||||
jsonData.Add(replaceCard.GetName());
|
||||
}
|
||||
_setupJsonData["player_mulligan_abandon"] = jsonData;
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Array);
|
||||
foreach (int completeCard in completeCards)
|
||||
{
|
||||
jsonData2.Add("p" + completeCard);
|
||||
}
|
||||
_setupJsonData["player_mulligan_complete"] = jsonData2;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyMulliganReplaceCards(IEnumerable<BattleCardBase> replaceCards, IEnumerable<int> completeCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData.SetJsonType(JsonType.Array);
|
||||
foreach (BattleCardBase replaceCard in replaceCards)
|
||||
{
|
||||
jsonData.Add(replaceCard.GetName());
|
||||
}
|
||||
_setupJsonData["enemy_mulligan_abandon"] = jsonData;
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Array);
|
||||
foreach (int completeCard in completeCards)
|
||||
{
|
||||
jsonData2.Add("e" + completeCard);
|
||||
}
|
||||
_setupJsonData["enemy_mulligan_complete"] = jsonData2;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordPlay(BattleCardBase card, BattleCardBase originalCard, IEnumerable<BattleCardBase> selectedCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "play";
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["id"] = card.CardId;
|
||||
jsonData["name"] = card.BaseParameter.CardName;
|
||||
jsonData["cost"] = card.Cost;
|
||||
jsonData["is_choice_brave"] = (originalCard.IsChoiceBraveSkillCard ? 1 : 0);
|
||||
WriteSkillTargetInfoToJson(selectedCards, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override VfxBase RecordAttack(BattleCardBase attackCard, BattleCardBase targetCard, SkillProcessor skillProcessor)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "attack";
|
||||
jsonData["index"] = CardToIndexName(attackCard);
|
||||
jsonData["id"] = attackCard.CardId;
|
||||
jsonData["name"] = attackCard.BaseParameter.CardName;
|
||||
jsonData["target"] = CardToIndexName(targetCard);
|
||||
jsonData["target_id"] = targetCard.CardId;
|
||||
jsonData["target_name"] = targetCard.BaseParameter.CardName;
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public override void RecordEvolve(BattleCardBase originalCard, BattleCardBase card, IEnumerable<BattleCardBase> selectedCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "evolve";
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["id"] = card.CardId;
|
||||
jsonData["name"] = card.BaseParameter.CardName;
|
||||
WriteSkillTargetInfoToJson(selectedCards, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordStartSelect(BattleCardBase card, bool isEvolve, List<BattleCardBase> selectableCards, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isBurialRite, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCompleteSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isChoiceBrave, bool isBurialRite)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordStartChoice(BattleCardBase card, bool isEvolve, List<BattleCardBase> choiceCards, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordStartFusion(BattleCardBase card, List<BattleCardBase> selectableCards)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordSelectFusion(BattleCardBase card)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCompleteChoice(BattleCardBase card, bool isEvolve, List<BattleCardBase> chosenCardList, BattleCardBase actCard, List<int> chosenCardIndexList, bool hasSelectionSkill, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCancelChoice(BattleCardBase card, bool isEvolve, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCancelFusion(BattleCardBase card)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCancelSelect(BattleCardBase actCard, bool isEvolve, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordTurnStart()
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordTurnEnd()
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "turn_end";
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordRetire()
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "retire";
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public void RecordChangeAI(string logicName, int operationQueueCount)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "change_ai";
|
||||
jsonData["logic"] = logicName;
|
||||
jsonData["queue_count"] = operationQueueCount;
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordSkillTargets(IEnumerable<BattleCardBase> targetCards)
|
||||
{
|
||||
foreach (BattleCardBase targetCard in targetCards)
|
||||
{
|
||||
_skillTargetList.Add(targetCard.GetName());
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public void RecordSpecialBattleSetting(DataMgr.SpecialBattleSetting setting)
|
||||
{
|
||||
if (setting != null)
|
||||
{
|
||||
_setupJsonData["story_special_battle_player_attach_skill"] = setting.PlayerAttachSkillText;
|
||||
_setupJsonData["story_special_battle_enemy_attach_skill"] = setting.EnemyAttachSkillText;
|
||||
_setupJsonData["story_special_battle_player_start_pp"] = setting.PlayerStartPp;
|
||||
_setupJsonData["story_special_battle_enemy_start_pp"] = setting.EnemyStartPp;
|
||||
_setupJsonData["story_special_battle_player_current_life"] = setting.PlayerStartLife;
|
||||
_setupJsonData["story_special_battle_player_start_life"] = setting.PlayerStartMaxLife;
|
||||
_setupJsonData["story_special_battle_enemy_start_life"] = setting.EnemyStartMaxLife;
|
||||
_setupJsonData["story_special_battle_id_override_in_battle_log"] = setting.IdOverrideInBattleLogText;
|
||||
_setupJsonData["story_special_battle_id"] = setting.Id;
|
||||
_setupJsonData["story_special_battle_banish_effect_override"] = setting.BanishEffectOverRideText;
|
||||
_setupJsonData["story_special_battle_token_draw_effect_override"] = setting.TokenDrawEffectOverrideText;
|
||||
_setupJsonData["story_special_battle_special_token_draw_effect_override"] = setting.SpecialTokenDrawEffectOverrideText;
|
||||
_setupJsonData["story_special_battle_skip_result"] = (int)GameMgr.GetIns().GetDataMgr().SkipStorySpecialBattleResult;
|
||||
WriteJsonData();
|
||||
}
|
||||
}
|
||||
|
||||
public override void RecordCompleteFusionSelect(BattleCardBase fusionCard, IEnumerable<BattleCardBase> ingredientCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "comp_fusion";
|
||||
jsonData["index"] = CardToIndexName(fusionCard);
|
||||
jsonData["id"] = fusionCard.CardId;
|
||||
jsonData["name"] = fusionCard.BaseParameter.CardName;
|
||||
WriteSkillTargetInfoToJson(ingredientCards, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
protected override void WriteJsonData()
|
||||
{
|
||||
if (RecoveryManagerBase.failedRecoveryFlag)
|
||||
{
|
||||
return;
|
||||
}
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["version"] = 0;
|
||||
jsonData["battle_type"] = (int)_battleType;
|
||||
jsonData["record_time"] = DateTime.Now.Ticks;
|
||||
jsonData["setup"] = _setupJsonData;
|
||||
jsonData["operations"] = new JsonData();
|
||||
jsonData["operations"].SetJsonType(JsonType.Array);
|
||||
foreach (JsonData operationJsonData in _operationJsonDataList)
|
||||
{
|
||||
jsonData["operations"].Add(operationJsonData);
|
||||
}
|
||||
jsonData["check"] = new JsonData();
|
||||
jsonData["check"]["player"] = new JsonData();
|
||||
jsonData["check"]["player"].SetJsonType(JsonType.Object);
|
||||
jsonData["check"]["enemy"] = new JsonData();
|
||||
jsonData["check"]["enemy"].SetJsonType(JsonType.Object);
|
||||
BattlePlayer battlePlayer = BattleManagerBase.GetIns().BattlePlayer;
|
||||
BattleEnemy battleEnemy = BattleManagerBase.GetIns().BattleEnemy;
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Array);
|
||||
JsonData jsonData3 = new JsonData();
|
||||
jsonData3.SetJsonType(JsonType.Array);
|
||||
JsonData jsonData4 = new JsonData();
|
||||
jsonData4.SetJsonType(JsonType.Array);
|
||||
JsonData jsonData5 = new JsonData();
|
||||
jsonData5.SetJsonType(JsonType.Array);
|
||||
foreach (BattleCardBase handCard in battlePlayer.HandCardList)
|
||||
{
|
||||
jsonData2.Add(handCard.GetName());
|
||||
}
|
||||
foreach (BattleCardBase inPlayCard in battlePlayer.InPlayCards)
|
||||
{
|
||||
jsonData3.Add(inPlayCard.GetName());
|
||||
}
|
||||
foreach (BattleCardBase handCard2 in battleEnemy.HandCardList)
|
||||
{
|
||||
jsonData4.Add(handCard2.GetName());
|
||||
}
|
||||
foreach (BattleCardBase inPlayCard2 in battleEnemy.InPlayCards)
|
||||
{
|
||||
jsonData5.Add(inPlayCard2.GetName());
|
||||
}
|
||||
jsonData["check"]["player"]["hand"] = jsonData2;
|
||||
jsonData["check"]["player"]["inplay"] = jsonData3;
|
||||
jsonData["check"]["enemy"]["hand"] = jsonData4;
|
||||
jsonData["check"]["enemy"]["inplay"] = jsonData5;
|
||||
JsonData jsonData6 = new JsonData();
|
||||
jsonData6.SetJsonType(JsonType.Array);
|
||||
foreach (string skillTarget in _skillTargetList)
|
||||
{
|
||||
jsonData6.Add(skillTarget);
|
||||
}
|
||||
if (jsonData6.Count > 0)
|
||||
{
|
||||
jsonData["skill_targets"] = jsonData6;
|
||||
}
|
||||
WriteJsonDataToFile(jsonData);
|
||||
}
|
||||
|
||||
protected override void WriteJsonDataToFile(JsonData jsonData, string overrideFilePath = "")
|
||||
{
|
||||
base.WriteJsonDataToFile(jsonData, _tempRecoveryFilePath);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
namespace Wizard.Battle.Resource;
|
||||
|
||||
public class RecoveryBattleResourceMgr : BattleResourceMgr
|
||||
{
|
||||
private bool _enable;
|
||||
|
||||
public override VfxBase LoadAsset(string path, ResourcesManager.AssetLoadPathType pathType, Action action)
|
||||
{
|
||||
if (_enable)
|
||||
{
|
||||
return base.LoadAsset(path, pathType, action);
|
||||
}
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public override VfxBase LoadAsset(string fullPath, Action action)
|
||||
{
|
||||
if (_enable)
|
||||
{
|
||||
return base.LoadAsset(fullPath, action);
|
||||
}
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public override VfxBase LoadEffectBattle(string objectFullPath, string objectPath, string sePath)
|
||||
{
|
||||
if (_enable)
|
||||
{
|
||||
return base.LoadEffectBattle(objectFullPath, objectPath, sePath);
|
||||
}
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public override VfxBase LoadAndCreateEffectBattleInstance(string objectPath, EffectMgr.EngineType engineType, string sePath, Action<EffectBattle> loadEndCallback)
|
||||
{
|
||||
if (_enable)
|
||||
{
|
||||
return base.LoadAndCreateEffectBattleInstance(objectPath, engineType, sePath, loadEndCallback);
|
||||
}
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public void EnableLoadResouce()
|
||||
{
|
||||
_enable = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
|
||||
namespace Wizard.Battle.View.Vfx;
|
||||
|
||||
public static class VfxResultEventExtension
|
||||
{
|
||||
public static VfxBase GetAllFuncVfxResults(this Func<VfxBase> func)
|
||||
{
|
||||
return CallAllFunc(func, (Delegate f) => ((Func<VfxBase>)f)());
|
||||
}
|
||||
|
||||
public static VfxBase GetAllFuncVfxResults<T1>(this Func<T1, VfxBase> func, T1 arg1)
|
||||
{
|
||||
return CallAllFunc(func, (Delegate f) => ((Func<T1, VfxBase>)f)(arg1));
|
||||
}
|
||||
|
||||
public static VfxBase GetAllFuncVfxResults<T1, T2>(this Func<T1, T2, VfxBase> func, T1 arg1, T2 arg2)
|
||||
{
|
||||
return CallAllFunc(func, (Delegate f) => ((Func<T1, T2, VfxBase>)f)(arg1, arg2));
|
||||
}
|
||||
|
||||
public static VfxBase GetAllFuncVfxResults<T1, T2, T3>(this Func<T1, T2, T3, VfxBase> func, T1 arg1, T2 arg2, T3 arg3)
|
||||
{
|
||||
return CallAllFunc(func, (Delegate f) => ((Func<T1, T2, T3, VfxBase>)f)(arg1, arg2, arg3));
|
||||
}
|
||||
|
||||
public static VfxBase GetAllFuncVfxResults<T1, T2, T3, T4>(this Func<T1, T2, T3, T4, VfxBase> func, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
|
||||
{
|
||||
return CallAllFunc(func, (Delegate f) => ((Func<T1, T2, T3, T4, VfxBase>)f)(arg1, arg2, arg3, arg4));
|
||||
}
|
||||
|
||||
private static VfxBase CallAllFunc(Delegate func, Func<Delegate, VfxBase> call)
|
||||
{
|
||||
if ((object)func == null)
|
||||
{
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
|
||||
Delegate[] invocationList = func.GetInvocationList();
|
||||
foreach (Delegate arg in invocationList)
|
||||
{
|
||||
VfxBase vfx = call(arg);
|
||||
parallelVfxPlayer.Register(vfx);
|
||||
}
|
||||
return parallelVfxPlayer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace Wizard.Battle;
|
||||
|
||||
public static class IBattleCardUniqueIDExtension
|
||||
{
|
||||
public static bool EquelsID(this IBattleCardUniqueID lhs, IBattleCardUniqueID rhs)
|
||||
{
|
||||
if (lhs == null || rhs == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (lhs.IsPlayer == rhs.IsPlayer)
|
||||
{
|
||||
return lhs.Index == rhs.Index;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string GetName(this IBattleCardUniqueID cardId)
|
||||
{
|
||||
return (cardId.IsPlayer ? "p" : "e") + cardId.Index;
|
||||
}
|
||||
}
|
||||
55
SVSim.BattleEngine/Engine/Wizard.Bingo/BingoMissionDialog.cs
Normal file
55
SVSim.BattleEngine/Engine/Wizard.Bingo/BingoMissionDialog.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Bingo;
|
||||
|
||||
public class BingoMissionDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _bingoMissionItemPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _grid;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollView _scrollPanel;
|
||||
|
||||
private BingoInfoTask.BingoInfoData _bingoInfoData;
|
||||
|
||||
private ResourceHandler _resourceHandler;
|
||||
|
||||
public static void Create(GameObject prefab, BingoInfoTask.BingoInfoData bingoData)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
BingoMissionDialog missionDialog = Object.Instantiate(prefab).GetComponent<BingoMissionDialog>();
|
||||
missionDialog._resourceHandler = missionDialog.gameObject.AddMissingComponent<ResourceHandler>();
|
||||
dialogBase.SetObj(missionDialog.gameObject);
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Bingo_0005"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
missionDialog._resourceHandler.UnloadAll();
|
||||
};
|
||||
missionDialog.Initialize(bingoData);
|
||||
}
|
||||
|
||||
private void Initialize(BingoInfoTask.BingoInfoData bingoInfoData)
|
||||
{
|
||||
_bingoInfoData = bingoInfoData;
|
||||
UpdateMissionView();
|
||||
}
|
||||
|
||||
private void UpdateMissionView()
|
||||
{
|
||||
_grid.transform.DestroyChildren();
|
||||
for (int i = 0; i < _bingoInfoData.MissionList.Count; i++)
|
||||
{
|
||||
bool flag = i + 1 == _bingoInfoData.MissionList.Count;
|
||||
AchievementWindowBase component = NGUITools.AddChild(_grid.gameObject, _bingoMissionItemPrefab).GetComponent<AchievementWindowBase>();
|
||||
component.gameObject.SetActive(value: true);
|
||||
component.SetBingoMission(_bingoInfoData.MissionList[i], !flag, _resourceHandler);
|
||||
}
|
||||
_grid.Reposition();
|
||||
_scrollPanel.ResetPosition();
|
||||
}
|
||||
}
|
||||
179
SVSim.BattleEngine/Engine/Wizard.Bingo/BingoRewardsDialog.cs
Normal file
179
SVSim.BattleEngine/Engine/Wizard.Bingo/BingoRewardsDialog.cs
Normal file
@@ -0,0 +1,179 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Bingo;
|
||||
|
||||
public class BingoRewardsDialog : MonoBehaviour
|
||||
{
|
||||
public enum MissionViewTab
|
||||
{
|
||||
First,
|
||||
Second,
|
||||
Third,
|
||||
Fourth,
|
||||
AfterFifth
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _bingoMissionItemPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _grid;
|
||||
|
||||
private ResourceHandler _resourceHandler;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _firstRewardsButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _secondRewardsButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _thirdRewardsButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _fourthRewardsButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _fifthRewardsButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollView _scrollPanel;
|
||||
|
||||
private BingoInfoTask.BingoInfoData _bingoInfoData;
|
||||
|
||||
private MissionViewTab _currentViewTab;
|
||||
|
||||
public static void Create(GameObject prefab, BingoInfoTask.BingoInfoData bingoData)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
BingoRewardsDialog rewardDialog = Object.Instantiate(prefab).GetComponent<BingoRewardsDialog>();
|
||||
rewardDialog._resourceHandler = rewardDialog.gameObject.AddMissingComponent<ResourceHandler>();
|
||||
dialogBase.SetObj(rewardDialog.gameObject);
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Bingo_0006"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
rewardDialog._resourceHandler.UnloadAll();
|
||||
};
|
||||
rewardDialog.Initialize(bingoData);
|
||||
}
|
||||
|
||||
private void Initialize(BingoInfoTask.BingoInfoData bingoInfoData)
|
||||
{
|
||||
_bingoInfoData = bingoInfoData;
|
||||
MissionViewTab viewTab = (MissionViewTab)Mathf.Clamp(_bingoInfoData.SheetNum - 1, 0, 4);
|
||||
OnPushTabButton(viewTab, firstCall: true);
|
||||
_firstRewardsButton.onClick.Clear();
|
||||
_firstRewardsButton.GetComponentInChildren<UILabel>().text = string.Format(Data.SystemText.Get("Bingo_0012"), GetCurrentTabIndex(MissionViewTab.First));
|
||||
_firstRewardsButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnPushTabButton(MissionViewTab.First);
|
||||
}));
|
||||
_secondRewardsButton.onClick.Clear();
|
||||
_secondRewardsButton.GetComponentInChildren<UILabel>().text = string.Format(Data.SystemText.Get("Bingo_0012"), GetCurrentTabIndex(MissionViewTab.Second));
|
||||
_secondRewardsButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnPushTabButton(MissionViewTab.Second);
|
||||
}));
|
||||
_thirdRewardsButton.onClick.Clear();
|
||||
_thirdRewardsButton.GetComponentInChildren<UILabel>().text = string.Format(Data.SystemText.Get("Bingo_0012"), GetCurrentTabIndex(MissionViewTab.Third));
|
||||
_thirdRewardsButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnPushTabButton(MissionViewTab.Third);
|
||||
}));
|
||||
_fourthRewardsButton.onClick.Clear();
|
||||
_fourthRewardsButton.GetComponentInChildren<UILabel>().text = string.Format(Data.SystemText.Get("Bingo_0012"), GetCurrentTabIndex(MissionViewTab.Fourth));
|
||||
_fourthRewardsButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnPushTabButton(MissionViewTab.Fourth);
|
||||
}));
|
||||
_fifthRewardsButton.onClick.Clear();
|
||||
_fifthRewardsButton.GetComponentInChildren<UILabel>().text = string.Format(Data.SystemText.Get("Bingo_0013"), GetCurrentTabIndex(MissionViewTab.AfterFifth));
|
||||
_fifthRewardsButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnPushTabButton(MissionViewTab.AfterFifth);
|
||||
}));
|
||||
}
|
||||
|
||||
private int GetCurrentTabIndex(MissionViewTab missionViewTab)
|
||||
{
|
||||
return (int)(missionViewTab + 1);
|
||||
}
|
||||
|
||||
private void OnPushTabButton(MissionViewTab viewTab, bool firstCall = false)
|
||||
{
|
||||
if (_currentViewTab != viewTab || firstCall)
|
||||
{
|
||||
_currentViewTab = viewTab;
|
||||
UpdateMissionView(viewTab);
|
||||
if (!firstCall)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateMissionView(MissionViewTab viewTab)
|
||||
{
|
||||
ChangeTab(viewTab);
|
||||
UpdateTabSprite(viewTab);
|
||||
}
|
||||
|
||||
public void ChangeTab(MissionViewTab viewTab)
|
||||
{
|
||||
_bingoInfoData.AllLineRewardsListDic.TryGetValue((int)viewTab, out var value);
|
||||
_grid.transform.DestroyChildren();
|
||||
for (int i = 0; i < value.Count; i++)
|
||||
{
|
||||
bool flag = i + 1 == value.Count;
|
||||
AchievementWindowBase component = NGUITools.AddChild(_grid.gameObject, _bingoMissionItemPrefab).GetComponent<AchievementWindowBase>();
|
||||
component.gameObject.SetActive(value: true);
|
||||
component.SetBingoRewardDetails(value[i], !flag, _resourceHandler);
|
||||
}
|
||||
_grid.Reposition();
|
||||
_scrollPanel.ResetPosition();
|
||||
}
|
||||
|
||||
private void UpdateTabSprite(MissionViewTab scene)
|
||||
{
|
||||
switch (scene)
|
||||
{
|
||||
case MissionViewTab.First:
|
||||
_firstRewardsButton.normalSprite = _firstRewardsButton.pressedSprite;
|
||||
_secondRewardsButton.normalSprite = _secondRewardsButton.disabledSprite;
|
||||
_thirdRewardsButton.normalSprite = _thirdRewardsButton.disabledSprite;
|
||||
_fourthRewardsButton.normalSprite = _fourthRewardsButton.disabledSprite;
|
||||
_fifthRewardsButton.normalSprite = _fifthRewardsButton.disabledSprite;
|
||||
break;
|
||||
case MissionViewTab.Second:
|
||||
_firstRewardsButton.normalSprite = _firstRewardsButton.disabledSprite;
|
||||
_secondRewardsButton.normalSprite = _secondRewardsButton.pressedSprite;
|
||||
_thirdRewardsButton.normalSprite = _thirdRewardsButton.disabledSprite;
|
||||
_fourthRewardsButton.normalSprite = _fourthRewardsButton.disabledSprite;
|
||||
_fifthRewardsButton.normalSprite = _fifthRewardsButton.disabledSprite;
|
||||
break;
|
||||
case MissionViewTab.Third:
|
||||
_firstRewardsButton.normalSprite = _firstRewardsButton.disabledSprite;
|
||||
_secondRewardsButton.normalSprite = _secondRewardsButton.disabledSprite;
|
||||
_thirdRewardsButton.normalSprite = _thirdRewardsButton.pressedSprite;
|
||||
_fourthRewardsButton.normalSprite = _fourthRewardsButton.disabledSprite;
|
||||
_fifthRewardsButton.normalSprite = _fifthRewardsButton.disabledSprite;
|
||||
break;
|
||||
case MissionViewTab.Fourth:
|
||||
_firstRewardsButton.normalSprite = _firstRewardsButton.disabledSprite;
|
||||
_secondRewardsButton.normalSprite = _secondRewardsButton.disabledSprite;
|
||||
_thirdRewardsButton.normalSprite = _thirdRewardsButton.disabledSprite;
|
||||
_fourthRewardsButton.normalSprite = _fourthRewardsButton.pressedSprite;
|
||||
_fifthRewardsButton.normalSprite = _fifthRewardsButton.disabledSprite;
|
||||
break;
|
||||
case MissionViewTab.AfterFifth:
|
||||
_firstRewardsButton.normalSprite = _firstRewardsButton.disabledSprite;
|
||||
_secondRewardsButton.normalSprite = _secondRewardsButton.disabledSprite;
|
||||
_thirdRewardsButton.normalSprite = _thirdRewardsButton.disabledSprite;
|
||||
_fourthRewardsButton.normalSprite = _fourthRewardsButton.disabledSprite;
|
||||
_fifthRewardsButton.normalSprite = _fifthRewardsButton.pressedSprite;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Dialog.DataLink;
|
||||
|
||||
public class IdPasswordInput : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public UIInputWizard _idInput;
|
||||
|
||||
[SerializeField]
|
||||
public UIInputWizard _passwordInput;
|
||||
|
||||
public void ResetInputValue()
|
||||
{
|
||||
_idInput.value = string.Empty;
|
||||
_passwordInput.value = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
using Wizard.Dialog.Setting;
|
||||
|
||||
namespace Wizard.Dialog.DataLink;
|
||||
|
||||
public class PasswordSetting : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public UIInputWizard _firstInput;
|
||||
|
||||
[SerializeField]
|
||||
public UIInputWizard _secondInput;
|
||||
|
||||
[SerializeField]
|
||||
public UIButton _privacyPolicyButton;
|
||||
|
||||
[SerializeField]
|
||||
public ItemToggle _acceptToggle;
|
||||
|
||||
public void ResetInputValue()
|
||||
{
|
||||
_firstInput.value = string.Empty;
|
||||
_secondInput.value = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Lottery;
|
||||
|
||||
public class LotteryBigChanceTreasureBox : LotteryTreasureBox
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _parentTreasureObj;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _centerLine;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _backGround;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelOverTrasureBox;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _touchBg;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelCenter;
|
||||
|
||||
protected override void UpdateInfoLabel()
|
||||
{
|
||||
switch (_lotteryRewardData.state)
|
||||
{
|
||||
case LotteryRewardData.eLotteryRewardState.Unapplied:
|
||||
_labelInfoText.gameObject.SetActive(value: true);
|
||||
break;
|
||||
case LotteryRewardData.eLotteryRewardState.Applied:
|
||||
case LotteryRewardData.eLotteryRewardState.WaitResult:
|
||||
_labelInfoText.fontSize = 13;
|
||||
_labelInfoText.gameObject.SetActive(value: true);
|
||||
break;
|
||||
default:
|
||||
_labelInfoText.gameObject.SetActive(value: false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateStatusText()
|
||||
{
|
||||
switch (_lotteryRewardData.state)
|
||||
{
|
||||
case LotteryRewardData.eLotteryRewardState.Unapplied:
|
||||
_labelStatus.text = Data.SystemText.Get("Mission_0087");
|
||||
_labelInfoText.color = LabelDefine.TEXT_COLOR_ORANGE;
|
||||
_labelOverTrasureBox.text = Data.SystemText.Get("Mission_0010");
|
||||
break;
|
||||
case LotteryRewardData.eLotteryRewardState.Applied:
|
||||
case LotteryRewardData.eLotteryRewardState.WaitResult:
|
||||
_labelStatus.text = Data.SystemText.Get("Mission_0089");
|
||||
_labelStatus.color = LabelDefine.TEXT_COLOR_ORANGE;
|
||||
break;
|
||||
case LotteryRewardData.eLotteryRewardState.NotReceived:
|
||||
_labelCenter.text = Data.SystemText.Get("Mission_0091");
|
||||
_labelCenter.color = LabelDefine.TEXT_COLOR_ORANGE;
|
||||
break;
|
||||
case LotteryRewardData.eLotteryRewardState.Received:
|
||||
_labelCenter.text = Data.SystemText.Get("Mission_0092");
|
||||
break;
|
||||
case LotteryRewardData.eLotteryRewardState.NotAchieved:
|
||||
_labelCenter.text = Data.SystemText.Get("Mission_0059");
|
||||
break;
|
||||
default:
|
||||
_labelStatus.text = string.Empty;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateRewardImage()
|
||||
{
|
||||
if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.Received)
|
||||
{
|
||||
string textureRewardImage = string.Empty;
|
||||
if (_lotteryRewardData.IsSpecial)
|
||||
{
|
||||
string path = "thumbnail_lottery";
|
||||
textureRewardImage = Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.Lottery, isfetch: true);
|
||||
_labelRewardNum.gameObject.SetActive(value: false);
|
||||
}
|
||||
else if (_lotteryRewardData.NormalGotRewardList.Count > 0)
|
||||
{
|
||||
string textureName = _lotteryRewardData.NormalGotRewardList[0].TextureName;
|
||||
textureRewardImage = Toolbox.ResourcesManager.GetAssetTypePath(textureName, ResourcesManager.AssetLoadPathType.Item, isfetch: true);
|
||||
_labelRewardNum.gameObject.SetActive(value: true);
|
||||
_labelRewardNum.text = _lotteryRewardData.NormalGotRewardList[0].RewardGotNum.ToString();
|
||||
}
|
||||
SetTextureRewardImage(textureRewardImage);
|
||||
_labelCenter.gameObject.SetActive(value: true);
|
||||
_backGround.gameObject.SetActive(value: false);
|
||||
_labelTreasureTouch.gameObject.SetActive(value: false);
|
||||
_touchBg.gameObject.SetActive(value: false);
|
||||
return;
|
||||
}
|
||||
if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.Unapplied)
|
||||
{
|
||||
_centerLine.SetActive(value: true);
|
||||
UIManager.SetObjectToGrey(_spriteTreasureImage.gameObject, b: true);
|
||||
_textureRewardImage.gameObject.SetActive(value: false);
|
||||
_labelRewardNum.gameObject.SetActive(value: false);
|
||||
_backGround.gameObject.SetActive(value: false);
|
||||
_labelOverTrasureBox.gameObject.SetActive(value: true);
|
||||
return;
|
||||
}
|
||||
_textureRewardImage.gameObject.SetActive(value: false);
|
||||
_labelRewardNum.gameObject.SetActive(value: false);
|
||||
_spriteTreasureImage.gameObject.SetActive(value: true);
|
||||
if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.NotReceived)
|
||||
{
|
||||
_labelTreasureTouch.gameObject.SetActive(value: true);
|
||||
_labelTreasureTouch.text = GetTouchText();
|
||||
_backGround.gameObject.SetActive(value: false);
|
||||
_touchBg.gameObject.SetActive(value: true);
|
||||
_labelCenter.gameObject.SetActive(value: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_labelTreasureTouch.gameObject.SetActive(value: false);
|
||||
if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.NotAchieved)
|
||||
{
|
||||
_labelCenter.gameObject.SetActive(value: true);
|
||||
_backGround.gameObject.SetActive(value: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateNonActiveColor()
|
||||
{
|
||||
switch (_lotteryRewardData.state)
|
||||
{
|
||||
case LotteryRewardData.eLotteryRewardState.Received:
|
||||
if (_lotteryRewardData.IsSpecial)
|
||||
{
|
||||
SetNonActiveColor(isNonActive: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetNonActiveColor(isNonActive: true);
|
||||
}
|
||||
break;
|
||||
case LotteryRewardData.eLotteryRewardState.Unapplied:
|
||||
case LotteryRewardData.eLotteryRewardState.NotAchieved:
|
||||
SetNonActiveColor(isNonActive: true);
|
||||
break;
|
||||
case LotteryRewardData.eLotteryRewardState.Applied:
|
||||
case LotteryRewardData.eLotteryRewardState.WaitResult:
|
||||
case LotteryRewardData.eLotteryRewardState.NotReceived:
|
||||
SetNonActiveColor(isNonActive: false);
|
||||
break;
|
||||
default:
|
||||
_labelStatus.text = string.Empty;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetNonActiveColor(bool isNonActive)
|
||||
{
|
||||
UIManager.SetObjectToGrey(_parentTreasureObj, isNonActive);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Lottery;
|
||||
|
||||
public class LotteryMissionDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _lotteryMissionItemPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _grid;
|
||||
|
||||
public static void Create(GameObject prefab, LotteryInfoTask.LotteryInfoData lotteryData)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
LotteryMissionDialog component = Object.Instantiate(prefab).GetComponent<LotteryMissionDialog>();
|
||||
dialogBase.SetObj(component.gameObject);
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Mission_0075"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
component.Initialize(lotteryData);
|
||||
}
|
||||
|
||||
private void Initialize(LotteryInfoTask.LotteryInfoData lotteryData)
|
||||
{
|
||||
List<LotteryMissionData> list = new List<LotteryMissionData>(lotteryData.LotteryMissionList);
|
||||
if (lotteryData.BigChanceMission != null)
|
||||
{
|
||||
list.Add(lotteryData.BigChanceMission);
|
||||
}
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
LotteryMissionData lotteryData2 = list[i];
|
||||
bool flag = i + 1 == list.Count;
|
||||
AchievementWindowBase component = NGUITools.AddChild(_grid.gameObject, _lotteryMissionItemPrefab).GetComponent<AchievementWindowBase>();
|
||||
component.gameObject.SetActive(value: true);
|
||||
component.SetLottery(lotteryData2, !flag);
|
||||
}
|
||||
_grid.Reposition();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Lottery;
|
||||
|
||||
public class LotteryMissionTreasureBox : LotteryTreasureBox
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _categoryLabel;
|
||||
|
||||
[SerializeField]
|
||||
protected UISprite _categoryLabelLine;
|
||||
|
||||
public void Initialize(LotteryRewardData data, string categoryText, Action onClickEvent)
|
||||
{
|
||||
_categoryLabel.text = categoryText;
|
||||
SetData(data, string.Empty, onClickEvent);
|
||||
switch (data.state)
|
||||
{
|
||||
case LotteryRewardData.eLotteryRewardState.Applied:
|
||||
case LotteryRewardData.eLotteryRewardState.Received:
|
||||
case LotteryRewardData.eLotteryRewardState.NotAchieved:
|
||||
UIManager.SetObjectToGrey(_spriteTreasureImage.gameObject, b: true);
|
||||
break;
|
||||
default:
|
||||
UIManager.SetObjectToGrey(_spriteTreasureImage.gameObject, b: false);
|
||||
break;
|
||||
case LotteryRewardData.eLotteryRewardState.NotReceived:
|
||||
break;
|
||||
}
|
||||
if (data.MissionData.IsTimeOver)
|
||||
{
|
||||
UIManager.SetObjectToGrey(_spriteTreasureImage.gameObject, b: true);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateStatusText()
|
||||
{
|
||||
LotteryRewardData.eLotteryRewardState state = _lotteryRewardData.state;
|
||||
base.UpdateStatusText();
|
||||
if (state == LotteryRewardData.eLotteryRewardState.NotAchieved)
|
||||
{
|
||||
_labelStatus.text = Data.SystemText.Get("Mission_0059");
|
||||
}
|
||||
if (_lotteryRewardData.MissionData != null && _lotteryRewardData.MissionData.IsTimeOver)
|
||||
{
|
||||
_labelStatus.text = Data.SystemText.Get("Mission_0078");
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetCategoryLabelLineWitdh(int width)
|
||||
{
|
||||
_categoryLabelLine.width = width;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
namespace Wizard.Lottery;
|
||||
|
||||
public class LotteryReceiveBigChanceTask : BaseTask
|
||||
{
|
||||
public class LotteryReceiveBigChanceTaskParam : BaseParam
|
||||
{
|
||||
public int campaign_id;
|
||||
|
||||
public int mission_id;
|
||||
}
|
||||
|
||||
public LotteryRewardData Result { get; private set; }
|
||||
|
||||
public LotteryReceiveBigChanceTask()
|
||||
{
|
||||
base.type = ApiType.Type.LotteryReceiveBigChance;
|
||||
}
|
||||
|
||||
public void SetParameter(int campaignId, int missionId)
|
||||
{
|
||||
LotteryReceiveBigChanceTaskParam lotteryReceiveBigChanceTaskParam = new LotteryReceiveBigChanceTaskParam();
|
||||
lotteryReceiveBigChanceTaskParam.campaign_id = campaignId;
|
||||
lotteryReceiveBigChanceTaskParam.mission_id = missionId;
|
||||
base.Params = lotteryReceiveBigChanceTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Result = new LotteryRewardData(base.ResponseData["data"]["lottery_reward"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
namespace Wizard.Lottery;
|
||||
|
||||
public class LotteryReceiveDoubleChanceTask : BaseTask
|
||||
{
|
||||
public class LotteryReceiveDoubleChanceTaskParam : BaseParam
|
||||
{
|
||||
public int campaign_id;
|
||||
|
||||
public int mission_id;
|
||||
}
|
||||
|
||||
public LotteryRewardData Result { get; private set; }
|
||||
|
||||
public LotteryReceiveDoubleChanceTask()
|
||||
{
|
||||
base.type = ApiType.Type.LotteryReceiveDoubleChance;
|
||||
}
|
||||
|
||||
public void SetParameter(int campaignId, int missionId)
|
||||
{
|
||||
LotteryReceiveDoubleChanceTaskParam lotteryReceiveDoubleChanceTaskParam = new LotteryReceiveDoubleChanceTaskParam();
|
||||
lotteryReceiveDoubleChanceTaskParam.campaign_id = campaignId;
|
||||
lotteryReceiveDoubleChanceTaskParam.mission_id = missionId;
|
||||
base.Params = lotteryReceiveDoubleChanceTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Result = new LotteryRewardData(base.ResponseData["data"]["lottery_reward"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace Wizard.Lottery;
|
||||
|
||||
public class LotteryReceiveTask : BaseTask
|
||||
{
|
||||
public class LotteryReceiveTaskParam : BaseParam
|
||||
{
|
||||
public int mission_id;
|
||||
}
|
||||
|
||||
public LotteryRewardData Result { get; private set; }
|
||||
|
||||
public LotteryReceiveTask()
|
||||
{
|
||||
base.type = ApiType.Type.LotteryReceive;
|
||||
}
|
||||
|
||||
public void SetParameter(int mission_id)
|
||||
{
|
||||
LotteryReceiveTaskParam lotteryReceiveTaskParam = new LotteryReceiveTaskParam();
|
||||
lotteryReceiveTaskParam.mission_id = mission_id;
|
||||
base.Params = lotteryReceiveTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Result = new LotteryRewardData(base.ResponseData["data"]["lottery_reward"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
|
||||
public class BuildDeckDetailWindow : MonoBehaviour
|
||||
{
|
||||
private const int SUPPLY_TYPE_LABEL_INDEX = 0;
|
||||
|
||||
private const int SUPPLY_NAME_LABEL_INDEX = 1;
|
||||
|
||||
private const int DEPTH_COPY_CONFIRM_DIALOG = 20;
|
||||
|
||||
[SerializeField]
|
||||
private BuildDeckProductDetail _buildDeckProductDetail;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelProductName;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _spriteClassColorIcon;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelDeckCode;
|
||||
|
||||
private BuildDeckProductInfo _productInfo;
|
||||
|
||||
private UICardList _uiCardList;
|
||||
|
||||
private List<string> _loadedCardList = new List<string>();
|
||||
|
||||
public void SetSingleData(UICardList uiCardList, BuildDeckProductInfo productInfo)
|
||||
{
|
||||
_productInfo = productInfo;
|
||||
_uiCardList = uiCardList;
|
||||
_buildDeckProductDetail.SetSingleProductDetail(productInfo);
|
||||
ClassCharacterMasterData charaPrmByClassId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(productInfo.leader_id);
|
||||
_labelProductName.text = productInfo.saleInfo.name;
|
||||
ClassCharaPrm.SetClassLabelSetting(_labelProductName, charaPrmByClassId.ClassColorId);
|
||||
_spriteClassColorIcon.spriteName = ClassCharaPrm.GetIconSpriteName(charaPrmByClassId.clan);
|
||||
_uiCardList.SetClan(charaPrmByClassId.clan);
|
||||
_uiCardList.SetDeckName(productInfo.saleInfo.name);
|
||||
_uiCardList.SetMaxCardNum(40);
|
||||
_labelDeckCode.text = Wizard.Data.SystemText.Get("Shop_0117", productInfo.deck_code);
|
||||
}
|
||||
|
||||
public void OnCloseWindow()
|
||||
{
|
||||
_uiCardList.RemoveData();
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadedCardList);
|
||||
}
|
||||
|
||||
public void OnBtnCopyDeckCode()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
NativePluginWrapper.SetStringToClipboard(_productInfo.deck_code);
|
||||
UIManager.GetInstance().CreateConfirmationDialog(Wizard.Data.SystemText.Get("Shop_0118", _productInfo.deck_code)).SetPanelDepth(20);
|
||||
}
|
||||
|
||||
public void OnBtnShowCardList()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
if (_uiCardList.getCardNum() > 0)
|
||||
{
|
||||
ShowUICardList();
|
||||
return;
|
||||
}
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
StartCoroutine(LoadCardAndShowUICardList());
|
||||
}
|
||||
|
||||
private IEnumerator LoadCardAndShowUICardList()
|
||||
{
|
||||
List<int> cardIdList = _productInfo.CardIdList;
|
||||
List<string> assetList = _uiCardList.GetLoadFileList(cardIdList);
|
||||
yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(assetList, null));
|
||||
_loadedCardList.AddRange(assetList);
|
||||
List<int> list = UIManager.GetInstance().getUIBase_CardManager().SortIDList(cardIdList, CardMaster.CardMasterId.Default);
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
_uiCardList.addScrollItem(list[i]);
|
||||
}
|
||||
_uiCardList.SetFormat(Format.Rotation, null);
|
||||
yield return null;
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
ShowUICardList();
|
||||
}
|
||||
|
||||
private void ShowUICardList()
|
||||
{
|
||||
_uiCardList.SetActive(in_Active: true);
|
||||
_uiCardList.ResetScroll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
|
||||
public class BuildDeckPlate : MonoBehaviour
|
||||
{
|
||||
private const int MAX_LENGTH_VIEW_DECK_PRODUCT_NAME = 15;
|
||||
|
||||
private const int MAX_LENGTH_VIEW_DECK_PRODUCT_NAME_ALPHABET = 35;
|
||||
|
||||
private readonly Vector3 POS_VIEW_SINGLE_PRODUCT_NAME = new Vector3(13f, -52f, 0f);
|
||||
|
||||
[SerializeField]
|
||||
private UIEventListener _eventListenerDeckImage;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelCostCrystalLeft;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelCostCrystalCenter;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton m_BtnBuy;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_LabelBuy;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_LabelPurchased;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _LabelPurchaseNum;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _LabelProductName;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _uiDeckTexture;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _spriteClassColorIcon;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelCostTicket;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _leaderSkinTicketIcon;
|
||||
|
||||
public BuildDeckProductInfo ProductInfo { get; private set; }
|
||||
|
||||
public Texture ImageTexture { get; private set; }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
m_LabelPurchased.text = Wizard.Data.SystemText.Get("Shop_0100");
|
||||
}
|
||||
|
||||
public void SetData(BuildDeckProductInfo productInfo, EventDelegate onPushBuyBtnCallback, Action onTapDeckImage)
|
||||
{
|
||||
ProductInfo = productInfo;
|
||||
ClassCharacterMasterData charaPrmByClassId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(productInfo.leader_id);
|
||||
_LabelProductName.transform.localPosition = POS_VIEW_SINGLE_PRODUCT_NAME;
|
||||
int maxLength = (Global.IsAlphabetLanguage() ? 35 : 15);
|
||||
_LabelProductName.text = ShopCommonUtility.TrimProductName(productInfo.saleInfo.name, maxLength);
|
||||
ClassCharaPrm.SetClassLabelSetting(_LabelProductName, charaPrmByClassId.ClassColorId);
|
||||
_uiDeckTexture.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(productInfo.saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail, isfetch: true));
|
||||
_spriteClassColorIcon.gameObject.SetActive(value: true);
|
||||
_spriteClassColorIcon.spriteName = ClassCharaPrm.GetIconSpriteName(charaPrmByClassId.clan);
|
||||
m_BtnBuy.onClick.Clear();
|
||||
m_BtnBuy.onClick.Add(onPushBuyBtnCallback);
|
||||
_eventListenerDeckImage.onClick = null;
|
||||
_eventListenerDeckImage.onClick = delegate
|
||||
{
|
||||
onTapDeckImage.Call();
|
||||
};
|
||||
_SetBuyButton(productInfo);
|
||||
}
|
||||
|
||||
private void _SetBuyButton(BuildDeckProductInfo productInfo)
|
||||
{
|
||||
int? num = null;
|
||||
if (productInfo.saleInfo.costCrystal.HasValue)
|
||||
{
|
||||
num = productInfo.saleInfo.costCrystal.Value;
|
||||
}
|
||||
if (productInfo.saleInfo.costTicket.HasValue)
|
||||
{
|
||||
num = productInfo.saleInfo.costTicket.Value;
|
||||
}
|
||||
UIManager.SetObjectToGrey(m_BtnBuy.gameObject, b: false);
|
||||
_labelCostTicket.gameObject.SetActive(value: false);
|
||||
_leaderSkinTicketIcon.gameObject.SetActive(value: false);
|
||||
int num2 = 0;
|
||||
if (productInfo.saleInfo.costTicket.HasValue && productInfo.saleInfo.costTicketItemId.HasValue)
|
||||
{
|
||||
num2 = PlayerStaticData.GetItemNum((int)productInfo.saleInfo.costTicketItemId.Value);
|
||||
_labelCostTicket.text = Wizard.Data.SystemText.Get("Shop_0189", productInfo.saleInfo.costTicket.Value.ToString());
|
||||
_leaderSkinTicketIcon.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(ShopCommonUtility.GetTicketIconPath(productInfo.saleInfo.costTicketItemId.Value.ToString(), isFetch: true));
|
||||
}
|
||||
if (!productInfo.is_purchased)
|
||||
{
|
||||
m_BtnBuy.gameObject.SetActive(value: true);
|
||||
m_BtnBuy.isEnabled = true;
|
||||
m_LabelPurchased.gameObject.SetActive(value: false);
|
||||
if (productInfo.saleInfo.isFree)
|
||||
{
|
||||
m_LabelBuy.text = Wizard.Data.SystemText.Get("Shop_0099");
|
||||
return;
|
||||
}
|
||||
m_LabelBuy.text = Wizard.Data.SystemText.Get("Shop_0095");
|
||||
if (productInfo.saleInfo.costTicket.HasValue && productInfo.saleInfo.costTicketItemId.HasValue)
|
||||
{
|
||||
_labelCostTicket.gameObject.SetActive(value: true);
|
||||
_leaderSkinTicketIcon.gameObject.SetActive(value: true);
|
||||
UIManager.SetObjectToGrey(m_BtnBuy.gameObject, num2 < productInfo.saleInfo.costTicket.Value);
|
||||
}
|
||||
if (!productInfo.saleInfo.costCrystal.HasValue)
|
||||
{
|
||||
_labelCostCrystalLeft.gameObject.SetActive(value: false);
|
||||
_labelCostCrystalCenter.gameObject.SetActive(value: false);
|
||||
}
|
||||
else if (productInfo.purchase_num_max == 1)
|
||||
{
|
||||
SetCostLabel(num.Value, isCenter: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCostLabel(num.Value, isCenter: false);
|
||||
}
|
||||
if (productInfo.purchase_num_max == 1)
|
||||
{
|
||||
_LabelPurchaseNum.gameObject.SetActive(value: false);
|
||||
return;
|
||||
}
|
||||
if (productInfo.is_first_price && productInfo.purchase_num_current <= 0)
|
||||
{
|
||||
_LabelPurchaseNum.gameObject.SetActive(value: true);
|
||||
_LabelPurchaseNum.text = Wizard.Data.SystemText.Get("Shop_0122");
|
||||
return;
|
||||
}
|
||||
_LabelPurchaseNum.gameObject.SetActive(value: true);
|
||||
int num3 = productInfo.purchase_num_max - productInfo.purchase_num_current;
|
||||
_LabelPurchaseNum.text = Wizard.Data.SystemText.Get("Shop_0123", num3.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_BtnBuy.gameObject.SetActive(value: false);
|
||||
m_LabelPurchased.gameObject.SetActive(value: true);
|
||||
_LabelPurchaseNum.gameObject.SetActive(value: false);
|
||||
if (productInfo.saleInfo.costTicket.HasValue && productInfo.saleInfo.costTicketItemId.HasValue)
|
||||
{
|
||||
_labelCostTicket.gameObject.SetActive(value: true);
|
||||
_leaderSkinTicketIcon.gameObject.SetActive(value: true);
|
||||
}
|
||||
if (!productInfo.saleInfo.costCrystal.HasValue)
|
||||
{
|
||||
_labelCostCrystalLeft.gameObject.SetActive(value: false);
|
||||
_labelCostCrystalCenter.gameObject.SetActive(value: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCostLabel(num.Value, isCenter: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetCostLabel(int cost, bool isCenter)
|
||||
{
|
||||
string text = Wizard.Data.SystemText.Get("Shop_0112", cost.ToString());
|
||||
if (isCenter)
|
||||
{
|
||||
_labelCostCrystalLeft.gameObject.SetActive(value: false);
|
||||
_labelCostCrystalCenter.gameObject.SetActive(value: true);
|
||||
_labelCostCrystalCenter.text = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
_labelCostCrystalLeft.gameObject.SetActive(value: true);
|
||||
_labelCostCrystalCenter.gameObject.SetActive(value: false);
|
||||
_labelCostCrystalLeft.text = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,788 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.DeckCardEdit;
|
||||
using Wizard.Lottery;
|
||||
|
||||
namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
|
||||
public class BuildDeckPurchasePage : BaseShopPurchasePage
|
||||
{
|
||||
private const int DEFAULT_INDEX = 0;
|
||||
|
||||
private const string LAYER_DIALOG_PRODUCT_DETAIL = "MyPage";
|
||||
|
||||
private const int SORTODER_DIALOG_PRODUCT_DETAIL = 2;
|
||||
|
||||
private const int DEPTH_DIALOG_PRODUCT_DETAIL = 140;
|
||||
|
||||
private const string LAYER_DIALOG_PURCHASE_REWARD = "MyPage";
|
||||
|
||||
private const int SORTODER_DIALOG_PURCHASE_REWARD = 2;
|
||||
|
||||
private const int DEPTH_DIALOG_PURCHASE_REWARD = 140;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _prefabDialogSelectBuyMeans;
|
||||
|
||||
[SerializeField]
|
||||
private PurchaseConfirm _prefabDialogPurchaseConfirm;
|
||||
|
||||
[SerializeField]
|
||||
private BuildDeckDetailWindow _prefabDialogBuildDeckDetail;
|
||||
|
||||
[SerializeField]
|
||||
private CardDetailUI _cardDetailPrefab;
|
||||
|
||||
private CardDetailUI _cardDetail;
|
||||
|
||||
[SerializeField]
|
||||
private UICardList _cardListPrefab;
|
||||
|
||||
private UICardList _uiCardListClass;
|
||||
|
||||
[SerializeField]
|
||||
private ShopDrumrollScrollManager _drumrollManager;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _btnSeriesRewards;
|
||||
|
||||
[SerializeField]
|
||||
private UIAnchor _achiveAnchor;
|
||||
|
||||
private BuildDeckSeriesPurchaseInfo _selectSeriesInfo;
|
||||
|
||||
private BuildDeckProductInfo _purchaseProductInfo;
|
||||
|
||||
private string _purchaseDeckName = string.Empty;
|
||||
|
||||
private int _purchaseDeckClassId;
|
||||
|
||||
private List<int> _purchaseDeckCardIds;
|
||||
|
||||
private BuildDeckPlate _selectPlate;
|
||||
|
||||
private DialogBase _dialogPurchaseConfirm;
|
||||
|
||||
private DialogBase _dialogSelectBuyMeans;
|
||||
|
||||
private DialogBase _dialogProductDetail;
|
||||
|
||||
private DialogBase _dialogCrystalShortage;
|
||||
|
||||
private BuildDeckBuyTask _buyTask;
|
||||
|
||||
private bool _isBuyConnect;
|
||||
|
||||
private static int _autoShowBuildDeckProductId;
|
||||
|
||||
private static bool _autoShowBuildDeckEnable;
|
||||
|
||||
private Format _deckCreateFormat;
|
||||
|
||||
private List<string> _loadResource = new List<string>();
|
||||
|
||||
private int _addShowSeriesId;
|
||||
|
||||
[SerializeField]
|
||||
private NotificatonAnimation _notificationAnimationPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _achieveLog;
|
||||
|
||||
private NotificatonAnimation _notificationAnimation;
|
||||
|
||||
public static void BuildDeckConfirmDialogShow(int productID)
|
||||
{
|
||||
_autoShowBuildDeckEnable = true;
|
||||
_autoShowBuildDeckProductId = productID;
|
||||
}
|
||||
|
||||
public override void onFirstStart()
|
||||
{
|
||||
_cardDetail = UnityEngine.Object.Instantiate(_cardDetailPrefab);
|
||||
_cardDetail.transform.parent = base.transform;
|
||||
_cardDetail.transform.localPosition = Vector3.zero;
|
||||
_cardDetail.transform.localScale = Vector3.one;
|
||||
_cardDetail.Initialize(LayerMask.NameToLayer("Detail"), CardMaster.CardMasterId.Default);
|
||||
_cardDetail.gameObject.SetActive(value: false);
|
||||
_uiCardListClass = UnityEngine.Object.Instantiate(_cardListPrefab).GetComponent<UICardList>();
|
||||
_uiCardListClass.SetActive(in_Active: false);
|
||||
_uiCardListClass.Init(base.gameObject, _cardDetail, null, null, "Detail", in_DetailCameraUse: true);
|
||||
CreateTopBar(Wizard.Data.SystemText.Get("Shop_0116"), delegate
|
||||
{
|
||||
MyPageMenu.Instance.GoToShopCard();
|
||||
});
|
||||
_achiveAnchor.uiCamera = UIManager.GetInstance().MyPageUICameraObj.GetComponent<Camera>();
|
||||
base.onFirstStart();
|
||||
}
|
||||
|
||||
protected override void onOpen()
|
||||
{
|
||||
base.onOpen();
|
||||
_loadedResourceList = new List<string>();
|
||||
StartGetBuildDeckInfo(OnBuildDeckInfoRequestFinished);
|
||||
}
|
||||
|
||||
protected override void onClose()
|
||||
{
|
||||
base.onClose();
|
||||
DisposeResource();
|
||||
}
|
||||
|
||||
private void DisposeResource()
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadResource);
|
||||
_loadResource.Clear();
|
||||
}
|
||||
|
||||
private void StartGetBuildDeckInfo(Action<NetworkTask.ResultCode> callbackOnSuccess)
|
||||
{
|
||||
BuildDeckPurchaseInfoTask buildDeckPurchaseInfoTask = new BuildDeckPurchaseInfoTask();
|
||||
buildDeckPurchaseInfoTask.SetParameter(_addShowSeriesId);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(buildDeckPurchaseInfoTask, callbackOnSuccess));
|
||||
}
|
||||
|
||||
private void StartBuyBuildDeck(ShopCommonUtility.SalesType costType, int id)
|
||||
{
|
||||
if (!_isBuyConnect)
|
||||
{
|
||||
_isBuyConnect = true;
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
_buyTask = new BuildDeckBuyTask();
|
||||
_buyTask.SetParameter(id, costType);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(_buyTask, delegate(NetworkTask.ResultCode error)
|
||||
{
|
||||
onSuccessPurchase(error, costType);
|
||||
}, _OnFailurePurchase, _OnResultCodeError));
|
||||
}
|
||||
}
|
||||
|
||||
private int GetViewSeriesId()
|
||||
{
|
||||
int seriesId = Wizard.Data.BuildDeckPurchaseInfo.seriesList[0]._seriesId;
|
||||
int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LATEST_DECK_SERIES_ID);
|
||||
if (seriesId != value)
|
||||
{
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.LATEST_DECK_SERIES_ID, seriesId);
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.LAST_PURCHASE_DECK_SERIES_ID, seriesId);
|
||||
}
|
||||
if (_autoShowBuildDeckEnable)
|
||||
{
|
||||
return Wizard.Data.BuildDeckPurchaseInfo.GetSeriesId(_autoShowBuildDeckProductId);
|
||||
}
|
||||
int value2 = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.SCENE_TRANSITION_VIEW_DECK_SERIES_ID);
|
||||
if (value2 > -1)
|
||||
{
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SCENE_TRANSITION_VIEW_DECK_SERIES_ID, -1);
|
||||
return value2;
|
||||
}
|
||||
return PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_PURCHASE_DECK_SERIES_ID);
|
||||
}
|
||||
|
||||
private void OnBuildDeckInfoRequestFinished(NetworkTask.ResultCode error)
|
||||
{
|
||||
List<int> seriesIdList = GetSeriesIdList();
|
||||
Dictionary<int, BaseSeriesData> seriesMasterDic = GetSeriesDataDictionary();
|
||||
List<BuildDeckSeriesPurchaseInfo> seriesList = Wizard.Data.BuildDeckPurchaseInfo.seriesList;
|
||||
DisposeResource();
|
||||
foreach (BuildDeckSeriesPurchaseInfo item in seriesList)
|
||||
{
|
||||
foreach (BuildDeckProductInfo product in item.productList)
|
||||
{
|
||||
if (product.saleInfo.costTicket.HasValue && product.saleInfo.costTicketItemId.HasValue)
|
||||
{
|
||||
_loadResource.Add(ShopCommonUtility.GetTicketIconPath(product.saleInfo.costTicketItemId.Value.ToString(), isFetch: false));
|
||||
_loadResource.Add(ShopCommonUtility.GetTicketIconRightDownPath(product.saleInfo.costTicketItemId.Value.ToString(), isFetch: false));
|
||||
}
|
||||
}
|
||||
}
|
||||
StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadResource, delegate
|
||||
{
|
||||
StartCoroutine(loadSeriesImages(ResourcesManager.AssetLoadPathType.ShopBuildDeck, seriesIdList, seriesMasterDic, delegate
|
||||
{
|
||||
if (_drumrollSeriesImageList.Count <= 0)
|
||||
{
|
||||
UIManager.GetInstance().OnReadyViewScene(isFadein: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
int viewSeriesId = GetViewSeriesId();
|
||||
int seriesIndex = seriesList.FindIndex((BuildDeckSeriesPurchaseInfo data) => data._seriesId == viewSeriesId);
|
||||
if (seriesIndex < 0)
|
||||
{
|
||||
seriesIndex = 0;
|
||||
}
|
||||
List<ShopDrumrollScrollManager.DrumrollItem> itemList = _drumrollSeriesImageList.Select((Texture tex, int index) => new ShopDrumrollScrollManager.DrumrollItem(tex, seriesList[index]._isNew)).ToList();
|
||||
StartCoroutine(_drumrollManager.CreateDrumrollScroll_Coroutine(itemList, seriesIndex, onSelectSeries, delegate
|
||||
{
|
||||
onSelectSeries(seriesIndex, delegate
|
||||
{
|
||||
UIManager.GetInstance().OnReadyViewScene(isFadein: true);
|
||||
if (_autoShowBuildDeckEnable)
|
||||
{
|
||||
_autoShowBuildDeckEnable = false;
|
||||
BuildDeckProductInfo productInfo = Wizard.Data.BuildDeckPurchaseInfo.GetProductInfo(_autoShowBuildDeckProductId);
|
||||
if (productInfo != null)
|
||||
{
|
||||
createBuildDeckSelectBuyMeansDialog(productInfo);
|
||||
}
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
private List<int> GetSeriesIdList()
|
||||
{
|
||||
return Wizard.Data.BuildDeckPurchaseInfo.seriesList.ConvertAll((BuildDeckSeriesPurchaseInfo info) => info._seriesId);
|
||||
}
|
||||
|
||||
private Dictionary<int, BaseSeriesData> GetSeriesDataDictionary()
|
||||
{
|
||||
Dictionary<int, BaseSeriesData> dictionary = new Dictionary<int, BaseSeriesData>();
|
||||
foreach (KeyValuePair<int, BuildDeckSeries> item in Wizard.Data.Master.BuildDeckSeriesIdDic)
|
||||
{
|
||||
dictionary.Add(item.Key, item.Value);
|
||||
}
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
private void onSelectSeries(int seriesIndex)
|
||||
{
|
||||
onSelectSeries(seriesIndex, null);
|
||||
}
|
||||
|
||||
private void onSelectSeries(int seriesIndex, Action onFinish)
|
||||
{
|
||||
BuildDeckSeriesPurchaseInfo seriesInfo = Wizard.Data.BuildDeckPurchaseInfo.seriesList[seriesIndex];
|
||||
_selectSeriesInfo = seriesInfo;
|
||||
_titleLogoTexture.mainTexture = _seriesTitleImageList[seriesIndex];
|
||||
_labelSeriesDescription.text = seriesInfo._introduction;
|
||||
if (seriesInfo.SeriesRewardList.Count > 0)
|
||||
{
|
||||
_btnSeriesRewards.gameObject.SetActive(value: true);
|
||||
_btnSeriesRewards.onClick.Clear();
|
||||
_btnSeriesRewards.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickSeriesRewardButton(seriesIndex);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
_btnSeriesRewards.gameObject.SetActive(value: false);
|
||||
}
|
||||
int num = _cacheSeriesIdList.IndexOf(seriesInfo._seriesId);
|
||||
if (num != -1)
|
||||
{
|
||||
_cacheRefCountList[num]++;
|
||||
ResetProductListScroll(seriesInfo.productList.Count);
|
||||
onFinish.Call();
|
||||
return;
|
||||
}
|
||||
if (_cacheSeriesIdList.Count >= 4)
|
||||
{
|
||||
int num2 = _cacheRefCountList[0];
|
||||
int cacheIndex = 0;
|
||||
for (int num3 = 1; num3 < _cacheRefCountList.Count; num3++)
|
||||
{
|
||||
if (num2 > _cacheRefCountList[num3])
|
||||
{
|
||||
num2 = _cacheRefCountList[num3];
|
||||
cacheIndex = num3;
|
||||
}
|
||||
}
|
||||
DeleteCacheSeriesByCashIndex(cacheIndex);
|
||||
}
|
||||
UIManager.GetInstance().LoadingViewManager.CreateInSceneCenter();
|
||||
StartCoroutine(loadBuildDecks(delegate
|
||||
{
|
||||
UIManager.GetInstance().LoadingViewManager.CloseInSceneCenter();
|
||||
if (_selectSeriesInfo == seriesInfo)
|
||||
{
|
||||
ResetProductListScroll(seriesInfo.productList.Count);
|
||||
}
|
||||
_cacheSeriesIdList.Add(seriesInfo._seriesId);
|
||||
_cacheRefCountList.Add(1);
|
||||
onFinish.Call();
|
||||
}));
|
||||
}
|
||||
|
||||
private void DeleteCacheSeriesByCashIndex(int cacheIndex)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
BuildDeckSeriesPurchaseInfo buildDeckSeriesPurchaseInfo = Wizard.Data.BuildDeckPurchaseInfo.seriesList.Find((BuildDeckSeriesPurchaseInfo m) => m._seriesId == _cacheSeriesIdList[cacheIndex]);
|
||||
if (buildDeckSeriesPurchaseInfo != null)
|
||||
{
|
||||
for (int num = 0; num < buildDeckSeriesPurchaseInfo.productList.Count; num++)
|
||||
{
|
||||
list.Add(Toolbox.ResourcesManager.GetAssetTypePath(buildDeckSeriesPurchaseInfo.productList[num].saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail));
|
||||
}
|
||||
}
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(list);
|
||||
_cacheSeriesIdList.RemoveAt(cacheIndex);
|
||||
_cacheRefCountList.RemoveAt(cacheIndex);
|
||||
for (int num2 = 0; num2 < list.Count; num2++)
|
||||
{
|
||||
_cacheResourceList.Remove(list[num2]);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator loadBuildDecks(Action callBack = null)
|
||||
{
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
List<string> listResource = new List<string>();
|
||||
List<BuildDeckProductInfo> productList = _selectSeriesInfo.productList;
|
||||
for (int i = 0; i < productList.Count; i++)
|
||||
{
|
||||
listResource.Add(Toolbox.ResourcesManager.GetAssetTypePath(productList[i].saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail));
|
||||
}
|
||||
yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(listResource, null));
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
for (int j = 0; j < listResource.Count; j++)
|
||||
{
|
||||
_cacheResourceList.Add(listResource[j]);
|
||||
}
|
||||
callBack.Call();
|
||||
}
|
||||
|
||||
protected override void OnInitializeItem(GameObject go, int wrapIndex, int realIndex)
|
||||
{
|
||||
if (_selectSeriesInfo == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (realIndex >= _selectSeriesInfo.productList.Count || realIndex < 0)
|
||||
{
|
||||
go.SetActive(value: false);
|
||||
return;
|
||||
}
|
||||
go.SetActive(value: true);
|
||||
BuildDeckPlate plate = go.GetComponent<BuildDeckPlate>();
|
||||
EventDelegate eventDelegate = new EventDelegate(this, "onPushBuyButton");
|
||||
eventDelegate.parameters[0].value = plate;
|
||||
plate.SetData(_selectSeriesInfo.productList[realIndex], eventDelegate, delegate
|
||||
{
|
||||
_onTapBuildDeckImage(plate);
|
||||
});
|
||||
}
|
||||
|
||||
private void _onTapBuildDeckImage(BuildDeckPlate plate)
|
||||
{
|
||||
if (!(_dialogProductDetail != null))
|
||||
{
|
||||
_dialogProductDetail = UIManager.GetInstance().CreateDialogClose();
|
||||
_dialogProductDetail.SetSize(DialogBase.Size.M);
|
||||
_dialogProductDetail.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_003_Title"));
|
||||
_dialogProductDetail.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
_dialogProductDetail.gameObject.layer = LayerMask.NameToLayer("MyPage");
|
||||
_dialogProductDetail.SetBackViewLayer(LayerMask.NameToLayer("MyPage"));
|
||||
_dialogProductDetail.SetDepthAndSortingOrder(140, 2);
|
||||
BuildDeckDetailWindow component = UnityEngine.Object.Instantiate(_prefabDialogBuildDeckDetail).GetComponent<BuildDeckDetailWindow>();
|
||||
_dialogProductDetail.SetObj(component.gameObject);
|
||||
component.SetSingleData(_uiCardListClass, plate.ProductInfo);
|
||||
_dialogProductDetail.OnClose = component.OnCloseWindow;
|
||||
}
|
||||
}
|
||||
|
||||
private void onPushBuyButton(BuildDeckPlate plate)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
_selectPlate = plate;
|
||||
createBuildDeckSelectBuyMeansDialog(plate.ProductInfo);
|
||||
}
|
||||
|
||||
private void OnClickSeriesRewardButton(int seriesIndex)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
DialogBase dialogBase = PurchaseRewardDialog.Create(Wizard.Data.BuildDeckPurchaseInfo.seriesList[seriesIndex].SeriesRewardList, _cardDetail, useLargeDetailDialog: false, PurchaseRewardDialog.Layout.NORMAL);
|
||||
dialogBase.SetLayer("MyPage");
|
||||
dialogBase.SetDepthAndSortingOrder(140, 2);
|
||||
}
|
||||
|
||||
private void createBuildDeckSelectBuyMeansDialog(BuildDeckProductInfo pInfo)
|
||||
{
|
||||
if (_dialogSelectBuyMeans != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_ = pInfo.is_purchased;
|
||||
_dialogSelectBuyMeans = _createBaseDialogForSelectBuyMeans(pInfo.saleInfo);
|
||||
BuildDeckSelectBuyMeansDialog component = UnityEngine.Object.Instantiate(_prefabDialogSelectBuyMeans).GetComponent<BuildDeckSelectBuyMeansDialog>();
|
||||
_dialogSelectBuyMeans.SetObj(component.gameObject);
|
||||
Action onPushBuyCrystalBtnCallBack = null;
|
||||
Action onPushBuyRupyBtnCallBack = null;
|
||||
Action onPushBuyTicketBtnCallBack = null;
|
||||
if (pInfo.saleInfo.isFree)
|
||||
{
|
||||
_dialogSelectBuyMeans.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
_dialogSelectBuyMeans.SetButtonText(Wizard.Data.SystemText.Get("Shop_0082"));
|
||||
_dialogSelectBuyMeans.onPushButton1 = delegate
|
||||
{
|
||||
_purchaseProductInfo = pInfo;
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
StartBuyBuildDeck(ShopCommonUtility.SalesType.free, pInfo.product_id);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_dialogSelectBuyMeans.SetButtonLayout(DialogBase.ButtonLayout.NONE);
|
||||
onPushBuyCrystalBtnCallBack = delegate
|
||||
{
|
||||
_purchaseProductInfo = pInfo;
|
||||
_createPurchaseConfirmDialog(pInfo.saleInfo, ShopCommonUtility.SalesType.crystal, delegate
|
||||
{
|
||||
StartBuyBuildDeck(ShopCommonUtility.SalesType.crystal, pInfo.product_id);
|
||||
});
|
||||
};
|
||||
onPushBuyRupyBtnCallBack = delegate
|
||||
{
|
||||
_purchaseProductInfo = pInfo;
|
||||
_createPurchaseConfirmDialog(pInfo.saleInfo, ShopCommonUtility.SalesType.rupy, delegate
|
||||
{
|
||||
StartBuyBuildDeck(ShopCommonUtility.SalesType.rupy, pInfo.product_id);
|
||||
});
|
||||
};
|
||||
onPushBuyTicketBtnCallBack = delegate
|
||||
{
|
||||
_purchaseProductInfo = pInfo;
|
||||
_createPurchaseConfirmDialog(pInfo.saleInfo, ShopCommonUtility.SalesType.ticket, delegate
|
||||
{
|
||||
StartBuyBuildDeck(ShopCommonUtility.SalesType.ticket, pInfo.product_id);
|
||||
});
|
||||
};
|
||||
}
|
||||
component.Init(pInfo, _dialogSelectBuyMeans, onPushBuyCrystalBtnCallBack, onPushBuyRupyBtnCallBack, onPushBuyTicketBtnCallBack);
|
||||
}
|
||||
|
||||
private DialogBase _createBaseDialogForSelectBuyMeans(ShopCommonSaleInfo info)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_001_Title"));
|
||||
dialogBase.SetReturnMsg(null, "");
|
||||
return dialogBase;
|
||||
}
|
||||
|
||||
private void _createPurchaseConfirmDialog(ShopCommonSaleInfo info, ShopCommonUtility.SalesType costType, Action buyApiFunc)
|
||||
{
|
||||
if (!(_dialogPurchaseConfirm != null) && ShopCommonUtility.IsHaveEnoughCost(info, costType, delegate
|
||||
{
|
||||
if (_dialogCrystalShortage == null)
|
||||
{
|
||||
_dialogCrystalShortage = ShopCommonUtility.CreateCrystalShortagePopup();
|
||||
}
|
||||
}))
|
||||
{
|
||||
string warningTextId = (_purchaseProductInfo.ContainsOnlyRotationCards() ? null : "Shop_0139");
|
||||
_dialogPurchaseConfirm = ShopCommonUtility.CreatePurchaseConfirmPopup(info, costType, _prefabDialogPurchaseConfirm, buyApiFunc, warningTextId);
|
||||
_dialogPurchaseConfirm.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_002_Title"));
|
||||
}
|
||||
}
|
||||
|
||||
private void _OnFailurePurchase(NetworkTask.ResultCode code)
|
||||
{
|
||||
_isBuyConnect = false;
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}
|
||||
|
||||
private void _OnResultCodeError(int code)
|
||||
{
|
||||
if (code != 110)
|
||||
{
|
||||
_isBuyConnect = false;
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
_ReloadBuildDeckInfo();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowRewardDialog(Action onFinish)
|
||||
{
|
||||
if (_buyTask.LotteryRewardList.Count == 0)
|
||||
{
|
||||
onFinish.Call();
|
||||
return;
|
||||
}
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Story_0029"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
RewardBase component = NGUITools.AddChild(dialogBase.gameObject, UIManager.GetInstance().GetRewardDialogPrefab().gameObject).GetComponent<RewardBase>();
|
||||
foreach (ReceivedReward lotteryReward in _buyTask.LotteryRewardList)
|
||||
{
|
||||
component.AddReward(lotteryReward);
|
||||
if (!string.IsNullOrEmpty(lotteryReward.reward_message))
|
||||
{
|
||||
dialogBase.SetTitleLabel(lotteryReward.reward_message);
|
||||
}
|
||||
}
|
||||
component.EndCreate();
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
onFinish.Call();
|
||||
};
|
||||
}
|
||||
|
||||
private void ShowLotteryApplyDialog(Action onFinish)
|
||||
{
|
||||
UIManager.GetInstance().LoadingViewManager.CreateInSceneCenter();
|
||||
string lotteryTexturePath = LotteryApplyDialog.GetLotteryTexturePath(_buyTask.LotteryData, isFetch: false);
|
||||
_loadResource.Add(lotteryTexturePath);
|
||||
StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(lotteryTexturePath, delegate
|
||||
{
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
LotteryApplyDialog.Create(_buyTask.LotteryData, autoClose: false).OnClose = delegate
|
||||
{
|
||||
ShowRewardDialog(delegate
|
||||
{
|
||||
onFinish.Call();
|
||||
});
|
||||
};
|
||||
}));
|
||||
}
|
||||
|
||||
private void onSuccessPurchase(NetworkTask.ResultCode error, ShopCommonUtility.SalesType salesType)
|
||||
{
|
||||
_isBuyConnect = false;
|
||||
BuildDeckProductInfo savePurchaseProductInfo = _purchaseProductInfo;
|
||||
if (_purchaseProductInfo != null)
|
||||
{
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.LAST_PURCHASE_DECK_SERIES_ID, _selectSeriesInfo._seriesId);
|
||||
if (salesType == ShopCommonUtility.SalesType.ticket)
|
||||
{
|
||||
_addShowSeriesId = _selectSeriesInfo._seriesId;
|
||||
}
|
||||
if (!_buyTask.LotteryData.IsEnable && _buyTask.MissionRewardList.Count == 0)
|
||||
{
|
||||
ShowCreateDeckDialog(savePurchaseProductInfo);
|
||||
}
|
||||
else if (_buyTask.LotteryData.IsEnable)
|
||||
{
|
||||
ShowLotteryApplyDialog(delegate
|
||||
{
|
||||
ShowCreateDeckDialog(savePurchaseProductInfo);
|
||||
});
|
||||
}
|
||||
else if (_buyTask.MissionRewardList.Count > 0)
|
||||
{
|
||||
ShowMissionRewardDialog(delegate
|
||||
{
|
||||
ShowCreateDeckDialog(savePurchaseProductInfo);
|
||||
});
|
||||
}
|
||||
}
|
||||
_ReloadBuildDeckInfo();
|
||||
}
|
||||
|
||||
private void ShowCreateDeckDialog(BuildDeckProductInfo savePurchaseProductInfo)
|
||||
{
|
||||
DialogBase diaChange = UIManager.GetInstance().CreateDialogClose();
|
||||
bool hasResurgentCard = savePurchaseProductInfo.HasResurgentCard;
|
||||
string empty = string.Empty;
|
||||
empty = ((_buyTask._seriesRewardList.Count > 0) ? Wizard.Data.SystemText.Get("Shop_0144", savePurchaseProductInfo.saleInfo.name.Replace("\n", "")) : ((!hasResurgentCard) ? Wizard.Data.SystemText.Get("Shop_0124", savePurchaseProductInfo.saleInfo.name.Replace("\n", "")) : Wizard.Data.SystemText.Get("Shop_0256", savePurchaseProductInfo.saleInfo.name.Replace("\n", ""))));
|
||||
diaChange.SetText(empty);
|
||||
diaChange.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_004_Title"));
|
||||
diaChange.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
diaChange.SetButtonText(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_001_Button"));
|
||||
_purchaseDeckName = savePurchaseProductInfo.saleInfo.name;
|
||||
_purchaseDeckClassId = savePurchaseProductInfo.leader_id;
|
||||
_purchaseDeckCardIds = savePurchaseProductInfo.CardIdList;
|
||||
if (hasResurgentCard)
|
||||
{
|
||||
diaChange.onPushButton1 = delegate
|
||||
{
|
||||
CheckEmptyDeck(Format.Rotation);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
diaChange.onPushButton1 = OpenSelectFormatDialog;
|
||||
}
|
||||
diaChange.onPushButton2 = delegate
|
||||
{
|
||||
diaChange.CloseWithoutSelect();
|
||||
};
|
||||
diaChange.onCloseWithoutSelect = delegate
|
||||
{
|
||||
UIManager.GetInstance().StartCoroutine(ShowAchieveLog(_buyTask.NotificatonAnimationParams));
|
||||
_buyTask.NotificatonAnimationParams = null;
|
||||
};
|
||||
}
|
||||
|
||||
private void ShowMissionRewardDialog(Action onFinish)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Story_0029"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
onFinish.Call();
|
||||
};
|
||||
RewardBase component = NGUITools.AddChild(dialogBase.gameObject, UIManager.GetInstance().GetRewardDialogPrefab().gameObject).GetComponent<RewardBase>();
|
||||
for (int num = 0; num < _buyTask.MissionRewardList.Count; num++)
|
||||
{
|
||||
component.AddReward(_buyTask.MissionRewardList[num]);
|
||||
}
|
||||
component.EndCreate();
|
||||
}
|
||||
|
||||
private IEnumerator ShowAchieveLog(List<NotificatonAnimation.Param> paramList)
|
||||
{
|
||||
if (paramList != null)
|
||||
{
|
||||
if (_notificationAnimation != null)
|
||||
{
|
||||
UnityEngine.Object.Destroy(_notificationAnimation.gameObject);
|
||||
_notificationAnimation = null;
|
||||
}
|
||||
_notificationAnimation = NGUITools.AddChild(_achieveLog, _notificationAnimationPrefab.gameObject).GetComponent<NotificatonAnimation>();
|
||||
yield return StartCoroutine(_notificationAnimation.Exec(paramList));
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckEmptyDeck(Format format)
|
||||
{
|
||||
_deckCreateFormat = format;
|
||||
EmptyDeckInfoTask emptyDeckInfoTask = new EmptyDeckInfoTask();
|
||||
emptyDeckInfoTask.SetParameter(_deckCreateFormat);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(emptyDeckInfoTask, OnSuccessDeckListCheck));
|
||||
}
|
||||
|
||||
private void OpenSelectFormatDialog()
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
SystemText systemText = Wizard.Data.SystemText;
|
||||
dialogBase.SetText(systemText.Get("Shop_0138"));
|
||||
dialogBase.SetTitleLabel(systemText.Get("Dia_BuyBuildDeck_004_Title"));
|
||||
dialogBase.AddButton(DialogBase.ButtonType.Blue, isReflect: true, systemText.Get("Common_0155"));
|
||||
dialogBase.AddButton(DialogBase.ButtonType.Blue, isReflect: true, systemText.Get("Common_0154"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
CheckEmptyDeck(Format.Unlimited);
|
||||
};
|
||||
dialogBase.onPushButton2 = delegate
|
||||
{
|
||||
CheckEmptyDeck(Format.Rotation);
|
||||
};
|
||||
dialogBase.onCloseWithoutSelect = delegate
|
||||
{
|
||||
UIManager.GetInstance().StartCoroutine(ShowAchieveLog(_buyTask.NotificatonAnimationParams));
|
||||
_buyTask.NotificatonAnimationParams = null;
|
||||
};
|
||||
}
|
||||
|
||||
private void OnSuccessDeckListCheck(NetworkTask.ResultCode errorcode)
|
||||
{
|
||||
if (Wizard.Data.EmptyDeckInfo.CanDeckCreate)
|
||||
{
|
||||
SetUpDeckDataAndChangeViewDeckEdit();
|
||||
return;
|
||||
}
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetText(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_005_Body"));
|
||||
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_005_Title"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.SetButtonText(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_005_Button"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam
|
||||
{
|
||||
IsUpdateFooterMenuTexture = true
|
||||
};
|
||||
DeckListUI.ChangeSceneToDeckList(_deckCreateFormat, param);
|
||||
};
|
||||
}
|
||||
|
||||
private void SetUpDeckDataAndChangeViewDeckEdit()
|
||||
{
|
||||
DeckData deckData = new DeckData();
|
||||
deckData.SetDeckClassID(_purchaseDeckClassId);
|
||||
deckData.SetDeckSleeveID(3000011L);
|
||||
deckData.SetDeckIsComplete(isComplete: true);
|
||||
deckData.SetCardIdList(_purchaseDeckCardIds);
|
||||
DeckData deckData2 = new DeckData(_deckCreateFormat, DeckAttributeType.CustomDeck);
|
||||
deckData2.SetDeckID(Wizard.Data.EmptyDeckInfo.EmptyDeckID);
|
||||
DeckCardEditUI.SetBuildDeckEditParameter(deckData, _purchaseDeckName, deckData2);
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.DeckCardEdit);
|
||||
}
|
||||
|
||||
private void _ReloadBuildDeckInfo()
|
||||
{
|
||||
if (MyPageMenu.Instance != null)
|
||||
{
|
||||
MyPageMenu.Instance.UpdateCrystalCount();
|
||||
MyPageMenu.Instance.UpdateRupyCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.GetInstance().UpDateCrystalNum();
|
||||
}
|
||||
List<BuildDeckSeriesPurchaseInfo> oldSeriesList = new List<BuildDeckSeriesPurchaseInfo>(Wizard.Data.BuildDeckPurchaseInfo.seriesList);
|
||||
StartGetBuildDeckInfo(delegate
|
||||
{
|
||||
bool flag = false;
|
||||
List<BuildDeckSeriesPurchaseInfo> seriesList = Wizard.Data.BuildDeckPurchaseInfo.seriesList;
|
||||
for (int i = 0; i < seriesList.Count; i++)
|
||||
{
|
||||
if (oldSeriesList[i]._seriesId != seriesList[i]._seriesId)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
if (seriesList[i]._seriesId == _selectSeriesInfo._seriesId)
|
||||
{
|
||||
if (_selectPlate != null)
|
||||
{
|
||||
if (_selectPlate.ProductInfo.product_id == _purchaseProductInfo.product_id)
|
||||
{
|
||||
_selectSeriesInfo = seriesList[i];
|
||||
BuildDeckPlate[] componentsInChildren = _wrapContent.gameObject.GetComponentsInChildren<BuildDeckPlate>();
|
||||
foreach (BuildDeckPlate plate in componentsInChildren)
|
||||
{
|
||||
int realIndex = _selectSeriesInfo.productList.FindIndex((BuildDeckProductInfo p) => p.product_id == plate.ProductInfo.product_id);
|
||||
OnInitializeItem(plate.gameObject, 0, realIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
onSelectSeries(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
onSelectSeries(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oldSeriesList.Count != seriesList.Count)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
_purchaseProductInfo = null;
|
||||
_selectPlate = null;
|
||||
if (flag)
|
||||
{
|
||||
List<int> seriesIdList = GetSeriesIdList();
|
||||
Dictionary<int, BaseSeriesData> seriesDataDictionary = GetSeriesDataDictionary();
|
||||
StartCoroutine(loadSeriesImages(ResourcesManager.AssetLoadPathType.ShopBuildDeck, seriesIdList, seriesDataDictionary, delegate
|
||||
{
|
||||
List<ShopDrumrollScrollManager.DrumrollItem> itemList = _drumrollSeriesImageList.ConvertAll((Texture tex) => new ShopDrumrollScrollManager.DrumrollItem(tex));
|
||||
StartCoroutine(_drumrollManager.CreateDrumrollScroll_Coroutine(itemList, 0, onSelectSeries, delegate
|
||||
{
|
||||
onSelectSeries(0);
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}));
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using LitJson;
|
||||
using Wizard.Scripts.Network.Data.TaskData.Arena;
|
||||
using Wizard.Scripts.Network.Data.TaskData.Arena.TwoPick;
|
||||
|
||||
namespace Wizard.Scripts.Network.Task.Arena.TwoPick;
|
||||
|
||||
public class EntryTask : ArenaEntryTaskBase
|
||||
{
|
||||
public class ArenaTwoPickPrepareTaskParam : BaseParam
|
||||
{
|
||||
public int consume_item_type;
|
||||
}
|
||||
|
||||
public EntryTask()
|
||||
{
|
||||
base.type = ApiType.Type.ArenaTwoPickEntry;
|
||||
}
|
||||
|
||||
public override void SetParameter(int consumeItemType)
|
||||
{
|
||||
ArenaTwoPickPrepareTaskParam arenaTwoPickPrepareTaskParam = new ArenaTwoPickPrepareTaskParam();
|
||||
arenaTwoPickPrepareTaskParam.consume_item_type = consumeItemType;
|
||||
base.Params = arenaTwoPickPrepareTaskParam;
|
||||
}
|
||||
|
||||
protected override void SetResponseParams(JsonData data, JsonData headerData)
|
||||
{
|
||||
Wizard.Data.TwoPickEntry = new Entry(data);
|
||||
Wizard.Data.TwoPickInfo = new TwoPickInfo(data, headerData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard.Scripts.Network.Task.Arena.TwoPick;
|
||||
|
||||
public class RetireTask : ArenaRetireTaskBase
|
||||
{
|
||||
public class RetireTaskParam : BaseParam
|
||||
{
|
||||
}
|
||||
|
||||
public RetireTask()
|
||||
{
|
||||
base.type = ApiType.Type.ArenaTwoPickRetire;
|
||||
}
|
||||
|
||||
public override void SetParameter()
|
||||
{
|
||||
RetireTaskParam retireTaskParam = new RetireTaskParam();
|
||||
base.Params = retireTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
Wizard.Data.TwoPickInfo.SetEntryRewardList(jsonData["rewards"]);
|
||||
PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Wizard.Scripts.Network.Data.TaskData.Arena;
|
||||
|
||||
namespace Wizard.Scripts.Network.Task.Arena.TwoPick;
|
||||
|
||||
public class TopTask : ArenaTopTaskBase
|
||||
{
|
||||
public class ArenaTwoPickTopTaskParam : BaseParam
|
||||
{
|
||||
public int mode;
|
||||
}
|
||||
|
||||
public TopTask()
|
||||
{
|
||||
base.type = ApiType.Type.ArenaTwoPickTop;
|
||||
}
|
||||
|
||||
public override void SetParameter()
|
||||
{
|
||||
ArenaTwoPickTopTaskParam arenaTwoPickTopTaskParam = new ArenaTwoPickTopTaskParam();
|
||||
base.Params = arenaTwoPickTopTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Wizard.Data.TwoPickInfo = new TwoPickInfo(base.ResponseData["data"], base.ResponseData["data_headers"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using Wizard.Scripts.Network.Data.TaskData;
|
||||
|
||||
namespace Wizard.Scripts.Network.Task.ItemAcquireHistory;
|
||||
|
||||
public class ItemAcquireHistoryInfoTask : BaseTask
|
||||
{
|
||||
public class ItemAcquireHistoryInfoTaskParam : BaseParam
|
||||
{
|
||||
}
|
||||
|
||||
public ItemAcquireHistoryInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.ItemAcquireHistoryInfo;
|
||||
}
|
||||
|
||||
public void SetParameter()
|
||||
{
|
||||
ItemAcquireHistoryInfoTaskParam itemAcquireHistoryInfoTaskParam = new ItemAcquireHistoryInfoTaskParam();
|
||||
base.Params = itemAcquireHistoryInfoTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Wizard.Data.ItemAcquireHistoryInfo = new ItemAcquireHistoryInfo(base.ResponseData["data"]["histories"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
445
SVSim.BattleEngine/Engine/Wizard/AccountBase.cs
Normal file
445
SVSim.BattleEngine/Engine/Wizard/AccountBase.cs
Normal file
@@ -0,0 +1,445 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.Dialog.DataLink;
|
||||
using Wizard.Dialog.Setting;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class AccountBase : MonoBehaviour
|
||||
{
|
||||
public enum DisplayType
|
||||
{
|
||||
NONE,
|
||||
TITLE,
|
||||
OTHER,
|
||||
ACCOUNT_LINK,
|
||||
ID_PASSWORD_INPUT,
|
||||
PASSWORD_SETTING
|
||||
}
|
||||
|
||||
public enum TransitionOriginalScreen
|
||||
{
|
||||
TITLE,
|
||||
OTHER
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private GameObject TransferContainer;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject InputContainer;
|
||||
|
||||
[SerializeField]
|
||||
public IdPasswordInput _idPasswordInput;
|
||||
|
||||
[SerializeField]
|
||||
public PasswordSetting _passwordSetting;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject TopContainer;
|
||||
|
||||
[SerializeField]
|
||||
private Transform _topContainerLine;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject TitleContainer;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject OtherContainer;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _appleButton;
|
||||
|
||||
private const int INDEX_TOP_LABEL = 0;
|
||||
|
||||
private const int INDEX_MID_LABEL = 1;
|
||||
|
||||
private const int INDEX_INPUT_LABEL = 2;
|
||||
|
||||
private const int INDEX_BOTTOM_LABEL = 3;
|
||||
|
||||
private const int INDEX_BUTTON_LABEL = 4;
|
||||
|
||||
private Vector3 AccountPos = new Vector3(0f, 70f, 0f);
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid ButtonGrid;
|
||||
|
||||
[SerializeField]
|
||||
public NguiObjs BtnTransferCode;
|
||||
|
||||
[SerializeField]
|
||||
public NguiObjs BtnGoogle;
|
||||
|
||||
[SerializeField]
|
||||
public NguiObjs BtnFaceBook;
|
||||
|
||||
[SerializeField]
|
||||
public NguiObjs ButtonGetCode;
|
||||
|
||||
[SerializeField]
|
||||
public UILabel CommonLabelTop;
|
||||
|
||||
[SerializeField]
|
||||
public UILabel CommonLabelBtm;
|
||||
|
||||
private readonly Vector3 TopContainerPosition = new Vector3(0f, -90f, 0f);
|
||||
|
||||
private const int MIN_PASSWORD_LENGTH = 8;
|
||||
|
||||
private const int MAX_PASSWORD_LENGTH = 16;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
SetLabels();
|
||||
BtnGoogle.gameObject.SetActive(value: false);
|
||||
_appleButton.gameObject.SetActive(value: false);
|
||||
ButtonGrid.repositionNow = true;
|
||||
}
|
||||
|
||||
private void SetLabels()
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
BtnTransferCode.labels[0].text = systemText.Get("Account_0094");
|
||||
ButtonGetCode.labels[0].text = (GameStartCheckTask.IsSetTransitionPassword ? systemText.Get("Account_0100") : systemText.Get("Account_0099"));
|
||||
CommonLabelTop.text = systemText.Get("Account_0095");
|
||||
CommonLabelBtm.text = systemText.Get("Account_0073");
|
||||
}
|
||||
|
||||
public void SetDisplayType(DisplayType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DisplayType.TITLE:
|
||||
TransferContainer.SetActive(value: true);
|
||||
InputContainer.SetActive(value: false);
|
||||
_idPasswordInput.gameObject.SetActive(value: false);
|
||||
_passwordSetting.gameObject.SetActive(value: false);
|
||||
OtherContainer.SetActive(value: false);
|
||||
TitleContainer.SetActive(value: false);
|
||||
UIUtil.SetPositionY(TopContainer.transform, -90f);
|
||||
_topContainerLine.gameObject.SetActive(value: false);
|
||||
break;
|
||||
case DisplayType.OTHER:
|
||||
TransferContainer.SetActive(value: true);
|
||||
InputContainer.SetActive(value: false);
|
||||
_idPasswordInput.gameObject.SetActive(value: false);
|
||||
_passwordSetting.gameObject.SetActive(value: false);
|
||||
TitleContainer.SetActive(value: false);
|
||||
break;
|
||||
case DisplayType.ACCOUNT_LINK:
|
||||
TransferContainer.SetActive(value: true);
|
||||
TransferContainer.transform.localPosition = AccountPos;
|
||||
InputContainer.SetActive(value: false);
|
||||
_idPasswordInput.gameObject.SetActive(value: false);
|
||||
_passwordSetting.gameObject.SetActive(value: false);
|
||||
TopContainer.SetActive(value: false);
|
||||
OtherContainer.SetActive(value: false);
|
||||
if (GetActiveChildCount(ButtonGrid.transform) <= 2)
|
||||
{
|
||||
UIUtil.SetPositionY(TitleContainer.transform, 50f);
|
||||
UIUtil.SetPositionY(ButtonGrid.transform, -96f);
|
||||
}
|
||||
else
|
||||
{
|
||||
UIUtil.SetPositionY(TitleContainer.transform, 0f);
|
||||
UIUtil.SetPositionY(ButtonGrid.transform, -60f);
|
||||
}
|
||||
break;
|
||||
case DisplayType.ID_PASSWORD_INPUT:
|
||||
TransferContainer.SetActive(value: false);
|
||||
InputContainer.SetActive(value: false);
|
||||
_idPasswordInput.gameObject.SetActive(value: true);
|
||||
_passwordSetting.gameObject.SetActive(value: false);
|
||||
break;
|
||||
case DisplayType.PASSWORD_SETTING:
|
||||
TransferContainer.SetActive(value: false);
|
||||
InputContainer.SetActive(value: false);
|
||||
_idPasswordInput.gameObject.SetActive(value: false);
|
||||
_passwordSetting.gameObject.SetActive(value: true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public DialogBase Init(DisplayType type, TransitionOriginalScreen from, Action close_callback = null)
|
||||
{
|
||||
SystemText text = Data.SystemText;
|
||||
SetDisplayType(type);
|
||||
DialogBase dialog = UIManager.GetInstance().CreateDialogClose();
|
||||
dialog.SetSize(DialogBase.Size.M);
|
||||
dialog.SetObj(base.gameObject);
|
||||
if (type != DisplayType.PASSWORD_SETTING)
|
||||
{
|
||||
if (type == DisplayType.OTHER)
|
||||
{
|
||||
dialog.SetTitleLabel(text.Get("Account_0001"));
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog.SetTitleLabel(text.Get("Account_0004"));
|
||||
}
|
||||
dialog.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
}
|
||||
BtnTransferCode.buttons[0].onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickIdPasswordInputButton(dialog, from);
|
||||
}));
|
||||
BtnGoogle.buttons[0].onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
dialog.CloseWithoutSelect();
|
||||
UIManager.GetInstance().AccountTransferHelper.PressedTransitongButton = CuteNetworkDefine.ACCOUNT_TYPE.GOOGLE_PLAY;
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(text.Get("Account_0015"));
|
||||
dialogBase.SetText(text.Get("Account_0077"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn);
|
||||
dialogBase.SetButtonText(text.Get("Account_0084"), text.Get("Account_0080"));
|
||||
EventDelegate method_btn = new EventDelegate(delegate
|
||||
{
|
||||
UIManager.GetInstance().AccountTransferHelper.DataTransfer(close_callback);
|
||||
});
|
||||
dialogBase.SetButtonDelegate(method_btn);
|
||||
}));
|
||||
BtnFaceBook.buttons[0].onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
dialog.CloseWithoutSelect();
|
||||
UIManager.GetInstance().AccountTransferHelper.PressedTransitongButton = CuteNetworkDefine.ACCOUNT_TYPE.FACEBOOK;
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(text.Get("Account_0058"));
|
||||
dialogBase.SetText(text.Get("Account_0079"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn);
|
||||
dialogBase.SetButtonText(text.Get("Account_0084"), text.Get("Account_0080"));
|
||||
EventDelegate method_btn = new EventDelegate(delegate
|
||||
{
|
||||
UIManager.GetInstance().WebViewHelper.CreateOpenURLWindow(WebViewHelper.UrlType.FACEBOOK);
|
||||
});
|
||||
dialogBase.SetButtonDelegate(method_btn);
|
||||
}));
|
||||
ButtonGetCode.buttons[0].onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickPasswordSettingButton(dialog, from);
|
||||
}));
|
||||
return dialog;
|
||||
}
|
||||
|
||||
private void OnClickIdPasswordInputButton(DialogBase previousDialog, TransitionOriginalScreen from)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
previousDialog.CloseWithoutSelect();
|
||||
DialogBase idPasswordInputDialog = UIManager.GetInstance().AccountTransferHelper.CreateAccountTransferDialog(DisplayType.ID_PASSWORD_INPUT, from);
|
||||
IdPasswordInput idPasswordInputObject = idPasswordInputDialog.InsideObject.GetComponent<AccountBase>()._idPasswordInput;
|
||||
UIInputWizard idInput = idPasswordInputObject._idInput;
|
||||
UIInputWizard passwordInput = idPasswordInputObject._passwordInput;
|
||||
EventDelegate item = new EventDelegate(delegate
|
||||
{
|
||||
idPasswordInputDialog.SetButtonDisable(string.IsNullOrEmpty(idInput.value) || string.IsNullOrEmpty(passwordInput.value));
|
||||
});
|
||||
UIInputWizard[] array = new UIInputWizard[2] { idInput, passwordInput };
|
||||
foreach (UIInputWizard input in array)
|
||||
{
|
||||
EventDelegate item2 = new EventDelegate(delegate
|
||||
{
|
||||
InputDialog.TextInputLimitCheck(input.characterLimit);
|
||||
});
|
||||
input.onChange.Add(item);
|
||||
input.onSubmit.Add(item2);
|
||||
input.onDeselect.Add(item2);
|
||||
}
|
||||
SystemText systemText = Data.SystemText;
|
||||
idPasswordInputDialog.SetSize(DialogBase.Size.S);
|
||||
idPasswordInputDialog.SetTitleLabel(systemText.Get("Account_0001"));
|
||||
idPasswordInputDialog.SetButtonLayout(DialogBase.ButtonLayout.DecisionBtn);
|
||||
idPasswordInputDialog.SetButtonDisable(isEnableOK: true);
|
||||
idPasswordInputDialog.isNotCloseWindowButton1 = true;
|
||||
idPasswordInputDialog.onPushButton1 = delegate
|
||||
{
|
||||
string userId = idInput.value;
|
||||
string passwordHash = Cryptographer.MakeMd5(passwordInput.value);
|
||||
CheckTimeSlipRotationPeriod(delegate
|
||||
{
|
||||
GetGameDataByTransitionCode getGameDataByTransitionCode = new GetGameDataByTransitionCode();
|
||||
getGameDataByTransitionCode.SetParameter(userId, passwordHash);
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(getGameDataByTransitionCode, delegate(NetworkTask.ResultCode code)
|
||||
{
|
||||
idPasswordInputDialog.Close();
|
||||
UIManager.GetInstance().AccountTransferHelper.ShowAccountMagritionConfirmByTransferCode(code);
|
||||
}, null, delegate
|
||||
{
|
||||
idPasswordInputObject.ResetInputValue();
|
||||
}));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
private static void CheckTimeSlipRotationPeriod(Action onFinish)
|
||||
{
|
||||
if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Title)
|
||||
{
|
||||
onFinish.Call();
|
||||
return;
|
||||
}
|
||||
CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask();
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
onFinish.Call();
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnClickPasswordSettingButton(DialogBase previousDialog, TransitionOriginalScreen from)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
previousDialog.CloseWithoutSelect();
|
||||
SystemText text = Data.SystemText;
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(text.Get("Account_0101"));
|
||||
dialogBase.SetText(text.Get("Account_0102"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(text.Get("Account_0103"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
DialogBase passwordSettingDialog = UIManager.GetInstance().AccountTransferHelper.CreateAccountTransferDialog(DisplayType.PASSWORD_SETTING, from);
|
||||
AccountBase passwordSettingAccountBase = passwordSettingDialog.InsideObject.GetComponent<AccountBase>();
|
||||
PasswordSetting passwordSettingObject = passwordSettingAccountBase._passwordSetting;
|
||||
UIInputWizard firstInput = passwordSettingObject._firstInput;
|
||||
UIInputWizard secondInput = passwordSettingObject._secondInput;
|
||||
EventDelegate eventDelegate = new EventDelegate(delegate
|
||||
{
|
||||
passwordSettingDialog.SetButtonDisable(string.IsNullOrEmpty(firstInput.value) || string.IsNullOrEmpty(secondInput.value) || !passwordSettingObject._acceptToggle.GetValue());
|
||||
});
|
||||
UIInputWizard[] array = new UIInputWizard[2] { firstInput, secondInput };
|
||||
foreach (UIInputWizard input in array)
|
||||
{
|
||||
EventDelegate item = new EventDelegate(delegate
|
||||
{
|
||||
InputDialog.TextInputLimitCheck(input.characterLimit);
|
||||
});
|
||||
input.onChange.Add(eventDelegate);
|
||||
input.onSubmit.Add(item);
|
||||
input.onDeselect.Add(item);
|
||||
}
|
||||
passwordSettingObject._privacyPolicyButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.PRIVACY_POLICY);
|
||||
}));
|
||||
ItemToggle acceptToggle = passwordSettingObject._acceptToggle;
|
||||
acceptToggle.SetValue(value: false);
|
||||
acceptToggle.AddChangeCallback(eventDelegate);
|
||||
passwordSettingDialog.SetSize(DialogBase.Size.M);
|
||||
passwordSettingDialog.SetTitleLabel(text.Get("Account_0101"));
|
||||
passwordSettingDialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
passwordSettingDialog.SetButtonText(text.Get("Account_0103"));
|
||||
passwordSettingDialog.SetButtonDisable(isEnableOK: true);
|
||||
passwordSettingDialog.isNotCloseWindowButton1 = true;
|
||||
passwordSettingDialog.onPushButton1 = delegate
|
||||
{
|
||||
if (!CheckDataLinkPassword(firstInput.value, secondInput.value))
|
||||
{
|
||||
passwordSettingObject.ResetInputValue();
|
||||
DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase2.SetPanelDepth(passwordSettingAccountBase.GetComponent<UIPanel>().depth + 5);
|
||||
dialogBase2.SetTitleLabel(text.Get("Account_0101"));
|
||||
dialogBase2.SetText(text.Get("Account_0107"));
|
||||
dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
}
|
||||
else
|
||||
{
|
||||
passwordSettingDialog.Close();
|
||||
UpdatePassword(firstInput.value);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
private static void UpdatePassword(string password)
|
||||
{
|
||||
SystemText text = Data.SystemText;
|
||||
CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask();
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
string parameter = Cryptographer.MakeMd5(password);
|
||||
PublistTransitionCode publistTransitionCode = new PublistTransitionCode();
|
||||
publistTransitionCode.SetParameter(parameter);
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(publistTransitionCode, delegate
|
||||
{
|
||||
GameStartCheckTask.IsSetTransitionPassword = true;
|
||||
GameMgr.GetIns().GetPrefabMgr().Load("UI/layoutParts/Dialog/PasswordConfirm");
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
NguiObjs component = NGUITools.AddChild(dialogBase.gameObject, GameMgr.GetIns().GetPrefabMgr().Get("UI/layoutParts/Dialog/PasswordConfirm")).GetComponent<NguiObjs>();
|
||||
component.labels[0].text = text.Get("Account_0108");
|
||||
component.labels[1].text = text.Get("Account_0109");
|
||||
component.labels[2].text = text.Get("Profile_0008") + ": " + VideoHostingUtil.GetUserIDHidden($"{PlayerStaticData.UserViewerID:#,0}".Replace(",", " "));
|
||||
component.labels[3].text = text.Get("Account_0110");
|
||||
component.labels[4].text = text.Get("Profile_0009");
|
||||
component.buttons[0].onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
NativePluginWrapper.SetStringToClipboard(PlayerStaticData.UserViewerID.ToString());
|
||||
DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase2.SetPanelDepth(100);
|
||||
dialogBase2.SetSize(DialogBase.Size.S);
|
||||
dialogBase2.SetText(text.Get("Profile_0015"));
|
||||
dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
}));
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
private bool CheckDataLinkPassword(string firstPass, string secondPass)
|
||||
{
|
||||
if (firstPass != secondPass)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (firstPass.Length < 8 || 16 < firstPass.Length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int num = 0;
|
||||
int num2 = 0;
|
||||
int num3 = 0;
|
||||
foreach (char c in firstPass)
|
||||
{
|
||||
if ('0' <= c && c <= '9')
|
||||
{
|
||||
num++;
|
||||
continue;
|
||||
}
|
||||
if ('a' <= c && c <= 'z')
|
||||
{
|
||||
num2++;
|
||||
continue;
|
||||
}
|
||||
if ('A' <= c && c <= 'Z')
|
||||
{
|
||||
num3++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (num <= 0 || num2 <= 0 || num3 <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private int GetActiveChildCount(Transform parent)
|
||||
{
|
||||
int num = 0;
|
||||
for (int i = 0; i < parent.childCount; i++)
|
||||
{
|
||||
if (parent.GetChild(i).gameObject.activeSelf)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
47
SVSim.BattleEngine/Engine/Wizard/AdjustSendSettingDialog.cs
Normal file
47
SVSim.BattleEngine/Engine/Wizard/AdjustSendSettingDialog.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class AdjustSendSettingDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIToggle _toggle;
|
||||
|
||||
private bool _firstToggleCall = true;
|
||||
|
||||
public Action<bool> OnChange;
|
||||
|
||||
public static AdjustSendSettingDialog Create(GameObject prefab)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
SystemText systemText = Data.SystemText;
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.SetTitleLabel(systemText.Get("MyPage_0072"));
|
||||
dialogBase.SetText(systemText.Get("MyPage_0073"));
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
AdjustSendSettingDialog component = UnityEngine.Object.Instantiate(prefab).GetComponent<AdjustSendSettingDialog>();
|
||||
dialogBase.SetObj(component.gameObject);
|
||||
return component;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_toggle.value = Data.Load.data._userConfig.ArrowAdjustSend;
|
||||
_toggle.onChange.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnChangeToggle();
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnChangeToggle()
|
||||
{
|
||||
if (!_firstToggleCall)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(_toggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF);
|
||||
OnChange.Call(_toggle.value);
|
||||
}
|
||||
_firstToggleCall = false;
|
||||
}
|
||||
}
|
||||
54
SVSim.BattleEngine/Engine/Wizard/BattlePassBuyTask.cs
Normal file
54
SVSim.BattleEngine/Engine/Wizard/BattlePassBuyTask.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class BattlePassBuyTask : BaseTask
|
||||
{
|
||||
public class BattlePassBuyTaskParam : BaseParam
|
||||
{
|
||||
public int season_id { get; set; }
|
||||
|
||||
public int id { get; set; }
|
||||
}
|
||||
|
||||
public List<ReceivedReward> RewardList { get; private set; }
|
||||
|
||||
public BattlePassBuyTask()
|
||||
{
|
||||
base.type = ApiType.Type.BattlePassBuy;
|
||||
}
|
||||
|
||||
public void SetParameter(int seasonId, int id)
|
||||
{
|
||||
BattlePassBuyTaskParam battlePassBuyTaskParam = new BattlePassBuyTaskParam();
|
||||
battlePassBuyTaskParam.season_id = seasonId;
|
||||
battlePassBuyTaskParam.id = id;
|
||||
base.Params = battlePassBuyTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["achieved_info"];
|
||||
if (jsonData.Count > 0 && jsonData.Keys.Contains("battle_pass_reward_list"))
|
||||
{
|
||||
JsonData jsonData2 = jsonData["battle_pass_reward_list"];
|
||||
RewardList = new List<ReceivedReward>();
|
||||
for (int i = 0; i < jsonData2.Count; i++)
|
||||
{
|
||||
JsonData jsonData3 = jsonData2[i];
|
||||
int rewardType = jsonData3["reward_type"].ToInt();
|
||||
long rewardId = jsonData3["reward_detail_id"].ToLong();
|
||||
int rewardCount = jsonData3["reward_number"].ToInt();
|
||||
RewardList.Add(new ReceivedReward(rewardType, rewardId, rewardCount));
|
||||
}
|
||||
}
|
||||
PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class BattlePassProductDetailDialog : MonoBehaviour
|
||||
{
|
||||
private const string PATH_DIALOG_PREFAB = "UI/layoutParts/BattlePass/DialogBattlePassProductDetail";
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _descriptionLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _posterTexture;
|
||||
|
||||
private List<string> _loadedResourceList;
|
||||
|
||||
public static void Create(BattlePassProduct product)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.SetPanelDepth(100);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("BattlePass_0003"));
|
||||
GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("UI/layoutParts/BattlePass/DialogBattlePassProductDetail")) as GameObject;
|
||||
dialogBase.SetObj(gameObject);
|
||||
gameObject.GetComponent<BattlePassProductDetailDialog>().Initialize(product);
|
||||
}
|
||||
|
||||
public void Initialize(BattlePassProduct product)
|
||||
{
|
||||
_descriptionLabel.text = product.Description;
|
||||
_loadedResourceList = new List<string>();
|
||||
LoadResources(product, delegate
|
||||
{
|
||||
_posterTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(product.GetDetailPosterTexturePath(isFetch: true)) as Texture;
|
||||
});
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
UnloadResources();
|
||||
}
|
||||
|
||||
private void LoadResources(BattlePassProduct product, Action onFinishLoad)
|
||||
{
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
List<string> loadPassList = new List<string>();
|
||||
loadPassList.Add(product.GetDetailPosterTexturePath(isFetch: false));
|
||||
StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPassList, delegate
|
||||
{
|
||||
_loadedResourceList.AddRange(loadPassList);
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
onFinishLoad.Call();
|
||||
}));
|
||||
}
|
||||
|
||||
private void UnloadResources()
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList);
|
||||
_loadedResourceList = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class BattlePassPurchaseInfoTask : BaseTask
|
||||
{
|
||||
public BattlePassPurchaseInfo PurchaseInfo { get; private set; }
|
||||
|
||||
public BattlePassPurchaseInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.BattlePassItemList;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
string text = jsonData["premium_pass_description"].ToString();
|
||||
text = text.Replace("\\n", "\n");
|
||||
if (jsonData.Keys.Contains("sales_period_info") && jsonData["sales_period_info"].Keys.Contains("sales_period_time"))
|
||||
{
|
||||
string arg = ConvertTime.ToLocal(DateTime.Parse(jsonData["sales_period_info"]["sales_period_time"].ToString()));
|
||||
text = string.Format(text, arg);
|
||||
}
|
||||
List<BattlePassProduct> list = new List<BattlePassProduct>();
|
||||
JsonData jsonData2 = jsonData["products"];
|
||||
for (int i = 0; i < jsonData2.Count; i++)
|
||||
{
|
||||
int id = jsonData2[i]["id"].ToInt();
|
||||
int seasonId = jsonData2[i]["season_id"].ToInt();
|
||||
string name = jsonData2[i]["name"].ToString();
|
||||
int priceInCrystal = jsonData2[i]["price_crystal"].ToInt();
|
||||
string text2 = jsonData2[i]["description"].ToString();
|
||||
text2 = text2.Replace("\\n", "\n");
|
||||
ShopExpirtyInfo expirtyInfo = new ShopExpirtyInfo(jsonData2[i]["sales_period_info"]);
|
||||
list.Add(new BattlePassProduct(id, seasonId, name, priceInCrystal, text2, expirtyInfo));
|
||||
}
|
||||
PurchaseInfo = new BattlePassPurchaseInfo(text, list);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.View;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class BossRushLobbyAbilityDetailDialog : MonoBehaviour
|
||||
{
|
||||
private const float SELECT_CARD_SCALE = 1.35f;
|
||||
|
||||
private const float GRID_CARD_SCALE = 0.64f;
|
||||
|
||||
private const int GRID_CARD_DEPTH = 5;
|
||||
|
||||
private const int KEYWORD_DIALOG_DEPTH = 20;
|
||||
|
||||
private const int KEYWORD_PANEL_DEPTH = 25;
|
||||
|
||||
private static readonly Vector3 DIALOG_POSITION = new Vector3(0f, 0f, 2f);
|
||||
|
||||
[SerializeField]
|
||||
private CardImageHelpder _cardLoader;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _buttonOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _cardGrid;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _nameLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollView _descScrollView;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _descLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _selectCardRoot;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _selectCursor;
|
||||
|
||||
[SerializeField]
|
||||
private TextLineCreater _descLineCreator;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _emptyOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _keywordCollider;
|
||||
|
||||
private GameObject _selectCard;
|
||||
|
||||
public static void Create(List<BossRushLobbyAbilityData> abilityList, int maxBossCount, BossRushLobbyAbilityData defaultSelectAbility = null)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.L);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("BossRush_0022"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
dialogBase.transform.localPosition = DIALOG_POSITION;
|
||||
if (abilityList.Count == 0)
|
||||
{
|
||||
dialogBase.SetText(Data.SystemText.Get("BossRush_0024"));
|
||||
return;
|
||||
}
|
||||
GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("UI/layoutParts/BossRush/BossRushLobbyAbilityDetailDialog")) as GameObject;
|
||||
dialogBase.SetObj(gameObject);
|
||||
gameObject.GetComponent<BossRushLobbyAbilityDetailDialog>().Initialize(abilityList, maxBossCount, defaultSelectAbility);
|
||||
}
|
||||
|
||||
private void Initialize(List<BossRushLobbyAbilityData> abilityList, int maxBossCount, BossRushLobbyAbilityData defaultSelectAbility)
|
||||
{
|
||||
_emptyOriginal.SetActive(value: false);
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
StartCoroutine(LoadResources(abilityList, delegate
|
||||
{
|
||||
InitializeCardList(abilityList, maxBossCount, defaultSelectAbility);
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}));
|
||||
}
|
||||
|
||||
private void InitializeCardList(List<BossRushLobbyAbilityData> abilityList, int maxBossCount, BossRushLobbyAbilityData defaultSelectAbility)
|
||||
{
|
||||
_buttonOriginal.gameObject.SetActive(value: false);
|
||||
int num = 0;
|
||||
if (defaultSelectAbility != null)
|
||||
{
|
||||
for (int i = 0; i < abilityList.Count; i++)
|
||||
{
|
||||
if (abilityList[i] == defaultSelectAbility)
|
||||
{
|
||||
num = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < maxBossCount; j++)
|
||||
{
|
||||
if (j >= abilityList.Count)
|
||||
{
|
||||
AddEmptyAbilityFrame();
|
||||
}
|
||||
else
|
||||
{
|
||||
AddAbilityCardObj(abilityList, j, num);
|
||||
}
|
||||
}
|
||||
_cardGrid.Reposition();
|
||||
UIBase_CardManager.CardObjData cardObjData = _cardLoader.GetCardObjData(num);
|
||||
_selectCursor.transform.position = cardObjData.CardObj.transform.position;
|
||||
}
|
||||
|
||||
private void AddEmptyAbilityFrame()
|
||||
{
|
||||
NGUITools.AddChild(_cardGrid.gameObject, _emptyOriginal).SetActive(value: true);
|
||||
}
|
||||
|
||||
private void AddAbilityCardObj(List<BossRushLobbyAbilityData> abilityList, int index, int defaultSelectIndex)
|
||||
{
|
||||
GameObject gameObject = NGUITools.AddChild(_cardGrid.gameObject, _buttonOriginal.gameObject);
|
||||
UIButton component = gameObject.GetComponent<UIButton>();
|
||||
gameObject.SetActive(value: true);
|
||||
BossRushLobbyAbilityData abilityData = abilityList[index];
|
||||
UIBase_CardManager.CardObjData objData = _cardLoader.GetCardObjData(index);
|
||||
GameObject cardObj = objData.CardObj;
|
||||
Vector3 localScale = cardObj.transform.localScale;
|
||||
component.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickAbility(abilityData, objData);
|
||||
}));
|
||||
cardObj.transform.parent = gameObject.transform;
|
||||
cardObj.transform.localPosition = Vector3.zero;
|
||||
cardObj.transform.localScale = localScale;
|
||||
if (index == defaultSelectIndex)
|
||||
{
|
||||
SelectAbility(abilityData, objData);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClickAbility(BossRushLobbyAbilityData abilityData, UIBase_CardManager.CardObjData objData)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SelectAbility(abilityData, objData);
|
||||
}
|
||||
|
||||
private void SelectAbility(BossRushLobbyAbilityData abilityData, UIBase_CardManager.CardObjData objData)
|
||||
{
|
||||
SetNameLabel(abilityData);
|
||||
_descLabel.SetWrapText(BattleCardBase.ConvertSkillDescriptionText(abilityData.SkillDescText));
|
||||
if (_selectCard != null)
|
||||
{
|
||||
UnityEngine.Object.Destroy(_selectCard);
|
||||
}
|
||||
_selectCursor.transform.position = objData.CardObj.transform.position;
|
||||
_selectCard = NGUITools.AddChild(_selectCardRoot, objData.CardObj);
|
||||
_selectCard.transform.localScale = new Vector3(1.35f, 1.35f, 1f);
|
||||
CardListTemplate component = _selectCard.GetComponent<CardListTemplate>();
|
||||
component.SetId(abilityData.DisplayCardId);
|
||||
CardTemplateCustomize(component);
|
||||
int textLineCount = Global.GetTextLineCount(_descLabel.text);
|
||||
_descLineCreator.ShowLines(textLineCount);
|
||||
_descScrollView.ResetPosition();
|
||||
UIEventListener.Get(_descLabel.gameObject).onClick = delegate
|
||||
{
|
||||
OnClickDescLabel(abilityData);
|
||||
};
|
||||
UIEventListener.Get(_keywordCollider).onPress = delegate(GameObject g, bool b)
|
||||
{
|
||||
BattlePlayerView.PressKeyWordColorChange(_descLabel, b);
|
||||
};
|
||||
UIEventListener.Get(_keywordCollider).onDragStart = delegate
|
||||
{
|
||||
BattlePlayerView.SetKeyWordLabelColor(_descLabel);
|
||||
};
|
||||
}
|
||||
|
||||
private void OnClickDescLabel(BossRushLobbyAbilityData abilityData)
|
||||
{
|
||||
if (abilityData.SkillDescText.Length > 0 && HasKeyword(abilityData.SkillDescText))
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
IList<string> keywords = BattleKeywordInfoListMgr.GetKeywords(abilityData.SkillDescText);
|
||||
DialogBase dialogBase = BattlePlayerView.CreateKeyPanel(_descLabel, keywords, CardMaster.CardMasterId.Default);
|
||||
dialogBase.SetPanelDepth(20, isSetBackViewDepthImmediately: true);
|
||||
dialogBase.GetComponentInChildren<BattleKeywordInfoListMgr>().SetPanelDepth(25);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasKeyword(string skillDescText)
|
||||
{
|
||||
IList<string> keywords = BattleKeywordInfoListMgr.GetKeywords(skillDescText);
|
||||
bool result = false;
|
||||
foreach (string item in keywords)
|
||||
{
|
||||
if (Data.Master.BattleKeyWordDic.ContainsKey(item))
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void SetNameLabel(BossRushLobbyAbilityData abilityData)
|
||||
{
|
||||
_nameLabel.text = abilityData.Name;
|
||||
UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(_nameLabel, abilityData.IsFoil);
|
||||
}
|
||||
|
||||
private IEnumerator LoadResources(List<BossRushLobbyAbilityData> abilityList, Action callBack)
|
||||
{
|
||||
List<int> list = new List<int>();
|
||||
CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default);
|
||||
foreach (BossRushLobbyAbilityData ability in abilityList)
|
||||
{
|
||||
CardParameter cardParameterFromId = instance.GetCardParameterFromId(ability.DisplayCardId);
|
||||
if (ability.IsFoil)
|
||||
{
|
||||
list.Add(cardParameterFromId.FoilCardId);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(ability.DisplayCardId);
|
||||
}
|
||||
}
|
||||
float cardScale = 0.64f;
|
||||
int depth = 5;
|
||||
bool finish = false;
|
||||
_cardLoader.Load(list, cardScale, depth, CardTemplateCustomize, delegate
|
||||
{
|
||||
finish = true;
|
||||
});
|
||||
while (!finish)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
callBack.Call();
|
||||
}
|
||||
|
||||
private void CardTemplateCustomize(CardListTemplate cardTemplate)
|
||||
{
|
||||
cardTemplate.SetBossRushSkillFrame();
|
||||
cardTemplate.HideNum();
|
||||
cardTemplate.HideLabelsForBossRushSkill();
|
||||
cardTemplate.SetBossRushCardTexture();
|
||||
}
|
||||
}
|
||||
152
SVSim.BattleEngine/Engine/Wizard/BuildDeckProductDetail.cs
Normal file
152
SVSim.BattleEngine/Engine/Wizard/BuildDeckProductDetail.cs
Normal file
@@ -0,0 +1,152 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class BuildDeckProductDetail : BaseProductDetail
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _labelSetHead;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _topLineCardList;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelCardNum;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _rewardCardParent;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _spotCardRoot;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _spotCardOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _spotCardGrid;
|
||||
|
||||
public void SetSingleProductDetail(BuildDeckProductInfo productInfo)
|
||||
{
|
||||
Texture textureProductImage = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(productInfo.saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail, isfetch: true));
|
||||
List<ShopCommonRewardInfo> list = new List<ShopCommonRewardInfo>();
|
||||
Dictionary<int, int> dictionary = new Dictionary<int, int>();
|
||||
Dictionary<int, int> dictionary2 = new Dictionary<int, int>();
|
||||
for (int i = 0; i < productInfo.rewardInfoList.Count; i++)
|
||||
{
|
||||
ShopCommonRewardInfo shopCommonRewardInfo = productInfo.rewardInfoList[i];
|
||||
if (shopCommonRewardInfo.Type == 5)
|
||||
{
|
||||
dictionary.Add((int)shopCommonRewardInfo.UserGoodsId, shopCommonRewardInfo.Num);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(productInfo.rewardInfoList[i]);
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < productInfo.cardList.Count; j++)
|
||||
{
|
||||
BuildDeckCard buildDeckCard = productInfo.cardList[j];
|
||||
if (CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(buildDeckCard._cardId).IsBasicCard)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (buildDeckCard.IsSpotCard)
|
||||
{
|
||||
if (dictionary2.ContainsKey(buildDeckCard._cardId))
|
||||
{
|
||||
dictionary2[buildDeckCard._cardId] = dictionary2[buildDeckCard._cardId] + buildDeckCard._number;
|
||||
}
|
||||
else
|
||||
{
|
||||
dictionary2[buildDeckCard._cardId] = buildDeckCard._number;
|
||||
}
|
||||
}
|
||||
else if (dictionary.ContainsKey(buildDeckCard._cardId))
|
||||
{
|
||||
dictionary[buildDeckCard._cardId] += buildDeckCard._number;
|
||||
}
|
||||
else
|
||||
{
|
||||
dictionary.Add(buildDeckCard._cardId, buildDeckCard._number);
|
||||
}
|
||||
}
|
||||
_spotCardRoot.SetActive(dictionary2.Count > 0);
|
||||
_spotCardOriginal.SetActive(value: true);
|
||||
foreach (KeyValuePair<int, int> item in dictionary2)
|
||||
{
|
||||
string userGoodsName = UserGoods.getUserGoodsName(UserGoods.Type.Card, item.Key);
|
||||
NGUITools.AddChild(_spotCardOriginal.transform.parent.gameObject, _spotCardOriginal).GetComponent<UILabel>().text = Data.SystemText.Get("Shop_0121", userGoodsName, item.Value.ToString());
|
||||
}
|
||||
_spotCardGrid.Reposition();
|
||||
_spotCardOriginal.SetActive(value: false);
|
||||
List<int> list2 = ConvertSortedCardList(dictionary, productInfo.featured_card_id);
|
||||
if (_rewardCardParent != null)
|
||||
{
|
||||
_rewardCardParent.SetActive(list2.Count > 0);
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
int num = 0;
|
||||
for (int k = 0; k < list2.Count; k++)
|
||||
{
|
||||
int num2 = list2[k];
|
||||
string userGoodsName2 = UserGoods.getUserGoodsName(UserGoods.Type.Card, num2);
|
||||
int num3 = dictionary[num2];
|
||||
stringBuilder.Append(Data.SystemText.Get("Shop_0121", userGoodsName2, num3.ToString()));
|
||||
stringBuilder.Append("\n");
|
||||
num += num3;
|
||||
}
|
||||
_labelCardNum.text = Data.SystemText.Get("Shop_0119", num.ToString());
|
||||
if (list.Count <= 0 || productInfo.purchase_num_current > 0)
|
||||
{
|
||||
list.Clear();
|
||||
_labelSetHead.SetActive(value: false);
|
||||
_topLineCardList.SetActive(value: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_labelSetHead.SetActive(value: true);
|
||||
_topLineCardList.SetActive(value: true);
|
||||
}
|
||||
SetProductDetail(textureProductImage, list, stringBuilder.ToString());
|
||||
}
|
||||
|
||||
private List<int> ConvertSortedCardList(Dictionary<int, int> rewardCardDict, int featuredCardId)
|
||||
{
|
||||
List<int> list = new List<int>(rewardCardDict.Keys);
|
||||
list.Sort(delegate(int x, int y)
|
||||
{
|
||||
CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(x);
|
||||
CardParameter cardParameterFromId2 = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(y);
|
||||
if (cardParameterFromId.CardId == featuredCardId)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (cardParameterFromId2.CardId == featuredCardId)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (cardParameterFromId.IsPrizeCard && cardParameterFromId2.IsPrizeCard)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (cardParameterFromId.IsPrizeCard)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (cardParameterFromId2.IsPrizeCard)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (cardParameterFromId.Rarity != cardParameterFromId2.Rarity)
|
||||
{
|
||||
return cardParameterFromId2.Rarity.CompareTo(cardParameterFromId.Rarity);
|
||||
}
|
||||
return (cardParameterFromId.CardSetId != cardParameterFromId2.CardSetId) ? cardParameterFromId2.CardSetId.CompareTo(cardParameterFromId.CardSetId) : cardParameterFromId.CardId.CompareTo(cardParameterFromId2.CardId);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
}
|
||||
22
SVSim.BattleEngine/Engine/Wizard/ChangeableTitleUIParts.cs
Normal file
22
SVSim.BattleEngine/Engine/Wizard/ChangeableTitleUIParts.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ChangeableTitleUIParts : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _labelTapToStart;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
SetLabelTapToStart();
|
||||
}
|
||||
|
||||
private void SetLabelTapToStart()
|
||||
{
|
||||
if (!(_labelTapToStart == null))
|
||||
{
|
||||
_labelTapToStart.text = Data.SystemText.Get("System_0048");
|
||||
}
|
||||
}
|
||||
}
|
||||
31
SVSim.BattleEngine/Engine/Wizard/ChatAddDeckTask.cs
Normal file
31
SVSim.BattleEngine/Engine/Wizard/ChatAddDeckTask.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class ChatAddDeckTask : BaseTask
|
||||
{
|
||||
public class ChatAddDeckTaskParam : BaseParam
|
||||
{
|
||||
public int deck_format { get; set; }
|
||||
|
||||
public int deck_no { get; set; }
|
||||
}
|
||||
|
||||
public ChatAddDeckTask(ApiType.Type apiType)
|
||||
{
|
||||
base.type = apiType;
|
||||
}
|
||||
|
||||
public void SetParameter(int deckFormat, int deckNo)
|
||||
{
|
||||
ChatAddDeckTaskParam chatAddDeckTaskParam = new ChatAddDeckTaskParam();
|
||||
chatAddDeckTaskParam.deck_format = deckFormat;
|
||||
chatAddDeckTaskParam.deck_no = deckNo;
|
||||
base.Params = chatAddDeckTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int result = base.Parse();
|
||||
_ = 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
28
SVSim.BattleEngine/Engine/Wizard/ChatAddReplayTask.cs
Normal file
28
SVSim.BattleEngine/Engine/Wizard/ChatAddReplayTask.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class ChatAddReplayTask : BaseTask
|
||||
{
|
||||
public class ChatAddReplayTaskParam : BaseParam
|
||||
{
|
||||
public long battle_id { get; set; }
|
||||
}
|
||||
|
||||
public ChatAddReplayTask(ApiType.Type apiType)
|
||||
{
|
||||
base.type = apiType;
|
||||
}
|
||||
|
||||
public void SetParameter(long battleId)
|
||||
{
|
||||
ChatAddReplayTaskParam chatAddReplayTaskParam = new ChatAddReplayTaskParam();
|
||||
chatAddReplayTaskParam.battle_id = battleId;
|
||||
base.Params = chatAddReplayTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int result = base.Parse();
|
||||
_ = 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
45
SVSim.BattleEngine/Engine/Wizard/ChatDeckLogTask.cs
Normal file
45
SVSim.BattleEngine/Engine/Wizard/ChatDeckLogTask.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ChatDeckLogTask : BaseTask
|
||||
{
|
||||
public List<ChatMessageInfo.DeckLogData> DeckLogListRotation { get; private set; }
|
||||
|
||||
public List<ChatMessageInfo.DeckLogData> DeckLogListUnlimited { get; private set; }
|
||||
|
||||
public List<ChatMessageInfo.DeckLogData> DeckLogListPreRotation { get; private set; }
|
||||
|
||||
public List<ChatMessageInfo.DeckLogData> DeckLogListCrossover { get; private set; }
|
||||
|
||||
public List<ChatMessageInfo.DeckLogData> DeckLogListMyRotation { get; private set; }
|
||||
|
||||
public ChatDeckLogTask(ApiType.Type apiType)
|
||||
{
|
||||
base.type = apiType;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["deck_log"];
|
||||
GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]);
|
||||
DeckLogListRotation = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.Rotation).ToString()]);
|
||||
DeckLogListUnlimited = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.Unlimited).ToString()]);
|
||||
DeckLogListPreRotation = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.PreRotation).ToString()]);
|
||||
if (jsonData.TryGetValue(Data.FormatConvertApi(Format.Crossover).ToString(), out var value))
|
||||
{
|
||||
DeckLogListCrossover = ChatMessageInfo.DeckLogData.ParseDeckDataList(value);
|
||||
}
|
||||
if (jsonData.TryGetValue(Data.FormatConvertApi(Format.MyRotation).ToString(), out var value2))
|
||||
{
|
||||
DeckLogListMyRotation = ChatMessageInfo.DeckLogData.ParseDeckDataList(value2);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
53
SVSim.BattleEngine/Engine/Wizard/ChatDeleteDeckTask.cs
Normal file
53
SVSim.BattleEngine/Engine/Wizard/ChatDeleteDeckTask.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ChatDeleteDeckTask : BaseTask
|
||||
{
|
||||
public class ChatDeleteDeckTaskParam : BaseParam
|
||||
{
|
||||
public int deck_format { get; set; }
|
||||
|
||||
public int message_id { get; set; }
|
||||
}
|
||||
|
||||
public Dictionary<Format, List<ChatMessageInfo.DeckLogData>> DictDeckLogList { get; private set; }
|
||||
|
||||
public ChatDeleteDeckTask(ApiType.Type apiType)
|
||||
{
|
||||
base.type = apiType;
|
||||
}
|
||||
|
||||
public void SetParameter(int deckFormat, int messageId)
|
||||
{
|
||||
ChatDeleteDeckTaskParam chatDeleteDeckTaskParam = new ChatDeleteDeckTaskParam();
|
||||
chatDeleteDeckTaskParam.deck_format = deckFormat;
|
||||
chatDeleteDeckTaskParam.message_id = messageId;
|
||||
base.Params = chatDeleteDeckTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["deck_log"];
|
||||
GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]);
|
||||
DictDeckLogList = new Dictionary<Format, List<ChatMessageInfo.DeckLogData>>();
|
||||
DictDeckLogList[Format.Rotation] = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.Rotation).ToString()]);
|
||||
DictDeckLogList[Format.Unlimited] = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.Unlimited).ToString()]);
|
||||
DictDeckLogList[Format.PreRotation] = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.PreRotation).ToString()]);
|
||||
if (jsonData.TryGetValue(Data.FormatConvertApi(Format.Crossover).ToString(), out var value))
|
||||
{
|
||||
DictDeckLogList[Format.Crossover] = ChatMessageInfo.DeckLogData.ParseDeckDataList(value);
|
||||
}
|
||||
if (jsonData.TryGetValue(Data.FormatConvertApi(Format.MyRotation).ToString(), out var value2))
|
||||
{
|
||||
DictDeckLogList[Format.MyRotation] = ChatMessageInfo.DeckLogData.ParseDeckDataList(value2);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
54
SVSim.BattleEngine/Engine/Wizard/ChatGetMessagesTask.cs
Normal file
54
SVSim.BattleEngine/Engine/Wizard/ChatGetMessagesTask.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class ChatGetMessagesTask : BaseTask
|
||||
{
|
||||
public class ChatGetMessagesTaskParam : BaseParam
|
||||
{
|
||||
public int start_message_id { get; set; }
|
||||
|
||||
public int direction { get; set; }
|
||||
|
||||
public int wait_interval { get; set; }
|
||||
}
|
||||
|
||||
private const int LATEST_REQUEST_MESSAGE_ID = 0;
|
||||
|
||||
private const Chat.eRequestDirection LATEST_REQUEST_DIRECTION = Chat.eRequestDirection.OLD;
|
||||
|
||||
public ChatInfo ChatInfo { get; private set; }
|
||||
|
||||
public ChatGetMessagesTask(ApiType.Type apiType)
|
||||
{
|
||||
base.type = apiType;
|
||||
}
|
||||
|
||||
public void SetParameter(int startMessageId, Chat.eRequestDirection direction, int waitInterval)
|
||||
{
|
||||
ChatGetMessagesTaskParam chatGetMessagesTaskParam = new ChatGetMessagesTaskParam();
|
||||
chatGetMessagesTaskParam.start_message_id = startMessageId;
|
||||
chatGetMessagesTaskParam.direction = (int)direction;
|
||||
chatGetMessagesTaskParam.wait_interval = waitInterval;
|
||||
base.Params = chatGetMessagesTaskParam;
|
||||
}
|
||||
|
||||
public void SetParameterLatestLog(int waitInterval)
|
||||
{
|
||||
ChatGetMessagesTaskParam chatGetMessagesTaskParam = new ChatGetMessagesTaskParam();
|
||||
chatGetMessagesTaskParam.start_message_id = 0;
|
||||
chatGetMessagesTaskParam.direction = 1;
|
||||
chatGetMessagesTaskParam.wait_interval = waitInterval;
|
||||
base.Params = chatGetMessagesTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]);
|
||||
ChatInfo = new ChatInfo(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
47
SVSim.BattleEngine/Engine/Wizard/ChatPostTask.cs
Normal file
47
SVSim.BattleEngine/Engine/Wizard/ChatPostTask.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class ChatPostTask : BaseTask
|
||||
{
|
||||
public class ChatPostTaskParam : BaseParam
|
||||
{
|
||||
public int type { get; set; }
|
||||
|
||||
public string message { get; set; }
|
||||
}
|
||||
|
||||
public AchievedInfo AchievedInfo { get; private set; }
|
||||
|
||||
public ChatPostTask(ApiType.Type apiType)
|
||||
{
|
||||
base.type = apiType;
|
||||
}
|
||||
|
||||
public void SetParameter(int type, string message)
|
||||
{
|
||||
ChatPostTaskParam chatPostTaskParam = new ChatPostTaskParam();
|
||||
chatPostTaskParam.type = type;
|
||||
chatPostTaskParam.message = message;
|
||||
base.Params = chatPostTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
if (base.ResponseData["data"].Count > 0)
|
||||
{
|
||||
if (base.ResponseData["data"].Keys.Contains("achieved_info"))
|
||||
{
|
||||
AchievedInfo = new AchievedInfo(base.ResponseData["data"]["achieved_info"]);
|
||||
}
|
||||
if (base.ResponseData["data"].Keys.Contains("reward_list"))
|
||||
{
|
||||
PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]);
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ChatReplayListDialogContent : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private ReplayContentView _prefabReplayInfoView;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _rootReplayInfoView;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _btnReplaySend;
|
||||
|
||||
private ReplayContentView _replayInfoView;
|
||||
|
||||
public void SetData(ReplayInfoItem replayInfoItem, Action onClickReplaySend)
|
||||
{
|
||||
if (_replayInfoView == null)
|
||||
{
|
||||
_replayInfoView = NGUITools.AddChild(_rootReplayInfoView, _prefabReplayInfoView.gameObject).GetComponent<ReplayContentView>();
|
||||
}
|
||||
_replayInfoView.SetData(replayInfoItem);
|
||||
_btnReplaySend.onClick.Clear();
|
||||
_btnReplaySend.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
onClickReplaySend.Call();
|
||||
}));
|
||||
}
|
||||
}
|
||||
9
SVSim.BattleEngine/Engine/Wizard/ClientCacheClearTask.cs
Normal file
9
SVSim.BattleEngine/Engine/Wizard/ClientCacheClearTask.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class ClientCacheClearTask : BaseTask
|
||||
{
|
||||
public ClientCacheClearTask()
|
||||
{
|
||||
base.type = ApiType.Type.ClientCacheClear;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ColosseumDeckEntryAvatarTask : BaseTask
|
||||
{
|
||||
public class ColosseumDeckEntryHOFTaskParam : BaseParam
|
||||
{
|
||||
public string deck_no_list;
|
||||
}
|
||||
|
||||
public ColosseumDeckEntryAvatarTask()
|
||||
{
|
||||
base.type = ApiType.Type.ColosseumAvatarDeckEntry;
|
||||
}
|
||||
|
||||
public void SetParameter(List<DeckData> deckList)
|
||||
{
|
||||
ColosseumDeckEntryHOFTaskParam colosseumDeckEntryHOFTaskParam = new ColosseumDeckEntryHOFTaskParam();
|
||||
List<int> list = new List<int>();
|
||||
for (int i = 0; i < deckList.Count; i++)
|
||||
{
|
||||
list.Add(deckList[i].GetDeckID());
|
||||
}
|
||||
colosseumDeckEntryHOFTaskParam.deck_no_list = JsonMapper.ToJson(list);
|
||||
base.Params = colosseumDeckEntryHOFTaskParam;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ColosseumDeckEntryHOFTask : BaseTask
|
||||
{
|
||||
public class ColosseumDeckEntryHOFTaskParam : BaseParam
|
||||
{
|
||||
public string deck_no_list;
|
||||
}
|
||||
|
||||
public ColosseumDeckEntryHOFTask()
|
||||
{
|
||||
base.type = ApiType.Type.ColosseumHOFDeckEntry;
|
||||
}
|
||||
|
||||
public void SetParameter(List<DeckData> deckList)
|
||||
{
|
||||
ColosseumDeckEntryHOFTaskParam colosseumDeckEntryHOFTaskParam = new ColosseumDeckEntryHOFTaskParam();
|
||||
List<int> list = new List<int>();
|
||||
for (int i = 0; i < deckList.Count; i++)
|
||||
{
|
||||
list.Add(deckList[i].GetDeckID());
|
||||
}
|
||||
colosseumDeckEntryHOFTaskParam.deck_no_list = JsonMapper.ToJson(list);
|
||||
base.Params = colosseumDeckEntryHOFTaskParam;
|
||||
}
|
||||
}
|
||||
32
SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryTask.cs
Normal file
32
SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryTask.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ColosseumDeckEntryTask : BaseTask
|
||||
{
|
||||
public class ColosseumDeckEntryTaskParam : BaseParam
|
||||
{
|
||||
public string deck_no_list;
|
||||
|
||||
public bool is_published;
|
||||
}
|
||||
|
||||
public ColosseumDeckEntryTask()
|
||||
{
|
||||
base.type = ApiType.Type.ColosseumDeckEntry;
|
||||
}
|
||||
|
||||
public void SetParameter(List<DeckData> deckList, bool isPublished)
|
||||
{
|
||||
ColosseumDeckEntryTaskParam colosseumDeckEntryTaskParam = new ColosseumDeckEntryTaskParam();
|
||||
List<int> list = new List<int>();
|
||||
for (int i = 0; i < deckList.Count; i++)
|
||||
{
|
||||
list.Add(deckList[i].GetDeckID());
|
||||
}
|
||||
colosseumDeckEntryTaskParam.deck_no_list = JsonMapper.ToJson(list);
|
||||
colosseumDeckEntryTaskParam.is_published = isPublished;
|
||||
base.Params = colosseumDeckEntryTaskParam;
|
||||
}
|
||||
}
|
||||
63
SVSim.BattleEngine/Engine/Wizard/ColosseumDetailTask.cs
Normal file
63
SVSim.BattleEngine/Engine/Wizard/ColosseumDetailTask.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ColosseumDetailTask : BaseTask
|
||||
{
|
||||
public const int COLOSSEUM_ANNOUNCE_ID_NOT_SET_ERROR_CODE = 4416;
|
||||
|
||||
public ColosseumDetailTask()
|
||||
{
|
||||
base.type = ApiType.Type.ColosseumDetail;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
JsonData colosseumOwnStatus = jsonData["colosseum_status"];
|
||||
JsonData jsonData2 = jsonData["colosseum_info"];
|
||||
ArenaColosseum colosseumData = Data.ArenaData.ColosseumData;
|
||||
colosseumData.ApiRuleParseAndSet(jsonData2["format"].ToInt());
|
||||
string text = ConvertTime.ToLocal(DateTime.Parse(jsonData2["start_time"].ToString()));
|
||||
string text2 = ConvertTime.ToLocal(DateTime.Parse(jsonData2["end_time"].ToString()));
|
||||
colosseumData.ColosseumTimeText = Data.SystemText.Get("Colosseum_0033", text, text2);
|
||||
colosseumData.AnnounceNo = ((jsonData2["announce_id"] != null) ? jsonData2["announce_id"].ToString() : "");
|
||||
colosseumData.FinalRoundEliminateCount = jsonData2["final_round_eliminate_count"].ToInt();
|
||||
int num2 = 0;
|
||||
colosseumData.FocusStageNo = ArenaColosseum.eStageNo.Max;
|
||||
for (int i = 1; i <= 3; i++)
|
||||
{
|
||||
JsonData jsonData3 = jsonData[i.ToString()];
|
||||
text = ConvertTime.ToLocal(DateTime.Parse(jsonData3["start_time"].ToString()), ConvertTime.FORMAT.TIME_DATE_SHORT);
|
||||
text2 = ConvertTime.ToLocal(DateTime.Parse(jsonData3["end_time"].ToString()), ConvertTime.FORMAT.TIME_DATE_SHORT);
|
||||
if (jsonData3["is_now_round"].ToBoolean())
|
||||
{
|
||||
colosseumData.FocusStageNo = (ArenaColosseum.eStageNo)i;
|
||||
}
|
||||
JsonData jsonData4 = jsonData3["round_detail"];
|
||||
for (int j = 0; j < jsonData4.Count; j++)
|
||||
{
|
||||
colosseumData.DetailData[num2].RoundTimeText = Data.SystemText.Get("Colosseum_0033", text, text2);
|
||||
colosseumData.DetailData[num2].RoundTimeStartText = Data.SystemText.Get("Colosseum_0106", text);
|
||||
colosseumData.DetailData[num2].RoundTimeEndText = Data.SystemText.Get("Colosseum_0107", text2);
|
||||
colosseumData.DetailData[num2].GroupName = jsonData4[j]["group"].ToString();
|
||||
colosseumData.DetailData[num2].MaxBattleNum = jsonData4[j]["max_battle_count"].ToInt();
|
||||
colosseumData.DetailData[num2].BreakThroughNum = jsonData4[j]["breakthrough_number"].ToInt();
|
||||
colosseumData.DetailData[num2].MaxEntryNum = jsonData4[j]["entry_number"].ToInt();
|
||||
if (colosseumData.DetailData[num2].GroupName == "")
|
||||
{
|
||||
colosseumData.DetailData[num2].GroupName = Data.SystemText.Get("Colosseum_0079");
|
||||
}
|
||||
num2++;
|
||||
}
|
||||
}
|
||||
ColosseumEntryInfoTask.SetColosseumOwnStatus(colosseumOwnStatus);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
39
SVSim.BattleEngine/Engine/Wizard/ColosseumEntryTask.cs
Normal file
39
SVSim.BattleEngine/Engine/Wizard/ColosseumEntryTask.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ColosseumEntryTask : BaseTask
|
||||
{
|
||||
public class ColosseumEntryTaskParam : BaseParam
|
||||
{
|
||||
public int now_round_id;
|
||||
|
||||
public int consume_item_type;
|
||||
}
|
||||
|
||||
public ColosseumEntryTask()
|
||||
{
|
||||
base.type = ApiType.Type.ColosseumEntry;
|
||||
}
|
||||
|
||||
public void SetParameter(ArenaData.eARENA_PAY inPayType)
|
||||
{
|
||||
ColosseumEntryTaskParam colosseumEntryTaskParam = new ColosseumEntryTaskParam();
|
||||
colosseumEntryTaskParam.consume_item_type = (int)inPayType;
|
||||
colosseumEntryTaskParam.now_round_id = Data.ArenaData.ColosseumData.ServerRoundId;
|
||||
base.Params = colosseumEntryTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]);
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
Data.ArenaData.ColosseumData.ApiRuleParseAndSet(jsonData["entry_info"]["deck_format"].ToInt());
|
||||
return num;
|
||||
}
|
||||
}
|
||||
33
SVSim.BattleEngine/Engine/Wizard/ColosseumHOFDeckInfoTask.cs
Normal file
33
SVSim.BattleEngine/Engine/Wizard/ColosseumHOFDeckInfoTask.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ColosseumHOFDeckInfoTask : BaseTask
|
||||
{
|
||||
public List<DeckData> DeckList { get; private set; }
|
||||
|
||||
public ColosseumHOFDeckInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.ColosseumHOFDeckInfo;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
DeckList = new List<DeckData>();
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
JsonData deckData = jsonData[i];
|
||||
DeckData deckData2 = new DeckData(Format.Max, DeckAttributeType.CustomDeck);
|
||||
deckData2.Initialize(deckData);
|
||||
DeckList.Add(deckData2);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ColosseumWindFallDeckEntry : BaseTask
|
||||
{
|
||||
public class ColosseumWindFallDeckEntryTaskParam : BaseParam
|
||||
{
|
||||
public string deck_no_list;
|
||||
}
|
||||
|
||||
public ColosseumWindFallDeckEntry()
|
||||
{
|
||||
base.type = ApiType.Type.ColosseumWindFallDeckEntry;
|
||||
}
|
||||
|
||||
public void SetParameter(List<DeckData> deckList)
|
||||
{
|
||||
ColosseumWindFallDeckEntryTaskParam colosseumWindFallDeckEntryTaskParam = new ColosseumWindFallDeckEntryTaskParam();
|
||||
List<int> list = new List<int>();
|
||||
for (int i = 0; i < deckList.Count; i++)
|
||||
{
|
||||
list.Add(deckList[i].GetDeckID());
|
||||
}
|
||||
colosseumWindFallDeckEntryTaskParam.deck_no_list = JsonMapper.ToJson(list);
|
||||
base.Params = colosseumWindFallDeckEntryTaskParam;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ColosseumWindFallDeckInfoTask : BaseTask
|
||||
{
|
||||
public List<DeckData> DeckList { get; private set; }
|
||||
|
||||
public ColosseumWindFallDeckInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.ColosseumWindFallDeckInfo;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
DeckList = new List<DeckData>();
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
JsonData deckData = jsonData[i];
|
||||
DeckData deckData2 = new DeckData(Format.Max, DeckAttributeType.CustomDeck);
|
||||
deckData2.Initialize(deckData);
|
||||
DeckList.Add(deckData2);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
87
SVSim.BattleEngine/Engine/Wizard/CompetitionDetail.cs
Normal file
87
SVSim.BattleEngine/Engine/Wizard/CompetitionDetail.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using UnityEngine;
|
||||
using Wizard.ErrorDialog;
|
||||
using Wizard.Scripts.Network.Data.TaskData.Arena;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class CompetitionDetail : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _prefabRewardDialog;
|
||||
|
||||
[SerializeField]
|
||||
private CardDetailUI _cardDetailDialog;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _rewardRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _formatLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _entryPeriodTimeLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _openPeriodTimeLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _maxNumLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _conditionLable;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _entryNum;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _tryNum;
|
||||
|
||||
private const int COMPETITION_ANNOUNCE_ID_NOT_SET_ERROR_CODE = 5516;
|
||||
|
||||
public void Init(DialogBase inDialog, ArenaCompetition data, bool isEntry)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
inDialog.SetSize(DialogBase.Size.M);
|
||||
inDialog.SetTitleLabel(systemText.Get("Common_0022"));
|
||||
inDialog.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn_GrayBtn);
|
||||
inDialog.SetButtonText(systemText.Get("Colosseum_0023"), systemText.Get("Colosseum_0025"));
|
||||
string text = "";
|
||||
text = data.DeckFormat switch
|
||||
{
|
||||
Format.TwoPick => systemText.Get("Arena_0002"),
|
||||
Format.Rotation => systemText.Get("Common_0154"),
|
||||
_ => systemText.Get("Common_0155"),
|
||||
};
|
||||
_formatLabel.text = systemText.Get("Colosseum_0054", text) + systemText.Get("Colosseum_0093");
|
||||
_openPeriodTimeLabel.text = systemText.Get("Competition_0029") + " : " + data.NowRoundTimeText;
|
||||
_entryPeriodTimeLabel.text = systemText.Get("Competition_0028") + " : " + data.EntryTimeText;
|
||||
_maxNumLabel.text = systemText.Get("Competition_0023", data.MaxBattleCount.ToString());
|
||||
_conditionLable.text = systemText.Get("Colosseum_0104", data.MaxLoseCount.ToString());
|
||||
_entryNum.text = systemText.Get("Colosseum_0088", data.MaxEntryCount.ToString());
|
||||
_tryNum.text = systemText.Get("Competition_0042", data.MaxChallengeCount.ToString());
|
||||
inDialog.onPushButton1 = delegate
|
||||
{
|
||||
if (!string.IsNullOrEmpty(data.AnnounceId))
|
||||
{
|
||||
UIManager.GetInstance().WebViewHelper.OpenAnnounceWebView(data.AnnounceId);
|
||||
}
|
||||
else
|
||||
{
|
||||
Wizard.ErrorDialog.Dialog.Create(5516);
|
||||
}
|
||||
};
|
||||
inDialog.onPushButton2 = delegate
|
||||
{
|
||||
UIManager.GetInstance().StartFirstTips(CompetitionUtility.GetCompetitionTipsType(Data.ArenaData.CompetitionData.Rule));
|
||||
};
|
||||
RewardBase component = NGUITools.AddChild(_rewardRoot, _prefabRewardDialog).GetComponent<RewardBase>();
|
||||
component.SetCardDetailUI(_cardDetailDialog);
|
||||
foreach (Wizard.Scripts.Network.Data.TaskData.Arena.Reward entryReward in data.EntryRewardList)
|
||||
{
|
||||
component.AddReward(entryReward);
|
||||
}
|
||||
component.SetActiveRewardLabel(isShow: false);
|
||||
component.SetOnlyIconEndCreate();
|
||||
base.transform.localPosition = Vector3.forward * 10f;
|
||||
}
|
||||
}
|
||||
186
SVSim.BattleEngine/Engine/Wizard/CompetitionEntryDialog.cs
Normal file
186
SVSim.BattleEngine/Engine/Wizard/CompetitionEntryDialog.cs
Normal file
@@ -0,0 +1,186 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.Scripts.Network.Data.TaskData.Arena;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class CompetitionEntryDialog : ArenaEntryDialogBase
|
||||
{
|
||||
public delegate void OnCompleteEntry();
|
||||
|
||||
public delegate void OnCompleteJoin();
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _prefabRewardDialog;
|
||||
|
||||
[SerializeField]
|
||||
private CardDetailUI _cardDetailDialog;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _mainText;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _competitionEntryCompleteDialog;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _rewardRoot;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _freeEntryDialogLine;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _entryRupyButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _entryCrystalButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _entryButtonGrid;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _rewardLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _coutionLabel;
|
||||
|
||||
public Action CompleteEntryHandler;
|
||||
|
||||
public Action CompleteJoinHandler;
|
||||
|
||||
private const int CELL_WIDTH_ADJUST = -12;
|
||||
|
||||
private const int CELL_WIDTH_ADJUST_COUNT = 4;
|
||||
|
||||
private readonly Vector3 FREE_BATTLE_LABEL_POS = new Vector3(0f, 198f, 0f);
|
||||
|
||||
private readonly Vector3 FREE_BATTLE_COUTION_LABEL_POS = new Vector3(0f, 108f, 0f);
|
||||
|
||||
private readonly Vector3 FREE_BATTLE_REWARD_LABEL_POS = new Vector3(0f, 29f, 0f);
|
||||
|
||||
private readonly Vector3 FREE_BATTLE_REWARD_POS = new Vector3(0f, -96f, 0f);
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
IsCompetition = true;
|
||||
switch (Data.ArenaData.CompetitionData.CostType)
|
||||
{
|
||||
case ArenaCompetition.EntryCostType.EntryWithFree:
|
||||
{
|
||||
bool flag = Data.ArenaData.CompetitionData.CurrentWinCount > 0;
|
||||
_mainText.text = (flag ? Data.SystemText.Get("Competition_0062", Data.ArenaData.CompetitionData.MaxChallengeCount.ToString()) : Data.SystemText.Get("Competition_0069", Data.ArenaData.CompetitionData.MaxChallengeCount.ToString()));
|
||||
_freeEntryDialogLine.SetActive(value: true);
|
||||
_mainText.gameObject.transform.localPosition = FREE_BATTLE_LABEL_POS;
|
||||
_rewardRoot.transform.localPosition = FREE_BATTLE_REWARD_POS;
|
||||
_rewardLabel.transform.localPosition = FREE_BATTLE_REWARD_LABEL_POS;
|
||||
_coutionLabel.transform.localPosition = FREE_BATTLE_COUTION_LABEL_POS;
|
||||
break;
|
||||
}
|
||||
case ArenaCompetition.EntryCostType.EntryWithCost:
|
||||
_mainText.text = Data.SystemText.Get("Competition_0077", Data.ArenaData.CompetitionData.MaxChallengeCount.ToString());
|
||||
_freeEntryDialogLine.SetActive(value: false);
|
||||
break;
|
||||
}
|
||||
_entryCrystalButton.gameObject.SetActive(Data.ArenaData.CompetitionData.crystalCost != 0);
|
||||
_entryRupyButton.gameObject.SetActive(Data.ArenaData.CompetitionData.rupyCost != 0);
|
||||
_entryButtonGrid.Reposition();
|
||||
_arenaNameTextId = "Competition_0035";
|
||||
_entryButtonSe = Se.TYPE.SYS_BTN_DECIDE;
|
||||
}
|
||||
|
||||
protected override int GetTicketNum()
|
||||
{
|
||||
return PlayerStaticData.UserColosseumTicketNum;
|
||||
}
|
||||
|
||||
protected override ArenaEntryDataBase GetEntryData()
|
||||
{
|
||||
return Data.ArenaData.CompetitionData;
|
||||
}
|
||||
|
||||
protected override void Entry()
|
||||
{
|
||||
base.Entry();
|
||||
if (Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithCost)
|
||||
{
|
||||
CompetitionEntryTask competitionEntryTask = new CompetitionEntryTask();
|
||||
competitionEntryTask.SetParameter(_payType);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(competitionEntryTask, EntryTaskSuccess));
|
||||
}
|
||||
else
|
||||
{
|
||||
CompetitionPermanentEntryTask competitionPermanentEntryTask = new CompetitionPermanentEntryTask();
|
||||
competitionPermanentEntryTask.SetParameter(_payType);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(competitionPermanentEntryTask, EntryTaskSuccess));
|
||||
}
|
||||
}
|
||||
|
||||
private void EntryTaskSuccess(NetworkTask.ResultCode inResult)
|
||||
{
|
||||
base.ParentDialog.CloseWithoutSelect();
|
||||
CompleteEntryHandler.Call();
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Competition_0018"));
|
||||
GameObject gameObject = UnityEngine.Object.Instantiate(_competitionEntryCompleteDialog);
|
||||
dialogBase.SetObj(gameObject);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
SetRewardInfo(gameObject, isOnlyIcon: false, isSetLabel: true);
|
||||
gameObject.transform.localPosition = Vector3.forward * 10f;
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
if (Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithFree)
|
||||
{
|
||||
UIManager.ViewScene nextScene = ((Data.ArenaData.CompetitionData.Rule == ArenaColosseum.eRule.TwoPick) ? UIManager.ViewScene.Competition2Pick : UIManager.ViewScene.CompetitionLobby);
|
||||
UIManager.GetInstance().ChangeViewScene(nextScene);
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateJoinCompetitionDialog();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void SetRewardInfoEntryConfirm()
|
||||
{
|
||||
SetRewardInfo(_rewardRoot, isOnlyIcon: true);
|
||||
}
|
||||
|
||||
public void SetRewardInfo(GameObject root, bool isOnlyIcon = false, bool isSetLabel = false)
|
||||
{
|
||||
RewardBase component = NGUITools.AddChild(root, _prefabRewardDialog).GetComponent<RewardBase>();
|
||||
component.SetCardDetailUI(_cardDetailDialog);
|
||||
foreach (Wizard.Scripts.Network.Data.TaskData.Arena.Reward entryReward in Data.ArenaData.CompetitionData.EntryRewardList)
|
||||
{
|
||||
component.AddReward(entryReward);
|
||||
}
|
||||
component.GetComponent<UIPanel>().depth = 8;
|
||||
if (component._rewardObjectInfoList.Count >= 4)
|
||||
{
|
||||
component.AllInEndCreate(0.8f, -12);
|
||||
}
|
||||
else
|
||||
{
|
||||
component.AllInEndCreate(1f);
|
||||
}
|
||||
if (isOnlyIcon)
|
||||
{
|
||||
component.SetOnlyIconEndCreate(isSleeveRotate: false);
|
||||
}
|
||||
component.SetActiveRewardLabel(isSetLabel);
|
||||
}
|
||||
|
||||
public void CreateJoinCompetitionDialog()
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(systemText.Get("Competition_0039"));
|
||||
dialogBase.SetText(systemText.Get("Competition_0078"));
|
||||
dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS;
|
||||
dialogBase.SetButtonDelegate(delegate
|
||||
{
|
||||
CompleteJoinHandler.Call();
|
||||
});
|
||||
}
|
||||
}
|
||||
33
SVSim.BattleEngine/Engine/Wizard/CompetitionEntryTask.cs
Normal file
33
SVSim.BattleEngine/Engine/Wizard/CompetitionEntryTask.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class CompetitionEntryTask : BaseTask
|
||||
{
|
||||
public class CompetitionEntryTaskParam : BaseParam
|
||||
{
|
||||
public int consume_item_type;
|
||||
}
|
||||
|
||||
public CompetitionEntryTask()
|
||||
{
|
||||
base.type = ApiType.Type.CompetitionEntry;
|
||||
}
|
||||
|
||||
public void SetParameter(ArenaData.eARENA_PAY inPayType)
|
||||
{
|
||||
CompetitionEntryTaskParam competitionEntryTaskParam = new CompetitionEntryTaskParam();
|
||||
competitionEntryTaskParam.consume_item_type = (int)inPayType;
|
||||
base.Params = competitionEntryTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]);
|
||||
Data.ArenaData.CompetitionData.SetRestChallangeCountByEntry(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user