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:
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;
|
||||
}
|
||||
}
|
||||
9
SVSim.BattleEngine/Engine/Wizard/CompetitionJoinTask.cs
Normal file
9
SVSim.BattleEngine/Engine/Wizard/CompetitionJoinTask.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class CompetitionJoinTask : BaseTask
|
||||
{
|
||||
public CompetitionJoinTask()
|
||||
{
|
||||
base.type = ApiType.Type.CompetitionJoin;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class CompetitionRegisterDeckTask : BaseTask
|
||||
{
|
||||
public class CompetitionRegisterDeckTaskParam : BaseParam
|
||||
{
|
||||
public string deck_no_list;
|
||||
|
||||
public bool is_published;
|
||||
}
|
||||
|
||||
public CompetitionRegisterDeckTask()
|
||||
{
|
||||
base.type = ApiType.Type.CompetitionRegisterDeck;
|
||||
}
|
||||
|
||||
public void SetParameter(List<DeckData> deckList, bool isPublished)
|
||||
{
|
||||
CompetitionRegisterDeckTaskParam competitionRegisterDeckTaskParam = new CompetitionRegisterDeckTaskParam();
|
||||
List<int> list = new List<int>();
|
||||
for (int i = 0; i < deckList.Count; i++)
|
||||
{
|
||||
list.Add(deckList[i].GetDeckID());
|
||||
}
|
||||
competitionRegisterDeckTaskParam.deck_no_list = JsonMapper.ToJson(list);
|
||||
competitionRegisterDeckTaskParam.is_published = isPublished;
|
||||
base.Params = competitionRegisterDeckTaskParam;
|
||||
}
|
||||
}
|
||||
27
SVSim.BattleEngine/Engine/Wizard/ConventionDeckOrderTask.cs
Normal file
27
SVSim.BattleEngine/Engine/Wizard/ConventionDeckOrderTask.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class ConventionDeckOrderTask : BaseTask
|
||||
{
|
||||
public class DeckOrderTaskParam : BaseParam
|
||||
{
|
||||
public string tournament_id;
|
||||
|
||||
public int[] deck_order;
|
||||
|
||||
public int deck_format;
|
||||
}
|
||||
|
||||
public ConventionDeckOrderTask()
|
||||
{
|
||||
base.type = ApiType.Type.ConventionDeckOrder;
|
||||
}
|
||||
|
||||
public void SetParameter(string tournament_id, int[] deck_order, Format format)
|
||||
{
|
||||
DeckOrderTaskParam deckOrderTaskParam = new DeckOrderTaskParam();
|
||||
deckOrderTaskParam.tournament_id = tournament_id;
|
||||
deckOrderTaskParam.deck_order = deck_order;
|
||||
deckOrderTaskParam.deck_format = Data.FormatConvertApi(format);
|
||||
base.Params = deckOrderTaskParam;
|
||||
}
|
||||
}
|
||||
411
SVSim.BattleEngine/Engine/Wizard/CustomEasing.cs
Normal file
411
SVSim.BattleEngine/Engine/Wizard/CustomEasing.cs
Normal file
@@ -0,0 +1,411 @@
|
||||
using System;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class CustomEasing
|
||||
{
|
||||
public enum eType
|
||||
{
|
||||
linear,
|
||||
inQuad,
|
||||
outQuad,
|
||||
inOutQuad,
|
||||
inCubic,
|
||||
outCubic,
|
||||
inOutCubic,
|
||||
inQuart,
|
||||
outQuart,
|
||||
inOutQuart,
|
||||
inSine,
|
||||
outSine,
|
||||
inOutSine,
|
||||
inExpo,
|
||||
outExpo,
|
||||
inOutExpo,
|
||||
inCirc,
|
||||
outCirc,
|
||||
inOutCirc,
|
||||
inElastic,
|
||||
outElastic,
|
||||
inOutElastic,
|
||||
inBack,
|
||||
outBack,
|
||||
inOutBack,
|
||||
inBounce,
|
||||
outBounce,
|
||||
inOutBounce
|
||||
}
|
||||
|
||||
private delegate float easingFunc(float curTime);
|
||||
|
||||
private float beginVal;
|
||||
|
||||
private float endVal;
|
||||
|
||||
private float changeVal;
|
||||
|
||||
private float duration;
|
||||
|
||||
private float curTime;
|
||||
|
||||
private easingFunc func;
|
||||
|
||||
public bool IsMoving { get; private set; }
|
||||
|
||||
public CustomEasing(eType type, float beginValue, float endValue, float durationTime)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case eType.linear:
|
||||
func = linear;
|
||||
break;
|
||||
case eType.inQuad:
|
||||
func = inQuad;
|
||||
break;
|
||||
case eType.outQuad:
|
||||
func = outQuad;
|
||||
break;
|
||||
case eType.inOutQuad:
|
||||
func = inOutQuad;
|
||||
break;
|
||||
case eType.inCubic:
|
||||
func = inCubic;
|
||||
break;
|
||||
case eType.outCubic:
|
||||
func = outCubic;
|
||||
break;
|
||||
case eType.inOutCubic:
|
||||
func = inOutCubic;
|
||||
break;
|
||||
case eType.inQuart:
|
||||
func = inQuart;
|
||||
break;
|
||||
case eType.outQuart:
|
||||
func = outQuart;
|
||||
break;
|
||||
case eType.inOutQuart:
|
||||
func = inOutQuart;
|
||||
break;
|
||||
case eType.inSine:
|
||||
func = inSine;
|
||||
break;
|
||||
case eType.outSine:
|
||||
func = outSine;
|
||||
break;
|
||||
case eType.inOutSine:
|
||||
func = inOutSine;
|
||||
break;
|
||||
case eType.inExpo:
|
||||
func = inExpo;
|
||||
break;
|
||||
case eType.outExpo:
|
||||
func = outExpo;
|
||||
break;
|
||||
case eType.inOutExpo:
|
||||
func = inOutExpo;
|
||||
break;
|
||||
case eType.inCirc:
|
||||
func = inCirc;
|
||||
break;
|
||||
case eType.outCirc:
|
||||
func = outCirc;
|
||||
break;
|
||||
case eType.inOutCirc:
|
||||
func = inOutCirc;
|
||||
break;
|
||||
case eType.inElastic:
|
||||
func = inElastic;
|
||||
break;
|
||||
case eType.outElastic:
|
||||
func = outElastic;
|
||||
break;
|
||||
case eType.inOutElastic:
|
||||
func = inOutElastic;
|
||||
break;
|
||||
case eType.inBack:
|
||||
func = inBack;
|
||||
break;
|
||||
case eType.outBack:
|
||||
func = outBack;
|
||||
break;
|
||||
case eType.inOutBack:
|
||||
func = inOutBack;
|
||||
break;
|
||||
case eType.inBounce:
|
||||
func = inBounce;
|
||||
break;
|
||||
case eType.outBounce:
|
||||
func = outBounce;
|
||||
break;
|
||||
case eType.inOutBounce:
|
||||
func = inOutBounce;
|
||||
break;
|
||||
}
|
||||
beginVal = beginValue;
|
||||
endVal = endValue;
|
||||
duration = durationTime;
|
||||
curTime = 0f;
|
||||
changeVal = endValue - beginValue;
|
||||
IsMoving = true;
|
||||
}
|
||||
|
||||
public float GetCurVal(float deltaTime, bool canOver = false)
|
||||
{
|
||||
curTime += deltaTime;
|
||||
if (curTime >= duration && !canOver)
|
||||
{
|
||||
IsMoving = false;
|
||||
return endVal;
|
||||
}
|
||||
return func(curTime) + beginVal;
|
||||
}
|
||||
|
||||
private float linear(float t)
|
||||
{
|
||||
return changeVal * t / duration;
|
||||
}
|
||||
|
||||
private float inQuad(float t)
|
||||
{
|
||||
float num = t / duration;
|
||||
return changeVal * num * num;
|
||||
}
|
||||
|
||||
private float outQuad(float t)
|
||||
{
|
||||
float num = t / duration;
|
||||
return (0f - changeVal) * num * (num - 2f);
|
||||
}
|
||||
|
||||
private float inOutQuad(float t)
|
||||
{
|
||||
float num = t * 2f / duration;
|
||||
if (num < 1f)
|
||||
{
|
||||
return changeVal / 2f * num * num;
|
||||
}
|
||||
return (0f - changeVal) / 2f * ((num - 1f) * (num - 3f) - 1f);
|
||||
}
|
||||
|
||||
private float inCubic(float t)
|
||||
{
|
||||
float num = t / duration;
|
||||
return changeVal * num * num * num;
|
||||
}
|
||||
|
||||
private float outCubic(float t)
|
||||
{
|
||||
float num = t / duration - 1f;
|
||||
return changeVal * (num * num * num + 1f);
|
||||
}
|
||||
|
||||
private float inOutCubic(float t)
|
||||
{
|
||||
float num = t * 2f / duration;
|
||||
if (num < 1f)
|
||||
{
|
||||
return changeVal / 2f * num * num * num;
|
||||
}
|
||||
num -= 2f;
|
||||
return changeVal / 2f * (num * num * num + 2f);
|
||||
}
|
||||
|
||||
private float inQuart(float t)
|
||||
{
|
||||
float num = t / duration;
|
||||
return changeVal * num * num * num * num;
|
||||
}
|
||||
|
||||
private float outQuart(float t)
|
||||
{
|
||||
float num = t / duration - 1f;
|
||||
return (0f - changeVal) * (num * num * num * num - 1f);
|
||||
}
|
||||
|
||||
private float inOutQuart(float t)
|
||||
{
|
||||
float num = t * 2f / duration;
|
||||
if (num < 1f)
|
||||
{
|
||||
return changeVal / 2f * num * num * num * num;
|
||||
}
|
||||
num -= 2f;
|
||||
return (0f - changeVal) / 2f * (num * num * num * num - 2f);
|
||||
}
|
||||
|
||||
private float inSine(float t)
|
||||
{
|
||||
return (0f - changeVal) * (float)Math.Cos((double)(t / duration) * (Math.PI / 2.0)) + changeVal;
|
||||
}
|
||||
|
||||
private float outSine(float t)
|
||||
{
|
||||
return changeVal * (float)Math.Sin((double)(t / duration) * (Math.PI / 2.0));
|
||||
}
|
||||
|
||||
private float inOutSine(float t)
|
||||
{
|
||||
return (0f - changeVal) / 2f * ((float)Math.Cos((double)(t / duration) * Math.PI) - 1f);
|
||||
}
|
||||
|
||||
private float inExpo(float t)
|
||||
{
|
||||
if (t == 0f)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
return changeVal * (float)Math.Pow(2.0, 10f * (t / duration - 1f));
|
||||
}
|
||||
|
||||
private float outExpo(float t)
|
||||
{
|
||||
return changeVal * (0f - (float)Math.Pow(2.0, -10f * t / duration) + 1f);
|
||||
}
|
||||
|
||||
private float inOutExpo(float t)
|
||||
{
|
||||
if (t == 0f)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
float num = t * 2f / duration;
|
||||
if (num < 1f)
|
||||
{
|
||||
return changeVal / 2f * (float)Math.Pow(2.0, 10f * (num - 1f));
|
||||
}
|
||||
return changeVal / 2f * (0f - (float)Math.Pow(2.0, -10f * (num - 1f)) + 2f);
|
||||
}
|
||||
|
||||
private float inCirc(float t)
|
||||
{
|
||||
float num = t / duration;
|
||||
return (0f - changeVal) * ((float)Math.Sqrt(1f - num * num) - 1f);
|
||||
}
|
||||
|
||||
private float outCirc(float t)
|
||||
{
|
||||
float num = t / duration - 1f;
|
||||
return changeVal * (float)Math.Sqrt(1f - num * num);
|
||||
}
|
||||
|
||||
private float inOutCirc(float t)
|
||||
{
|
||||
float num = t * 2f / duration;
|
||||
if (num < 1f)
|
||||
{
|
||||
return (0f - changeVal) / 2f * ((float)Math.Sqrt(1f - num * num) - 1f);
|
||||
}
|
||||
num -= 2f;
|
||||
return changeVal / 2f * ((float)Math.Sqrt(1f - num * num) + 1f);
|
||||
}
|
||||
|
||||
private float inElastic(float t)
|
||||
{
|
||||
float num = t / duration;
|
||||
float num2 = 1.70158f;
|
||||
float num3 = changeVal;
|
||||
if (num == 0f)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
float num4 = duration * 0.3f;
|
||||
num2 = ((!(num3 < Math.Abs(changeVal))) ? (num4 / ((float)Math.PI * 2f) * (float)Math.Asin(changeVal / num3)) : (num4 / 4f));
|
||||
num -= 1f;
|
||||
return 0f - num3 * (float)Math.Pow(2.0, 10f * num) * (float)Math.Sin((num * duration - num2) * ((float)Math.PI * 2f) / num4);
|
||||
}
|
||||
|
||||
private float outElastic(float t)
|
||||
{
|
||||
float num = t / duration;
|
||||
float num2 = 1.70158f;
|
||||
float num3 = changeVal;
|
||||
if (num == 0f)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
float num4 = duration * 0.3f;
|
||||
num2 = ((!(num3 < Math.Abs(changeVal))) ? (num4 / ((float)Math.PI * 2f) * (float)Math.Asin(changeVal / num3)) : (num4 / 4f));
|
||||
return num3 * (float)Math.Pow(2.0, -10f * num) * (float)Math.Sin((num * duration - num2) * ((float)Math.PI * 2f) / num4) + changeVal;
|
||||
}
|
||||
|
||||
private float inOutElastic(float t)
|
||||
{
|
||||
float num = t * 2f / duration;
|
||||
float num2 = 1.70158f;
|
||||
float num3 = changeVal;
|
||||
if (num == 0f)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
float num4 = duration * 0.45f;
|
||||
num2 = ((!(num3 < Math.Abs(changeVal))) ? (num4 / ((float)Math.PI * 2f) * (float)Math.Asin(changeVal / num3)) : (num4 / 4f));
|
||||
if (num < 1f)
|
||||
{
|
||||
num -= 1f;
|
||||
return -0.5f * (num3 * (float)Math.Pow(2.0, 10f * num) * (float)Math.Sin((num * duration - num2) * ((float)Math.PI * 2f) / num4));
|
||||
}
|
||||
num -= 1f;
|
||||
return num3 * (float)Math.Pow(2.0, -10f * num) * (float)Math.Sin((num * duration - num2) * ((float)Math.PI * 2f / num4)) * 0.5f + changeVal;
|
||||
}
|
||||
|
||||
private float inBack(float t)
|
||||
{
|
||||
float num = t / duration;
|
||||
float num2 = 1.70158f;
|
||||
return changeVal * num * num * ((num2 + 1f) * num - num2);
|
||||
}
|
||||
|
||||
private float outBack(float t)
|
||||
{
|
||||
float num = t / duration - 1f;
|
||||
float num2 = 1.70158f;
|
||||
return changeVal * (num * num * ((num2 + 1f) * num + num2) + 1f);
|
||||
}
|
||||
|
||||
private float inOutBack(float t)
|
||||
{
|
||||
float num = t * 2f / duration;
|
||||
float num2 = 2.5949094f;
|
||||
if (num < 1f)
|
||||
{
|
||||
return changeVal / 2f * num * num * ((num2 + 1f) * num - num2);
|
||||
}
|
||||
num -= 2f;
|
||||
return changeVal / 2f * (num * num * ((num2 + 1f) * num + num2) + 2f);
|
||||
}
|
||||
|
||||
private float inBounce(float t)
|
||||
{
|
||||
return changeVal - outBounce(duration - t);
|
||||
}
|
||||
|
||||
private float outBounce(float t)
|
||||
{
|
||||
float num = t / duration;
|
||||
if (num < 0.36363637f)
|
||||
{
|
||||
return changeVal * (7.5625f * num * num);
|
||||
}
|
||||
if (num < 0.72727275f)
|
||||
{
|
||||
num -= 0.54545456f;
|
||||
return changeVal * (7.5625f * num * num + 0.75f);
|
||||
}
|
||||
if (num < 0.90909094f)
|
||||
{
|
||||
num -= 0.8181818f;
|
||||
return changeVal * (7.5625f * num * num + 0.9375f);
|
||||
}
|
||||
num -= 21f / 22f;
|
||||
return changeVal * (7.5625f * num * num + 63f / 64f);
|
||||
}
|
||||
|
||||
private float inOutBounce(float t)
|
||||
{
|
||||
if (t * 2f < duration)
|
||||
{
|
||||
return inBounce(t * 2f) * 0.5f;
|
||||
}
|
||||
return 0.5f * outBounce(t * 2f - duration) + changeVal * 0.5f;
|
||||
}
|
||||
}
|
||||
45
SVSim.BattleEngine/Engine/Wizard/DeckConventionInfoTask.cs
Normal file
45
SVSim.BattleEngine/Engine/Wizard/DeckConventionInfoTask.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckConventionInfoTask : BaseTask
|
||||
{
|
||||
public class DeckConventionInfoTaskParam : BaseParam
|
||||
{
|
||||
public string tournament_id;
|
||||
|
||||
public int deck_no;
|
||||
}
|
||||
|
||||
private ConventionInfo _conventionInfo;
|
||||
|
||||
public ConventionDeckList DeckList { get; private set; }
|
||||
|
||||
public DeckConventionInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckInfoConvention;
|
||||
}
|
||||
|
||||
public void SetParameter(int deck_no, ConventionInfo conventionInfo, ConventionDeckList conventionDeckList = null)
|
||||
{
|
||||
DeckConventionInfoTaskParam deckConventionInfoTaskParam = new DeckConventionInfoTaskParam();
|
||||
_conventionInfo = conventionInfo;
|
||||
DeckList = conventionDeckList;
|
||||
if (conventionDeckList == null)
|
||||
{
|
||||
DeckList = new ConventionDeckList();
|
||||
}
|
||||
deckConventionInfoTaskParam.tournament_id = conventionInfo.Id;
|
||||
deckConventionInfoTaskParam.deck_no = deck_no;
|
||||
base.Params = deckConventionInfoTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
DeckList.Parse(base.ResponseData, _conventionInfo);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckConventionLeaderSkinUpdateTask : BaseTask
|
||||
{
|
||||
private class Param : BaseParam
|
||||
{
|
||||
public string tournament_id;
|
||||
|
||||
public int deck_no;
|
||||
|
||||
public int leader_skin_id;
|
||||
}
|
||||
|
||||
private ConventionDeckList _deckList;
|
||||
|
||||
public DeckConventionLeaderSkinUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckLeaderSkinUpdateConvention;
|
||||
}
|
||||
|
||||
public void SetParameter(int deckNo, int leaderSkinId, ConventionDeckList deckList)
|
||||
{
|
||||
_deckList = deckList;
|
||||
Param param = new Param();
|
||||
param.tournament_id = _deckList.Conventioninfo.Id;
|
||||
param.deck_no = deckNo;
|
||||
param.leader_skin_id = leaderSkinId;
|
||||
base.Params = param;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["user_deck"];
|
||||
int key = jsonData["deck_no"].ToInt();
|
||||
int skinId = jsonData["leader_skin_id"].ToInt();
|
||||
_deckList.DeckList[key].SetSkinId(skinId);
|
||||
_deckList.DeckList[key].IsSkinRandom = false;
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckConventionNameUpdateTask : BaseTask
|
||||
{
|
||||
public class DeckConventionNameUpdateTaskParam : BaseParam
|
||||
{
|
||||
public string tournament_id;
|
||||
|
||||
public int deck_no;
|
||||
|
||||
public string deck_name;
|
||||
}
|
||||
|
||||
private ConventionDeckList _deckList;
|
||||
|
||||
public DeckConventionNameUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckNameUpdateConvention;
|
||||
}
|
||||
|
||||
public void SetParameter(int deck_no, string deck_name, ConventionDeckList deckList)
|
||||
{
|
||||
_deckList = deckList;
|
||||
DeckConventionNameUpdateTaskParam deckConventionNameUpdateTaskParam = new DeckConventionNameUpdateTaskParam();
|
||||
deckConventionNameUpdateTaskParam.tournament_id = deckList.Conventioninfo.Id;
|
||||
deckConventionNameUpdateTaskParam.deck_no = deck_no;
|
||||
deckConventionNameUpdateTaskParam.deck_name = deck_name;
|
||||
base.Params = deckConventionNameUpdateTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["user_deck"];
|
||||
int key = jsonData["deck_no"].ToInt();
|
||||
_deckList.DeckList[key].SetDeckName(jsonData["deck_name"].ToString());
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckConventionRandomLeaderSkinUpdateTask : BaseTask
|
||||
{
|
||||
private class DeckConventionRandomLeaderSkinUpdateParam : BaseParam
|
||||
{
|
||||
public string tournament_id;
|
||||
|
||||
public int deck_no;
|
||||
|
||||
public int[] leader_skin_id_list;
|
||||
}
|
||||
|
||||
private ConventionDeckList _deckList;
|
||||
|
||||
public int SelectedSkinId { get; private set; }
|
||||
|
||||
public DeckConventionRandomLeaderSkinUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckRandomLeaderSkinUpdateConvention;
|
||||
}
|
||||
|
||||
public void SetParameter(int deckNo, int[] leaderSkinIdList, ConventionDeckList deckList)
|
||||
{
|
||||
_deckList = deckList;
|
||||
DeckConventionRandomLeaderSkinUpdateParam deckConventionRandomLeaderSkinUpdateParam = new DeckConventionRandomLeaderSkinUpdateParam();
|
||||
deckConventionRandomLeaderSkinUpdateParam.tournament_id = _deckList.Conventioninfo.Id;
|
||||
deckConventionRandomLeaderSkinUpdateParam.deck_no = deckNo;
|
||||
deckConventionRandomLeaderSkinUpdateParam.leader_skin_id_list = leaderSkinIdList;
|
||||
base.Params = deckConventionRandomLeaderSkinUpdateParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["user_deck"];
|
||||
int key = jsonData["deck_no"].ToInt();
|
||||
_deckList.DeckList[key].IsSkinRandom = true;
|
||||
JsonData jsonData2 = jsonData["leader_skin_id_list"];
|
||||
_deckList.DeckList[key].SelectRandomSkinIdList = new List<int>();
|
||||
for (int i = 0; i < jsonData2.Count; i++)
|
||||
{
|
||||
_deckList.DeckList[key].SelectRandomSkinIdList.Add(jsonData2[i].ToInt());
|
||||
}
|
||||
SelectedSkinId = jsonData["leader_skin_id"].ToInt();
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckConventionUpdateSleeveTask : BaseTask
|
||||
{
|
||||
public class SleeveConventionSetTaskParam : BaseParam
|
||||
{
|
||||
public string tournament_id;
|
||||
|
||||
public int deck_no;
|
||||
|
||||
public long sleeve_id;
|
||||
}
|
||||
|
||||
private ConventionDeckList _deckList;
|
||||
|
||||
public DeckConventionUpdateSleeveTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckUpdateSleeveConvention;
|
||||
}
|
||||
|
||||
public void SetParameter(int deck_no, long sleeve_id, ConventionDeckList deckList)
|
||||
{
|
||||
_deckList = deckList;
|
||||
SleeveConventionSetTaskParam sleeveConventionSetTaskParam = new SleeveConventionSetTaskParam();
|
||||
sleeveConventionSetTaskParam.tournament_id = deckList.Conventioninfo.Id;
|
||||
sleeveConventionSetTaskParam.deck_no = deck_no;
|
||||
sleeveConventionSetTaskParam.sleeve_id = sleeve_id;
|
||||
base.Params = sleeveConventionSetTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["user_deck"];
|
||||
int key = jsonData["deck_no"].ToInt();
|
||||
long deckSleeveID = jsonData["sleeve_id"].ToLong();
|
||||
_deckList.DeckList[key].SetDeckSleeveID(deckSleeveID);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckIntroductionPeriodSelectDialog : MonoBehaviour
|
||||
{
|
||||
public DeckIntroductionTask DeckIntroductionDeta { get; private set; }
|
||||
|
||||
private Action<int> OnSelectEvent { get; set; }
|
||||
|
||||
public static DialogBase Create(int defaultSelectId, DeckIntroductionTask task, Action<int> onSelect)
|
||||
{
|
||||
List<string> resultDeckSeriesNameList = task.ResultDeckSeriesNameList;
|
||||
int defaultIndex = 0;
|
||||
for (int i = 0; i < task.ResultDeckSeriesIdList.Count; i++)
|
||||
{
|
||||
if (task.ResultDeckSeriesIdList[i] == defaultSelectId)
|
||||
{
|
||||
defaultIndex = i;
|
||||
}
|
||||
}
|
||||
GameObject obj = UnityEngine.Object.Instantiate(Resources.Load("UI/layoutParts/MyPage/DeckIntroductionPeriodSelectDialog")) as GameObject;
|
||||
DeckIntroductionPeriodSelectDialog componentInChildren = obj.GetComponentInChildren<DeckIntroductionPeriodSelectDialog>();
|
||||
componentInChildren.DeckIntroductionDeta = task;
|
||||
componentInChildren.OnSelectEvent = onSelect;
|
||||
return DrumrollDialog.Create(obj.GetComponent<DrumrollDialog>(), resultDeckSeriesNameList, defaultIndex, componentInChildren.OnSelect);
|
||||
}
|
||||
|
||||
private void OnSelect(int index)
|
||||
{
|
||||
OnSelectEvent(DeckIntroductionDeta.ResultDeckSeriesIdList[index]);
|
||||
}
|
||||
}
|
||||
41
SVSim.BattleEngine/Engine/Wizard/DeckLeaderSkinUpdateTask.cs
Normal file
41
SVSim.BattleEngine/Engine/Wizard/DeckLeaderSkinUpdateTask.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckLeaderSkinUpdateTask : BaseTask
|
||||
{
|
||||
private class Param : BaseParam
|
||||
{
|
||||
public int deck_no;
|
||||
|
||||
public int leader_skin_id;
|
||||
|
||||
public int deck_format;
|
||||
}
|
||||
|
||||
private Format _updateDeckFormat;
|
||||
|
||||
public DeckLeaderSkinUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckLeaderSkinUpdate;
|
||||
}
|
||||
|
||||
public void SetParameter(int deckNo, int leaderSkinId, Format format)
|
||||
{
|
||||
Param param = new Param();
|
||||
param.deck_no = deckNo;
|
||||
param.leader_skin_id = leaderSkinId;
|
||||
param.deck_format = Data.FormatConvertApi(format);
|
||||
base.Params = param;
|
||||
_updateDeckFormat = format;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
DeckListUtility.DeckUpdate(base.ResponseData["data"]["user_deck"], _updateDeckFormat, DeckAttributeType.CustomDeck);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
39
SVSim.BattleEngine/Engine/Wizard/DeckMyListTask.cs
Normal file
39
SVSim.BattleEngine/Engine/Wizard/DeckMyListTask.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckMyListTask : BaseTask
|
||||
{
|
||||
public class DeckMyListTaskParam : BaseParam
|
||||
{
|
||||
public int deck_format;
|
||||
}
|
||||
|
||||
private Format _format;
|
||||
|
||||
public DeckGroupListData DeckGroupListData { get; private set; }
|
||||
|
||||
public DeckMyListTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckMyList;
|
||||
}
|
||||
|
||||
public void SetParameter(Format format)
|
||||
{
|
||||
DeckMyListTaskParam deckMyListTaskParam = new DeckMyListTaskParam();
|
||||
deckMyListTaskParam.deck_format = Data.FormatConvertApi(format);
|
||||
base.Params = deckMyListTaskParam;
|
||||
_format = format;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]);
|
||||
DeckGroupListData = new DeckGroupListData(base.ResponseData["data"], _format);
|
||||
GameMgr.GetIns().GetDataMgr().CurrentDeckListParamData = DeckGroupListData;
|
||||
return num;
|
||||
}
|
||||
}
|
||||
41
SVSim.BattleEngine/Engine/Wizard/DeckNameUpdateTask.cs
Normal file
41
SVSim.BattleEngine/Engine/Wizard/DeckNameUpdateTask.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckNameUpdateTask : BaseTask
|
||||
{
|
||||
public class DeckNameUpdateTaskParam : BaseParam
|
||||
{
|
||||
public int deck_no;
|
||||
|
||||
public string deck_name;
|
||||
|
||||
public int deck_format;
|
||||
}
|
||||
|
||||
private Format _updateDeckFormat;
|
||||
|
||||
public DeckNameUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckNameUpdate;
|
||||
}
|
||||
|
||||
public void SetParameter(int deck_no, string deck_name, Format format)
|
||||
{
|
||||
DeckNameUpdateTaskParam deckNameUpdateTaskParam = new DeckNameUpdateTaskParam();
|
||||
deckNameUpdateTaskParam.deck_no = deck_no;
|
||||
deckNameUpdateTaskParam.deck_name = deck_name;
|
||||
deckNameUpdateTaskParam.deck_format = Data.FormatConvertApi(format);
|
||||
base.Params = deckNameUpdateTaskParam;
|
||||
_updateDeckFormat = format;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
DeckListUtility.DeckUpdate(base.ResponseData["data"]["user_deck"], _updateDeckFormat, DeckAttributeType.CustomDeck);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
38
SVSim.BattleEngine/Engine/Wizard/DeckOrderTask.cs
Normal file
38
SVSim.BattleEngine/Engine/Wizard/DeckOrderTask.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckOrderTask : BaseTask
|
||||
{
|
||||
public class DeckOrderTaskParam : BaseParam
|
||||
{
|
||||
public int[] deck_order;
|
||||
|
||||
public int deck_format;
|
||||
}
|
||||
|
||||
private Format _updateDeckFormat;
|
||||
|
||||
public DeckOrderTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckOrder;
|
||||
}
|
||||
|
||||
public void SetParameter(int[] deck_order, Format format)
|
||||
{
|
||||
DeckOrderTaskParam deckOrderTaskParam = new DeckOrderTaskParam();
|
||||
deckOrderTaskParam.deck_order = deck_order;
|
||||
deckOrderTaskParam.deck_format = Data.FormatConvertApi(format);
|
||||
_updateDeckFormat = format;
|
||||
base.Params = deckOrderTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
DeckListUtility.ParseDeckInfoResponceData(base.ResponseData["data"], _updateDeckFormat);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckRandomLeaderSkinUpdateTask : BaseTask
|
||||
{
|
||||
private class DeckRandomLeaderSkinUpdateParam : BaseParam
|
||||
{
|
||||
public int deck_format;
|
||||
|
||||
public int deck_no;
|
||||
|
||||
public int[] leader_skin_id_list;
|
||||
}
|
||||
|
||||
private Format _updateDeckFormat;
|
||||
|
||||
public int SelectedSkinId { get; private set; }
|
||||
|
||||
public DeckRandomLeaderSkinUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckRandomLeaderSkinUpdate;
|
||||
}
|
||||
|
||||
public void SetParameter(Format format, int deckNo, int[] leaderSkinIdList)
|
||||
{
|
||||
DeckRandomLeaderSkinUpdateParam deckRandomLeaderSkinUpdateParam = new DeckRandomLeaderSkinUpdateParam();
|
||||
deckRandomLeaderSkinUpdateParam.deck_format = Data.FormatConvertApi(format);
|
||||
deckRandomLeaderSkinUpdateParam.deck_no = deckNo;
|
||||
deckRandomLeaderSkinUpdateParam.leader_skin_id_list = leaderSkinIdList;
|
||||
base.Params = deckRandomLeaderSkinUpdateParam;
|
||||
_updateDeckFormat = format;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["user_deck"];
|
||||
DeckListUtility.DeckUpdate(jsonData, _updateDeckFormat, DeckAttributeType.CustomDeck);
|
||||
SelectedSkinId = jsonData["leader_skin_id"].ToInt();
|
||||
return num;
|
||||
}
|
||||
}
|
||||
41
SVSim.BattleEngine/Engine/Wizard/DeckUpdateSleeveTask.cs
Normal file
41
SVSim.BattleEngine/Engine/Wizard/DeckUpdateSleeveTask.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class DeckUpdateSleeveTask : BaseTask
|
||||
{
|
||||
public class SleeveSetTaskParam : BaseParam
|
||||
{
|
||||
public int deck_no;
|
||||
|
||||
public long sleeve_id;
|
||||
|
||||
public int deck_format;
|
||||
}
|
||||
|
||||
private Format _updateDeckFormat;
|
||||
|
||||
public DeckUpdateSleeveTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeckUpdateSleeve;
|
||||
}
|
||||
|
||||
public void SetParameter(int deck_no, long sleeve_id, Format format)
|
||||
{
|
||||
SleeveSetTaskParam sleeveSetTaskParam = new SleeveSetTaskParam();
|
||||
sleeveSetTaskParam.deck_no = deck_no;
|
||||
sleeveSetTaskParam.sleeve_id = sleeve_id;
|
||||
sleeveSetTaskParam.deck_format = Data.FormatConvertApi(format);
|
||||
base.Params = sleeveSetTaskParam;
|
||||
_updateDeckFormat = format;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
DeckListUtility.DeckUpdate(base.ResponseData["data"]["user_deck"], _updateDeckFormat, DeckAttributeType.CustomDeck);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
9
SVSim.BattleEngine/Engine/Wizard/DeleteUserDataTask.cs
Normal file
9
SVSim.BattleEngine/Engine/Wizard/DeleteUserDataTask.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class DeleteUserDataTask : BaseTask
|
||||
{
|
||||
public DeleteUserDataTask()
|
||||
{
|
||||
base.type = ApiType.Type.DeleteUserData;
|
||||
}
|
||||
}
|
||||
100
SVSim.BattleEngine/Engine/Wizard/Gathering.cs
Normal file
100
SVSim.BattleEngine/Engine/Wizard/Gathering.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class Gathering : UIBase
|
||||
{
|
||||
[SerializeField]
|
||||
private GatheringEntry _entryRoot;
|
||||
|
||||
[SerializeField]
|
||||
private GatheringJoining _joiningRoot;
|
||||
|
||||
public override void onFirstStart()
|
||||
{
|
||||
_entryRoot.InitializeUI();
|
||||
_joiningRoot.InitializeUI();
|
||||
_entryRoot.gameObject.SetActive(value: false);
|
||||
_joiningRoot.gameObject.SetActive(value: false);
|
||||
base.IsShowFooterMenu = true;
|
||||
base.onFirstStart();
|
||||
Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification = false;
|
||||
if (Data.MyPage.data != null)
|
||||
{
|
||||
UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon();
|
||||
}
|
||||
GatheringGetSelfInfoTask task = new GatheringGetSelfInfoTask(isDependGatheringInfo: false);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
Initialize(task);
|
||||
}));
|
||||
}
|
||||
|
||||
private UIManager.ChangeViewSceneParam CreateBackButtonParam()
|
||||
{
|
||||
return new UIManager.ChangeViewSceneParam
|
||||
{
|
||||
MyPageMenuIndex = 3,
|
||||
OnFinishChangeView = delegate
|
||||
{
|
||||
MyPageMenu.Instance.GoToGatheringActionMenu();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static void BackToMyPageForDrop()
|
||||
{
|
||||
UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam();
|
||||
changeViewSceneParam.MyPageMenuIndex = 3;
|
||||
changeViewSceneParam.OnFinishChangeView = delegate
|
||||
{
|
||||
MyPageMenu.Instance.GoToGatheringActionMenu();
|
||||
};
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam);
|
||||
}
|
||||
|
||||
private void Initialize(GatheringGetSelfInfoTask task)
|
||||
{
|
||||
GatheringInfo info = task.Info;
|
||||
string titleMsg;
|
||||
if (info.Role == GatheringRule.eRole.NONE)
|
||||
{
|
||||
_entryRoot.Initialize(task);
|
||||
titleMsg = Data.SystemText.Get("Gathering_0002");
|
||||
}
|
||||
else
|
||||
{
|
||||
_joiningRoot.Initialize();
|
||||
titleMsg = Data.SystemText.Get("Gathering_0034");
|
||||
}
|
||||
_entryRoot.gameObject.SetActive(info.Role == GatheringRule.eRole.NONE);
|
||||
_joiningRoot.gameObject.SetActive(info.Role != GatheringRule.eRole.NONE);
|
||||
_joiningRoot.OnReceiveSelfInfo(info);
|
||||
UIManager.GetInstance().CreateTopBar(base.gameObject, titleMsg, UIManager.ViewScene.MyPage, MoneyDraw: true, CreateBackButtonParam()).gameObject.layer = LayerMask.NameToLayer("MyPage");
|
||||
StartCoroutine(WaitForCommonBackGround(delegate
|
||||
{
|
||||
UIManager.GetInstance().OnReadyViewScene(isFadein: true);
|
||||
}));
|
||||
}
|
||||
|
||||
private IEnumerator WaitForCommonBackGround(Action onComplete)
|
||||
{
|
||||
while (!CommonBackGround.Instance.IsFinishLod)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
while (!CommonBackGround.Instance.IsFinishEffectLoading())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
onComplete?.Invoke();
|
||||
}
|
||||
|
||||
public override bool IsUseCommonBackground()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
18
SVSim.BattleEngine/Engine/Wizard/GatheringChatApiSettings.cs
Normal file
18
SVSim.BattleEngine/Engine/Wizard/GatheringChatApiSettings.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringChatApiSettings : IChatApiSettings
|
||||
{
|
||||
public ApiType.Type ApiChatMessages => ApiType.Type.GatheringChatMessages;
|
||||
|
||||
public ApiType.Type ApiChatPost => ApiType.Type.GatheringChatPost;
|
||||
|
||||
public ApiType.Type ApiChatAddReplay => ApiType.Type.GatheringChatAddReplay;
|
||||
|
||||
public ApiType.Type ApiChatReplayDetail => ApiType.Type.GatheringChatReplayDetail;
|
||||
|
||||
public ApiType.Type ApiChatAddDeck => ApiType.Type.GatheringChatAddDeck;
|
||||
|
||||
public ApiType.Type ApiChatDeleteDeck => ApiType.Type.GatheringChatDeleteDeck;
|
||||
|
||||
public ApiType.Type ApiChatDeckLog => ApiType.Type.GatheringChatDeckLog;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringConfirmDeckListTask : BaseTask
|
||||
{
|
||||
public Format DeckFormat { get; private set; }
|
||||
|
||||
public List<DeckGroup> DeckGroupList { get; private set; }
|
||||
|
||||
public DeckGroupListData DeckGroupListData { get; private set; }
|
||||
|
||||
public GatheringConfirmDeckListTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringConfirmDeckList;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(jsonData["maintenance_card_list"]);
|
||||
DeckFormat = Data.ParseApiFormat(jsonData["deck_format"].ToInt());
|
||||
DeckGroupList = new List<DeckGroup>();
|
||||
DeckGroupList.Add(DeckListUtility.CreateDeckGroup(jsonData["deck_list"], DeckFormat, DeckAttributeType.CustomDeck));
|
||||
DeckGroupListData = new DeckGroupListData(DeckGroupList);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
123
SVSim.BattleEngine/Engine/Wizard/GatheringEntry.cs
Normal file
123
SVSim.BattleEngine/Engine/Wizard/GatheringEntry.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringEntry : MonoBehaviour
|
||||
{
|
||||
private enum ViewMode
|
||||
{
|
||||
ID_INPUT,
|
||||
INVITE
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _idInputPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _entryConfirmPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _receiveInviteListPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _changeViewIdInputButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _changeViewInviteButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _activeTabSprite;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _inviteBadge;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel[] _categoryLabel;
|
||||
|
||||
private GatheringIDInput _input;
|
||||
|
||||
private GatheringEntryConfirm _entryConfirm;
|
||||
|
||||
private GatheringReceiveInviteList _receiveInviteList;
|
||||
|
||||
public void InitializeUI()
|
||||
{
|
||||
_input = NGUITools.AddChild(base.gameObject, _idInputPrefab).GetComponent<GatheringIDInput>();
|
||||
}
|
||||
|
||||
public void Initialize(GatheringGetSelfInfoTask task)
|
||||
{
|
||||
_input.OnGetInfo = OnGetEntryGetheringInfo;
|
||||
_changeViewIdInputButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickShowIdInputButton();
|
||||
}));
|
||||
_changeViewInviteButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickInviteButton();
|
||||
}));
|
||||
_inviteBadge.SetActive(task.HasInvite);
|
||||
SetViewMode(ViewMode.ID_INPUT);
|
||||
}
|
||||
|
||||
private void OnGetEntryGetheringInfo(GatheringGetInfoTask task)
|
||||
{
|
||||
GameObject gameObject = Object.Instantiate(_entryConfirmPrefab);
|
||||
_entryConfirm = gameObject.GetComponent<GatheringEntryConfirm>();
|
||||
_entryConfirm.StartConfirm(task);
|
||||
}
|
||||
|
||||
private void OnClickShowIdInputButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetViewMode(ViewMode.ID_INPUT);
|
||||
}
|
||||
|
||||
private void OnClickInviteButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetViewMode(ViewMode.INVITE);
|
||||
}
|
||||
|
||||
private void SetViewMode(ViewMode mode)
|
||||
{
|
||||
if (_receiveInviteList != null)
|
||||
{
|
||||
Object.Destroy(_receiveInviteList.gameObject);
|
||||
}
|
||||
_input.gameObject.SetActive(mode == ViewMode.ID_INPUT);
|
||||
switch (mode)
|
||||
{
|
||||
case ViewMode.ID_INPUT:
|
||||
_activeTabSprite.transform.parent = _changeViewIdInputButton.transform;
|
||||
break;
|
||||
case ViewMode.INVITE:
|
||||
_activeTabSprite.transform.parent = _changeViewInviteButton.transform;
|
||||
_receiveInviteList = NGUITools.AddChild(base.gameObject, _receiveInviteListPrefab).GetComponent<GatheringReceiveInviteList>();
|
||||
_receiveInviteList.Show(this);
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < _categoryLabel.Length; i++)
|
||||
{
|
||||
if (i == (int)mode)
|
||||
{
|
||||
_categoryLabel[i].color = LabelDefine.TEXT_COLOR_NORMAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
_categoryLabel[i].color = LabelDefine.TEXT_COLOR_B0B0B0;
|
||||
}
|
||||
}
|
||||
_activeTabSprite.transform.localPosition = Vector3.zero;
|
||||
}
|
||||
|
||||
public void ReOpenInvite()
|
||||
{
|
||||
SetViewMode(ViewMode.INVITE);
|
||||
}
|
||||
|
||||
public void UpdateInviteBadge(GatheringGetReceiveInviteTask task)
|
||||
{
|
||||
_inviteBadge.SetActive(task.InviteList.Count > 0);
|
||||
}
|
||||
}
|
||||
107
SVSim.BattleEngine/Engine/Wizard/GatheringEntryConfirm.cs
Normal file
107
SVSim.BattleEngine/Engine/Wizard/GatheringEntryConfirm.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.RoomMatch;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringEntryConfirm : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GatheringRuleView _ruleView;
|
||||
|
||||
[SerializeField]
|
||||
private UserPlateBase _ownerPlate;
|
||||
|
||||
private List<string> _loadedResourceList = new List<string>();
|
||||
|
||||
private GatheringInfo _info;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (_loadedResourceList.Count > 0)
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList);
|
||||
_loadedResourceList.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void StartConfirm(GatheringGetInfoTask task)
|
||||
{
|
||||
base.gameObject.SetActive(value: false);
|
||||
_info = task.Info;
|
||||
GatheringUserInfo ownerInfo = _info.OwnerInfo;
|
||||
_loadedResourceList.AddRange(ownerInfo.GetUserAssetPathList());
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadedResourceList, delegate
|
||||
{
|
||||
base.gameObject.SetActive(value: true);
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
_ruleView.SetGatheringInfo(task.Info);
|
||||
dialogBase.SetObj(base.gameObject);
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(Data.SystemText.Get("Gathering_Join_0003"));
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_Menu_0002"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
OnClickEntryButton();
|
||||
};
|
||||
_ownerPlate.InitializeSimplePlate(ownerInfo);
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnClickEntryButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
if (_info.Rule.IsEntryDeckOnly)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_0025"));
|
||||
dialogBase.SetText(Data.SystemText.Get("Gathering_Join_0007"));
|
||||
dialogBase.SetButtonText(Data.SystemText.Get("Gathering_0022"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
ShowDeckListDialog(_info);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
GatheringEntryTask gatheringEntryTask = new GatheringEntryTask();
|
||||
gatheringEntryTask.SetParameter(_info.Id, null);
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(gatheringEntryTask, delegate
|
||||
{
|
||||
OnSuccessEntry();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShowDeckListDialog(GatheringInfo info)
|
||||
{
|
||||
string deckListHeader = Data.SystemText.Get("Gathering_0026");
|
||||
MultiDeckSelectDialog.Create(RoomConnectController.RuleSelectDeckCount(info.Rule.BattleParameterInstance.Rule), info.Rule.BattleParameterInstance.DeckFormat, deckListHeader).OnDecide = delegate(List<DeckData> deckList)
|
||||
{
|
||||
EntryGathering(deckList, info);
|
||||
};
|
||||
}
|
||||
|
||||
public static void EntryGathering(List<DeckData> deckList, GatheringInfo info)
|
||||
{
|
||||
GatheringEntryTask gatheringEntryTask = new GatheringEntryTask();
|
||||
gatheringEntryTask.SetParameter(info.Id, deckList);
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(gatheringEntryTask, delegate
|
||||
{
|
||||
OnSuccessEntry();
|
||||
}));
|
||||
}
|
||||
|
||||
public static void OnSuccessEntry()
|
||||
{
|
||||
GatheringChat.ResetLatestReadChatMessageId();
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering);
|
||||
}
|
||||
}
|
||||
46
SVSim.BattleEngine/Engine/Wizard/GatheringFriendListTask.cs
Normal file
46
SVSim.BattleEngine/Engine/Wizard/GatheringFriendListTask.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringFriendListTask : BaseTask
|
||||
{
|
||||
public class InviteFriendData : GatheringUserInfo
|
||||
{
|
||||
public bool IsJoinGathering { get; private set; }
|
||||
|
||||
public bool IsInvited { get; private set; }
|
||||
|
||||
public InviteFriendData(JsonData data, bool isJoinedGuild, bool isInvited)
|
||||
: base(data)
|
||||
{
|
||||
IsJoinGathering = isJoinedGuild;
|
||||
IsInvited = isInvited;
|
||||
}
|
||||
}
|
||||
|
||||
public List<InviteFriendData> InviteFriendList { get; private set; }
|
||||
|
||||
public GatheringFriendListTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringFriendList;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
InviteFriendList = new List<InviteFriendData>();
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
JsonData jsonData2 = jsonData[i];
|
||||
InviteFriendData item = new InviteFriendData(jsonData2, jsonData2["is_join_gathering"].ToBoolean(), jsonData2["is_invited"].ToBoolean());
|
||||
InviteFriendList.Add(item);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
34
SVSim.BattleEngine/Engine/Wizard/GatheringGetInfoTask.cs
Normal file
34
SVSim.BattleEngine/Engine/Wizard/GatheringGetInfoTask.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringGetInfoTask : BaseTask
|
||||
{
|
||||
public class GatheringGetInfoTaskParam : BaseParam
|
||||
{
|
||||
public string gathering_id;
|
||||
}
|
||||
|
||||
public GatheringInfo Info { get; private set; }
|
||||
|
||||
public GatheringGetInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringGetInfo;
|
||||
}
|
||||
|
||||
public void SetParameter(string id)
|
||||
{
|
||||
GatheringGetInfoTaskParam gatheringGetInfoTaskParam = new GatheringGetInfoTaskParam();
|
||||
gatheringGetInfoTaskParam.gathering_id = id;
|
||||
base.Params = gatheringGetInfoTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Info = new GatheringInfo(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringGetReceiveInviteTask : BaseTask
|
||||
{
|
||||
public class UserInfo
|
||||
{
|
||||
public GatheringUserInfo GatherintUserInfo { get; private set; }
|
||||
|
||||
public string GatheringId { get; private set; }
|
||||
|
||||
public string InviteId { get; private set; }
|
||||
|
||||
public UserInfo(JsonData data)
|
||||
{
|
||||
JsonData jsonData = data["gathering"];
|
||||
InviteId = data["id"].ToString();
|
||||
GatheringId = jsonData["id"].ToString();
|
||||
GatherintUserInfo = new GatheringUserInfo(jsonData["master_user"]);
|
||||
}
|
||||
}
|
||||
|
||||
public List<UserInfo> InviteList { get; private set; }
|
||||
|
||||
public GatheringGetReceiveInviteTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringGetReceiveInvite;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
InviteList = new List<UserInfo>();
|
||||
JsonData jsonData = base.ResponseData["data"]["invite_list"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
InviteList.Add(new UserInfo(jsonData[i]));
|
||||
}
|
||||
Data.MyPageNotifications.data.IsInviteGathering = InviteList.Count > 0;
|
||||
return num;
|
||||
}
|
||||
}
|
||||
50
SVSim.BattleEngine/Engine/Wizard/GatheringGetSelfInfoTask.cs
Normal file
50
SVSim.BattleEngine/Engine/Wizard/GatheringGetSelfInfoTask.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringGetSelfInfoTask : BaseTask
|
||||
{
|
||||
public GatheringInfo Info { get; private set; }
|
||||
|
||||
public bool HasInvite { get; private set; }
|
||||
|
||||
public GatheringEntrySetting EntrySetting { get; private set; }
|
||||
|
||||
public List<int> ChatStampList { get; private set; } = new List<int>();
|
||||
|
||||
public string _hashTags { get; private set; }
|
||||
|
||||
public GatheringGetSelfInfoTask(bool isDependGatheringInfo)
|
||||
{
|
||||
base.type = (isDependGatheringInfo ? ApiType.Type.GatheringInfoDependJoin : ApiType.Type.GatheringSelfInfo);
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
if (jsonData.Keys.Contains("has_invite"))
|
||||
{
|
||||
HasInvite = jsonData["has_invite"].ToInt() != 0;
|
||||
}
|
||||
if (jsonData.Count == 0 || !jsonData.Keys.Contains("gathering"))
|
||||
{
|
||||
Info = new GatheringInfo();
|
||||
return num;
|
||||
}
|
||||
Info = new GatheringInfo(jsonData);
|
||||
EntrySetting = new GatheringEntrySetting(Info.Rule);
|
||||
JsonData jsonData2 = jsonData["usable_stamp_list"];
|
||||
for (int i = 0; i < jsonData2.Count; i++)
|
||||
{
|
||||
ChatStampList.Add(jsonData2[i].ToInt());
|
||||
}
|
||||
_hashTags = jsonData["hash_tag"].ToString();
|
||||
return num;
|
||||
}
|
||||
}
|
||||
71
SVSim.BattleEngine/Engine/Wizard/GatheringIDInput.cs
Normal file
71
SVSim.BattleEngine/Engine/Wizard/GatheringIDInput.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringIDInput : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIButton _searchButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _pasteButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIInputWizard _idInput;
|
||||
|
||||
public Action<GatheringGetInfoTask> OnGetInfo { get; set; }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_searchButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickSearchButton();
|
||||
}));
|
||||
_idInput.onChange.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnChangeInputId();
|
||||
}));
|
||||
_pasteButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
Paste();
|
||||
}));
|
||||
UIManager.SetObjectToGrey(_searchButton.gameObject, b: true);
|
||||
}
|
||||
|
||||
private void OnChangeInputId()
|
||||
{
|
||||
UIManager.SetObjectToGrey(_searchButton.gameObject, !UIUtil.IsValidIdDigits(_idInput.value, 6));
|
||||
}
|
||||
|
||||
private void OnClickSearchButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
GatheringGetInfoTask task = new GatheringGetInfoTask();
|
||||
task.SetParameter(_idInput.value);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
OnSuccessGetGatheringInfo(task);
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnSuccessGetGatheringInfo(GatheringGetInfoTask task)
|
||||
{
|
||||
OnGetInfo(task);
|
||||
}
|
||||
|
||||
private void Paste()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
string clipboard = ClipboardHelper.Clipboard;
|
||||
clipboard = Regex.Replace(clipboard, "[0-9]", (Match match) => ((char)(match.Value[0] - 65296 + 48)).ToString());
|
||||
clipboard = Regex.Replace(clipboard, "\\s", "");
|
||||
if (UIUtil.IsValidIdDigits(clipboard, 6))
|
||||
{
|
||||
_idInput.value = clipboard;
|
||||
OnChangeInputId();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringInterruptTask : BaseTask
|
||||
{
|
||||
public GatheringInterruptTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringInterrupt;
|
||||
}
|
||||
}
|
||||
276
SVSim.BattleEngine/Engine/Wizard/GatheringInvite.cs
Normal file
276
SVSim.BattleEngine/Engine/Wizard/GatheringInvite.cs
Normal file
@@ -0,0 +1,276 @@
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.RoomMatch;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringInvite : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIButton _userIdSearchButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _friendInviteButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _idInputDialogPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _userDataDialogPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _friendListDialogPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UserListView _friendViewOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _inviteNoneRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _twitterButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _twitterButtonText;
|
||||
|
||||
private GatheringInviteUserListTask _inviteUserListTask;
|
||||
|
||||
private GatheringJoining _parent;
|
||||
|
||||
private GatheringGetSelfInfoTask _selfInfoTask;
|
||||
|
||||
private const int ID_INPUT_PANEL_DEPTH = 19;
|
||||
|
||||
private const int FRIEND_SELECT_PANEL_DEPTH = 30;
|
||||
|
||||
private const int FRIEND_INVITE_CONFIRM_PANEL_DEPTH = 30;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_userIdSearchButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickUserIdSearch();
|
||||
}));
|
||||
_friendInviteButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickFriendInviteButton();
|
||||
}));
|
||||
_twitterButtonText.text = Data.SystemText.Get("RoomBattle_0185");
|
||||
_twitterButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
CopyInviteText();
|
||||
}));
|
||||
}
|
||||
|
||||
public void Show(GatheringJoining parent)
|
||||
{
|
||||
_parent = parent;
|
||||
_selfInfoTask = new GatheringGetSelfInfoTask(isDependGatheringInfo: true);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(_selfInfoTask, delegate
|
||||
{
|
||||
if (!parent.CheckChangeStatus(_selfInfoTask.Info))
|
||||
{
|
||||
GatheringInviteUserListTask inviteListTask = new GatheringInviteUserListTask();
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(inviteListTask, delegate
|
||||
{
|
||||
OnReceiveInviteList(inviteListTask);
|
||||
}));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnReceiveInviteList(GatheringInviteUserListTask task)
|
||||
{
|
||||
_inviteUserListTask = task;
|
||||
_inviteNoneRoot.SetActive(task.InviteUserInfoList.Count == 0);
|
||||
string actionButtonLabel = Data.SystemText.Get("Guild_List_0014");
|
||||
List<UserInfoBase> list = new List<UserInfoBase>();
|
||||
foreach (GatheringInviteUserListTask.InviteUserInfo inviteUserInfo in task.InviteUserInfoList)
|
||||
{
|
||||
list.Add(inviteUserInfo.userInfo);
|
||||
}
|
||||
UserListView.CreateView(_friendViewOriginal.gameObject, base.gameObject, list, OnClickInviteCancel, actionButtonLabel);
|
||||
}
|
||||
|
||||
private void OnClickInviteCancel(UserInfoBase userInfo)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SystemText systemText = Data.SystemText;
|
||||
UserDataDialog userDataDialog = UserDataDialog.Create(_userDataDialogPrefab, userInfo, systemText.Get("Gathering_Invite_0002"));
|
||||
DialogBase dialog = userDataDialog.Dialog;
|
||||
userDataDialog.SetDiscriptionLabel(systemText.Get("Guild_List_0015"));
|
||||
dialog.SetButtonText(systemText.Get("Guild_List_0016"));
|
||||
dialog.SetPanelDepth(30);
|
||||
dialog.onPushButton1 = delegate
|
||||
{
|
||||
InviteCancel(userInfo as GatheringUserInfo);
|
||||
};
|
||||
}
|
||||
|
||||
private void InviteCancel(GatheringUserInfo userInfo)
|
||||
{
|
||||
GatheringInviteCancelTask gatheringInviteCancelTask = new GatheringInviteCancelTask();
|
||||
gatheringInviteCancelTask.SetParameter(_inviteUserListTask.GetInviteIdFromViewerId(userInfo.ViewerId));
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(gatheringInviteCancelTask, delegate
|
||||
{
|
||||
_parent.ReOpenCurrentCategory();
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnClickFriendInviteButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
GatheringFriendListTask task = new GatheringFriendListTask();
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
OnReceiveFriendList(task);
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnReceiveFriendList(GatheringFriendListTask task)
|
||||
{
|
||||
if (task.InviteFriendList.Count <= 0)
|
||||
{
|
||||
ShowNoFriendDialog();
|
||||
return;
|
||||
}
|
||||
List<UserInfoBase> list = new List<UserInfoBase>();
|
||||
foreach (GatheringFriendListTask.InviteFriendData inviteFriend in task.InviteFriendList)
|
||||
{
|
||||
list.Add(inviteFriend);
|
||||
}
|
||||
string actionButtonLabel = Data.SystemText.Get("Guild_List_0007");
|
||||
UserListView friendList = UserListView.CreateDialog(_friendListDialogPrefab, list, OnSelectInviteFriend, actionButtonLabel);
|
||||
friendList.Dialog.SetPanelDepth(30);
|
||||
friendList.Dialog.SetTitleLabel(Data.SystemText.Get("Guild_List_0006"));
|
||||
friendList.PanelDepth = 31;
|
||||
friendList.PlateCustomize = FriendListePlateCustomize;
|
||||
friendList.OnSelect = delegate(UserInfoBase userInfo)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
OnSelectInviteFriend(userInfo);
|
||||
friendList.Dialog.Close();
|
||||
};
|
||||
}
|
||||
|
||||
private void FriendListePlateCustomize(UserListViewPlate friendListPlate, UserInfoBase userInfoBase)
|
||||
{
|
||||
GatheringFriendListTask.InviteFriendData inviteData = userInfoBase as GatheringFriendListTask.InviteFriendData;
|
||||
friendListPlate.gameObject.GetComponent<GatheringFriendInviteListPlate>().Initialize(inviteData);
|
||||
}
|
||||
|
||||
private void OnSelectInviteFriend(UserInfoBase userInfo)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
UserDataDialog userDataDialog = UserDataDialog.Create(_userDataDialogPrefab, userInfo, systemText.Get("Gathering_Invite_0002"));
|
||||
DialogBase dialog = userDataDialog.Dialog;
|
||||
userDataDialog.SetDiscriptionLabel(systemText.Get("Gathering_Invite_0003"));
|
||||
dialog.SetButtonText(Data.SystemText.Get("Guild_List_0011"));
|
||||
dialog.SetPanelDepth(30);
|
||||
dialog.onPushButton1 = delegate
|
||||
{
|
||||
Invite(userInfo as GatheringUserInfo);
|
||||
};
|
||||
}
|
||||
|
||||
private void ShowNoFriendDialog()
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetText(Data.SystemText.Get("Gathering_Invite_0005"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.SetSize(DialogBase.Size.S);
|
||||
}
|
||||
|
||||
private void OnClickUserIdSearch()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
GuildInputViewerIdDialog inputDialog = Object.Instantiate(_idInputDialogPrefab).GetComponent<GuildInputViewerIdDialog>();
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Guild_List_0002"));
|
||||
dialogBase.SetSize(DialogBase.Size.S);
|
||||
dialogBase.SetObj(inputDialog.gameObject);
|
||||
dialogBase.SetPanelDepth(19);
|
||||
inputDialog.InitializeDialog(dialogBase);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(Data.SystemText.Get("Guild_List_0005"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
FindViewerIdUser(inputDialog.InputValue);
|
||||
};
|
||||
}
|
||||
|
||||
private void FindViewerIdUser(int search_viewer_id)
|
||||
{
|
||||
FriendUserSearchTask friendUserSearchTask = new FriendUserSearchTask();
|
||||
friendUserSearchTask.SetParameter(search_viewer_id);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(friendUserSearchTask, delegate
|
||||
{
|
||||
GatheringUserInfo userInfo = new GatheringUserInfo(Data.SearchUserInfo.data.user);
|
||||
SystemText systemText = Data.SystemText;
|
||||
UserDataDialog userDataDialog = UserDataDialog.Create(_userDataDialogPrefab, userInfo, systemText.Get("Gathering_Invite_0002"));
|
||||
DialogBase dialog = userDataDialog.Dialog;
|
||||
userDataDialog.SetDiscriptionLabel(systemText.Get("Gathering_Invite_0003"));
|
||||
dialog.SetButtonText(Data.SystemText.Get("Guild_List_0011"));
|
||||
dialog.onPushButton1 = delegate
|
||||
{
|
||||
Invite(userInfo);
|
||||
};
|
||||
}));
|
||||
}
|
||||
|
||||
private void Invite(GatheringUserInfo user)
|
||||
{
|
||||
GatheringInviteTask gatheringInviteTask = new GatheringInviteTask();
|
||||
gatheringInviteTask.SetParameter(user.ViewerId.ToString());
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(gatheringInviteTask, delegate
|
||||
{
|
||||
OnSuccessInvite();
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnSuccessInvite()
|
||||
{
|
||||
UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Invite_0004")).OnClose = delegate
|
||||
{
|
||||
_parent.ReOpenCurrentCategory();
|
||||
};
|
||||
}
|
||||
|
||||
private void CopyInviteText()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
CreateDialog(Data.SystemText.Get("RoomBattle_0186"), Data.SystemText.Get("Gathering_0044"));
|
||||
NativePluginWrapper.SetStringToClipboard(GetTweetText());
|
||||
}
|
||||
|
||||
private string GetTweetText()
|
||||
{
|
||||
string hashTags = _selfInfoTask._hashTags;
|
||||
GatheringInfo info = _selfInfoTask.Info;
|
||||
string gatheringTypeString = GatheringUtility.GetGatheringTypeString(info);
|
||||
string text = GetFormatTexForHashTag(info.Rule.BattleParameterInstance.DeckFormat) + "/" + RoomRuleSetting.GetWinTypeString(info.Rule.BattleParameterInstance.Rule);
|
||||
return Data.SystemText.Get("Gathering_0043", hashTags, info.Id, gatheringTypeString, text, info.BattleStartTimeShort);
|
||||
}
|
||||
|
||||
private string GetFormatTexForHashTag(Format deckFormat)
|
||||
{
|
||||
return deckFormat switch
|
||||
{
|
||||
Format.Hof => Data.SystemText.Get("RoomBattle_0188"),
|
||||
Format.Windfall => Data.SystemText.Get("RoomBattle_0193"),
|
||||
Format.Crossover => Data.SystemText.Get("RoomBattle_0194"),
|
||||
Format.MyRotation => Data.SystemText.Get("RoomBattle_0205"),
|
||||
Format.Avatar => Data.SystemText.Get("RoomBattle_0208"),
|
||||
_ => FormatBehaviorManager.GetFormatName(deckFormat),
|
||||
};
|
||||
}
|
||||
|
||||
private void CreateDialog(string title, string msg)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetTitleLabel(title);
|
||||
dialogBase.SetText(msg);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringInviteUserListTask : BaseTask
|
||||
{
|
||||
public class InviteUserInfo
|
||||
{
|
||||
public string InviteId { get; private set; }
|
||||
|
||||
public GatheringUserInfo userInfo { get; private set; }
|
||||
|
||||
public InviteUserInfo(JsonData json)
|
||||
{
|
||||
InviteId = json["id"].ToString();
|
||||
userInfo = new GatheringUserInfo(json["user_info"]);
|
||||
}
|
||||
}
|
||||
|
||||
public class GatheringInviteUserListTaskParam : BaseParam
|
||||
{
|
||||
public int page;
|
||||
|
||||
public int oldest_time;
|
||||
}
|
||||
|
||||
private Dictionary<int, string> _inviteIdDictionary;
|
||||
|
||||
public List<InviteUserInfo> InviteUserInfoList { get; private set; }
|
||||
|
||||
public GatheringInviteUserListTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringInviteUserList;
|
||||
}
|
||||
|
||||
public void SetParameter()
|
||||
{
|
||||
GatheringInviteUserListTaskParam gatheringInviteUserListTaskParam = new GatheringInviteUserListTaskParam();
|
||||
gatheringInviteUserListTaskParam.page = 0;
|
||||
gatheringInviteUserListTaskParam.oldest_time = 0;
|
||||
base.Params = gatheringInviteUserListTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
_inviteIdDictionary = new Dictionary<int, string>();
|
||||
InviteUserInfoList = new List<InviteUserInfo>();
|
||||
JsonData jsonData = base.ResponseData["data"]["invite_list"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
InviteUserInfo inviteUserInfo = new InviteUserInfo(jsonData[i]);
|
||||
InviteUserInfoList.Add(inviteUserInfo);
|
||||
_inviteIdDictionary[inviteUserInfo.userInfo.ViewerId] = inviteUserInfo.InviteId;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public string GetInviteIdFromViewerId(int viewerId)
|
||||
{
|
||||
return _inviteIdDictionary[viewerId];
|
||||
}
|
||||
}
|
||||
148
SVSim.BattleEngine/Engine/Wizard/GatheringJoining.cs
Normal file
148
SVSim.BattleEngine/Engine/Wizard/GatheringJoining.cs
Normal file
@@ -0,0 +1,148 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringJoining : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _categorySelectPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _chatPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _infoPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _memberListPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _rankingPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _invitePrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _tournamentPrefab;
|
||||
|
||||
private GatheringChat _chat;
|
||||
|
||||
private GatheringJoiningCategorySelect _categorySelect;
|
||||
|
||||
private GatheringMemberList _memberList;
|
||||
|
||||
private GatheringInvite _invite;
|
||||
|
||||
private GatheringRanking _ranking;
|
||||
|
||||
private GatheringTournament _tournament;
|
||||
|
||||
private GatheringJoiningInfo _info;
|
||||
|
||||
private GatheringJoiningCategorySelect.Category _currentCategory;
|
||||
|
||||
private GatheringInfo _gatheringInfo;
|
||||
|
||||
public void InitializeUI()
|
||||
{
|
||||
_categorySelect = NGUITools.AddChild(base.gameObject, _categorySelectPrefab).GetComponent<GatheringJoiningCategorySelect>();
|
||||
_categorySelect.OnSelect = OnSelectCategory;
|
||||
_info = NGUITools.AddChild(base.gameObject, _infoPrefab).GetComponent<GatheringJoiningInfo>();
|
||||
_memberList = NGUITools.AddChild(base.gameObject, _memberListPrefab).GetComponent<GatheringMemberList>();
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
OnSelectCategory(GatheringJoiningCategorySelect.Category.CHAT);
|
||||
}
|
||||
|
||||
public void OnReceiveSelfInfo(GatheringInfo info)
|
||||
{
|
||||
_gatheringInfo = info;
|
||||
_categorySelect.OnReceiveSelfInfo(info);
|
||||
}
|
||||
|
||||
public bool CheckChangeStatus(GatheringInfo currentInfo)
|
||||
{
|
||||
if (_gatheringInfo.State == currentInfo.State)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
SystemText systemText = Data.SystemText;
|
||||
DialogBase dialogBase = null;
|
||||
dialogBase = ((currentInfo.State != GatheringInfo.eState.ACTIVE_BATTLE) ? UIManager.GetInstance().CreateConfirmationDialog(systemText.Get("Gathering_Chat_0010")) : UIManager.GetInstance().CreateConfirmationDialog(systemText.Get("Gathering_Chat_0009")));
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam
|
||||
{
|
||||
MyPageMenuIndex = 3,
|
||||
OnFinishChangeView = delegate
|
||||
{
|
||||
MyPageMenu.Instance.GoToGatheringActionMenu();
|
||||
}
|
||||
};
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, param);
|
||||
};
|
||||
dialogBase.SetPanelDepth(4000);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnSelectCategory(GatheringJoiningCategorySelect.Category category)
|
||||
{
|
||||
_currentCategory = category;
|
||||
if (_chat != null)
|
||||
{
|
||||
_chat.ReadyCloseCategory();
|
||||
_chat.CloseCategory();
|
||||
Object.Destroy(_chat.gameObject);
|
||||
}
|
||||
if (_memberList != null)
|
||||
{
|
||||
Object.Destroy(_memberList.gameObject);
|
||||
}
|
||||
if (_invite != null)
|
||||
{
|
||||
Object.Destroy(_invite.gameObject);
|
||||
}
|
||||
if (_ranking != null)
|
||||
{
|
||||
Object.Destroy(_ranking.gameObject);
|
||||
}
|
||||
if (_tournament != null)
|
||||
{
|
||||
Object.Destroy(_tournament.gameObject);
|
||||
}
|
||||
_info.gameObject.SetActive(category == GatheringJoiningCategorySelect.Category.INFO);
|
||||
switch (category)
|
||||
{
|
||||
case GatheringJoiningCategorySelect.Category.CHAT:
|
||||
_chat = NGUITools.AddChild(base.gameObject, _chatPrefab).GetComponent<GatheringChat>();
|
||||
_chat.OpenCategory();
|
||||
break;
|
||||
case GatheringJoiningCategorySelect.Category.INFO:
|
||||
_info.Show(this);
|
||||
break;
|
||||
case GatheringJoiningCategorySelect.Category.MEMBER_LIST:
|
||||
_memberList = NGUITools.AddChild(base.gameObject, _memberListPrefab).GetComponent<GatheringMemberList>();
|
||||
_memberList.Show(this);
|
||||
break;
|
||||
case GatheringJoiningCategorySelect.Category.INVITE:
|
||||
_invite = NGUITools.AddChild(base.gameObject, _invitePrefab).GetComponent<GatheringInvite>();
|
||||
_invite.Show(this);
|
||||
break;
|
||||
case GatheringJoiningCategorySelect.Category.RANKING:
|
||||
_ranking = NGUITools.AddChild(base.gameObject, _rankingPrefab).GetComponent<GatheringRanking>();
|
||||
_ranking.Show(_gatheringInfo, this);
|
||||
break;
|
||||
case GatheringJoiningCategorySelect.Category.TOURNAMENT:
|
||||
_tournament = NGUITools.AddChild(base.gameObject, _tournamentPrefab).GetComponent<GatheringTournament>();
|
||||
_tournament.Show(_gatheringInfo, this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void ReOpenCurrentCategory()
|
||||
{
|
||||
OnSelectCategory(_currentCategory);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringJoiningCategorySelect : MonoBehaviour
|
||||
{
|
||||
public enum Category
|
||||
{
|
||||
CHAT,
|
||||
INFO,
|
||||
MEMBER_LIST,
|
||||
INVITE,
|
||||
RANKING,
|
||||
TOURNAMENT
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _chatButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _infoButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _memberListButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _inviteButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _rankingButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _selectCursor;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _bottomSprite;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _bgSpriteInvite;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _bgSpriteMemberList;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _bgSpriteRanking;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel[] _categoryLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _grid;
|
||||
|
||||
public Action<Category> OnSelect;
|
||||
|
||||
private bool _isTournament;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_categoryLabel[0].color = LabelDefine.TEXT_COLOR_NORMAL;
|
||||
SetCursor(_chatButton);
|
||||
_chatButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetCursor(_chatButton);
|
||||
OnSelectCategory(Category.CHAT);
|
||||
}));
|
||||
_infoButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetCursor(_infoButton);
|
||||
OnSelectCategory(Category.INFO);
|
||||
}));
|
||||
_memberListButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetCursor(_memberListButton);
|
||||
OnSelectCategory(Category.MEMBER_LIST);
|
||||
}));
|
||||
_inviteButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetCursor(_inviteButton);
|
||||
OnSelectCategory(Category.INVITE);
|
||||
}));
|
||||
_rankingButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetCursor(_rankingButton);
|
||||
Category category = (_isTournament ? Category.TOURNAMENT : Category.RANKING);
|
||||
OnSelectCategory(category);
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnSelectCategory(Category category)
|
||||
{
|
||||
int num = (int)((category == Category.TOURNAMENT) ? Category.RANKING : category);
|
||||
for (int i = 0; i < _categoryLabel.Length; i++)
|
||||
{
|
||||
if (i == num)
|
||||
{
|
||||
_categoryLabel[i].color = LabelDefine.TEXT_COLOR_NORMAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
_categoryLabel[i].color = LabelDefine.TEXT_COLOR_B0B0B0;
|
||||
}
|
||||
}
|
||||
OnSelect.Call(category);
|
||||
}
|
||||
|
||||
private void SetCursor(UIButton parent)
|
||||
{
|
||||
_selectCursor.transform.parent = parent.transform;
|
||||
_selectCursor.transform.localPosition = Vector3.zero;
|
||||
}
|
||||
|
||||
public void OnReceiveSelfInfo(GatheringInfo info)
|
||||
{
|
||||
if (info.State == GatheringInfo.eState.BEFORE_BATTLE)
|
||||
{
|
||||
_inviteButton.gameObject.SetActive(info.Role == GatheringRule.eRole.OWNER);
|
||||
_rankingButton.gameObject.SetActive(value: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_inviteButton.gameObject.SetActive(value: false);
|
||||
_rankingButton.gameObject.SetActive(value: true);
|
||||
}
|
||||
_grid.Reposition();
|
||||
GameObject gameObject = null;
|
||||
gameObject = ((info.Role != GatheringRule.eRole.OWNER) ? ((info.State == GatheringInfo.eState.BEFORE_BATTLE) ? _bgSpriteMemberList : _bgSpriteRanking) : ((info.State == GatheringInfo.eState.BEFORE_BATTLE) ? _bgSpriteInvite : _bgSpriteRanking));
|
||||
_bottomSprite.topAnchor.target = gameObject.transform;
|
||||
_bottomSprite.bottomAnchor.target = gameObject.transform;
|
||||
_bottomSprite.ResetAnchors();
|
||||
_bottomSprite.UpdateAnchors();
|
||||
if (info.Rule != null)
|
||||
{
|
||||
_isTournament = info.Rule.Type == GatheringRule.eType.TOURNAMENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
134
SVSim.BattleEngine/Engine/Wizard/GatheringJoiningInfo.cs
Normal file
134
SVSim.BattleEngine/Engine/Wizard/GatheringJoiningInfo.cs
Normal file
@@ -0,0 +1,134 @@
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringJoiningInfo : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GatheringRuleView _ruleView;
|
||||
|
||||
[SerializeField]
|
||||
private GatheringRuleView _eliminationRuleView;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _root;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _boardText;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _editBoardButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _editBoardInputDialogPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _idCopyButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _settingButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _gatheringSettingDialogPrefab;
|
||||
|
||||
private GatheringGetSelfInfoTask _infoTask;
|
||||
|
||||
private GatheringJoining _parent;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_editBoardButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickEditBoardButton();
|
||||
}));
|
||||
_idCopyButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickIdCopyButton();
|
||||
}));
|
||||
_settingButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickSettingButton();
|
||||
}));
|
||||
}
|
||||
|
||||
public void Show(GatheringJoining parent)
|
||||
{
|
||||
_parent = parent;
|
||||
_root.SetActive(value: false);
|
||||
GatheringGetSelfInfoTask task = new GatheringGetSelfInfoTask(isDependGatheringInfo: true);
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
OnReceiveInfo(task);
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnReceiveInfo(GatheringGetSelfInfoTask task)
|
||||
{
|
||||
_parent.CheckChangeStatus(task.Info);
|
||||
_infoTask = task;
|
||||
bool isTournament = _infoTask.Info.Rule.IsTournament;
|
||||
_ruleView.gameObject.SetActive(!isTournament);
|
||||
_eliminationRuleView.gameObject.SetActive(isTournament);
|
||||
if (isTournament)
|
||||
{
|
||||
_eliminationRuleView.SetGatheringInfo(task.Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ruleView.SetGatheringInfo(task.Info);
|
||||
}
|
||||
_root.SetActive(value: true);
|
||||
_boardText.text = task.Info.Description;
|
||||
bool active = task.Info.Role == GatheringRule.eRole.OWNER;
|
||||
_editBoardButton.gameObject.SetActive(active);
|
||||
_settingButton.gameObject.SetActive(active);
|
||||
}
|
||||
|
||||
private void OnClickEditBoardButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
GuildInputDescriptionDialog input = Object.Instantiate(_editBoardInputDialogPrefab).GetComponent<GuildInputDescriptionDialog>();
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.S);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Guild_Profile_0007"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.DecisionBtn);
|
||||
dialogBase.SetObj(input.gameObject);
|
||||
input.InputValue = _infoTask.Info.Description;
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
UpdateBoardText(input.InputValue);
|
||||
};
|
||||
}
|
||||
|
||||
private void UpdateBoardText(string text)
|
||||
{
|
||||
GatheringUpdateDescriptionTask gatheringUpdateDescriptionTask = new GatheringUpdateDescriptionTask();
|
||||
gatheringUpdateDescriptionTask.SetParameter(text);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(gatheringUpdateDescriptionTask, delegate
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Guild_Profile_0010"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
_parent.ReOpenCurrentCategory();
|
||||
};
|
||||
dialogBase.onCloseWithoutSelect = delegate
|
||||
{
|
||||
_parent.ReOpenCurrentCategory();
|
||||
};
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnClickIdCopyButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
NativePluginWrapper.SetStringToClipboard(_infoTask.Info.Id);
|
||||
UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Information_0011"));
|
||||
}
|
||||
|
||||
private void OnClickSettingButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
GatheringSettingDialog.Create(_gatheringSettingDialogPrefab, _infoTask.Info);
|
||||
}
|
||||
}
|
||||
9
SVSim.BattleEngine/Engine/Wizard/GatheringLeaveTask.cs
Normal file
9
SVSim.BattleEngine/Engine/Wizard/GatheringLeaveTask.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringLeaveTask : BaseTask
|
||||
{
|
||||
public GatheringLeaveTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringLeave;
|
||||
}
|
||||
}
|
||||
204
SVSim.BattleEngine/Engine/Wizard/GatheringMemberList.cs
Normal file
204
SVSim.BattleEngine/Engine/Wizard/GatheringMemberList.cs
Normal file
@@ -0,0 +1,204 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringMemberList : MonoBehaviour
|
||||
{
|
||||
private List<string> _loadedResourceList = new List<string>();
|
||||
|
||||
[SerializeField]
|
||||
private SimpleScrollViewUI _memberListScrollView;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _userDataDialog;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _kickConfirmPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _memberCount;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _memberNoneObject;
|
||||
|
||||
private GatheringJoining _parent;
|
||||
|
||||
private GatheringGetSelfInfoTask _task;
|
||||
|
||||
public void Show(GatheringJoining parent)
|
||||
{
|
||||
_parent = parent;
|
||||
GatheringGetSelfInfoTask task = new GatheringGetSelfInfoTask(isDependGatheringInfo: true);
|
||||
_memberCount.gameObject.SetActive(value: false);
|
||||
_memberNoneObject.SetActive(value: false);
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
_memberCount.gameObject.SetActive(value: true);
|
||||
OnReceiveInfo(task);
|
||||
}));
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
if (_loadedResourceList.Count > 0)
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList);
|
||||
_loadedResourceList.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnReceiveInfo(GatheringGetSelfInfoTask task)
|
||||
{
|
||||
_parent.CheckChangeStatus(task.Info);
|
||||
_task = task;
|
||||
UpdateMemberList(task);
|
||||
GatheringInfo info = task.Info;
|
||||
_memberCount.text = Data.SystemText.Get("Guild_0005", info.CurrentMemberCount.ToString(), info.Rule.MaxMember.ToString());
|
||||
_memberNoneObject.SetActive(info.CurrentMemberCount == 0);
|
||||
}
|
||||
|
||||
private void UpdateMemberList(GatheringGetSelfInfoTask task)
|
||||
{
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
StartCoroutine(LoadImages(task, delegate
|
||||
{
|
||||
_memberListScrollView.CreateScrollView(task.Info.MemberList.Count, InitializePlate);
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}));
|
||||
}
|
||||
|
||||
private IEnumerator LoadImages(GatheringGetSelfInfoTask task, Action callBack = null)
|
||||
{
|
||||
List<GatheringUserInfo> memberList = task.Info.MemberList;
|
||||
List<string> list = new List<string>();
|
||||
for (int i = 0; i < memberList.Count; i++)
|
||||
{
|
||||
GatheringUserInfo gatheringUserInfo = memberList[i];
|
||||
list.AddRange(gatheringUserInfo.GetUserAssetPathList());
|
||||
}
|
||||
List<string> loadPathList = list.Distinct().Except(_loadedResourceList).ToList();
|
||||
if (loadPathList.Count > 0)
|
||||
{
|
||||
yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPathList, null));
|
||||
_loadedResourceList.AddRange(loadPathList);
|
||||
}
|
||||
callBack.Call();
|
||||
}
|
||||
|
||||
private void InitializePlate(int index, GameObject plate)
|
||||
{
|
||||
GatheringMemberPlate component = plate.GetComponent<GatheringMemberPlate>();
|
||||
component.Initialize(_task.Info, _task.Info.MemberList[index]);
|
||||
component.OnClickFriendRequest = OnClickFriendRequest;
|
||||
component.OnClickKick = OnClickKickButton;
|
||||
component.OnClickDropOut = OnClickDropOutButton;
|
||||
}
|
||||
|
||||
private DialogBase CreateMemberActionDialog(GatheringUserInfo member, string title, string discription, string decideText, Action onDecide)
|
||||
{
|
||||
GuildUserDataDialog component = UnityEngine.Object.Instantiate(_userDataDialog).GetComponent<GuildUserDataDialog>();
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.S);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetTitleLabel(title);
|
||||
dialogBase.SetObj(component.gameObject);
|
||||
component.SetUserData(member);
|
||||
component.SetDiscriptionLabel(discription);
|
||||
dialogBase.SetButtonText(decideText);
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
onDecide();
|
||||
};
|
||||
return dialogBase;
|
||||
}
|
||||
|
||||
private void OnClickFriendRequest(GatheringUserInfo member)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
Action onDecide = delegate
|
||||
{
|
||||
ApplyFriend(member.ViewerId);
|
||||
};
|
||||
SystemText systemText = Data.SystemText;
|
||||
string title = systemText.Get("Guild_Profile_0014");
|
||||
string discription = systemText.Get("Guild_Profile_0015");
|
||||
string decideText = systemText.Get("OtherFriend_0032");
|
||||
CreateMemberActionDialog(member, title, discription, decideText, onDecide);
|
||||
}
|
||||
|
||||
private void OnClickKickButton(GatheringUserInfo member)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
Action<bool> onKickDecide = delegate(bool kickEternal)
|
||||
{
|
||||
Kick(member, kickEternal);
|
||||
};
|
||||
GatheringKickConfirm.Create(_kickConfirmPrefab, member, onKickDecide);
|
||||
}
|
||||
|
||||
private void Kick(GatheringUserInfo member, bool kickEternal)
|
||||
{
|
||||
GatheringKickTask gatheringKickTask = new GatheringKickTask();
|
||||
gatheringKickTask.SetParameter(member.ViewerId.ToString(), kickEternal);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(gatheringKickTask, delegate
|
||||
{
|
||||
OnKickSuccess();
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnKickSuccess()
|
||||
{
|
||||
UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Member_0006")).OnCloseStart = delegate
|
||||
{
|
||||
_parent.ReOpenCurrentCategory();
|
||||
};
|
||||
}
|
||||
|
||||
private void OnClickDropOutButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SystemText systemText = Data.SystemText;
|
||||
string titleLabel = systemText.Get("Gathering_Member_0011");
|
||||
string message = systemText.Get("Gathering_Member_0008");
|
||||
string text_btn = systemText.Get("Gathering_Member_0009");
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(message);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(text_btn);
|
||||
dialogBase.SetTitleLabel(titleLabel);
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
DropOut();
|
||||
};
|
||||
}
|
||||
|
||||
private void DropOut()
|
||||
{
|
||||
GatheringLeaveTask task = new GatheringLeaveTask();
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
string message = Data.SystemText.Get("Gathering_Member_0010");
|
||||
UIManager.GetInstance().CreateConfirmationDialog(message).OnCloseStart = delegate
|
||||
{
|
||||
Gathering.BackToMyPageForDrop();
|
||||
};
|
||||
}));
|
||||
}
|
||||
|
||||
private void ApplyFriend(int viewerId)
|
||||
{
|
||||
FriendApplySendTask friendApplySendTask = new FriendApplySendTask();
|
||||
friendApplySendTask.SetParameter(viewerId);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(friendApplySendTask, OnSuccessApplyFriend));
|
||||
}
|
||||
|
||||
private void OnSuccessApplyFriend(NetworkTask.ResultCode code)
|
||||
{
|
||||
UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Guild_Profile_0016"));
|
||||
_parent.ReOpenCurrentCategory();
|
||||
}
|
||||
}
|
||||
100
SVSim.BattleEngine/Engine/Wizard/GatheringRanking.cs
Normal file
100
SVSim.BattleEngine/Engine/Wizard/GatheringRanking.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.RoomMatch;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringRanking : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _rankingPlateOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _grid;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollView _scrollView;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _rootObject;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _ruleLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _timeLabel;
|
||||
|
||||
private List<string> _loadedResourceList = new List<string>();
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_rankingPlateOriginal.SetActive(value: false);
|
||||
UIManager.GetInstance().AttachAtlas(base.gameObject);
|
||||
}
|
||||
|
||||
public void Show(GatheringInfo info, GatheringJoining parent)
|
||||
{
|
||||
GatheringRule rule = info.Rule;
|
||||
_rootObject.SetActive(value: false);
|
||||
GatheringGetSelfInfoTask selfInfoTask = new GatheringGetSelfInfoTask(isDependGatheringInfo: true);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(selfInfoTask, delegate
|
||||
{
|
||||
if (!parent.CheckChangeStatus(selfInfoTask.Info))
|
||||
{
|
||||
GatheringRankingTask task = new GatheringRankingTask();
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
_rootObject.SetActive(value: true);
|
||||
StartCoroutine(InitRanking(task));
|
||||
}));
|
||||
}
|
||||
_timeLabel.text = Data.SystemText.Get("Gathering_Information_0014", info.BattleStartTime, info.FinishTime);
|
||||
_ruleLabel.text = RoomRuleSetting.GetWinTypeString(rule.BattleParameterInstance.Rule) + " " + FormatBehaviorManager.GetFormatName(rule.BattleParameterInstance.DeckFormat);
|
||||
}));
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
if (_loadedResourceList.Count > 0)
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList);
|
||||
_loadedResourceList.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator LoadImages(GatheringRankingTask task)
|
||||
{
|
||||
List<GatheringUserInfo> list = new List<GatheringUserInfo>();
|
||||
foreach (GatheringRankingTask.RankingUserInfo ranking in task.RankingList)
|
||||
{
|
||||
list.Add(ranking.gatheringUserInfo);
|
||||
}
|
||||
List<string> list2 = new List<string>();
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
list2.AddRange(list[i].GetUserAssetPathList());
|
||||
}
|
||||
List<string> loadPathList = list2.Distinct().Except(_loadedResourceList).ToList();
|
||||
if (loadPathList.Count > 0)
|
||||
{
|
||||
yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPathList, null));
|
||||
_loadedResourceList.AddRange(loadPathList);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator InitRanking(GatheringRankingTask task)
|
||||
{
|
||||
yield return LoadImages(task);
|
||||
foreach (GatheringRankingTask.RankingUserInfo ranking in task.RankingList)
|
||||
{
|
||||
GatheringRankingPlate component = NGUITools.AddChild(_grid.gameObject, _rankingPlateOriginal).GetComponent<GatheringRankingPlate>();
|
||||
component.gameObject.SetActive(value: true);
|
||||
component.Initialize(ranking);
|
||||
}
|
||||
_grid.Reposition();
|
||||
_scrollView.ResetPosition();
|
||||
}
|
||||
}
|
||||
47
SVSim.BattleEngine/Engine/Wizard/GatheringRankingTask.cs
Normal file
47
SVSim.BattleEngine/Engine/Wizard/GatheringRankingTask.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringRankingTask : BaseTask
|
||||
{
|
||||
public class RankingUserInfo
|
||||
{
|
||||
public GatheringUserInfo gatheringUserInfo { get; private set; }
|
||||
|
||||
public int Order { get; private set; }
|
||||
|
||||
public int WinCount { get; private set; }
|
||||
|
||||
public RankingUserInfo(JsonData data)
|
||||
{
|
||||
gatheringUserInfo = new GatheringUserInfo(data["user"]);
|
||||
Order = data["rank"].ToInt();
|
||||
WinCount = data["score"].ToInt();
|
||||
}
|
||||
}
|
||||
|
||||
public List<RankingUserInfo> RankingList { get; private set; }
|
||||
|
||||
public GatheringRankingTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringRanking;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["ranking"];
|
||||
RankingList = new List<RankingUserInfo>();
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
RankingUserInfo item = new RankingUserInfo(jsonData[i]);
|
||||
RankingList.Add(item);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
126
SVSim.BattleEngine/Engine/Wizard/GatheringReceiveInviteList.cs
Normal file
126
SVSim.BattleEngine/Engine/Wizard/GatheringReceiveInviteList.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringReceiveInviteList : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private SimpleScrollViewUI _inviteListScrollView;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _infoDialogPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _inviteNoneRoot;
|
||||
|
||||
private List<string> _loadedResourceList = new List<string>();
|
||||
|
||||
private GatheringGetReceiveInviteTask _receiveInviteTask;
|
||||
|
||||
private GatheringEntry _parent;
|
||||
|
||||
public void Show(GatheringEntry parent)
|
||||
{
|
||||
_parent = parent;
|
||||
_receiveInviteTask = new GatheringGetReceiveInviteTask();
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(_receiveInviteTask, delegate
|
||||
{
|
||||
OnReceiveInfo(_receiveInviteTask);
|
||||
}));
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
if (_loadedResourceList.Count > 0)
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList);
|
||||
_loadedResourceList.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnReceiveInfo(GatheringGetReceiveInviteTask task)
|
||||
{
|
||||
_parent.UpdateInviteBadge(task);
|
||||
_inviteNoneRoot.SetActive(task.InviteList.Count == 0);
|
||||
UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon();
|
||||
UpdateInviteList(task);
|
||||
}
|
||||
|
||||
private void InitializePlate(int index, GameObject plate)
|
||||
{
|
||||
UserListViewPlate component = plate.GetComponent<UserListViewPlate>();
|
||||
component.Initialize(_receiveInviteTask.InviteList[index].GatherintUserInfo, Data.SystemText.Get("Gathering_Menu_0002"));
|
||||
component.OnAction = delegate
|
||||
{
|
||||
OnClickInviteGatheringInfoButton(_receiveInviteTask.InviteList[index]);
|
||||
};
|
||||
}
|
||||
|
||||
private void UpdateInviteList(GatheringGetReceiveInviteTask task)
|
||||
{
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
StartCoroutine(LoadImages(task, delegate
|
||||
{
|
||||
_inviteListScrollView.CreateScrollView(task.InviteList.Count, InitializePlate);
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}));
|
||||
}
|
||||
|
||||
private IEnumerator LoadImages(GatheringGetReceiveInviteTask task, Action callBack = null)
|
||||
{
|
||||
List<GatheringGetReceiveInviteTask.UserInfo> inviteList = task.InviteList;
|
||||
List<string> list = new List<string>();
|
||||
for (int i = 0; i < inviteList.Count; i++)
|
||||
{
|
||||
GatheringUserInfo gatherintUserInfo = inviteList[i].GatherintUserInfo;
|
||||
list.AddRange(gatherintUserInfo.GetUserAssetPathList());
|
||||
}
|
||||
List<string> loadPathList = list.Distinct().Except(_loadedResourceList).ToList();
|
||||
if (loadPathList.Count > 0)
|
||||
{
|
||||
yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPathList, null));
|
||||
_loadedResourceList.AddRange(loadPathList);
|
||||
}
|
||||
callBack.Call();
|
||||
}
|
||||
|
||||
private void OnClickInviteGatheringInfoButton(GatheringGetReceiveInviteTask.UserInfo userInfo)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
Action onReject = delegate
|
||||
{
|
||||
OnClickRejectInvite(userInfo);
|
||||
};
|
||||
GatheringReceiveInfoDialog.Create(_infoDialogPrefab, userInfo.GatheringId, onReject);
|
||||
}
|
||||
|
||||
private void OnClickRejectInvite(GatheringGetReceiveInviteTask.UserInfo userInfo)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Join_0005"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_Menu_0004"));
|
||||
dialogBase.SetButtonText(Data.SystemText.Get("Gathering_Join_0004"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
InviteReject(userInfo);
|
||||
};
|
||||
}
|
||||
|
||||
private void InviteReject(GatheringGetReceiveInviteTask.UserInfo userInfo)
|
||||
{
|
||||
GatheringInviteRejectTask gatheringInviteRejectTask = new GatheringInviteRejectTask();
|
||||
gatheringInviteRejectTask.SetParameter(userInfo.InviteId);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(gatheringInviteRejectTask, delegate
|
||||
{
|
||||
UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Join_0006")).OnClose = delegate
|
||||
{
|
||||
_parent.ReOpenInvite();
|
||||
};
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using Cute;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringRoomEnterVacancyRoomTask : BaseRoomBattleEnterRoomTask
|
||||
{
|
||||
private GatheringInfo _gatheringInfo;
|
||||
|
||||
public GatheringAutoJoinTaskInfo GatheringAutoJoinTaskInfo { get; private set; }
|
||||
|
||||
public GatheringRoomEnterVacancyRoomTask(GatheringInfo gatheringInfo)
|
||||
{
|
||||
_gatheringInfo = gatheringInfo;
|
||||
base.type = ApiType.Type.GatheringRoomEnterVacancyRoom;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
if (base.ResponseData.TryGetValue("data", out var value) && value.IsObject && value.TryGetValue("is_owner", out var value2) && value2.ToInt() != 0 && value.Keys.Contains("result_reason"))
|
||||
{
|
||||
value["result_reason"] = "-1";
|
||||
}
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
GatheringAutoJoinTaskInfo = new GatheringAutoJoinTaskInfo(base.ResponseData, this, _gatheringInfo);
|
||||
if (GatheringAutoJoinTaskInfo.NeedsRetry)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
if (GatheringAutoJoinTaskInfo.IsOwner)
|
||||
{
|
||||
CustomPreference.SetNodeServerURL(value["node_server_url"].ToString());
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
150
SVSim.BattleEngine/Engine/Wizard/GatheringRuleView.cs
Normal file
150
SVSim.BattleEngine/Engine/Wizard/GatheringRuleView.cs
Normal file
@@ -0,0 +1,150 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.RoomMatch;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringRuleView : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _baseType;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _baseRule;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _memberCount;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _ownerName;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _ownerIsEntryBattle;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _ownerWatchBattle;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _timeTitle;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _startTime;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _endTime;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _battlePeriodLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _battlePeriodLabelSingleLine;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _isDeckEntryLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _isDeckEntryRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _id;
|
||||
|
||||
[SerializeField]
|
||||
private UserPlateBase _ownerPlate;
|
||||
|
||||
private List<string> _loadResourcePath = new List<string>();
|
||||
|
||||
public void SetGatheringInfo(GatheringInfo info)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
SetRule(info.Rule, info.CurrentMemberCount);
|
||||
if (_baseType != null)
|
||||
{
|
||||
_baseType.text = GatheringUtility.GetGatheringTypeString(info);
|
||||
}
|
||||
if (_id != null)
|
||||
{
|
||||
_id.text = info.Id;
|
||||
}
|
||||
if (_ownerName != null)
|
||||
{
|
||||
_ownerName.text = info.OwnerInfo.Name;
|
||||
}
|
||||
if (_timeTitle != null)
|
||||
{
|
||||
_timeTitle.text = (info.Rule.IsTournament ? systemText.Get("Gathering_0009") : systemText.Get("Gathering_0012"));
|
||||
}
|
||||
if (_startTime != null)
|
||||
{
|
||||
_startTime.text = info.BattleStartTime;
|
||||
}
|
||||
if (_endTime != null)
|
||||
{
|
||||
_endTime.text = info.FinishTime;
|
||||
}
|
||||
if (_battlePeriodLabel != null && !info.Rule.IsTournament)
|
||||
{
|
||||
_battlePeriodLabel.text = systemText.Get("Gathering_Information_0005", info.BattleStartTime, info.FinishTime);
|
||||
}
|
||||
if (_battlePeriodLabelSingleLine != null && !info.Rule.IsTournament)
|
||||
{
|
||||
_battlePeriodLabelSingleLine.text = systemText.Get("Gathering_Information_0014", info.BattleStartTime, info.FinishTime);
|
||||
}
|
||||
if (_ownerWatchBattle != null)
|
||||
{
|
||||
switch (info.Rule.WatchSetting)
|
||||
{
|
||||
case GatheringRule.eWatchSetting.ALL_MEMBER:
|
||||
_ownerWatchBattle.text = systemText.Get("Gathering_0016");
|
||||
break;
|
||||
case GatheringRule.eWatchSetting.OWNER_ONLY:
|
||||
_ownerWatchBattle.text = systemText.Get("Gathering_0015");
|
||||
break;
|
||||
case GatheringRule.eWatchSetting.NONE:
|
||||
_ownerWatchBattle.text = systemText.Get("Gathering_0017");
|
||||
break;
|
||||
}
|
||||
}
|
||||
List<string> loadResourceList = info.OwnerInfo.GetUserAssetPathList().Except(_loadResourcePath).ToList();
|
||||
UIManager.GetInstance().StartCoroutine(LoadResource(info, loadResourceList));
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadResourcePath);
|
||||
_loadResourcePath.Clear();
|
||||
}
|
||||
|
||||
private IEnumerator LoadResource(GatheringInfo info, List<string> loadResourceList)
|
||||
{
|
||||
yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadResourceList, delegate
|
||||
{
|
||||
_loadResourcePath.AddRange(loadResourceList);
|
||||
}));
|
||||
if (_ownerPlate != null)
|
||||
{
|
||||
_ownerPlate.InitializeSimplePlate(info.OwnerInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetRule(GatheringRule rule, int memberCount)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
_baseRule.text = RoomRuleSetting.GetWinTypeString(rule.BattleParameterInstance.Rule) + " " + FormatBehaviorManager.GetFormatName(rule.BattleParameterInstance.DeckFormat);
|
||||
_memberCount.text = systemText.Get("Gathering_Information_0003", memberCount.ToString(), rule.MaxMember.ToString());
|
||||
if (_ownerIsEntryBattle != null)
|
||||
{
|
||||
_ownerIsEntryBattle.text = (rule.IsOwnerEntryBattle ? systemText.Get("Gathering_Information_0008") : systemText.Get("Gathering_Information_0009"));
|
||||
}
|
||||
if (_isDeckEntryRoot != null)
|
||||
{
|
||||
_isDeckEntryRoot.SetActive(!rule.IsTournament);
|
||||
}
|
||||
if (_isDeckEntryLabel != null)
|
||||
{
|
||||
_isDeckEntryLabel.text = (rule.IsEntryDeckOnly ? systemText.Get("Gathering_Information_0022") : systemText.Get("Gathering_Information_0023"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringStartTimeSelectDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UtilityDrumrollScroll _daySelectDrum;
|
||||
|
||||
[SerializeField]
|
||||
private UtilityDrumrollScroll _hourSelectDrum;
|
||||
|
||||
[SerializeField]
|
||||
private UtilityDrumrollScroll _minuteSelectDrum;
|
||||
|
||||
[SerializeField]
|
||||
private UtilityDrumrollScroll _amPmSelectDrum;
|
||||
|
||||
[SerializeField]
|
||||
private UIPanel[] _alphaAnimationPanel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _daySelectArrowUp;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _daySelectArrowDown;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _hourSelectArrowUp;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _hourSelectArrowDown;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _minuteSelectArrowUp;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _minuteSelectArrowDown;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _ampmSelectArrowUp;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _ampmSelectArrowDown;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _amPmSelectRoot;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _rootObject;
|
||||
|
||||
private DialogBase _parentDialog;
|
||||
|
||||
private List<DateTime> _dayList = new List<DateTime>();
|
||||
|
||||
private List<int> _hourList = new List<int>();
|
||||
|
||||
private List<int> _minuteList = new List<int>();
|
||||
|
||||
private DateTime _selectDay;
|
||||
|
||||
private int _selectHour;
|
||||
|
||||
private int _selectMinute;
|
||||
|
||||
private bool _isAm;
|
||||
|
||||
private readonly Vector3 ENG_ROOT_POSITION = new Vector3(-65f, 0f, 0f);
|
||||
|
||||
private const int DAY_SELECT_LIMIT = 5;
|
||||
|
||||
public const int MINUTE_SELECT_INTERVAL = 15;
|
||||
|
||||
public const int DEFAULT_START_TIME_MINUTE = 16;
|
||||
|
||||
private const int AM_INDEX = 0;
|
||||
|
||||
private const int PM_INDEX = 1;
|
||||
|
||||
private int SelectHour
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!IsEnableAmPmSelect)
|
||||
{
|
||||
return _selectHour;
|
||||
}
|
||||
if (_selectHour == 12)
|
||||
{
|
||||
if (!_isAm)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (_isAm)
|
||||
{
|
||||
return _selectHour;
|
||||
}
|
||||
return _selectHour + 12;
|
||||
}
|
||||
}
|
||||
|
||||
private DateTime SelectTime => new DateTime(_selectDay.Year, _selectDay.Month, _selectDay.Day, SelectHour, _selectMinute, 0);
|
||||
|
||||
private bool IsEnableAmPmSelect => CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Eng.ToString();
|
||||
|
||||
public static DialogBase Create(GameObject prefab, Action<DateTime> onDecide, DateTime defaultTime)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.SetPanelDepth(14);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("MyPage_0082"));
|
||||
GatheringStartTimeSelectDialog startDialog = UnityEngine.Object.Instantiate(prefab).GetComponent<GatheringStartTimeSelectDialog>();
|
||||
dialogBase.SetObj(startDialog.gameObject);
|
||||
startDialog.Initialize(defaultTime, dialogBase);
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
onDecide(startDialog.SelectTime);
|
||||
};
|
||||
return dialogBase;
|
||||
}
|
||||
|
||||
private void Initialize(DateTime defaultTime, DialogBase parent)
|
||||
{
|
||||
_parentDialog = parent;
|
||||
InitializeDaySelectDrum(defaultTime);
|
||||
InitializeHourSelectDrum(defaultTime);
|
||||
InitializeMinuteSelectDrum(defaultTime);
|
||||
if (IsEnableAmPmSelect)
|
||||
{
|
||||
_rootObject.transform.localPosition = ENG_ROOT_POSITION;
|
||||
InitializeAmPmSelectDrum();
|
||||
}
|
||||
_amPmSelectRoot.SetActive(IsEnableAmPmSelect);
|
||||
}
|
||||
|
||||
private void InitializeDaySelectDrum(DateTime defaultTime)
|
||||
{
|
||||
int num = 0;
|
||||
List<string> list = new List<string>();
|
||||
DateTime item = PlayerStaticData.UserTime.GetNowTime().AddMinutes(15.0);
|
||||
string text = Data.SystemText.Get("System_DateLong");
|
||||
CultureInfo cultureInfo = new CultureInfo(Data.SystemText.Get("System_CultureInfo"), useUserOverride: false);
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
int year = item.Year;
|
||||
int month = item.Month;
|
||||
int day = item.Day;
|
||||
if (year == defaultTime.Year && month == defaultTime.Month && day == defaultTime.Day)
|
||||
{
|
||||
num = i;
|
||||
}
|
||||
list.Add(item.ToString(text, cultureInfo));
|
||||
_dayList.Add(item);
|
||||
item = item.AddDays(1.0);
|
||||
}
|
||||
_selectDay = _dayList[num];
|
||||
DaySelectCallBack(num);
|
||||
StartCoroutine(_daySelectDrum.CreateDrumrollScroll_Coroutine(list, num, DaySelectCallBack));
|
||||
}
|
||||
|
||||
private void InitializeHourSelectDrum(DateTime defaultTime)
|
||||
{
|
||||
int num = 0;
|
||||
List<string> list = new List<string>();
|
||||
int num2 = 0;
|
||||
int num3 = 23;
|
||||
int num4 = defaultTime.Hour;
|
||||
if (IsEnableAmPmSelect)
|
||||
{
|
||||
num2 = 1;
|
||||
num3 = 12;
|
||||
_isAm = true;
|
||||
if (num4 == 0)
|
||||
{
|
||||
num4 = 12;
|
||||
}
|
||||
else if (num4 == 12)
|
||||
{
|
||||
_isAm = false;
|
||||
}
|
||||
else if (num4 > 12)
|
||||
{
|
||||
num4 -= 12;
|
||||
_isAm = false;
|
||||
}
|
||||
}
|
||||
for (int i = num2; i <= num3; i++)
|
||||
{
|
||||
list.Add(i.ToString("00"));
|
||||
if (i == num4)
|
||||
{
|
||||
num = i - num2;
|
||||
}
|
||||
_hourList.Add(i);
|
||||
}
|
||||
_selectHour = _hourList[num];
|
||||
HourSelectCallBack(num);
|
||||
StartCoroutine(_hourSelectDrum.CreateDrumrollScroll_Coroutine(list, num, HourSelectCallBack));
|
||||
}
|
||||
|
||||
private void InitializeMinuteSelectDrum(DateTime defaultTime)
|
||||
{
|
||||
int num = 0;
|
||||
List<string> list = new List<string>();
|
||||
for (int i = 0; i < 60; i += 15)
|
||||
{
|
||||
list.Add(i.ToString("00"));
|
||||
if (i == defaultTime.Minute)
|
||||
{
|
||||
num = i / 15;
|
||||
}
|
||||
_minuteList.Add(i);
|
||||
}
|
||||
_selectMinute = _minuteList[num];
|
||||
MinuteSelectCallback(num);
|
||||
StartCoroutine(_minuteSelectDrum.CreateDrumrollScroll_Coroutine(list, num, MinuteSelectCallback));
|
||||
}
|
||||
|
||||
private void DaySelectCallBack(int index)
|
||||
{
|
||||
_selectDay = _dayList[index];
|
||||
_daySelectArrowUp.SetActive(index > 0);
|
||||
_daySelectArrowDown.SetActive(index < _dayList.Count - 1);
|
||||
}
|
||||
|
||||
private void HourSelectCallBack(int index)
|
||||
{
|
||||
_selectHour = _hourList[index];
|
||||
_hourSelectArrowUp.SetActive(index > 0);
|
||||
_hourSelectArrowDown.SetActive(index < _hourList.Count - 1);
|
||||
}
|
||||
|
||||
private void MinuteSelectCallback(int index)
|
||||
{
|
||||
_selectMinute = _minuteList[index];
|
||||
_minuteSelectArrowUp.SetActive(index > 0);
|
||||
_minuteSelectArrowDown.SetActive(index < _minuteList.Count - 1);
|
||||
}
|
||||
|
||||
private void InitializeAmPmSelectDrum()
|
||||
{
|
||||
int num = ((!_isAm) ? 1 : 0);
|
||||
List<string> list = new List<string>();
|
||||
list.Add(Data.SystemText.Get("System_0059"));
|
||||
list.Add(Data.SystemText.Get("System_0060"));
|
||||
StartCoroutine(_amPmSelectDrum.CreateDrumrollScroll_Coroutine(list, num, AmPmSelectCallBack));
|
||||
AmPmSelectCallBack(num);
|
||||
}
|
||||
|
||||
private void AmPmSelectCallBack(int index)
|
||||
{
|
||||
_isAm = index == 0;
|
||||
_ampmSelectArrowUp.SetActive(index != 0);
|
||||
_ampmSelectArrowDown.SetActive(index == 0);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
float panelAlpha = _parentDialog.PanelAlpha;
|
||||
UIPanel[] alphaAnimationPanel = _alphaAnimationPanel;
|
||||
foreach (UIPanel uIPanel in alphaAnimationPanel)
|
||||
{
|
||||
if (uIPanel != null)
|
||||
{
|
||||
uIPanel.alpha = panelAlpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
228
SVSim.BattleEngine/Engine/Wizard/GatheringTournament.cs
Normal file
228
SVSim.BattleEngine/Engine/Wizard/GatheringTournament.cs
Normal file
@@ -0,0 +1,228 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.RoomMatch;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringTournament : MonoBehaviour
|
||||
{
|
||||
private enum DoubleTab
|
||||
{
|
||||
Winners,
|
||||
Losers
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _originalTournament;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _tournamentRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _ruleLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _singleRoot;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _doubleRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _winnersButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _losersButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _messageRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _messageLabel;
|
||||
|
||||
private List<TournamentController> _tournamentControllers;
|
||||
|
||||
private List<TournamentData> _tournamentDataList;
|
||||
|
||||
private List<string> _resourceList;
|
||||
|
||||
private DoubleTab _doubleTab;
|
||||
|
||||
public void Show(GatheringInfo info, GatheringJoining parent)
|
||||
{
|
||||
UIManager.GetInstance().AttachAtlas(base.gameObject);
|
||||
_originalTournament.SetActive(value: false);
|
||||
_singleRoot.SetActive(value: false);
|
||||
_doubleRoot.SetActive(value: false);
|
||||
_ruleLabel.text = RoomRuleSetting.GetWinTypeString(info.Rule.BattleParameterInstance.Rule) + " " + FormatBehaviorManager.GetFormatName(info.Rule.BattleParameterInstance.DeckFormat);
|
||||
GatheringGetSelfInfoTask task = new GatheringGetSelfInfoTask(isDependGatheringInfo: true);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
GatheringTournamentInfoTask tournamentInfoTask = new GatheringTournamentInfoTask();
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(tournamentInfoTask, delegate
|
||||
{
|
||||
if (tournamentInfoTask.TournamentDataList != null)
|
||||
{
|
||||
Setup(tournamentInfoTask.TournamentDataList, info);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMessage(Data.SystemText.Get("Gathering_Tournament_0009"));
|
||||
}
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
private void Setup(List<TournamentData> tournamentDataList, GatheringInfo info)
|
||||
{
|
||||
_tournamentDataList = tournamentDataList;
|
||||
_tournamentRoot.SetActive(value: true);
|
||||
_messageRoot.SetActive(value: false);
|
||||
bool flag = !info.OwnerInfo.IsSelf || info.Rule.IsOwnerEntryBattle;
|
||||
_doubleTab = GetCurrentTabAndCell(out var currentCells, tournamentDataList, flag);
|
||||
if (flag && currentCells.All((TournamentCellData c) => c == null))
|
||||
{
|
||||
_doubleTab = GetCurrentTabAndCell(out currentCells, tournamentDataList, isEntry: false);
|
||||
}
|
||||
SetupTournamentType(info.Rule.TournamentType);
|
||||
_resourceList = CollectResourcePath(tournamentDataList);
|
||||
StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_resourceList, delegate
|
||||
{
|
||||
_originalTournament.SetActive(value: true);
|
||||
_tournamentControllers = new List<TournamentController>(tournamentDataList.Count);
|
||||
for (int i = 0; i < tournamentDataList.Count; i++)
|
||||
{
|
||||
TournamentController componentInChildren = NGUITools.AddChild(_tournamentRoot, _originalTournament).GetComponentInChildren<TournamentController>();
|
||||
_tournamentControllers.Add(componentInChildren);
|
||||
StartCoroutine(componentInChildren.Setup(tournamentDataList[i], currentCells[i], info, i == (int)_doubleTab));
|
||||
}
|
||||
_originalTournament.SetActive(value: false);
|
||||
}));
|
||||
}
|
||||
|
||||
private void SetupTournamentType(GatheringRule.eTournamentType type)
|
||||
{
|
||||
_singleRoot.SetActive(type == GatheringRule.eTournamentType.SINGLE_ELIMINATION);
|
||||
_doubleRoot.SetActive(type == GatheringRule.eTournamentType.DOUBLE_ELIMINATION);
|
||||
_winnersButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetDoubleTab(DoubleTab.Winners);
|
||||
}));
|
||||
_losersButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetDoubleTab(DoubleTab.Losers);
|
||||
}));
|
||||
UpdateDoubleTab();
|
||||
}
|
||||
|
||||
private DoubleTab GetCurrentTabAndCell(out List<TournamentCellData> currentCells, List<TournamentData> tournamentDataList, bool isEntry)
|
||||
{
|
||||
currentCells = new List<TournamentCellData>(tournamentDataList.Count);
|
||||
foreach (TournamentData tournamentData in tournamentDataList)
|
||||
{
|
||||
bool flag = false;
|
||||
for (int num = tournamentData.Rounds.Count - 1; num >= 0; num--)
|
||||
{
|
||||
foreach (TournamentCellData cell in tournamentData.Rounds[num].Cells)
|
||||
{
|
||||
if (IsCurrentCell(cell))
|
||||
{
|
||||
currentCells.Add(cell);
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
currentCells.Add(null);
|
||||
}
|
||||
}
|
||||
if (currentCells.Count > 1)
|
||||
{
|
||||
if (currentCells[0] == null)
|
||||
{
|
||||
return DoubleTab.Winners;
|
||||
}
|
||||
if (currentCells[0].Round == tournamentDataList[0].Rounds[tournamentDataList[0].Rounds.Count - 2])
|
||||
{
|
||||
return DoubleTab.Winners;
|
||||
}
|
||||
if (currentCells[0].State != TournamentCellData.CellState.Lose || currentCells[1] == null)
|
||||
{
|
||||
return DoubleTab.Winners;
|
||||
}
|
||||
return DoubleTab.Losers;
|
||||
}
|
||||
return DoubleTab.Winners;
|
||||
bool IsCurrentCell(TournamentCellData targetCell)
|
||||
{
|
||||
if (targetCell == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
TournamentCellData.CellState state = targetCell.State;
|
||||
if (state == TournamentCellData.CellState.Unresolved || state == TournamentCellData.CellState.Active || state == TournamentCellData.CellState.Win || state == TournamentCellData.CellState.Lose)
|
||||
{
|
||||
if (isEntry)
|
||||
{
|
||||
return targetCell.ViewerId == PlayerStaticData.UserViewerID;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateDoubleTab()
|
||||
{
|
||||
_winnersButton.normalSprite = ((_doubleTab == DoubleTab.Winners) ? "pilltab_02_left_on" : "pilltab_02_left_off");
|
||||
_losersButton.normalSprite = ((_doubleTab == DoubleTab.Losers) ? "pilltab_02_right_on" : "pilltab_02_right_off");
|
||||
}
|
||||
|
||||
private void SetDoubleTab(DoubleTab tab)
|
||||
{
|
||||
if (_doubleTab != tab)
|
||||
{
|
||||
_doubleTab = tab;
|
||||
UpdateDoubleTab();
|
||||
for (int i = 0; i < _tournamentControllers.Count; i++)
|
||||
{
|
||||
_tournamentControllers[i].SetVisible(i == (int)tab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> CollectResourcePath(List<TournamentData> dataList)
|
||||
{
|
||||
List<string> resourceList = new List<string>();
|
||||
foreach (TournamentData data in dataList)
|
||||
{
|
||||
data.CollectResourcePath(ref resourceList);
|
||||
}
|
||||
return resourceList;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (_resourceList != null)
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_resourceList);
|
||||
_resourceList.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetMessage(string message)
|
||||
{
|
||||
_tournamentRoot.SetActive(value: false);
|
||||
_messageRoot.SetActive(value: true);
|
||||
_messageLabel.text = message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringUpdateDeckLeaderSkin : BaseTask
|
||||
{
|
||||
public class GatheringUpdateDeckLeaderSkinParam : BaseParam
|
||||
{
|
||||
public int deck_no;
|
||||
|
||||
public int leader_skin_id;
|
||||
}
|
||||
|
||||
public GatheringUpdateDeckLeaderSkin()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringUpdateDeckLeaderSkin;
|
||||
}
|
||||
|
||||
public void SetParameter(int deckNo, int leaderSkinId)
|
||||
{
|
||||
GatheringUpdateDeckLeaderSkinParam gatheringUpdateDeckLeaderSkinParam = new GatheringUpdateDeckLeaderSkinParam();
|
||||
gatheringUpdateDeckLeaderSkinParam.deck_no = deckNo;
|
||||
gatheringUpdateDeckLeaderSkinParam.leader_skin_id = leaderSkinId;
|
||||
base.Params = gatheringUpdateDeckLeaderSkinParam;
|
||||
}
|
||||
}
|
||||
24
SVSim.BattleEngine/Engine/Wizard/GatheringUpdateDeckName.cs
Normal file
24
SVSim.BattleEngine/Engine/Wizard/GatheringUpdateDeckName.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringUpdateDeckName : BaseTask
|
||||
{
|
||||
public class GatheringUpdateDeckNameParam : BaseParam
|
||||
{
|
||||
public int deck_no;
|
||||
|
||||
public string deck_name;
|
||||
}
|
||||
|
||||
public GatheringUpdateDeckName()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringUpdateDeckName;
|
||||
}
|
||||
|
||||
public void SetParameter(int deckNo, string deckName)
|
||||
{
|
||||
GatheringUpdateDeckNameParam gatheringUpdateDeckNameParam = new GatheringUpdateDeckNameParam();
|
||||
gatheringUpdateDeckNameParam.deck_no = deckNo;
|
||||
gatheringUpdateDeckNameParam.deck_name = deckName;
|
||||
base.Params = gatheringUpdateDeckNameParam;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringUpdateDeckRandomLeaderSkinTask : BaseTask
|
||||
{
|
||||
public class GatheringUpdateDeckRandomLeaderSkinParam : BaseParam
|
||||
{
|
||||
public int deck_no;
|
||||
|
||||
public int[] leader_skin_id_list;
|
||||
}
|
||||
|
||||
public int SelectedSkinId { get; private set; }
|
||||
|
||||
public GatheringUpdateDeckRandomLeaderSkinTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringUpdateDeckRandomLeaderSkin;
|
||||
}
|
||||
|
||||
public void SetParameter(int deckNo, int[] leaderSkinIdList)
|
||||
{
|
||||
GatheringUpdateDeckRandomLeaderSkinParam gatheringUpdateDeckRandomLeaderSkinParam = new GatheringUpdateDeckRandomLeaderSkinParam();
|
||||
gatheringUpdateDeckRandomLeaderSkinParam.deck_no = deckNo;
|
||||
gatheringUpdateDeckRandomLeaderSkinParam.leader_skin_id_list = leaderSkinIdList;
|
||||
base.Params = gatheringUpdateDeckRandomLeaderSkinParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["user_deck"];
|
||||
SelectedSkinId = jsonData["leader_skin_id"].ToInt();
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringUpdateDeckSleeve : BaseTask
|
||||
{
|
||||
public class GatheringUpdateDeckSleeveParam : BaseParam
|
||||
{
|
||||
public int deck_no;
|
||||
|
||||
public long sleeve_id;
|
||||
}
|
||||
|
||||
public GatheringUpdateDeckSleeve()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringUpdateDeckSleeve;
|
||||
}
|
||||
|
||||
public void SetParameter(int deckNo, long sleeveId)
|
||||
{
|
||||
GatheringUpdateDeckSleeveParam gatheringUpdateDeckSleeveParam = new GatheringUpdateDeckSleeveParam();
|
||||
gatheringUpdateDeckSleeveParam.deck_no = deckNo;
|
||||
gatheringUpdateDeckSleeveParam.sleeve_id = sleeveId;
|
||||
base.Params = gatheringUpdateDeckSleeveParam;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GenerateDeckImageMaintenanceTask : BaseTask
|
||||
{
|
||||
public GenerateDeckImageMaintenanceTask()
|
||||
{
|
||||
base.type = ApiType.Type.GenerateDeckImageMaintenance;
|
||||
}
|
||||
}
|
||||
53
SVSim.BattleEngine/Engine/Wizard/GetDeckDataFromCodeTask.cs
Normal file
53
SVSim.BattleEngine/Engine/Wizard/GetDeckDataFromCodeTask.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Cute;
|
||||
using DeckBuilder;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GetDeckDataFromCodeTask : BaseTask
|
||||
{
|
||||
public class GetDeckDataFromCodeTaskParam : BaseParam
|
||||
{
|
||||
public string deck_code;
|
||||
}
|
||||
|
||||
public override string Url => $"{CustomPreference.GetDeckBuilderServerURL()}{ApiType.ApiList[base.type]}";
|
||||
|
||||
public GetDeckDataFromCodeTask()
|
||||
{
|
||||
base.type = ApiType.Type.GetDeckInfoFromDeckCode;
|
||||
}
|
||||
|
||||
public void SetParameter(string deck_code)
|
||||
{
|
||||
GetDeckDataFromCodeTaskParam getDeckDataFromCodeTaskParam = new GetDeckDataFromCodeTaskParam();
|
||||
getDeckDataFromCodeTaskParam.deck_code = deck_code;
|
||||
base.Params = getDeckDataFromCodeTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Data.DeckDataFromDeckCode = new GetDeckDataFromCode();
|
||||
JsonData jsonData = base.ResponseData["data"]["deck"];
|
||||
int clanId = int.Parse(jsonData["clan"].ToString());
|
||||
int valueOrDefault = jsonData.GetValueOrDefault("sub_clan", 10);
|
||||
Data.DeckDataFromDeckCode.ClanId = clanId;
|
||||
Data.DeckDataFromDeckCode.SubClanId = valueOrDefault;
|
||||
Data.DeckDataFromDeckCode.IsSubClanSet = CardBasePrm.ClanTypeIsUseable((CardBasePrm.ClanType)Data.DeckDataFromDeckCode.SubClanId);
|
||||
string defaultValue = null;
|
||||
Data.DeckDataFromDeckCode.MyRotationId = jsonData.GetValueOrDefault("rotation_id", defaultValue);
|
||||
JsonData jsonData2 = jsonData["cardID"];
|
||||
int count = jsonData2.Count;
|
||||
Data.DeckDataFromDeckCode.CardIds = new int[count];
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Data.DeckDataFromDeckCode.CardIds[i] = jsonData2[i].ToInt();
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
33
SVSim.BattleEngine/Engine/Wizard/InviteAcceptTask.cs
Normal file
33
SVSim.BattleEngine/Engine/Wizard/InviteAcceptTask.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class InviteAcceptTask : BaseTask
|
||||
{
|
||||
public class InviteAcceptTaskParam : BaseParam
|
||||
{
|
||||
public int friend_viewer_id;
|
||||
}
|
||||
|
||||
public InviteAcceptTask()
|
||||
{
|
||||
base.type = ApiType.Type.InviteAccept;
|
||||
}
|
||||
|
||||
public void SetParameter(int friendViewerId)
|
||||
{
|
||||
InviteAcceptTaskParam inviteAcceptTaskParam = new InviteAcceptTaskParam();
|
||||
inviteAcceptTaskParam.friend_viewer_id = friendViewerId;
|
||||
base.Params = inviteAcceptTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Data.InviteFriendBattle.RoomId = base.ResponseData["data"]["room_id"].ToString();
|
||||
Data.InviteFriendBattle.BattleParameterInstance = BattleParameter.JsonToBattleParameter(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class MissionChangeReceiveSettingTask : BaseTask
|
||||
{
|
||||
public class MissionChangeReceiveSettingTaskParam : BaseParam
|
||||
{
|
||||
public int mission_receive_type;
|
||||
}
|
||||
|
||||
public MissionChangeReceiveSettingTask()
|
||||
{
|
||||
base.type = ApiType.Type.MissionChangeReceiveSetting;
|
||||
}
|
||||
|
||||
public void SetParameter(MissionInfoDetail.eMissionReceiveType missionReceiveType)
|
||||
{
|
||||
MissionChangeReceiveSettingTaskParam missionChangeReceiveSettingTaskParam = new MissionChangeReceiveSettingTaskParam();
|
||||
missionChangeReceiveSettingTaskParam.mission_receive_type = (int)missionReceiveType;
|
||||
base.Params = missionChangeReceiveSettingTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Data.MissionInfo.data = new MissionInfoDetail(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
121
SVSim.BattleEngine/Engine/Wizard/MyPageBGRandomSelectDialog.cs
Normal file
121
SVSim.BattleEngine/Engine/Wizard/MyPageBGRandomSelectDialog.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.UI.Dialog.ImageSelection;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class MyPageBGRandomSelectDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private ImageSelection _imageSelection;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _btnAllOff;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelButton;
|
||||
|
||||
public static void Create(List<string> currentSelectIdList, int panelDepth, Action<List<string>> onDecide)
|
||||
{
|
||||
GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("UI/layoutParts/MyPage/MyPageBGRandomSelectDialog")) as GameObject;
|
||||
MyPageBGRandomSelectDialog customDialog = gameObject.GetComponent<MyPageBGRandomSelectDialog>();
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.XL);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("MyPage_0103"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.SetObj(gameObject);
|
||||
dialogBase.SetPanelDepth(panelDepth);
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
onDecide.Call(customDialog._imageSelection.GetSelectedList());
|
||||
};
|
||||
customDialog.Initialize(panelDepth, dialogBase, currentSelectIdList);
|
||||
}
|
||||
|
||||
private void Initialize(int panelDepth, DialogBase dialog, List<string> currentSelectIdList)
|
||||
{
|
||||
_btnAllOff.onClick.Clear();
|
||||
_btnAllOff.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
OnClickAllOffButton();
|
||||
}));
|
||||
_imageSelection.Create(panelDepth, dialog);
|
||||
foreach (MyPageCustomBGMasterData myPageCustomBGMaster in Data.Master.MyPageCustomBGMasterList)
|
||||
{
|
||||
if (currentSelectIdList.Contains(myPageCustomBGMaster.Id))
|
||||
{
|
||||
AddItem(myPageCustomBGMaster.Id);
|
||||
}
|
||||
}
|
||||
foreach (MyPageCustomBGMasterData myPageCustomBGMaster2 in Data.Master.MyPageCustomBGMasterList)
|
||||
{
|
||||
if (Data.Load.data.AcquiredMyPageBGList.Contains(myPageCustomBGMaster2.Id) && !currentSelectIdList.Contains(myPageCustomBGMaster2.Id))
|
||||
{
|
||||
AddItem(myPageCustomBGMaster2.Id);
|
||||
}
|
||||
}
|
||||
_imageSelection.SelectMultiItem(currentSelectIdList);
|
||||
_imageSelection.SetDisplayPage(0);
|
||||
_imageSelection.LoadDisplayPage();
|
||||
_imageSelection.Open();
|
||||
UpdateAllButton();
|
||||
}
|
||||
|
||||
private void AddItem(string id)
|
||||
{
|
||||
ResourcesManager.AssetLoadPathType type = ResourcesManager.AssetLoadPathType.MyPageBackGroundRandomSelectIcon;
|
||||
_imageSelection.AddItem(id, null, isSelectable: true, () => true, Toolbox.ResourcesManager.GetAssetTypePath(id, type), Toolbox.ResourcesManager.GetAssetTypePath(id, type, isfetch: true), isDisplaySprite: false, string.Empty, null, delegate
|
||||
{
|
||||
}, delegate
|
||||
{
|
||||
UpdateAllButton();
|
||||
}, delegate(GameObject g)
|
||||
{
|
||||
StartCoroutine(PushedAnimation(g));
|
||||
});
|
||||
}
|
||||
|
||||
private IEnumerator PushedAnimation(GameObject obj)
|
||||
{
|
||||
TweenScale scl = obj.GetComponent<TweenScale>();
|
||||
if ((bool)scl)
|
||||
{
|
||||
scl.PlayForward();
|
||||
while (Input.GetMouseButton(0))
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
scl.PlayReverse();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClickAllOffButton()
|
||||
{
|
||||
if (_imageSelection.GetSelectedList().Count > 0)
|
||||
{
|
||||
_imageSelection.SelectCancelAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
_imageSelection.SelectAll();
|
||||
}
|
||||
UpdateAllButton();
|
||||
}
|
||||
|
||||
private void UpdateAllButton()
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
if (_imageSelection.GetSelectedList().Count > 0)
|
||||
{
|
||||
_labelButton.text = systemText.Get("Card_0259");
|
||||
}
|
||||
else
|
||||
{
|
||||
_labelButton.text = systemText.Get("Card_0260");
|
||||
}
|
||||
}
|
||||
}
|
||||
29
SVSim.BattleEngine/Engine/Wizard/MyPageSettingUpdateTask.cs
Normal file
29
SVSim.BattleEngine/Engine/Wizard/MyPageSettingUpdateTask.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class MyPageSettingUpdateTask : BaseTask
|
||||
{
|
||||
public class TaskParam : BaseParam
|
||||
{
|
||||
public int select_type;
|
||||
|
||||
public string mypage_id;
|
||||
|
||||
public string[] mypage_id_list;
|
||||
}
|
||||
|
||||
public MyPageSettingUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.MyPageSettingUpdate;
|
||||
}
|
||||
|
||||
public void SetParameter(MyPageDetail.BGType type, string id, List<string> randomList)
|
||||
{
|
||||
TaskParam taskParam = new TaskParam();
|
||||
taskParam.select_type = (int)type;
|
||||
taskParam.mypage_id = id;
|
||||
taskParam.mypage_id_list = randomList.ToArray();
|
||||
base.Params = taskParam;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class MyRotationAbilityDetailDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private FlexibleGrid _grid;
|
||||
|
||||
[SerializeField]
|
||||
private MyRotationAbilityDetailDialogItem _itemOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _lineOriginal;
|
||||
|
||||
public static DialogBase Create(List<MyRotationAbilityGroup> abilityGroupList)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("MyRotation_ID_11"));
|
||||
GameObject gameObject = Object.Instantiate(Resources.Load("UI/layoutParts/MyRotation/MyRotationAbilityDetailDialog")) as GameObject;
|
||||
dialogBase.SetObj(gameObject);
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
gameObject.GetComponent<MyRotationAbilityDetailDialog>().Initialize(abilityGroupList);
|
||||
return dialogBase;
|
||||
}
|
||||
|
||||
private void Initialize(List<MyRotationAbilityGroup> abilityGroupList)
|
||||
{
|
||||
_itemOriginal.gameObject.SetActive(value: false);
|
||||
_lineOriginal.SetActive(value: false);
|
||||
bool flag = true;
|
||||
foreach (MyRotationAbilityGroup abilityGroup in abilityGroupList)
|
||||
{
|
||||
if (abilityGroup.AbilityList.Count != 0)
|
||||
{
|
||||
if (!flag)
|
||||
{
|
||||
NGUITools.AddChild(_grid.gameObject, _lineOriginal).SetActive(value: true);
|
||||
}
|
||||
GameObject obj = NGUITools.AddChild(_grid.gameObject, _itemOriginal.gameObject);
|
||||
obj.SetActive(value: true);
|
||||
obj.GetComponent<MyRotationAbilityDetailDialogItem>().Initialize(abilityGroup);
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
_grid.Reposition();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class MyRotationAbilityDetailDialogItem : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _headerLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _abilityOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _grid;
|
||||
|
||||
public void Initialize(MyRotationAbilityGroup group)
|
||||
{
|
||||
_headerLabel.text = Data.SystemText.Get("MyRotation_ID_12", group.StartPackNumber.ToString(), group.LastPackNumber.ToString(), group.StartPackShortName, group.LastPackShortName);
|
||||
_abilityOriginal.SetActive(value: false);
|
||||
foreach (MyRotationInfo.MyRotationBonus ability in group.AbilityList)
|
||||
{
|
||||
GameObject obj = NGUITools.AddChild(_grid.gameObject, _abilityOriginal);
|
||||
obj.GetComponentInChildren<UISprite>().spriteName = ability.IconName;
|
||||
obj.GetComponentInChildren<UILabel>().text = ability.AbilityDesc;
|
||||
obj.SetActive(value: true);
|
||||
}
|
||||
_grid.Reposition();
|
||||
}
|
||||
}
|
||||
20
SVSim.BattleEngine/Engine/Wizard/PracticeInfoTask.cs
Normal file
20
SVSim.BattleEngine/Engine/Wizard/PracticeInfoTask.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class PracticeInfoTask : BaseTask
|
||||
{
|
||||
public PracticeInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.PracticeInfo;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Data.PracticeDataMgr = new PracticeDataMgr(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
29
SVSim.BattleEngine/Engine/Wizard/PracticePuzzleInfoTask.cs
Normal file
29
SVSim.BattleEngine/Engine/Wizard/PracticePuzzleInfoTask.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class PracticePuzzleInfoTask : BaseTask
|
||||
{
|
||||
public List<PracticePuzzleData> PuzzleDataList { get; private set; } = new List<PracticePuzzleData>();
|
||||
|
||||
public PracticePuzzleInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.PracticePuzzleInfo;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
PuzzleDataList.Add(new PracticePuzzleData(jsonData[i]));
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class PracticePuzzleMissionDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private SimpleScrollViewUI _simpleScrollView;
|
||||
|
||||
[SerializeField]
|
||||
private ResourceHandler _resourceHandler;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _missionNotExist;
|
||||
|
||||
private List<PracticePuzzleMissionData> _missionList;
|
||||
|
||||
public static void Create(List<PracticePuzzleMissionData> missionList, GameObject prefab)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Mission_0003"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
PracticePuzzleMissionDialog component = Object.Instantiate(prefab).GetComponent<PracticePuzzleMissionDialog>();
|
||||
dialogBase.SetObj(component.gameObject);
|
||||
component.Initialize(missionList);
|
||||
}
|
||||
|
||||
private void Initialize(List<PracticePuzzleMissionData> missionList)
|
||||
{
|
||||
_missionList = missionList;
|
||||
_missionNotExist.SetActive(missionList.Count == 0);
|
||||
_simpleScrollView.CreateScrollView(missionList.Count, UpdateMissionPlate);
|
||||
}
|
||||
|
||||
private void UpdateMissionPlate(int index, GameObject plateObject)
|
||||
{
|
||||
PracticePuzzleMissionData mission = _missionList[index];
|
||||
plateObject.GetComponent<UISprite>().width = 800;
|
||||
plateObject.GetComponent<AchievementWindowBase>().SetPracticePuzzleMission(mission, _resourceHandler, canChangeMissions: false, index != _missionList.Count - 1, displayChange: false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class PracticePuzzleMissionListTask : BaseTask
|
||||
{
|
||||
public List<PracticePuzzleMissionData> MissionData { get; private set; }
|
||||
|
||||
public PracticePuzzleMissionListTask()
|
||||
{
|
||||
base.type = ApiType.Type.PracticePuzzleMissionList;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
MissionData = new List<PracticePuzzleMissionData>();
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
MissionData.Add(new PracticePuzzleMissionData(jsonData[i]));
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
64
SVSim.BattleEngine/Engine/Wizard/PracticePuzzlePlate.cs
Normal file
64
SVSim.BattleEngine/Engine/Wizard/PracticePuzzlePlate.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class PracticePuzzlePlate : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _title;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _button;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _clearCountLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _plateTexture;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _selectSprite;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _alreadyClear;
|
||||
|
||||
[SerializeField]
|
||||
private TweenAlpha _selectSpriteTween;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _missionTarget;
|
||||
|
||||
public PracticePuzzleData PuzzleData { get; private set; }
|
||||
|
||||
public void UpdateView(PracticePuzzleData data, Action<PracticePuzzleData> onSelect, bool isSelected)
|
||||
{
|
||||
PuzzleData = data;
|
||||
_title.text = data.Title;
|
||||
_clearCountLabel.text = $"{data.CurrentClearCount}/{data.MaxClearCount}";
|
||||
_alreadyClear.gameObject.SetActive(data.IsClear);
|
||||
_clearCountLabel.gameObject.SetActive(!data.IsClear);
|
||||
_missionTarget.SetActive(data.IsMissionTarget);
|
||||
_plateTexture.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(GetPlateTexturePath(data, isFetch: true));
|
||||
UpdateSelectSpriteVisible(isSelected);
|
||||
UIEventListener.Get(_button.gameObject).onClick = delegate
|
||||
{
|
||||
onSelect.Call(data);
|
||||
};
|
||||
}
|
||||
|
||||
public static string GetPlateTexturePath(PracticePuzzleData data, bool isFetch)
|
||||
{
|
||||
return Toolbox.ResourcesManager.GetAssetTypePath(data.GroupdId.ToString(), ResourcesManager.AssetLoadPathType.PracticePuzzleThumbnail, isFetch);
|
||||
}
|
||||
|
||||
public void UpdateSelectSpriteVisible(bool visible)
|
||||
{
|
||||
_selectSprite.SetActive(visible);
|
||||
if (visible)
|
||||
{
|
||||
_selectSpriteTween.PlayPingPong(isIncreaseAlpha: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
SVSim.BattleEngine/Engine/Wizard/PracticeStartTask.cs
Normal file
24
SVSim.BattleEngine/Engine/Wizard/PracticeStartTask.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class PracticeStartTask : BaseTask
|
||||
{
|
||||
public PracticeStartTask()
|
||||
{
|
||||
base.type = ApiType.Type.PracticeStart;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
if (base.ResponseData["data"].Keys.Contains("mission_parameter"))
|
||||
{
|
||||
dataMgr.SetMissionNecessaryInformation(base.ResponseData["data"]["mission_parameter"]);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
320
SVSim.BattleEngine/Engine/Wizard/QrCamera.cs
Normal file
320
SVSim.BattleEngine/Engine/Wizard/QrCamera.cs
Normal file
@@ -0,0 +1,320 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Cute;
|
||||
using SFB;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class QrCamera : MonoBehaviour
|
||||
{
|
||||
private enum Mode
|
||||
{
|
||||
None,
|
||||
Camera,
|
||||
CameraRoll
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _cameraRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _halfTransparentTexture;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _backGroundTexture;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _cameraTexture;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _blueFrameTexture;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _cameraRollTexture;
|
||||
|
||||
private string _qrCodeCameraText;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _backButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _descriptionTextLabel;
|
||||
|
||||
private WebCamTexture _webCamTexture;
|
||||
|
||||
private Action _qrScanSuccessee;
|
||||
|
||||
private Action<string> _qrScanFailed;
|
||||
|
||||
private GameObject _qrCameraObject;
|
||||
|
||||
private const float DESCRIPTION_TEXT_OFFSET = 30f;
|
||||
|
||||
private ScreenOrientation _preScreenOrientation = ScreenOrientation.LandscapeLeft;
|
||||
|
||||
private List<string> _resourcePathList = new List<string>();
|
||||
|
||||
private const string HALF_TRANSPARENT_TEXTURE_PATH = "512black_82transparent";
|
||||
|
||||
private bool loadCameraRollImageCalled;
|
||||
|
||||
private CardMaster.CardMasterId _cardMasterId = CardMaster.CardMasterId.Default;
|
||||
|
||||
private bool webCameraSetSuccess;
|
||||
|
||||
private Mode _currentMode;
|
||||
|
||||
public UIButton backButton
|
||||
{
|
||||
get
|
||||
{
|
||||
return _backButton;
|
||||
}
|
||||
private set
|
||||
{
|
||||
_backButton = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_cameraRoot.gameObject.SetActive(value: false);
|
||||
}
|
||||
|
||||
public void SetCallBacks(Action qrScanSuccessee, Action<string> qrScanFailed)
|
||||
{
|
||||
_qrScanSuccessee = qrScanSuccessee;
|
||||
_qrScanFailed = qrScanFailed;
|
||||
}
|
||||
|
||||
public IEnumerator StartQRCamera(GameObject qrCameraObject, CardMaster.CardMasterId cardMasterId, Action onComplete, Action onFailed)
|
||||
{
|
||||
SetupWebCam();
|
||||
_cardMasterId = cardMasterId;
|
||||
if (!webCameraSetSuccess)
|
||||
{
|
||||
onFailed.Call();
|
||||
yield break;
|
||||
}
|
||||
_cameraRoot.gameObject.SetActive(value: true);
|
||||
_qrCameraObject = qrCameraObject;
|
||||
_preScreenOrientation = Screen.orientation;
|
||||
if (_preScreenOrientation == ScreenOrientation.LandscapeRight)
|
||||
{
|
||||
Vector3 localScale = _cameraTexture.transform.localScale;
|
||||
localScale.x = 0f - localScale.x;
|
||||
localScale.y = 0f - localScale.y;
|
||||
_cameraTexture.transform.localScale = localScale;
|
||||
}
|
||||
_currentMode = Mode.Camera;
|
||||
StartCoroutine(PlayCamera());
|
||||
onComplete.Call();
|
||||
}
|
||||
|
||||
public void StartGetQRCodeFromImageFile(GameObject qrCameraObject, CardMaster.CardMasterId cardMasterId)
|
||||
{
|
||||
_cameraRollTexture.gameObject.SetActive(value: true);
|
||||
_cardMasterId = cardMasterId;
|
||||
_qrCameraObject = qrCameraObject;
|
||||
_currentMode = Mode.CameraRoll;
|
||||
ExtensionFilter[] extensions = new ExtensionFilter[1]
|
||||
{
|
||||
new ExtensionFilter("Image Files", "png", "jpg", "jpeg")
|
||||
};
|
||||
string[] array = StandaloneFileBrowser.OpenFilePanel(Data.SystemText.Get("Card_0271"), "", extensions, multiselect: false);
|
||||
if (array.Length != 0 && !string.IsNullOrEmpty(array[0]))
|
||||
{
|
||||
LoadCameraRollImage(array[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
UnityEngine.Object.Destroy(_qrCameraObject);
|
||||
}
|
||||
}
|
||||
|
||||
public void StopQRCamera()
|
||||
{
|
||||
_cameraRoot.gameObject.SetActive(value: false);
|
||||
_currentMode = Mode.None;
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_resourcePathList);
|
||||
_resourcePathList.Clear();
|
||||
StopCamera();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_currentMode != Mode.Camera || !(_webCamTexture != null) || !_webCamTexture.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (_preScreenOrientation != Screen.orientation)
|
||||
{
|
||||
ChangeCameraTextrueDirection();
|
||||
}
|
||||
_qrCodeCameraText = QRCodeUtility.DecodeContentText(_webCamTexture);
|
||||
if (!string.IsNullOrEmpty(_qrCodeCameraText))
|
||||
{
|
||||
StopCamera();
|
||||
if (QRCodeUtility.SetDeckFromQRCodeText(_qrCodeCameraText, _cardMasterId))
|
||||
{
|
||||
_qrScanSuccessee.Call();
|
||||
}
|
||||
else
|
||||
{
|
||||
_qrScanFailed.Call(Data.SystemText.Get("Card_0267"));
|
||||
}
|
||||
UnityEngine.Object.Destroy(_qrCameraObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeCameraTextrueDirection()
|
||||
{
|
||||
switch (Screen.orientation)
|
||||
{
|
||||
case ScreenOrientation.LandscapeLeft:
|
||||
{
|
||||
_preScreenOrientation = Screen.orientation;
|
||||
Vector3 localScale2 = _cameraTexture.transform.localScale;
|
||||
localScale2.x = 0f - localScale2.x;
|
||||
localScale2.y = 0f - localScale2.y;
|
||||
_cameraTexture.transform.localScale = localScale2;
|
||||
break;
|
||||
}
|
||||
case ScreenOrientation.LandscapeRight:
|
||||
{
|
||||
_preScreenOrientation = Screen.orientation;
|
||||
Vector3 localScale = _cameraTexture.transform.localScale;
|
||||
localScale.x = 0f - localScale.x;
|
||||
localScale.y = 0f - localScale.y;
|
||||
_cameraTexture.transform.localScale = localScale;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupWebCam()
|
||||
{
|
||||
ResourcesManager resMgr = Toolbox.ResourcesManager;
|
||||
_resourcePathList.Add(resMgr.GetAssetTypePath("512black_82transparent", ResourcesManager.AssetLoadPathType.UiOtherTexture));
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_resourcePathList, delegate
|
||||
{
|
||||
_halfTransparentTexture.mainTexture = resMgr.LoadObject(resMgr.GetAssetTypePath("512black_82transparent", ResourcesManager.AssetLoadPathType.UiOtherTexture, isfetch: true)) as Texture;
|
||||
}));
|
||||
WebCamDevice[] devices = WebCamTexture.devices;
|
||||
if (devices != null && devices.Length != 0)
|
||||
{
|
||||
float num = (float)Screen.width / (float)Screen.height;
|
||||
if (num != 1.7777778f)
|
||||
{
|
||||
float aspectRatio = _cameraTexture.aspectRatio;
|
||||
float num2 = ((num < 1.7777778f) ? 1f : (num / aspectRatio));
|
||||
float num3 = ((num < 1.7777778f) ? (aspectRatio / num) : 1f);
|
||||
_halfTransparentTexture.SetDimensions(Mathf.CeilToInt((float)_halfTransparentTexture.width * num2), Mathf.CeilToInt((float)_halfTransparentTexture.height * num3));
|
||||
_backGroundTexture.SetDimensions(Mathf.CeilToInt(_halfTransparentTexture.width), Mathf.CeilToInt(_halfTransparentTexture.height));
|
||||
}
|
||||
_webCamTexture = new WebCamTexture(devices[0].name, Screen.width, Screen.height, 30);
|
||||
webCameraSetSuccess = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
webCameraSetSuccess = false;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator PlayCamera()
|
||||
{
|
||||
if (!(_webCamTexture == null) && !_webCamTexture.isPlaying)
|
||||
{
|
||||
_halfTransparentTexture.ResizeCollider();
|
||||
_backGroundTexture.ResizeCollider();
|
||||
_cameraTexture.mainTexture = _webCamTexture;
|
||||
_descriptionTextLabel.gameObject.SetActive(value: false);
|
||||
_blueFrameTexture.gameObject.SetActive(value: false);
|
||||
_cameraTexture.gameObject.SetActive(value: false);
|
||||
_halfTransparentTexture.gameObject.SetActive(value: false);
|
||||
_webCamTexture.Play();
|
||||
while (_webCamTexture.width <= 16 && _webCamTexture.height <= 16)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
float num = (float)_halfTransparentTexture.width / (float)_halfTransparentTexture.height;
|
||||
float num2 = (float)_webCamTexture.width / (float)_webCamTexture.height;
|
||||
if (num > num2)
|
||||
{
|
||||
_cameraTexture.SetDimensions(Mathf.CeilToInt((float)_halfTransparentTexture.height / (float)_webCamTexture.height * (float)_webCamTexture.width), _halfTransparentTexture.height);
|
||||
}
|
||||
else if (Mathf.Approximately(num, num2))
|
||||
{
|
||||
_cameraTexture.SetDimensions(_halfTransparentTexture.width, _halfTransparentTexture.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cameraTexture.SetDimensions(_halfTransparentTexture.width, Mathf.CeilToInt((float)_halfTransparentTexture.width / (float)_webCamTexture.width * (float)_webCamTexture.height));
|
||||
}
|
||||
_cameraTexture.SetDimensions(Mathf.CeilToInt((float)_cameraTexture.width * 0.8f), Mathf.CeilToInt((float)_cameraTexture.height * 0.8f));
|
||||
int num3 = Mathf.FloorToInt((float)Mathf.Min(_halfTransparentTexture.width, _halfTransparentTexture.height) * 0.5f);
|
||||
_blueFrameTexture.SetDimensions(num3, num3);
|
||||
_blueFrameTexture.gameObject.SetActive(value: true);
|
||||
Vector3 localPosition = _descriptionTextLabel.transform.localPosition;
|
||||
localPosition.y = (float)num3 * 0.5f;
|
||||
localPosition.y += 30f;
|
||||
_descriptionTextLabel.transform.localPosition = localPosition;
|
||||
_descriptionTextLabel.gameObject.SetActive(value: true);
|
||||
float num4 = (float)Screen.width / (float)Screen.height;
|
||||
Rect uvRect = default(Rect);
|
||||
if (num4 > 1f)
|
||||
{
|
||||
uvRect.height = 1.359375f;
|
||||
uvRect.width = uvRect.height * num4;
|
||||
uvRect.x = (1f - uvRect.width) * 0.5f;
|
||||
uvRect.y = (1f - uvRect.height) * 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
uvRect.width = 1.359375f;
|
||||
uvRect.height = uvRect.width / num4;
|
||||
uvRect.x = (1f - uvRect.width) * 0.5f;
|
||||
uvRect.y = (1f - uvRect.height) * 0.5f;
|
||||
}
|
||||
_halfTransparentTexture.uvRect = uvRect;
|
||||
_halfTransparentTexture.gameObject.SetActive(value: true);
|
||||
yield return null;
|
||||
_cameraTexture.gameObject.SetActive(value: true);
|
||||
}
|
||||
}
|
||||
|
||||
private void StopCamera()
|
||||
{
|
||||
if (!(_webCamTexture == null) && _webCamTexture.isPlaying)
|
||||
{
|
||||
_webCamTexture.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadCameraRollImage(string path)
|
||||
{
|
||||
if (!loadCameraRollImageCalled)
|
||||
{
|
||||
loadCameraRollImageCalled = true;
|
||||
byte[] data = File.ReadAllBytes(path);
|
||||
Texture2D texture2D = new Texture2D(2, 2);
|
||||
texture2D.LoadImage(data);
|
||||
_qrCodeCameraText = QRCodeUtility.DecodeContentText(texture2D.GetPixels32(), texture2D.width, texture2D.height, isFromCamera: false);
|
||||
bool flag = false;
|
||||
if (!string.IsNullOrEmpty(_qrCodeCameraText) && QRCodeUtility.SetDeckFromQRCodeText(_qrCodeCameraText, _cardMasterId))
|
||||
{
|
||||
_qrScanSuccessee.Call();
|
||||
flag = true;
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
string arg = ((!string.IsNullOrEmpty(_qrCodeCameraText)) ? Data.SystemText.Get("Card_0267") : Data.SystemText.Get("Card_0268"));
|
||||
_qrScanFailed.Call(arg);
|
||||
}
|
||||
UnityEngine.Object.Destroy(_qrCameraObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
54
SVSim.BattleEngine/Engine/Wizard/RefundWarningDialog.cs
Normal file
54
SVSim.BattleEngine/Engine/Wizard/RefundWarningDialog.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using Cute;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class RefundWarningDialog
|
||||
{
|
||||
private const int PANEL_DEPTH = 25;
|
||||
|
||||
public static void Start(PaymentBase.RefundWarningType warningType, Action onFinish)
|
||||
{
|
||||
if (warningType == PaymentBase.RefundWarningType.NONE)
|
||||
{
|
||||
onFinish.Call();
|
||||
return;
|
||||
}
|
||||
SystemText systemText = Data.SystemText;
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetPanelDepth(25);
|
||||
if (warningType == PaymentBase.RefundWarningType.WARNING)
|
||||
{
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetTitleLabel(systemText.Get("Shop_0215"));
|
||||
dialogBase.SetText(systemText.Get("Shop_0216"));
|
||||
dialogBase.SetButtonText(systemText.Get("Dia_BuyCrystal_004_Button"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
onFinish.Call();
|
||||
};
|
||||
dialogBase.onPushButton2 = delegate
|
||||
{
|
||||
OnPaymentCancel();
|
||||
};
|
||||
dialogBase.onCloseWithoutSelect = delegate
|
||||
{
|
||||
OnPaymentCancel();
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.SetTitleLabel(systemText.Get("Shop_0218"));
|
||||
dialogBase.SetText(systemText.Get("Shop_0217"));
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
OnPaymentCancel();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnPaymentCancel()
|
||||
{
|
||||
}
|
||||
}
|
||||
28
SVSim.BattleEngine/Engine/Wizard/RegionCodeUpdateTask.cs
Normal file
28
SVSim.BattleEngine/Engine/Wizard/RegionCodeUpdateTask.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class RegionCodeUpdateTask : BaseTask
|
||||
{
|
||||
public class RegionCodeUpdateTaskParam : BaseParam
|
||||
{
|
||||
public int initialize_flag;
|
||||
}
|
||||
|
||||
public RegionCodeUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.RegionCodeUpdate;
|
||||
}
|
||||
|
||||
public void SetParameter(int initialize_flag)
|
||||
{
|
||||
RegionCodeUpdateTaskParam regionCodeUpdateTaskParam = new RegionCodeUpdateTaskParam();
|
||||
regionCodeUpdateTaskParam.initialize_flag = initialize_flag;
|
||||
base.Params = regionCodeUpdateTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int result = base.Parse();
|
||||
_ = 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
167
SVSim.BattleEngine/Engine/Wizard/ReplayDialog.cs
Normal file
167
SVSim.BattleEngine/Engine/Wizard/ReplayDialog.cs
Normal file
@@ -0,0 +1,167 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ReplayDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _replayDialogContent;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _noReplayLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIWrapContent _wrapContent;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollView _scrollView;
|
||||
|
||||
public Action OnClickReplayButton;
|
||||
|
||||
private List<string> _initTextures = new List<string>();
|
||||
|
||||
private List<string> _loadedTextures = new List<string>();
|
||||
|
||||
private LoadQueue _loadQueue = new LoadQueue();
|
||||
|
||||
private List<ReplayInfoItem> _items;
|
||||
|
||||
public static void Create()
|
||||
{
|
||||
GameObject gameObject = UnityEngine.Object.Instantiate(UIManager.GetInstance().ReplayDialogPrefab);
|
||||
ReplayDialog script = gameObject.GetComponent<ReplayDialog>();
|
||||
DialogBase dialog = UIManager.GetInstance().CreateDialogClose();
|
||||
dialog.SetSize(DialogBase.Size.XL);
|
||||
dialog.SetTitleLabel(Data.SystemText.Get("OtherTop_0033"));
|
||||
dialog.SetObj(gameObject);
|
||||
dialog.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
dialog.SetDisp(inDisp: false);
|
||||
script.SetupContents(Data.ReplayInfo.Items, delegate
|
||||
{
|
||||
dialog.SetDisp(inDisp: true);
|
||||
script.OnClickReplayButton = delegate
|
||||
{
|
||||
dialog.Close();
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public void SetupContents(List<ReplayInfoItem> items, Action onLoaded)
|
||||
{
|
||||
_items = items;
|
||||
_wrapContent.onInitializeItem = OnInitializeItem;
|
||||
_noReplayLabel.SetActive(items.Count == 0);
|
||||
_wrapContent.minIndex = -(items.Count - 1);
|
||||
_wrapContent.maxIndex = 0;
|
||||
int num = (int)(_scrollView.panel.height / (float)_wrapContent.itemSize) + 1;
|
||||
bool active = num <= items.Count;
|
||||
num = Math.Min(num, items.Count);
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
string emblemTexturePath = GetEmblemTexturePath(_items[i], isfetch: false);
|
||||
string countryTexturePath = GetCountryTexturePath(_items[i], isfetch: false);
|
||||
if (!_initTextures.Contains(emblemTexturePath))
|
||||
{
|
||||
_initTextures.Add(emblemTexturePath);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(countryTexturePath) && !_initTextures.Contains(countryTexturePath))
|
||||
{
|
||||
_initTextures.Add(countryTexturePath);
|
||||
}
|
||||
}
|
||||
List<string> list = new List<string>();
|
||||
for (int j = num; j < items.Count; j++)
|
||||
{
|
||||
string emblemTexturePath2 = GetEmblemTexturePath(_items[j], isfetch: false);
|
||||
string countryTexturePath2 = GetCountryTexturePath(_items[j], isfetch: false);
|
||||
if (!_initTextures.Contains(emblemTexturePath2) && !list.Contains(emblemTexturePath2))
|
||||
{
|
||||
list.Add(emblemTexturePath2);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(countryTexturePath2) && !_initTextures.Contains(countryTexturePath2) && !list.Contains(countryTexturePath2))
|
||||
{
|
||||
list.Add(countryTexturePath2);
|
||||
}
|
||||
}
|
||||
for (int k = 0; k < list.Count; k++)
|
||||
{
|
||||
string path = list[k];
|
||||
_loadQueue.AddToLast(path, new List<string> { path }, null, delegate
|
||||
{
|
||||
_loadedTextures.Add(path);
|
||||
});
|
||||
}
|
||||
if (num == 1)
|
||||
{
|
||||
GameObject gameObject = AddContent(_scrollView.gameObject);
|
||||
StartCoroutine(gameObject.GetComponent<ReplayDialogContent>().Setup(_items[0], _loadedTextures));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int num2 = 0; num2 < num; num2++)
|
||||
{
|
||||
AddContent(_wrapContent.gameObject);
|
||||
}
|
||||
}
|
||||
_scrollView.ResetPosition();
|
||||
_scrollView.enabled = active;
|
||||
_scrollView.verticalScrollBar.gameObject.SetActive(active);
|
||||
StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_initTextures, delegate
|
||||
{
|
||||
_loadedTextures.AddRange(_initTextures);
|
||||
_loadQueue.StartLoad();
|
||||
onLoaded.Call();
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnInitializeItem(GameObject go, int wrapIndex, int realIndex)
|
||||
{
|
||||
ReplayInfoItem item = _items[-realIndex];
|
||||
StartCoroutine(go.GetComponent<ReplayDialogContent>().Setup(item, _loadedTextures));
|
||||
}
|
||||
|
||||
private string GetEmblemTexturePath(ReplayInfoItem item, bool isfetch)
|
||||
{
|
||||
return Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentEmblemId, ResourcesManager.AssetLoadPathType.Emblem_S, isfetch);
|
||||
}
|
||||
|
||||
private string GetCountryTexturePath(ReplayInfoItem item, bool isfetch)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item.OpponentCountryCode))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentCountryCode, ResourcesManager.AssetLoadPathType.Country_S, isfetch);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
UIManager.GetInstance().StartCoroutine(UnloadTextures());
|
||||
}
|
||||
|
||||
private IEnumerator UnloadTextures()
|
||||
{
|
||||
_loadQueue.Clear();
|
||||
while (_loadQueue.IsClearing)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadedTextures);
|
||||
}
|
||||
|
||||
private GameObject AddContent(GameObject gameObject)
|
||||
{
|
||||
GameObject obj = NGUITools.AddChild(gameObject, _replayDialogContent);
|
||||
ReplayDialogContent component = obj.GetComponent<ReplayDialogContent>();
|
||||
component.GetComponent<UIDragScrollView>().scrollView = _scrollView;
|
||||
component.OnClickReplayButton = delegate
|
||||
{
|
||||
OnClickReplayButton.Call();
|
||||
};
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
54
SVSim.BattleEngine/Engine/Wizard/ReplayInfoTask.cs
Normal file
54
SVSim.BattleEngine/Engine/Wizard/ReplayInfoTask.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ReplayInfoTask : BaseTask
|
||||
{
|
||||
public class ReplayInfoTaskParam : BaseParam
|
||||
{
|
||||
}
|
||||
|
||||
public ReplayInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.ReplayInfo;
|
||||
}
|
||||
|
||||
public void SetParameter()
|
||||
{
|
||||
ReplayInfoTaskParam replayInfoTaskParam = new ReplayInfoTaskParam();
|
||||
base.Params = replayInfoTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
List<ReplayInfoItem> list = new List<ReplayInfoItem>();
|
||||
JsonData jsonData = base.ResponseData["data"]["replay_list"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
list.Add(new ReplayInfoItem(jsonData[i]));
|
||||
}
|
||||
Data.ReplayInfo.Items = list;
|
||||
if (base.ResponseData["data"].Keys.Contains("feature_maintenance_list"))
|
||||
{
|
||||
List<NetworkDefine.MAINTENANCE_TYPE> list2 = new List<NetworkDefine.MAINTENANCE_TYPE>();
|
||||
for (int j = 0; j < base.ResponseData["data"]["feature_maintenance_list"].Count; j++)
|
||||
{
|
||||
list2.Add((NetworkDefine.MAINTENANCE_TYPE)base.ResponseData["data"]["feature_maintenance_list"][j].ToInt());
|
||||
}
|
||||
Data.UpdateMaintenance(new List<NetworkDefine.MAINTENANCE_TYPE>
|
||||
{
|
||||
NetworkDefine.MAINTENANCE_TYPE.REPLAY_ALL,
|
||||
NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_ALL,
|
||||
NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_EXCLUDE_ROTATION,
|
||||
NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_RECORD
|
||||
}, list2);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
299
SVSim.BattleEngine/Engine/Wizard/RoomTwoPickApiVariation.cs
Normal file
299
SVSim.BattleEngine/Engine/Wizard/RoomTwoPickApiVariation.cs
Normal file
@@ -0,0 +1,299 @@
|
||||
using System.Collections.Generic;
|
||||
using Wizard.RoomMatch;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public static class RoomTwoPickApiVariation
|
||||
{
|
||||
public enum VariationType
|
||||
{
|
||||
DoMatching,
|
||||
Finish,
|
||||
ResetDeck,
|
||||
BeginCreateDeck,
|
||||
SelectClass,
|
||||
SelectCardSet
|
||||
}
|
||||
|
||||
private static readonly Dictionary<VariationType, ApiType.Type> NormalApiTypes = new Dictionary<VariationType, ApiType.Type>
|
||||
{
|
||||
{
|
||||
VariationType.DoMatching,
|
||||
ApiType.Type.OpenRoomBattle2PickBattleDoMatching
|
||||
},
|
||||
{
|
||||
VariationType.Finish,
|
||||
ApiType.Type.OpenRoom2PickMatchFinish
|
||||
},
|
||||
{
|
||||
VariationType.ResetDeck,
|
||||
ApiType.Type.OpenRoom2PickBattleDeckReset
|
||||
},
|
||||
{
|
||||
VariationType.BeginCreateDeck,
|
||||
ApiType.Type.OpenRoom2PickBattleBeginCreateDeck
|
||||
},
|
||||
{
|
||||
VariationType.SelectClass,
|
||||
ApiType.Type.OpenRoom2PickBattleSelectClass
|
||||
},
|
||||
{
|
||||
VariationType.SelectCardSet,
|
||||
ApiType.Type.OpenRoom2PickBattleSelectCard
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Dictionary<VariationType, ApiType.Type> MultiApiTypes = new Dictionary<VariationType, ApiType.Type>
|
||||
{
|
||||
{
|
||||
VariationType.DoMatching,
|
||||
ApiType.Type.OpenRoomBattle2PickMultiBattleDoMatching
|
||||
},
|
||||
{
|
||||
VariationType.Finish,
|
||||
ApiType.Type.OpenRoom2PickMultiBattleMatchFinish
|
||||
},
|
||||
{
|
||||
VariationType.ResetDeck,
|
||||
ApiType.Type.OpenRoom2PickMultiBattleDeckReset
|
||||
},
|
||||
{
|
||||
VariationType.BeginCreateDeck,
|
||||
ApiType.Type.OpenRoom2PickMultiBattleBeginCreateDeck
|
||||
},
|
||||
{
|
||||
VariationType.SelectClass,
|
||||
ApiType.Type.OpenRoom2PickMultiBattleSelectClass
|
||||
},
|
||||
{
|
||||
VariationType.SelectCardSet,
|
||||
ApiType.Type.OpenRoom2PickMultiBattleSelectCard
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Dictionary<VariationType, ApiType.Type> BackdraftApiTypes = new Dictionary<VariationType, ApiType.Type>
|
||||
{
|
||||
{
|
||||
VariationType.DoMatching,
|
||||
ApiType.Type.OpenRoomBattle2PickDraftBattleDoMatching
|
||||
},
|
||||
{
|
||||
VariationType.Finish,
|
||||
ApiType.Type.OpenRoom2PickDraftMatchFinish
|
||||
},
|
||||
{
|
||||
VariationType.ResetDeck,
|
||||
ApiType.Type.OpenRoom2PickDraftBattleDeckReset
|
||||
},
|
||||
{
|
||||
VariationType.BeginCreateDeck,
|
||||
ApiType.Type.OpenRoom2PickDraftBattleBeginCreateDeck
|
||||
},
|
||||
{
|
||||
VariationType.SelectClass,
|
||||
ApiType.Type.OpenRoom2PickDraftBattleSelectClass
|
||||
},
|
||||
{
|
||||
VariationType.SelectCardSet,
|
||||
ApiType.Type.OpenRoom2PickDraftBattleSelectCard
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Dictionary<VariationType, ApiType.Type> CubeApiTypes = new Dictionary<VariationType, ApiType.Type>
|
||||
{
|
||||
{
|
||||
VariationType.DoMatching,
|
||||
ApiType.Type.OpenRoom2PickCubeBattleDoMatching
|
||||
},
|
||||
{
|
||||
VariationType.Finish,
|
||||
ApiType.Type.OpenRoom2PickCubeBattleFinish
|
||||
},
|
||||
{
|
||||
VariationType.ResetDeck,
|
||||
ApiType.Type.OpenRoom2PickCubeBattleResetDeck
|
||||
},
|
||||
{
|
||||
VariationType.BeginCreateDeck,
|
||||
ApiType.Type.OpenRoom2PickCubeBattleBeginCreateDeck
|
||||
},
|
||||
{
|
||||
VariationType.SelectClass,
|
||||
ApiType.Type.OpenRoom2PickCubeBattleSelectClass
|
||||
},
|
||||
{
|
||||
VariationType.SelectCardSet,
|
||||
ApiType.Type.OpenRoom2PickCubeBattleSelectCardSet
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Dictionary<VariationType, ApiType.Type> MultiCubeApiTypes = new Dictionary<VariationType, ApiType.Type>
|
||||
{
|
||||
{
|
||||
VariationType.DoMatching,
|
||||
ApiType.Type.OpenRoom2PickCubeMultiBattleDoMatching
|
||||
},
|
||||
{
|
||||
VariationType.Finish,
|
||||
ApiType.Type.OpenRoom2PickCubeMultiBattleFinish
|
||||
},
|
||||
{
|
||||
VariationType.ResetDeck,
|
||||
ApiType.Type.OpenRoom2PickCubeMultiBattleResetDeck
|
||||
},
|
||||
{
|
||||
VariationType.BeginCreateDeck,
|
||||
ApiType.Type.OpenRoom2PickCubeMultiBattleBeginCreateDeck
|
||||
},
|
||||
{
|
||||
VariationType.SelectClass,
|
||||
ApiType.Type.OpenRoom2PickCubeMultiBattleSelectClass
|
||||
},
|
||||
{
|
||||
VariationType.SelectCardSet,
|
||||
ApiType.Type.OpenRoom2PickCubeMultiBattleSelectCardSet
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Dictionary<VariationType, ApiType.Type> BackDraftCubeApiTypes = new Dictionary<VariationType, ApiType.Type>
|
||||
{
|
||||
{
|
||||
VariationType.DoMatching,
|
||||
ApiType.Type.OpenRoomBattle2PickCubeDraftBattleDoMatching
|
||||
},
|
||||
{
|
||||
VariationType.Finish,
|
||||
ApiType.Type.OpenRoom2PickCubeDraftMatchFinish
|
||||
},
|
||||
{
|
||||
VariationType.ResetDeck,
|
||||
ApiType.Type.OpenRoom2PickCubeDraftBattleDeckReset
|
||||
},
|
||||
{
|
||||
VariationType.BeginCreateDeck,
|
||||
ApiType.Type.OpenRoom2PickCubeDraftBattleBeginCreateDeck
|
||||
},
|
||||
{
|
||||
VariationType.SelectClass,
|
||||
ApiType.Type.OpenRoom2PickCubeDraftBattleSelectClass
|
||||
},
|
||||
{
|
||||
VariationType.SelectCardSet,
|
||||
ApiType.Type.OpenRoom2PickCubeDraftBattleSelectCard
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Dictionary<VariationType, ApiType.Type> ChaosApiTypes = new Dictionary<VariationType, ApiType.Type>
|
||||
{
|
||||
{
|
||||
VariationType.DoMatching,
|
||||
ApiType.Type.OpenRoom2PickChaosBattleDoMatching
|
||||
},
|
||||
{
|
||||
VariationType.Finish,
|
||||
ApiType.Type.OpenRoom2PickChaosBattleFinish
|
||||
},
|
||||
{
|
||||
VariationType.ResetDeck,
|
||||
ApiType.Type.OpenRoom2PickChaosBattleResetDeck
|
||||
},
|
||||
{
|
||||
VariationType.BeginCreateDeck,
|
||||
ApiType.Type.OpenRoom2PickChaosBattleBeginCreateDeck
|
||||
},
|
||||
{
|
||||
VariationType.SelectClass,
|
||||
ApiType.Type.OpenRoom2PickChaosBattleSelectClass
|
||||
},
|
||||
{
|
||||
VariationType.SelectCardSet,
|
||||
ApiType.Type.OpenRoom2PickChaosBattleSelectCardSet
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Dictionary<VariationType, ApiType.Type> MultiChaosApiTypes = new Dictionary<VariationType, ApiType.Type>
|
||||
{
|
||||
{
|
||||
VariationType.DoMatching,
|
||||
ApiType.Type.OpenRoom2PickChaosMultiBattleDoMatching
|
||||
},
|
||||
{
|
||||
VariationType.Finish,
|
||||
ApiType.Type.OpenRoom2PickChaosMultiBattleFinish
|
||||
},
|
||||
{
|
||||
VariationType.ResetDeck,
|
||||
ApiType.Type.OpenRoom2PickChaosMultiBattleResetDeck
|
||||
},
|
||||
{
|
||||
VariationType.BeginCreateDeck,
|
||||
ApiType.Type.OpenRoom2PickChaosMultiBattleBeginCreateDeck
|
||||
},
|
||||
{
|
||||
VariationType.SelectClass,
|
||||
ApiType.Type.OpenRoom2PickChaosMultiBattleSelectClass
|
||||
},
|
||||
{
|
||||
VariationType.SelectCardSet,
|
||||
ApiType.Type.OpenRoom2PickChaosMultiBattleSelectCardSet
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Dictionary<VariationType, ApiType.Type> BackdraftChaosApiTypes = new Dictionary<VariationType, ApiType.Type>
|
||||
{
|
||||
{
|
||||
VariationType.DoMatching,
|
||||
ApiType.Type.OpenRoomBattle2PickChaosDraftBattleDoMatching
|
||||
},
|
||||
{
|
||||
VariationType.Finish,
|
||||
ApiType.Type.OpenRoom2PickChaosDraftMatchFinish
|
||||
},
|
||||
{
|
||||
VariationType.ResetDeck,
|
||||
ApiType.Type.OpenRoom2PickChaosDraftBattleDeckReset
|
||||
},
|
||||
{
|
||||
VariationType.BeginCreateDeck,
|
||||
ApiType.Type.OpenRoom2PickChaosDraftBattleBeginCreateDeck
|
||||
},
|
||||
{
|
||||
VariationType.SelectClass,
|
||||
ApiType.Type.OpenRoom2PickChaosDraftBattleSelectClass
|
||||
},
|
||||
{
|
||||
VariationType.SelectCardSet,
|
||||
ApiType.Type.OpenRoom2PickChaosDraftBattleSelectCard
|
||||
}
|
||||
};
|
||||
|
||||
public static ApiType.Type GetApiType(TwoPickFormat twoPickFormat, RoomConnectController.BattleRule rule, VariationType type)
|
||||
{
|
||||
Dictionary<VariationType, ApiType.Type> dictionary = NormalApiTypes;
|
||||
switch (twoPickFormat)
|
||||
{
|
||||
case TwoPickFormat.Backdraft:
|
||||
dictionary = BackdraftApiTypes;
|
||||
break;
|
||||
case TwoPickFormat.BackdraftCube:
|
||||
dictionary = BackDraftCubeApiTypes;
|
||||
break;
|
||||
case TwoPickFormat.BackdraftChaos:
|
||||
dictionary = BackdraftChaosApiTypes;
|
||||
break;
|
||||
case TwoPickFormat.Cube:
|
||||
dictionary = ((rule != RoomConnectController.BattleRule.Bo3 && rule != RoomConnectController.BattleRule.Bo5) ? CubeApiTypes : MultiCubeApiTypes);
|
||||
break;
|
||||
case TwoPickFormat.Chaos:
|
||||
dictionary = ((rule != RoomConnectController.BattleRule.Bo3 && rule != RoomConnectController.BattleRule.Bo5) ? ChaosApiTypes : MultiChaosApiTypes);
|
||||
break;
|
||||
default:
|
||||
if (rule == RoomConnectController.BattleRule.Bo3 || rule == RoomConnectController.BattleRule.Bo5)
|
||||
{
|
||||
dictionary = MultiApiTypes;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return dictionary[type];
|
||||
}
|
||||
}
|
||||
26
SVSim.BattleEngine/Engine/Wizard/SealedFinishTask.cs
Normal file
26
SVSim.BattleEngine/Engine/Wizard/SealedFinishTask.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class SealedFinishTask : BaseTask
|
||||
{
|
||||
public SealedFinishTask()
|
||||
{
|
||||
base.type = ApiType.Type.ArenaSealedFinish;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
SealedData sealedData = Data.ArenaData.SealedData;
|
||||
sealedData.SetRewardCardCandidates(jsonData);
|
||||
sealedData.SetRewardInfo(jsonData);
|
||||
sealedData.UpdateHaveUserGoodsNum(jsonData);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class SealedGetMaintCardListTask : BaseTask
|
||||
{
|
||||
public SealedGetMaintCardListTask()
|
||||
{
|
||||
base.type = ApiType.Type.ArenaSealedGetMaintCardList;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"]["maintenance_card_list"];
|
||||
int count = jsonData.Count;
|
||||
int[] array = ((count > 0) ? new int[count * 3] : null);
|
||||
int num2 = 0;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
int num3 = jsonData[i]["card_id"].ToInt();
|
||||
array[num2++] = num3;
|
||||
array[num2++] = SealedData.ConvertToSealedCardId(num3, isPhantomCard: false);
|
||||
array[num2++] = SealedData.ConvertToSealedCardId(num3, isPhantomCard: true);
|
||||
}
|
||||
GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(array);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
27
SVSim.BattleEngine/Engine/Wizard/SealedRetireTask.cs
Normal file
27
SVSim.BattleEngine/Engine/Wizard/SealedRetireTask.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class SealedRetireTask : BaseTask
|
||||
{
|
||||
public SealedRetireTask()
|
||||
{
|
||||
base.type = ApiType.Type.ArenaSealedRetire;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
SealedData sealedData = Data.ArenaData.SealedData;
|
||||
sealedData.SetRetired(isRetired: true);
|
||||
sealedData.SetRewardCardCandidates(jsonData);
|
||||
sealedData.SetRewardInfo(jsonData);
|
||||
sealedData.UpdateHaveUserGoodsNum(jsonData);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
41
SVSim.BattleEngine/Engine/Wizard/SealedSelectClassTask.cs
Normal file
41
SVSim.BattleEngine/Engine/Wizard/SealedSelectClassTask.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class SealedSelectClassTask : BaseTask
|
||||
{
|
||||
public class Param : BaseParam
|
||||
{
|
||||
public int class_id;
|
||||
|
||||
public Param(int classId)
|
||||
{
|
||||
class_id = classId;
|
||||
}
|
||||
}
|
||||
|
||||
public SealedSelectClassTask(int classId)
|
||||
{
|
||||
base.type = ApiType.Type.ArenaSealedSelectClass;
|
||||
base.Params = new Param(classId);
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
SealedData sealedData = Data.ArenaData.SealedData;
|
||||
sealedData.UpdateHaveUserGoodsNum(jsonData);
|
||||
sealedData.SetSelectedClassId((base.Params as Param).class_id);
|
||||
sealedData.SetGachaCardInfo(jsonData);
|
||||
sealedData.SetGachaSupplyInfo(jsonData);
|
||||
sealedData.SetSealedCardInfo(jsonData, isRegisterSealedCard: true);
|
||||
sealedData.SetDeckCompleted(jsonData);
|
||||
sealedData.SetIsSpecialEffect(jsonData);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class SealedSelectPhantomCardTask : BaseTask
|
||||
{
|
||||
public class Param : BaseParam
|
||||
{
|
||||
public int select_card_id;
|
||||
|
||||
public bool is_retire;
|
||||
|
||||
public Param(int selectCardId, bool isRetire)
|
||||
{
|
||||
select_card_id = selectCardId;
|
||||
is_retire = isRetire;
|
||||
}
|
||||
}
|
||||
|
||||
public SealedSelectPhantomCardTask(int selectCardId)
|
||||
{
|
||||
base.type = ApiType.Type.ArenaSealedSelectPhantomCard;
|
||||
base.Params = new Param(selectCardId, Data.ArenaData.SealedData.IsRetired.Value);
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
SealedData sealedData = Data.ArenaData.SealedData;
|
||||
sealedData.SetRewardInfo(jsonData);
|
||||
sealedData.UpdateHaveUserGoodsNum(jsonData);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
28
SVSim.BattleEngine/Engine/Wizard/SealedTopTask.cs
Normal file
28
SVSim.BattleEngine/Engine/Wizard/SealedTopTask.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class SealedTopTask : BaseTask
|
||||
{
|
||||
public SealedTopTask()
|
||||
{
|
||||
base.type = ApiType.Type.ArenaSealedTop;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
SealedData sealedData = Data.ArenaData.SealedData;
|
||||
sealedData.SetEntryInfo(jsonData);
|
||||
sealedData.SetClassInfo(jsonData);
|
||||
sealedData.SetSealedCardInfo(jsonData, isRegisterSealedCard: true);
|
||||
sealedData.SetDeckCompleted(jsonData);
|
||||
sealedData.SetBattleResultInfo(jsonData);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
64
SVSim.BattleEngine/Engine/Wizard/SealedUpdateDeckTask.cs
Normal file
64
SVSim.BattleEngine/Engine/Wizard/SealedUpdateDeckTask.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class SealedUpdateDeckTask : BaseTask
|
||||
{
|
||||
private enum eArrayIndex
|
||||
{
|
||||
AcquiredCard,
|
||||
PhantomCard,
|
||||
Max
|
||||
}
|
||||
|
||||
public class Param : BaseParam
|
||||
{
|
||||
public int[][] card_id_array;
|
||||
|
||||
public Param(int[][] cardIdArray)
|
||||
{
|
||||
card_id_array = cardIdArray;
|
||||
}
|
||||
}
|
||||
|
||||
public SealedUpdateDeckTask(List<int> cardList)
|
||||
{
|
||||
base.type = ApiType.Type.ArenaSealedUpdateDeck;
|
||||
List<int> list = new List<int>();
|
||||
List<int> list2 = new List<int>();
|
||||
SealedData sealedData = Data.ArenaData.SealedData;
|
||||
for (int i = 0; i < cardList.Count; i++)
|
||||
{
|
||||
SealedCardInfo sealedCardInfo = sealedData.GetSealedCardInfo(cardList[i]);
|
||||
int originalCardId = sealedCardInfo.OriginalCardId;
|
||||
if (!sealedCardInfo.IsPhantom)
|
||||
{
|
||||
list.Add(originalCardId);
|
||||
}
|
||||
else
|
||||
{
|
||||
list2.Add(originalCardId);
|
||||
}
|
||||
}
|
||||
base.Params = new Param(new int[2][]
|
||||
{
|
||||
list.ToArray(),
|
||||
list2.ToArray()
|
||||
});
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
SealedData sealedData = Data.ArenaData.SealedData;
|
||||
sealedData.SetSealedCardInfo(jsonData, isRegisterSealedCard: false);
|
||||
sealedData.SetDeckCompleted(jsonData);
|
||||
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