Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
1690 lines
42 KiB
C#
1690 lines
42 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Cute;
|
|
using UnityEngine;
|
|
using Wizard;
|
|
using Wizard.UI.Dialog.ImageSelection;
|
|
|
|
public class DialogBase : MonoBehaviour
|
|
{
|
|
public enum DialogScene
|
|
{
|
|
OPEN,
|
|
WAIT,
|
|
CLOSE,
|
|
END,
|
|
ERASE
|
|
}
|
|
|
|
public enum Size
|
|
{
|
|
S,
|
|
M,
|
|
L,
|
|
XL,
|
|
BATTLE_LOG
|
|
}
|
|
|
|
public enum ButtonLayout
|
|
{
|
|
NONE,
|
|
OkBtn,
|
|
DecisionBtn,
|
|
CloseBtn,
|
|
BackToTitleBtn,
|
|
GrayBtn,
|
|
RedBtn,
|
|
YellowBtn,
|
|
BlueBtn_CancelBtn,
|
|
RedBtn_CancelBtn,
|
|
BlueBtn_GrayBtn,
|
|
BlueBtn_RedBtn,
|
|
GrayBtn_GrayBtn,
|
|
BlueBtn_RedBtn_GrayBtn,
|
|
GrayBtn_CancelBtn_BlueBtn,
|
|
GrayBtn_GrayBtn_BlueBtn,
|
|
BattleEvolveConfirm,
|
|
BlueButton,
|
|
BlueButton_BlueButton,
|
|
BlueButton_BlueButton_BlueButton
|
|
}
|
|
|
|
private enum ButtonSprite
|
|
{
|
|
BLUE,
|
|
GRAY,
|
|
RED,
|
|
YELLOW,
|
|
BLUE_S,
|
|
RED_S
|
|
}
|
|
|
|
public enum ButtonType
|
|
{
|
|
Blue,
|
|
Red,
|
|
Gray,
|
|
Yellow,
|
|
OK,
|
|
Decision,
|
|
Close,
|
|
Cancel,
|
|
Retry,
|
|
BackToTitle,
|
|
BackToHome,
|
|
QuitApplication,
|
|
VersionUp,
|
|
RecommendedList
|
|
}
|
|
|
|
private class UIPanelAlphaController
|
|
{
|
|
private UIPanel _panel;
|
|
|
|
private float _originalAlpha;
|
|
|
|
public UIPanelAlphaController(UIPanel panel)
|
|
{
|
|
_panel = panel;
|
|
_originalAlpha = _panel.alpha;
|
|
}
|
|
|
|
public void SetAlpha(float alpha)
|
|
{
|
|
_panel.alpha = alpha;
|
|
}
|
|
|
|
public void ResetAlpha()
|
|
{
|
|
_panel.alpha = _originalAlpha;
|
|
}
|
|
}
|
|
|
|
public enum KeyboardDialogSelect
|
|
{
|
|
Button1,
|
|
Button2,
|
|
Button3,
|
|
CloseButton
|
|
}
|
|
|
|
private class Button
|
|
{
|
|
private ButtonType Type { get; set; }
|
|
|
|
public ButtonSprite Sprite { get; private set; }
|
|
|
|
public string Text { get; private set; }
|
|
|
|
public Se.TYPE SE { get; private set; }
|
|
|
|
public Action OnClick { get; private set; }
|
|
|
|
public Action OnDestroy { get; private set; }
|
|
|
|
public Button(ButtonType type, string text)
|
|
{
|
|
Type = type;
|
|
SystemText systemText = Data.SystemText;
|
|
switch (type)
|
|
{
|
|
case ButtonType.Blue:
|
|
Sprite = ButtonSprite.BLUE;
|
|
SE = Se.TYPE.SYS_BTN_DECIDE;
|
|
break;
|
|
case ButtonType.Red:
|
|
Sprite = ButtonSprite.RED;
|
|
SE = Se.TYPE.SYS_BTN_DECIDE;
|
|
break;
|
|
case ButtonType.Gray:
|
|
Sprite = ButtonSprite.GRAY;
|
|
SE = Se.TYPE.SYS_BTN_CANCEL;
|
|
break;
|
|
case ButtonType.Yellow:
|
|
Sprite = ButtonSprite.YELLOW;
|
|
SE = Se.TYPE.SYS_BTN_DECIDE;
|
|
break;
|
|
case ButtonType.OK:
|
|
Sprite = ButtonSprite.BLUE;
|
|
Text = systemText.Get("Common_0004");
|
|
SE = Se.TYPE.SYS_BTN_DECIDE;
|
|
break;
|
|
case ButtonType.Decision:
|
|
Sprite = ButtonSprite.BLUE;
|
|
Text = systemText.Get("Common_0003");
|
|
SE = Se.TYPE.SYS_BTN_DECIDE;
|
|
break;
|
|
case ButtonType.Close:
|
|
Sprite = ButtonSprite.GRAY;
|
|
Text = systemText.Get("Common_0008");
|
|
SE = Se.TYPE.SYS_BTN_CANCEL;
|
|
break;
|
|
case ButtonType.Cancel:
|
|
Sprite = ButtonSprite.GRAY;
|
|
Text = systemText.Get("Common_0005");
|
|
SE = Se.TYPE.SYS_BTN_CANCEL;
|
|
break;
|
|
case ButtonType.Retry:
|
|
Sprite = ButtonSprite.BLUE;
|
|
Text = systemText.Get("Common_0133");
|
|
SE = Se.TYPE.SYS_BTN_DECIDE;
|
|
OnClick = delegate
|
|
{
|
|
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Retry());
|
|
};
|
|
NetworkUI.GetInstance().SetKeepLastRequest(flag: true);
|
|
OnDestroy = delegate
|
|
{
|
|
NetworkUI.GetInstance().SetKeepLastRequest(flag: false);
|
|
};
|
|
break;
|
|
case ButtonType.BackToTitle:
|
|
Sprite = ButtonSprite.GRAY;
|
|
Text = systemText.Get("Common_0131");
|
|
SE = Se.TYPE.SYS_BTN_CANCEL_TRANS;
|
|
OnClick = delegate
|
|
{
|
|
SoftwareReset.exec();
|
|
};
|
|
break;
|
|
case ButtonType.BackToHome:
|
|
Sprite = ButtonSprite.GRAY;
|
|
Text = systemText.Get("Common_0132");
|
|
SE = Se.TYPE.SYS_BTN_CANCEL_TRANS;
|
|
OnClick = delegate
|
|
{
|
|
UIManager.GetInstance().closeInSceneCenterLoading();
|
|
if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Battle && GameMgr.GetIns().GetBattleCtrl() != null)
|
|
{
|
|
UIManager.GetInstance().StartCoroutine(BattleEndCoroutine());
|
|
}
|
|
else
|
|
{
|
|
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage);
|
|
}
|
|
};
|
|
break;
|
|
case ButtonType.QuitApplication:
|
|
Sprite = ButtonSprite.GRAY;
|
|
Text = systemText.Get("Common_0135");
|
|
SE = Se.TYPE.SYS_BTN_CANCEL;
|
|
OnClick = delegate
|
|
{
|
|
if (Toolbox.mute != null)
|
|
{
|
|
Toolbox.mute.Close();
|
|
Toolbox.mute = null;
|
|
}
|
|
UIManager.ApplicationQuit();
|
|
};
|
|
break;
|
|
case ButtonType.VersionUp:
|
|
Sprite = ButtonSprite.BLUE;
|
|
Text = systemText.Get("Common_0136");
|
|
SE = Se.TYPE.SYS_BTN_DECIDE;
|
|
OnClick = delegate
|
|
{
|
|
Toolbox.NetworkManager.GoToStore();
|
|
};
|
|
NetworkUI.GetInstance().SetKeepLastRequest(flag: true);
|
|
break;
|
|
case ButtonType.RecommendedList:
|
|
Sprite = ButtonSprite.BLUE;
|
|
Text = systemText.Get("Common_0134");
|
|
SE = Se.TYPE.SYS_BTN_DECIDE;
|
|
OnClick = delegate
|
|
{
|
|
UIManager.GetInstance().WebViewHelper.CreateOpenURLWindow(WebViewHelper.UrlType.RECOMMENDED_DEVICE);
|
|
};
|
|
break;
|
|
}
|
|
if (text != null)
|
|
{
|
|
Text = text;
|
|
}
|
|
}
|
|
|
|
private IEnumerator BattleEndCoroutine()
|
|
{
|
|
yield return null;
|
|
SBattleLoad battleLoad = BattleManagerBase.GetIns().SBattleLoad;
|
|
while (!battleLoad.isLoadEnd)
|
|
{
|
|
yield return null;
|
|
}
|
|
yield return GameMgr.GetIns().GetBattleCtrl().BattleEnd();
|
|
UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam();
|
|
changeViewSceneParam.OnChange = delegate
|
|
{
|
|
UIManager.GetInstance().CloseInSceneLoadingBattle();
|
|
};
|
|
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam);
|
|
}
|
|
}
|
|
|
|
private const int ONE_BUTTON_1BUTTON_LEFT_ANCHOR = -128;
|
|
|
|
private const int ONE_BUTTON_1BUTTON_RIGHT_ANCHOR = 128;
|
|
|
|
private const int TWO_BUTTON_1BUTTON_LEFT_ANCHOR = 8;
|
|
|
|
private const int TWO_BUTTON_1BUTTON_RIGHT_ANCHOR = 264;
|
|
|
|
private const int TWO_BUTTON_2BUTTON_LEFT_ANCHOR = -264;
|
|
|
|
private const int TWO_BUTTON_2BUTTON_RIGHT_ANCHOR = -8;
|
|
|
|
private const int THREE_BUTTON_1BUTTON_LEFT_ANCHOR = -128;
|
|
|
|
private const int THREE_BUTTON_1BUTTON_RIGHT_ANCHOR = 128;
|
|
|
|
private const int THREE_BUTTON_2BUTTON_LEFT_ANCHOR = -398;
|
|
|
|
private const int THREE_BUTTON_2BUTTON_RIGHT_ANCHOR = -142;
|
|
|
|
private const int THREE_BUTTON_3BUTTON_LEFT_ANCHOR = 142;
|
|
|
|
private const int THREE_BUTTON_3BUTTON_RIGHT_ANCHOR = 398;
|
|
|
|
private const int WEBVIEW_ANCHOR_LEFT = 6;
|
|
|
|
private const int WEBVIEW_ANCHOR_BOTTOM = 18;
|
|
|
|
private const int WEBVIEW_ANCHOR_RIGHT = -6;
|
|
|
|
private const int WEBVIEW_ANCHOR_TOP = -17;
|
|
|
|
private const float START_ALPHA = 0.01f;
|
|
|
|
public const float BACKVIEW_ALPHA = 0.8f;
|
|
|
|
private const float OPEN_TIME = 0.3f;
|
|
|
|
public const int DELTA_PANEL_DEPTH = 5;
|
|
|
|
public static readonly Vector3 BATTLELOG_TITLELABEL_POS = new Vector3(0f, 16f, 0f);
|
|
|
|
public static readonly Vector3 BATTLELOG_WINDOWSPRITE_POS = new Vector3(-250f, 0f, 0f);
|
|
|
|
private const int BATTLELOG_WINDOW_W = 600;
|
|
|
|
private const int BATTLELOG_WINDOW_H = 600;
|
|
|
|
private const int FAQ_DEAPTH = 6100;
|
|
|
|
public const int FRIEND_DIALOG_DEPTH = 1000;
|
|
|
|
public const int ERROR_DIALOG_BATTLE = 5000;
|
|
|
|
public const int ERROR_DIALOG_MATCHING_DEPTH = 5400;
|
|
|
|
public const int ERROR_DIALOG_DEPTH = 5500;
|
|
|
|
public const int ERROR_ASSETHANDLE_DIALOG_DEPTH = 6000;
|
|
|
|
public const int HOME_LOGIN_BONUS_DEPTH = 10;
|
|
|
|
public const int HOME_BATTLE_RESULT_DEPTH = 15;
|
|
|
|
public const int QUIT_DIALOG_DEPTH = 7000;
|
|
|
|
public const int GATHERING_STATE_CHANGE_DIALOG_DEPTH = 4000;
|
|
|
|
public const int SCROLL_BOTTOM_ANCHOR_WINDOW = 8;
|
|
|
|
public const int SCROLL_BOTTOM_ANCHOR_BUTTON_LINE = -2;
|
|
|
|
private const int WEBVIEW_DISPLAY_MARGIN = 35;
|
|
|
|
private const int WEBVIEW_Y_OFFSET = 2;
|
|
|
|
private const string spriteButtonBlue = "btn_common_02_m_off";
|
|
|
|
private const string spriteButtonBluePush = "btn_common_02_m_on";
|
|
|
|
private const string spriteButtonGray = "btn_common_01_m_off";
|
|
|
|
private const string spriteButtonGrayPush = "btn_common_01_m_on";
|
|
|
|
private const string spriteButtonRed = "btn_common_04_m_off";
|
|
|
|
private const string spriteButtonRedPush = "btn_common_04_m_on";
|
|
|
|
private const string spriteButtonYellow = "btn_common_03_m_off";
|
|
|
|
private const string spriteButtonYellowPush = "btn_common_03_m_on";
|
|
|
|
private const string spriteButtonRed_S = "btn_common_04_s_off";
|
|
|
|
private const string spriteButtonRedPush_S = "btn_common_04_s_on";
|
|
|
|
private const string spriteButtonBlue_S = "btn_common_02_s_off";
|
|
|
|
private const string spriteButtonBluePush_S = "btn_common_02_s_on";
|
|
|
|
[HideInInspector]
|
|
public NguiObjs InputAreaObjs;
|
|
|
|
[SerializeField]
|
|
public UISprite WindowSprite;
|
|
|
|
[SerializeField]
|
|
private UIButton CloseButton;
|
|
|
|
[SerializeField]
|
|
private GameObject TitleObjs;
|
|
|
|
[SerializeField]
|
|
private UILabel titleLabel;
|
|
|
|
[SerializeField]
|
|
private GameObject backViewOriginal;
|
|
|
|
[HideInInspector]
|
|
public GameObject backView;
|
|
|
|
[SerializeField]
|
|
private GameObject _collider;
|
|
|
|
[SerializeField]
|
|
private UIPanel _colliderPanel;
|
|
|
|
private float _colliderUpdateTimer;
|
|
|
|
private bool _colliderUpdateEnable;
|
|
|
|
[SerializeField]
|
|
private UILabel DetailMsg;
|
|
|
|
[SerializeField]
|
|
private GameObject ButtonBase;
|
|
|
|
[SerializeField]
|
|
public UIButton button1;
|
|
|
|
[SerializeField]
|
|
private UILabel button1_Label;
|
|
|
|
[SerializeField]
|
|
private UIButton button2;
|
|
|
|
[SerializeField]
|
|
private UILabel button2_Label;
|
|
|
|
[SerializeField]
|
|
private UIButton button3;
|
|
|
|
[SerializeField]
|
|
private UILabel button3_Label;
|
|
|
|
[SerializeField]
|
|
private UIButton contactButton;
|
|
|
|
[SerializeField]
|
|
private UILabel contactButton_Label;
|
|
|
|
[SerializeField]
|
|
private UIButton webviewBackButton;
|
|
|
|
[SerializeField]
|
|
private UISprite buttonLine;
|
|
|
|
[SerializeField]
|
|
public UISprite titleLine;
|
|
|
|
[SerializeField]
|
|
private UIRect scrollRect;
|
|
|
|
[SerializeField]
|
|
private UIRect scrollBarRect;
|
|
|
|
[SerializeField]
|
|
private UISlider vScrollBar;
|
|
|
|
[SerializeField]
|
|
private UIScrollView scrollView;
|
|
|
|
[SerializeField]
|
|
public GameObject EscapeDialogPrefab;
|
|
|
|
[SerializeField]
|
|
private GameObject _button1Select;
|
|
|
|
[SerializeField]
|
|
private GameObject _button2Select;
|
|
|
|
[SerializeField]
|
|
private GameObject _button3Select;
|
|
|
|
[SerializeField]
|
|
private GameObject _closeButtonSelect;
|
|
|
|
private DialogScene dialogNowScene;
|
|
|
|
private ButtonLayout dialogLayout;
|
|
|
|
private static Vector2[] Sizes = new Vector2[5]
|
|
{
|
|
new Vector2(624f, 360f),
|
|
new Vector2(850f, 564f),
|
|
new Vector2(1080f, 504f),
|
|
new Vector2(1125f, 605f),
|
|
new Vector2(600f, 600f)
|
|
};
|
|
|
|
private static int[] DETAIL_LABEL_SIZE = new int[5] { 540, 766, 996, 1041, 516 };
|
|
|
|
private GameObject returnObj;
|
|
|
|
private string returnMsg_Btn1;
|
|
|
|
private string returnMsg_Btn2;
|
|
|
|
private string returnMsg_Btn3;
|
|
|
|
public Action OnCloseStart;
|
|
|
|
public Action OnClose;
|
|
|
|
private Action OnClose_ForSystem;
|
|
|
|
public Action onPushButton1;
|
|
|
|
public Action onPushButton2;
|
|
|
|
public Action onPushButton3;
|
|
|
|
public Action onCloseWithoutSelect;
|
|
|
|
private Action onFirstUpdate;
|
|
|
|
private string closeMsg;
|
|
|
|
private float timer;
|
|
|
|
private bool isOpenAnim = true;
|
|
|
|
public bool isNotCloseWindowButton1;
|
|
|
|
public bool isNotCloseWindowButton2;
|
|
|
|
public bool isNotCloseWindowButton3;
|
|
|
|
private int _buttonNum;
|
|
|
|
private List<Button> _buttonList = new List<Button>();
|
|
|
|
private int? _layer;
|
|
|
|
private List<UIPanelAlphaController> _insideObjectUIPanelAlphaControllerList = new List<UIPanelAlphaController>();
|
|
|
|
private Coroutine _autoCloseCoroutine;
|
|
|
|
public InputDialog InputDialog { get; set; }
|
|
|
|
public bool IsEnableOpenSe { get; set; } = true;
|
|
|
|
public bool IsCloseByCloseButton { get; private set; }
|
|
|
|
public float PanelAlpha => base.gameObject.GetComponent<UIPanel>().alpha;
|
|
|
|
public CardDetailUI cardDetailDialog { get; set; }
|
|
|
|
public UIScrollView ScrollView => scrollView;
|
|
|
|
public GameObject Btn1GameObject
|
|
{
|
|
get
|
|
{
|
|
if (button1 != null)
|
|
{
|
|
return button1.gameObject;
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public GameObject Btn2GameObject => button2.gameObject;
|
|
|
|
public Se.TYPE OpenSe { get; set; }
|
|
|
|
public Se.TYPE CloseSe { get; set; }
|
|
|
|
public Se.TYPE ClickSe_Btn1 { get; set; }
|
|
|
|
public Se.TYPE ClickSe_Btn2 { get; set; }
|
|
|
|
public Se.TYPE ClickSe_Btn3 { get; set; }
|
|
|
|
public GameObject InsideObject { get; private set; }
|
|
|
|
public bool IsPossibleToCloseByAndroidBackKey { get; set; }
|
|
|
|
public bool IsButton1Enabled
|
|
{
|
|
set
|
|
{
|
|
button1.enabled = value;
|
|
}
|
|
}
|
|
|
|
public bool IsButton2Enabled
|
|
{
|
|
set
|
|
{
|
|
button2.enabled = value;
|
|
}
|
|
}
|
|
|
|
public bool IsCloseButtonEnabled
|
|
{
|
|
set
|
|
{
|
|
CloseButton.enabled = value;
|
|
}
|
|
}
|
|
|
|
public bool IsEmptyColliderEnabled
|
|
{
|
|
set
|
|
{
|
|
if (backView != null && CloseButton.gameObject.activeSelf)
|
|
{
|
|
backView.GetComponentInChildren<UISprite>().gameObject.AddMissingComponent<UIButton>().enabled = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool Button2Grey
|
|
{
|
|
set
|
|
{
|
|
UIManager.SetObjectToGrey(button2.gameObject, value);
|
|
}
|
|
}
|
|
|
|
public DialogBase()
|
|
{
|
|
OpenSe = Se.TYPE.SYS_DIALOG_OPEN;
|
|
CloseSe = Se.TYPE.SYS_BTN_CANCEL;
|
|
IsPossibleToCloseByAndroidBackKey = true;
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
UnityEngine.Object.Destroy(backView);
|
|
}
|
|
|
|
private void Awake()
|
|
{
|
|
SetButtonSprite();
|
|
SetSize(Size.S);
|
|
CloseOnOff(flag: true);
|
|
SetScrollBottomAnchor(isExistButton: false);
|
|
SetTitleLabel(Data.SystemText.Get("Common_0021"));
|
|
button1.onClick.Clear();
|
|
button1.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
if (dialogNowScene == DialogScene.WAIT)
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(ClickSe_Btn1);
|
|
if (returnObj != null && returnMsg_Btn1 != "")
|
|
{
|
|
returnObj.SendMessage(returnMsg_Btn1);
|
|
}
|
|
if (onPushButton1 != null)
|
|
{
|
|
onPushButton1();
|
|
}
|
|
if (!isNotCloseWindowButton1)
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
}));
|
|
button2.onClick.Clear();
|
|
button2.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
if (dialogNowScene == DialogScene.WAIT)
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(ClickSe_Btn2);
|
|
if (returnObj != null && !string.IsNullOrEmpty(returnMsg_Btn2))
|
|
{
|
|
returnObj.SendMessage(returnMsg_Btn2);
|
|
}
|
|
if (onPushButton2 != null)
|
|
{
|
|
onPushButton2();
|
|
}
|
|
if (!isNotCloseWindowButton2)
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
}));
|
|
button3.onClick.Clear();
|
|
button3.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
if (dialogNowScene == DialogScene.WAIT)
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(ClickSe_Btn3);
|
|
if (returnObj != null && !string.IsNullOrEmpty(returnMsg_Btn3))
|
|
{
|
|
returnObj.SendMessage(returnMsg_Btn3);
|
|
}
|
|
if (onPushButton3 != null)
|
|
{
|
|
onPushButton3();
|
|
}
|
|
if (!isNotCloseWindowButton3)
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
}));
|
|
CloseButton.onClick.Clear();
|
|
CloseButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
if (dialogNowScene == DialogScene.WAIT)
|
|
{
|
|
CloseNotSelect(isCloseButton: true);
|
|
}
|
|
}));
|
|
backView = UnityEngine.Object.Instantiate(backViewOriginal);
|
|
backView.transform.parent = UIManager.GetInstance().transform;
|
|
backView.transform.localPosition = Vector3.zero;
|
|
backView.transform.localScale = new Vector3(1f, 1f, 1f);
|
|
backView.layer = base.gameObject.layer;
|
|
backView.GetComponent<NguiObjs>().sprites[0].alpha = 0.8f;
|
|
if (isOpenAnim)
|
|
{
|
|
backView.gameObject.GetComponent<UIPanel>().alpha = 0.01f;
|
|
}
|
|
if (backView != null && CloseButton.gameObject.activeSelf)
|
|
{
|
|
UIButton uIButton = backView.GetComponentInChildren<UISprite>().gameObject.AddMissingComponent<UIButton>();
|
|
uIButton.dragHighlight = false;
|
|
uIButton.hover = uIButton.defaultColor;
|
|
uIButton.pressed = uIButton.defaultColor;
|
|
uIButton.onClick.Clear();
|
|
uIButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
CloseNotSelect(isCloseButton: false);
|
|
}));
|
|
}
|
|
if (isOpenAnim)
|
|
{
|
|
base.gameObject.GetComponent<UIPanel>().alpha = 0.01f;
|
|
}
|
|
_collider.GetComponent<UISprite>().spriteName = null;
|
|
}
|
|
|
|
private void CloseNotSelect(bool isCloseButton)
|
|
{
|
|
IsCloseByCloseButton = isCloseButton;
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(CloseSe);
|
|
Close();
|
|
if (returnObj != null && !string.IsNullOrEmpty(closeMsg))
|
|
{
|
|
returnObj.SendMessage(closeMsg);
|
|
}
|
|
if (onCloseWithoutSelect != null)
|
|
{
|
|
onCloseWithoutSelect();
|
|
}
|
|
}
|
|
|
|
private void ColliderUpdate()
|
|
{
|
|
if (_colliderUpdateEnable)
|
|
{
|
|
_colliderUpdateTimer += Time.deltaTime;
|
|
if (_colliderUpdateTimer >= 0.24000001f)
|
|
{
|
|
_collider.SetActive(value: false);
|
|
_colliderUpdateEnable = false;
|
|
_colliderUpdateTimer = 0f;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (ToolboxGame.GameManager == null)
|
|
{
|
|
return;
|
|
}
|
|
ColliderUpdate();
|
|
switch (dialogNowScene)
|
|
{
|
|
case DialogScene.OPEN:
|
|
{
|
|
if (IsEnableOpenSe)
|
|
{
|
|
GameMgr.GetIns().GetSoundMgr().PlaySe(OpenSe);
|
|
}
|
|
dialogNowScene = DialogScene.WAIT;
|
|
if (onFirstUpdate != null)
|
|
{
|
|
onFirstUpdate();
|
|
}
|
|
if (isOpenAnim)
|
|
{
|
|
iTween.MoveFrom(base.gameObject, iTween.Hash("y", base.transform.localPosition.y - 5f, "time", 0.3f, "movetopath", false, "islocal", true, "easetype", iTween.EaseType.easeOutCubic));
|
|
TweenAlpha.Begin(base.gameObject, 0.3f, 1f);
|
|
if (backView != null)
|
|
{
|
|
TweenAlpha.Begin(backView.gameObject, 0.3f, 1f);
|
|
}
|
|
}
|
|
_colliderUpdateEnable = true;
|
|
_colliderUpdateTimer = 0f;
|
|
for (int i = 0; i < _insideObjectUIPanelAlphaControllerList.Count; i++)
|
|
{
|
|
_insideObjectUIPanelAlphaControllerList[i].ResetAlpha();
|
|
}
|
|
break;
|
|
}
|
|
case DialogScene.CLOSE:
|
|
timer = 0.01f;
|
|
dialogNowScene = DialogScene.END;
|
|
break;
|
|
case DialogScene.END:
|
|
timer -= Time.deltaTime;
|
|
if (timer <= 0f)
|
|
{
|
|
Dispose();
|
|
dialogNowScene = DialogScene.ERASE;
|
|
}
|
|
break;
|
|
case DialogScene.WAIT:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void Dispose()
|
|
{
|
|
if (OnClose != null)
|
|
{
|
|
OnClose();
|
|
}
|
|
if (OnClose_ForSystem != null)
|
|
{
|
|
OnClose_ForSystem();
|
|
}
|
|
UnityEngine.Object.Destroy(base.gameObject);
|
|
}
|
|
|
|
public DialogScene GetNowScene()
|
|
{
|
|
return dialogNowScene;
|
|
}
|
|
|
|
public bool IsOpen()
|
|
{
|
|
if (dialogNowScene != DialogScene.OPEN)
|
|
{
|
|
return dialogNowScene == DialogScene.WAIT;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public void SetSize(Size s)
|
|
{
|
|
Vector2 vector = Sizes[(int)s];
|
|
SetDimensionsFinal((int)vector.x, (int)vector.y);
|
|
DetailMsg.width = DETAIL_LABEL_SIZE[(int)s];
|
|
}
|
|
|
|
private void SetDimensionsFinal(int w, int h)
|
|
{
|
|
base.transform.localScale = new Vector3(1f, 1f, 1f);
|
|
WindowSprite.SetDimensions(w, h);
|
|
buttonLine.ResetAndUpdateAnchors();
|
|
titleLine.ResetAndUpdateAnchors();
|
|
scrollView.GetComponent<UIPanel>().ResetAndUpdateAnchors();
|
|
}
|
|
|
|
public void SetAnchors()
|
|
{
|
|
WindowSprite.SetAnchor(base.gameObject, 6, 18, -6, -17);
|
|
}
|
|
|
|
public void SetTitleLabel(string str)
|
|
{
|
|
titleLabel.text = str;
|
|
}
|
|
|
|
public string GetTitleLabelStr()
|
|
{
|
|
return titleLabel.text;
|
|
}
|
|
|
|
public void SetTitleLabelActive(bool active)
|
|
{
|
|
titleLabel.gameObject.SetActive(active);
|
|
}
|
|
|
|
public void AttachObjToTitleLabel(GameObject obj, Action<UILabel> initializeCallBack)
|
|
{
|
|
obj.transform.parent = TitleObjs.transform;
|
|
initializeCallBack.Call(titleLabel);
|
|
}
|
|
|
|
public void AttachObjToTitleLabel(GameObject obj, Vector3 localPosition)
|
|
{
|
|
obj.transform.parent = TitleObjs.transform;
|
|
obj.transform.localScale = Vector3.one;
|
|
obj.transform.localPosition = localPosition;
|
|
}
|
|
|
|
public void SetObj(GameObject obj)
|
|
{
|
|
SetObj(obj, new Vector3(0f, 0f, 0f));
|
|
}
|
|
|
|
public void SetObj(GameObject obj, Vector3 localPos)
|
|
{
|
|
obj.transform.parent = base.transform;
|
|
obj.transform.localPosition = localPos;
|
|
obj.transform.localScale = new Vector3(1f, 1f, 1f);
|
|
obj.layer = base.gameObject.layer;
|
|
InsideObject = obj;
|
|
if (_layer.HasValue)
|
|
{
|
|
UIManager.GetInstance().SetLayerRecursive(obj.transform, _layer.Value);
|
|
}
|
|
UIPanel component = obj.GetComponent<UIPanel>();
|
|
if (component != null)
|
|
{
|
|
UIPanelAlphaController uIPanelAlphaController = new UIPanelAlphaController(component);
|
|
uIPanelAlphaController.SetAlpha(0.01f);
|
|
_insideObjectUIPanelAlphaControllerList.Add(uIPanelAlphaController);
|
|
}
|
|
if (UIManager.GetInstance().IsCurrentScene(UIManager.ViewScene.QuestSelectionPage))
|
|
{
|
|
AllLabelColorChanger.ChangeAllLabel(base.gameObject);
|
|
}
|
|
}
|
|
|
|
public void SetText(string text, bool isWrapText = false)
|
|
{
|
|
DetailMsg.transform.localPosition = Vector3.zero;
|
|
DetailMsg.gameObject.SetActive(value: true);
|
|
if (!isWrapText)
|
|
{
|
|
DetailMsg.text = text;
|
|
}
|
|
else
|
|
{
|
|
onFirstUpdate = (Action)Delegate.Combine(onFirstUpdate, (Action)delegate
|
|
{
|
|
DetailMsg.SetWrapText(text);
|
|
});
|
|
}
|
|
onFirstUpdate = (Action)Delegate.Combine(onFirstUpdate, (Action)delegate
|
|
{
|
|
if (scrollView.enabled)
|
|
{
|
|
scrollView.ResetPosition();
|
|
scrollView.UpdateScrollbars(recalculateBounds: true);
|
|
if (scrollView.shouldMoveVertically)
|
|
{
|
|
vScrollBar.value = 0f;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
public void SetButtonLayout(ButtonLayout btLayout)
|
|
{
|
|
dialogLayout = btLayout;
|
|
_buttonNum = 0;
|
|
_buttonList.Clear();
|
|
_ = Data.SystemText;
|
|
switch (dialogLayout)
|
|
{
|
|
case ButtonLayout.NONE:
|
|
ButtonBase.SetActive(value: false);
|
|
break;
|
|
case ButtonLayout.OkBtn:
|
|
AddButton(ButtonType.OK);
|
|
break;
|
|
case ButtonLayout.DecisionBtn:
|
|
AddButton(ButtonType.Decision);
|
|
break;
|
|
case ButtonLayout.CloseBtn:
|
|
AddButton(ButtonType.Close);
|
|
break;
|
|
case ButtonLayout.BackToTitleBtn:
|
|
AddButton(ButtonType.BackToTitle);
|
|
break;
|
|
case ButtonLayout.GrayBtn:
|
|
AddButton(ButtonType.Gray);
|
|
break;
|
|
case ButtonLayout.RedBtn:
|
|
AddButton(ButtonType.Red);
|
|
break;
|
|
case ButtonLayout.YellowBtn:
|
|
AddButton(ButtonType.Yellow);
|
|
break;
|
|
case ButtonLayout.BlueBtn_CancelBtn:
|
|
AddButton(ButtonType.Blue, isReflect: false);
|
|
AddButton(ButtonType.Cancel);
|
|
break;
|
|
case ButtonLayout.RedBtn_CancelBtn:
|
|
AddButton(ButtonType.Red, isReflect: false);
|
|
AddButton(ButtonType.Cancel);
|
|
break;
|
|
case ButtonLayout.BattleEvolveConfirm:
|
|
AddButton(ButtonType.Yellow, isReflect: false);
|
|
AddButton(ButtonType.Cancel);
|
|
break;
|
|
case ButtonLayout.BlueBtn_GrayBtn:
|
|
AddButton(ButtonType.Blue, isReflect: false);
|
|
AddButton(ButtonType.Gray);
|
|
break;
|
|
case ButtonLayout.BlueBtn_RedBtn:
|
|
AddButton(ButtonType.Blue, isReflect: false);
|
|
AddButton(ButtonType.Red);
|
|
break;
|
|
case ButtonLayout.GrayBtn_GrayBtn:
|
|
AddButton(ButtonType.Gray, isReflect: false);
|
|
AddButton(ButtonType.Gray);
|
|
break;
|
|
case ButtonLayout.BlueBtn_RedBtn_GrayBtn:
|
|
AddButton(ButtonType.Blue, isReflect: false);
|
|
AddButton(ButtonType.Red, isReflect: false);
|
|
AddButton(ButtonType.Gray);
|
|
break;
|
|
case ButtonLayout.GrayBtn_CancelBtn_BlueBtn:
|
|
AddButton(ButtonType.Gray, isReflect: false);
|
|
AddButton(ButtonType.Cancel, isReflect: false);
|
|
AddButton(ButtonType.Blue);
|
|
break;
|
|
case ButtonLayout.GrayBtn_GrayBtn_BlueBtn:
|
|
AddButton(ButtonType.Gray, isReflect: false);
|
|
AddButton(ButtonType.Gray, isReflect: false);
|
|
AddButton(ButtonType.Blue);
|
|
break;
|
|
case ButtonLayout.BlueButton:
|
|
AddButton(ButtonType.Blue);
|
|
break;
|
|
case ButtonLayout.BlueButton_BlueButton:
|
|
AddButton(ButtonType.Blue);
|
|
AddButton(ButtonType.Blue);
|
|
break;
|
|
case ButtonLayout.BlueButton_BlueButton_BlueButton:
|
|
AddButton(ButtonType.Blue);
|
|
AddButton(ButtonType.Blue);
|
|
AddButton(ButtonType.Blue);
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void SetButtonText(string text_btn1, string text_btn2 = null, string text_btn3 = null)
|
|
{
|
|
if (text_btn1 != null)
|
|
{
|
|
button1_Label.text = text_btn1;
|
|
}
|
|
if (text_btn2 != null)
|
|
{
|
|
button2_Label.text = text_btn2;
|
|
}
|
|
if (text_btn3 != null)
|
|
{
|
|
button3_Label.text = text_btn3;
|
|
}
|
|
}
|
|
|
|
public void SetReturnMsg(GameObject obj, string msg_btn1, string msg_btn2 = "", string msg_btn3 = "", string msg_close = "")
|
|
{
|
|
returnObj = obj;
|
|
returnMsg_Btn1 = msg_btn1;
|
|
returnMsg_Btn2 = msg_btn2;
|
|
returnMsg_Btn3 = msg_btn3;
|
|
closeMsg = msg_close;
|
|
}
|
|
|
|
public void SetButtonDelegate(EventDelegate method_btn1, EventDelegate method_btn2 = null, EventDelegate method_btn3 = null, EventDelegate methodClose = null)
|
|
{
|
|
EventDelegate.Add(button1.onClick, method_btn1);
|
|
if (method_btn2 != null)
|
|
{
|
|
EventDelegate.Add(button2.onClick, method_btn2);
|
|
}
|
|
if (method_btn3 != null)
|
|
{
|
|
EventDelegate.Add(button3.onClick, method_btn3);
|
|
}
|
|
if (methodClose != null)
|
|
{
|
|
EventDelegate.Add(CloseButton.onClick, methodClose);
|
|
}
|
|
}
|
|
|
|
public void SetButtonDelegate(Action method_btn1, Action method_btn2 = null, Action method_btn3 = null, Action method_close = null)
|
|
{
|
|
if (method_btn1 != null)
|
|
{
|
|
onPushButton1 = method_btn1;
|
|
}
|
|
if (method_btn2 != null)
|
|
{
|
|
onPushButton2 = method_btn2;
|
|
}
|
|
if (method_btn3 != null)
|
|
{
|
|
onPushButton3 = method_btn3;
|
|
}
|
|
if (method_close != null)
|
|
{
|
|
OnClose = method_close;
|
|
}
|
|
}
|
|
|
|
private void SetButtonDestroyDelegate(params Action[] methods)
|
|
{
|
|
OnClose_ForSystem = null;
|
|
for (int i = 0; i < methods.Length; i++)
|
|
{
|
|
OnClose_ForSystem = (Action)Delegate.Combine(OnClose_ForSystem, methods[i]);
|
|
}
|
|
}
|
|
|
|
public void SetButtonDisable(bool isEnableOK, bool isEnableCancel = false, bool isEnableEtc = false, bool isEnableClose = false)
|
|
{
|
|
UIManager.SetObjectToGrey(button1.gameObject, isEnableOK);
|
|
UIManager.SetObjectToGrey(button2.gameObject, isEnableCancel);
|
|
UIManager.SetObjectToGrey(button3.gameObject, isEnableEtc);
|
|
UIManager.SetObjectToGrey(CloseButton.gameObject, isEnableClose);
|
|
}
|
|
|
|
private void SetButtonSprite(ButtonSprite btn1 = ButtonSprite.BLUE, ButtonSprite btn2 = ButtonSprite.GRAY, ButtonSprite btn3 = ButtonSprite.GRAY)
|
|
{
|
|
button1.normalSprite = (button1.hoverSprite = GetButtonString(btn1));
|
|
button1.pressedSprite = GetButtonStringPush(btn1);
|
|
button2.normalSprite = (button2.hoverSprite = GetButtonString(btn2));
|
|
button2.pressedSprite = GetButtonStringPush(btn2);
|
|
button3.normalSprite = (button3.hoverSprite = GetButtonString(btn3));
|
|
button3.pressedSprite = GetButtonStringPush(btn3);
|
|
}
|
|
|
|
private string GetButtonString(ButtonSprite style)
|
|
{
|
|
return style switch
|
|
{
|
|
ButtonSprite.BLUE => "btn_common_02_m_off",
|
|
ButtonSprite.GRAY => "btn_common_01_m_off",
|
|
ButtonSprite.RED => "btn_common_04_m_off",
|
|
ButtonSprite.YELLOW => "btn_common_03_m_off",
|
|
ButtonSprite.BLUE_S => "btn_common_02_s_off",
|
|
ButtonSprite.RED_S => "btn_common_04_s_off",
|
|
_ => null,
|
|
};
|
|
}
|
|
|
|
private string GetButtonStringPush(ButtonSprite style)
|
|
{
|
|
return style switch
|
|
{
|
|
ButtonSprite.BLUE => "btn_common_02_m_on",
|
|
ButtonSprite.GRAY => "btn_common_01_m_on",
|
|
ButtonSprite.RED => "btn_common_04_m_on",
|
|
ButtonSprite.YELLOW => "btn_common_03_m_on",
|
|
ButtonSprite.BLUE_S => "btn_common_02_s_on",
|
|
ButtonSprite.RED_S => "btn_common_04_s_on",
|
|
_ => null,
|
|
};
|
|
}
|
|
|
|
private void Display_1_Button(ButtonSprite sprite_btn1, string text_btn1, Se.TYPE se_btn1, Action onClick_btn1, Action onDestroy_btn1)
|
|
{
|
|
ButtonBase.SetActive(value: true);
|
|
button1.gameObject.SetActive(value: true);
|
|
button2.gameObject.SetActive(value: false);
|
|
button3.gameObject.SetActive(value: false);
|
|
UISprite component = button1.GetComponent<UISprite>();
|
|
component.leftAnchor.absolute = -128;
|
|
component.rightAnchor.absolute = 128;
|
|
SetButtonSprite(sprite_btn1);
|
|
SetButtonText(text_btn1);
|
|
SetButtonSe(se_btn1);
|
|
SetButtonDelegate(onClick_btn1);
|
|
SetButtonDestroyDelegate(onDestroy_btn1);
|
|
}
|
|
|
|
private void Display_1_Button(Button btn1)
|
|
{
|
|
Display_1_Button(btn1.Sprite, btn1.Text, btn1.SE, btn1.OnClick, btn1.OnDestroy);
|
|
}
|
|
|
|
private void Display_2_Buttons(ButtonSprite sprite_btn1, string text_btn1, Se.TYPE se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, Se.TYPE se_btn2, Action onClick_btn2, Action onDestroy_btn2)
|
|
{
|
|
ButtonBase.SetActive(value: true);
|
|
button1.gameObject.SetActive(value: true);
|
|
button2.gameObject.SetActive(value: true);
|
|
button3.gameObject.SetActive(value: false);
|
|
UISprite component = button1.GetComponent<UISprite>();
|
|
component.leftAnchor.absolute = 8;
|
|
component.rightAnchor.absolute = 264;
|
|
UISprite component2 = button2.GetComponent<UISprite>();
|
|
component2.leftAnchor.absolute = -264;
|
|
component2.rightAnchor.absolute = -8;
|
|
SetButtonSprite(sprite_btn1, sprite_btn2);
|
|
SetButtonText(text_btn1, text_btn2);
|
|
SetButtonSe(se_btn1, se_btn2);
|
|
SetButtonDelegate(onClick_btn1, onClick_btn2);
|
|
SetButtonDestroyDelegate(onDestroy_btn1, onDestroy_btn2);
|
|
}
|
|
|
|
private void Display_2_Buttons(Button btn1, Button btn2)
|
|
{
|
|
Display_2_Buttons(btn1.Sprite, btn1.Text, btn1.SE, btn1.OnClick, btn1.OnDestroy, btn2.Sprite, btn2.Text, btn2.SE, btn2.OnClick, btn2.OnDestroy);
|
|
}
|
|
|
|
private void Display_3_Buttons(ButtonSprite sprite_btn1, string text_btn1, Se.TYPE se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, Se.TYPE se_btn2, Action onClick_btn2, Action onDestroy_btn2, ButtonSprite sprite_btn3, string text_btn3, Se.TYPE se_btn3, Action onClick_btn3, Action onDestroy_btn3)
|
|
{
|
|
ButtonBase.SetActive(value: true);
|
|
button1.gameObject.SetActive(value: true);
|
|
button2.gameObject.SetActive(value: true);
|
|
button3.gameObject.SetActive(value: true);
|
|
UISprite component = button1.GetComponent<UISprite>();
|
|
component.leftAnchor.absolute = -128;
|
|
component.rightAnchor.absolute = 128;
|
|
UISprite component2 = button2.GetComponent<UISprite>();
|
|
component2.leftAnchor.absolute = -398;
|
|
component2.rightAnchor.absolute = -142;
|
|
UISprite component3 = button3.GetComponent<UISprite>();
|
|
component3.leftAnchor.absolute = 142;
|
|
component3.rightAnchor.absolute = 398;
|
|
SetButtonSprite(sprite_btn1, sprite_btn2, sprite_btn3);
|
|
SetButtonText(text_btn1, text_btn2, text_btn3);
|
|
SetButtonSe(se_btn1, se_btn2, se_btn3);
|
|
SetButtonDelegate(onClick_btn1, onClick_btn2, onClick_btn3);
|
|
SetButtonDestroyDelegate(onDestroy_btn1, onDestroy_btn2, onDestroy_btn3);
|
|
}
|
|
|
|
private void Display_3_Buttons(Button btn1, Button btn2, Button btn3)
|
|
{
|
|
Display_3_Buttons(btn1.Sprite, btn1.Text, btn1.SE, btn1.OnClick, btn1.OnDestroy, btn2.Sprite, btn2.Text, btn2.SE, btn2.OnClick, btn2.OnDestroy, btn3.Sprite, btn3.Text, btn3.SE, btn3.OnClick, btn3.OnDestroy);
|
|
}
|
|
|
|
public void AddButton(ButtonType type, bool isReflect = true, string text = null)
|
|
{
|
|
_buttonNum++;
|
|
_buttonList.Add(new Button(type, text));
|
|
if (_buttonNum == 1)
|
|
{
|
|
SetScrollBottomAnchor(isExistButton: true);
|
|
}
|
|
if (isReflect)
|
|
{
|
|
if (_buttonNum == 1)
|
|
{
|
|
Display_1_Button(_buttonList[0]);
|
|
}
|
|
else if (_buttonNum == 2)
|
|
{
|
|
Display_2_Buttons(_buttonList[0], _buttonList[1]);
|
|
}
|
|
else
|
|
{
|
|
Display_3_Buttons(_buttonList[0], _buttonList[1], _buttonList[2]);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void SetScrollBottomAnchor(bool isExistButton)
|
|
{
|
|
UIRect.AnchorPoint bottomAnchor = scrollRect.bottomAnchor;
|
|
UIRect.AnchorPoint bottomAnchor2 = scrollBarRect.bottomAnchor;
|
|
if (isExistButton)
|
|
{
|
|
bottomAnchor.target = (bottomAnchor2.target = buttonLine.transform);
|
|
bottomAnchor.relative = (bottomAnchor2.relative = 1f);
|
|
bottomAnchor.absolute = -2;
|
|
}
|
|
else
|
|
{
|
|
bottomAnchor.target = (bottomAnchor2.target = WindowSprite.transform);
|
|
bottomAnchor.relative = (bottomAnchor2.relative = 0f);
|
|
bottomAnchor.absolute = 8;
|
|
}
|
|
scrollRect.ResetAnchors();
|
|
scrollRect.UpdateAnchors();
|
|
scrollBarRect.ResetAnchors();
|
|
scrollBarRect.UpdateAnchors();
|
|
}
|
|
|
|
private void SetButtonSe(Se.TYPE btn1 = Se.TYPE.SYS_BTN_DECIDE, Se.TYPE btn2 = Se.TYPE.SYS_BTN_DECIDE, Se.TYPE btn3 = Se.TYPE.SYS_BTN_DECIDE)
|
|
{
|
|
ClickSe_Btn1 = btn1;
|
|
ClickSe_Btn2 = btn2;
|
|
ClickSe_Btn3 = btn3;
|
|
}
|
|
|
|
public void SetVisibleContactButton(bool isVisible, string errorCode)
|
|
{
|
|
contactButton.gameObject.SetActive(isVisible);
|
|
contactButton.onClick.Clear();
|
|
contactButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
DialogBase dialogBase = DialogSupport.Create(errorCode);
|
|
dialogBase.SetPanelDepth(6100);
|
|
dialogBase.SetPanelSortingOrder(2);
|
|
}));
|
|
contactButton_Label.text = Data.SystemText.Get("OtherTop_0007");
|
|
scrollView.GetComponent<UIPanel>().bottomAnchor.absolute += (int)contactButton.GetComponent<BoxCollider>().size.y;
|
|
}
|
|
|
|
public void SetRefund(string url, string buttonText)
|
|
{
|
|
contactButton.gameObject.SetActive(value: true);
|
|
contactButton.onClick.Clear();
|
|
contactButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
UIManager.GetInstance().WebViewHelper.OpenUrl(url);
|
|
}));
|
|
contactButton_Label.text = buttonText;
|
|
scrollView.GetComponent<UIPanel>().bottomAnchor.absolute += (int)contactButton.GetComponent<BoxCollider>().size.y;
|
|
}
|
|
|
|
public void SetVisibleWebViewBackButton(string url, bool isVisible)
|
|
{
|
|
webviewBackButton.gameObject.SetActive(isVisible);
|
|
if (!isVisible)
|
|
{
|
|
return;
|
|
}
|
|
webviewBackButton.onClick.Clear();
|
|
webviewBackButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
WebViewManager instance = WebViewManager.getInstance();
|
|
if (instance != null)
|
|
{
|
|
if (url == null)
|
|
{
|
|
if (instance.CanGoBack())
|
|
{
|
|
instance.GoBack();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
instance.LoadWeb(url);
|
|
}
|
|
SetVisibleWebViewBackButton(null, isVisible: false);
|
|
}
|
|
}));
|
|
}
|
|
|
|
public void AddVScrollBar(UIScrollView view)
|
|
{
|
|
view.verticalScrollBar = vScrollBar;
|
|
scrollView.verticalScrollBar = null;
|
|
}
|
|
|
|
public void AttachScrollView(UIScrollView view, float scrollStartValue)
|
|
{
|
|
scrollView.verticalScrollBar = null;
|
|
view.verticalScrollBar = vScrollBar;
|
|
view.verticalScrollBar.value = scrollStartValue;
|
|
}
|
|
|
|
public void CloseWithoutSelect()
|
|
{
|
|
if (!(this == null))
|
|
{
|
|
Close();
|
|
if (onCloseWithoutSelect != null)
|
|
{
|
|
onCloseWithoutSelect();
|
|
}
|
|
}
|
|
}
|
|
|
|
public void Close()
|
|
{
|
|
dialogNowScene = DialogScene.CLOSE;
|
|
if (!base.gameObject.activeInHierarchy)
|
|
{
|
|
SetActive(inActive: true);
|
|
}
|
|
if (!(UIManager.GetInstance() != null) || !(this != null) || !(this == UIManager.GetInstance().ApplicationFinishManager.QuitDialog))
|
|
{
|
|
UIManager.GetInstance().CloseInSceneLoadingMatching();
|
|
}
|
|
_collider.SetActive(value: true);
|
|
if (OnCloseStart != null)
|
|
{
|
|
OnCloseStart();
|
|
}
|
|
}
|
|
|
|
public void CloseSoon()
|
|
{
|
|
if (!(UIManager.GetInstance() != null) || !(this != null) || !(this == UIManager.GetInstance().ApplicationFinishManager.QuitDialog))
|
|
{
|
|
UIManager.GetInstance().CloseInSceneLoadingMatching();
|
|
}
|
|
OnCloseStart.Call();
|
|
Dispose();
|
|
}
|
|
|
|
public void ReOpen(bool isResetBackViewAlpha = false)
|
|
{
|
|
SetActive(inActive: true);
|
|
base.gameObject.GetComponent<UIPanel>().alpha = 0.01f;
|
|
dialogNowScene = DialogScene.OPEN;
|
|
_collider.SetActive(value: true);
|
|
if (isResetBackViewAlpha)
|
|
{
|
|
ResetBackViewAlpha();
|
|
}
|
|
}
|
|
|
|
public void TitleOnOff(bool flag)
|
|
{
|
|
TitleObjs.gameObject.SetActive(flag);
|
|
}
|
|
|
|
public void CloseOnOff(bool flag)
|
|
{
|
|
CloseButton.gameObject.SetActive(flag);
|
|
}
|
|
|
|
public void SetButtonLineVisible(bool b)
|
|
{
|
|
buttonLine.gameObject.SetActive(b);
|
|
}
|
|
|
|
private void SetTextActive(bool b)
|
|
{
|
|
DetailMsg.gameObject.SetActive(b);
|
|
}
|
|
|
|
public void SetTitleLineVisible(bool visible)
|
|
{
|
|
if (null != titleLine && titleLine.enabled != visible)
|
|
{
|
|
titleLine.enabled = visible;
|
|
}
|
|
}
|
|
|
|
public void SetWindowSprite(string atlasname, string spritename)
|
|
{
|
|
List<UIAtlas> atlasList = UIManager.GetInstance().GetAtlasList();
|
|
if (atlasList == null)
|
|
{
|
|
return;
|
|
}
|
|
for (int i = 0; i < atlasList.Count; i++)
|
|
{
|
|
if (atlasList[i].name == atlasname)
|
|
{
|
|
WindowSprite.atlas = atlasList[i];
|
|
WindowSprite.spriteName = spritename;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetPanelDepth(int depth, bool isSetBackViewDepthImmediately = false)
|
|
{
|
|
GetComponent<UIPanel>().depth = depth;
|
|
scrollView.GetComponent<UIPanel>().depth = depth + 1;
|
|
if (isSetBackViewDepthImmediately)
|
|
{
|
|
backViewDepth();
|
|
}
|
|
else
|
|
{
|
|
Invoke("backViewDepth", 0.1f);
|
|
}
|
|
}
|
|
|
|
public int GetPanelDepth()
|
|
{
|
|
return GetComponent<UIPanel>().depth;
|
|
}
|
|
|
|
private void backViewDepth()
|
|
{
|
|
UIPanel component = GetComponent<UIPanel>();
|
|
if (component != null && backView != null && backView.GetComponent<UIPanel>() != null)
|
|
{
|
|
backView.GetComponent<UIPanel>().depth = component.depth - 1;
|
|
}
|
|
}
|
|
|
|
public void SetDepthAndSortingOrder(int depth, int sortingOrder)
|
|
{
|
|
UIPanel component = GetComponent<UIPanel>();
|
|
UIPanel component2 = backView.GetComponent<UIPanel>();
|
|
component.depth = depth;
|
|
component2.depth = depth - 1;
|
|
component.sortingOrder = sortingOrder;
|
|
component2.sortingOrder = sortingOrder;
|
|
}
|
|
|
|
public void SetPanelSortingOrder(int order)
|
|
{
|
|
GetComponent<UIPanel>().sortingOrder = order;
|
|
scrollRect.GetComponent<UIPanel>().sortingOrder = order;
|
|
backView.GetComponent<UIPanel>().sortingOrder = order;
|
|
}
|
|
|
|
public void SetLayer(string layerName)
|
|
{
|
|
int num = LayerMask.NameToLayer(layerName);
|
|
UIManager.GetInstance().SetLayerRecursive(base.transform, num);
|
|
SetBackViewLayer(num);
|
|
_layer = num;
|
|
}
|
|
|
|
public void SetBackViewLayer(int layer)
|
|
{
|
|
backView.layer = layer;
|
|
}
|
|
|
|
public void SetBackViewPosition(Vector3 position)
|
|
{
|
|
backView.transform.localPosition = position;
|
|
}
|
|
|
|
public void SetScrollViewActive(bool b)
|
|
{
|
|
scrollView.verticalScrollBar.gameObject.SetActive(b);
|
|
scrollView.enabled = b;
|
|
if (b)
|
|
{
|
|
scrollView.ResetPosition();
|
|
scrollView.UpdateScrollbars(recalculateBounds: true);
|
|
}
|
|
}
|
|
|
|
public void SetActive(bool inActive)
|
|
{
|
|
base.gameObject.SetActive(inActive);
|
|
backView.SetActive(inActive);
|
|
}
|
|
|
|
public void SetDisp(bool inDisp)
|
|
{
|
|
SetDialogAlpha(inDisp);
|
|
backView.SetActive(inDisp);
|
|
}
|
|
|
|
public void SetDialogAlpha(bool inDisp)
|
|
{
|
|
float alpha = (inDisp ? 1f : 0f);
|
|
base.gameObject.GetComponent<UIPanel>().alpha = alpha;
|
|
}
|
|
|
|
public void AttachToScrollView(Transform t)
|
|
{
|
|
t.parent = scrollView.transform;
|
|
t.localScale = Vector3.one;
|
|
t.localPosition = Vector3.zero;
|
|
}
|
|
|
|
public void InactiveBackView()
|
|
{
|
|
backView.SetActive(value: false);
|
|
}
|
|
|
|
public void ResetBackViewAlpha()
|
|
{
|
|
backView.gameObject.GetComponent<UIPanel>().alpha = 1f;
|
|
}
|
|
|
|
public void SetFadeButtonEnabled(bool flag)
|
|
{
|
|
CloseOnOff(flag);
|
|
IsPossibleToCloseByAndroidBackKey = flag;
|
|
if (!(backView == null))
|
|
{
|
|
UIButton componentInChildren = backView.GetComponentInChildren<UIButton>();
|
|
if (!(componentInChildren == null))
|
|
{
|
|
componentInChildren.enabled = flag;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetBackViewToNotCloseDialog()
|
|
{
|
|
backView.GetComponentInChildren<UIButton>().enabled = false;
|
|
}
|
|
|
|
public static DialogBase CreateImageSelectionDialog(ImageSelection imageSelection, string titleTextId, Size dialogSize = Size.M)
|
|
{
|
|
GameObject selectionObj = imageSelection.gameObject;
|
|
Transform selectionTrans = imageSelection.transform;
|
|
TransformBackup backup = new TransformBackup();
|
|
backup.Save(selectionTrans);
|
|
SystemText systemText = Data.SystemText;
|
|
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
|
dialogBase.SetSize(dialogSize);
|
|
dialogBase.SetTitleLabel(systemText.Get(titleTextId));
|
|
dialogBase.SetButtonLayout(ButtonLayout.DecisionBtn);
|
|
dialogBase.OnClose = delegate
|
|
{
|
|
imageSelection.Close();
|
|
backup.Restore(selectionTrans);
|
|
selectionObj.SetActive(value: false);
|
|
};
|
|
dialogBase.SetObj(selectionObj, selectionTrans.localPosition);
|
|
selectionObj.SetActive(value: true);
|
|
UIManager.GetInstance().SetLayerRecursive(dialogBase.transform, dialogBase.gameObject.layer);
|
|
imageSelection.Open();
|
|
return dialogBase;
|
|
}
|
|
|
|
public static DialogBase CreateFilteringImageSelectionDialog(FilteringImageSelection selection, string titleTextId, bool isOpenSelection = true)
|
|
{
|
|
TransformBackup backup = new TransformBackup();
|
|
backup.Save(selection.transform);
|
|
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
|
dialogBase.SetSize(Size.XL);
|
|
dialogBase.SetTitleLabel(Data.SystemText.Get(titleTextId));
|
|
dialogBase.SetButtonLayout(ButtonLayout.DecisionBtn);
|
|
selection.DialogCloseButton = dialogBase.CloseButton;
|
|
dialogBase.OnClose = delegate
|
|
{
|
|
selection.DestroyDialogCloseButtonCopy();
|
|
selection.RegisterFavoriteChanges();
|
|
backup.Restore(selection.transform);
|
|
selection.gameObject.SetActive(value: false);
|
|
};
|
|
dialogBase.SetObj(selection.gameObject, selection.transform.localPosition);
|
|
selection.gameObject.SetActive(value: true);
|
|
UIManager.GetInstance().SetLayerRecursive(dialogBase.transform, dialogBase.gameObject.layer);
|
|
if (isOpenSelection)
|
|
{
|
|
selection.Open();
|
|
}
|
|
return dialogBase;
|
|
}
|
|
|
|
public void FadeOut()
|
|
{
|
|
FadeUtility.FadeOutGameObject(base.gameObject);
|
|
FadeUtility.FadeOutGameObject(backView.gameObject);
|
|
}
|
|
|
|
public void KeyboardSelectButton(KeyboardDialogSelect select, bool enable)
|
|
{
|
|
switch (select)
|
|
{
|
|
case KeyboardDialogSelect.Button1:
|
|
_button1Select.SetActive(enable);
|
|
break;
|
|
case KeyboardDialogSelect.Button2:
|
|
_button2Select.SetActive(enable);
|
|
break;
|
|
case KeyboardDialogSelect.Button3:
|
|
_button3Select.SetActive(enable);
|
|
break;
|
|
case KeyboardDialogSelect.CloseButton:
|
|
_closeButtonSelect.SetActive(enable);
|
|
break;
|
|
}
|
|
}
|
|
|
|
public Vector4 GetWebViewDisplayRect()
|
|
{
|
|
return new Vector4
|
|
{
|
|
x = 0f,
|
|
y = -30f,
|
|
z = 1100f,
|
|
w = 510f
|
|
};
|
|
}
|
|
|
|
public void AutoClose(float second)
|
|
{
|
|
if (_autoCloseCoroutine == null)
|
|
{
|
|
_autoCloseCoroutine = StartCoroutine(AutoCloseCoroutine(second));
|
|
}
|
|
}
|
|
|
|
private IEnumerator AutoCloseCoroutine(float second)
|
|
{
|
|
yield return new WaitForSeconds(second);
|
|
if (dialogNowScene == DialogScene.WAIT)
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
|
|
public void SetOnClickUrl()
|
|
{
|
|
WindowSprite.gameObject.AddComponent<OpenURLOnClick>().ClickedUrlLabel = DetailMsg;
|
|
}
|
|
|
|
public void SetDialogNoClose()
|
|
{
|
|
SetBackViewToNotCloseDialog();
|
|
CloseButton.enabled = false;
|
|
IsPossibleToCloseByAndroidBackKey = false;
|
|
}
|
|
|
|
public int GetMaxPanelDepth()
|
|
{
|
|
UIPanel[] second = new UIPanel[1] { _colliderPanel };
|
|
return base.transform.GetComponentsInChildren<UIPanel>().Except(second).Max((UIPanel x) => x.depth);
|
|
}
|
|
|
|
public void SetPanelDepthAboveDialog(DialogBase dialog)
|
|
{
|
|
SetPanelDepth(dialog.GetMaxPanelDepth() + 5);
|
|
}
|
|
}
|