From 6de5f03956c032833b080abc53714ef94549c724 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Fri, 3 Jul 2026 23:22:43 -0400 Subject: [PATCH] =?UTF-8?q?cull(engine-cleanup):=20pass-9=20=E2=80=94=20st?= =?UTF-8?q?ub=20DialogBase=20to=20live=20surface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SVSim.BattleEngine/Engine/DialogBase.cs | 1248 ++--------------------- 1 file changed, 96 insertions(+), 1152 deletions(-) diff --git a/SVSim.BattleEngine/Engine/DialogBase.cs b/SVSim.BattleEngine/Engine/DialogBase.cs index 05d823a9..88cdc8f2 100644 --- a/SVSim.BattleEngine/Engine/DialogBase.cs +++ b/SVSim.BattleEngine/Engine/DialogBase.cs @@ -1,1152 +1,96 @@ -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 } - - public enum Size - { - S, - M, - L, - XL } - - 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 enum KeyboardDialogSelect - { - } - - private class Button - { - private ButtonType Type { get; set; } - - public ButtonSprite Sprite { get; private set; } - - public string Text { get; private set; } - - public int 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 = 0; - break; - case ButtonType.Red: - Sprite = ButtonSprite.RED; - SE = 0; - break; - case ButtonType.Gray: - Sprite = ButtonSprite.GRAY; - SE = 0; - break; - case ButtonType.Yellow: - Sprite = ButtonSprite.YELLOW; - SE = 0; - break; - case ButtonType.OK: - Sprite = ButtonSprite.BLUE; - Text = systemText.Get("Common_0004"); - SE = 0; - break; - case ButtonType.Decision: - Sprite = ButtonSprite.BLUE; - Text = systemText.Get("Common_0003"); - SE = 0; - break; - case ButtonType.Close: - Sprite = ButtonSprite.GRAY; - Text = systemText.Get("Common_0008"); - SE = 0; - break; - case ButtonType.Cancel: - Sprite = ButtonSprite.GRAY; - Text = systemText.Get("Common_0005"); - SE = 0; - break; - case ButtonType.Retry: - Sprite = ButtonSprite.BLUE; - Text = systemText.Get("Common_0133"); - SE = 0; - OnClick = delegate - { - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Retry()); - }; - - OnDestroy = delegate - { - - }; - break; - case ButtonType.BackToTitle: - Sprite = ButtonSprite.GRAY; - Text = systemText.Get("Common_0131"); - SE = 0; - OnClick = delegate - { - SoftwareReset.exec(); - }; - break; - case ButtonType.BackToHome: - Sprite = ButtonSprite.GRAY; - Text = systemText.Get("Common_0132"); - SE = 0; - OnClick = delegate - { - // Pre-Phase-5b: back-to-home dialog kicked off BattleEndCoroutine when in a - // battle scene. Headless has no scene, no BattleCtrl (Chunk 7 stubbed it), and - // no BattleEndCoroutine to run — collapse to the else branch. - UIManager.GetInstance().closeInSceneCenterLoading(); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage); - }; - break; - case ButtonType.QuitApplication: - Sprite = ButtonSprite.GRAY; - Text = systemText.Get("Common_0135"); - SE = 0; - 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 = 0; - OnClick = delegate - { - Toolbox.NetworkManager.GoToStore(); - }; - - break; - case ButtonType.RecommendedList: - Sprite = ButtonSprite.BLUE; - Text = systemText.Get("Common_0134"); - SE = 0; - OnClick = delegate - { - UIManager.GetInstance().WebViewHelper.CreateOpenURLWindow(WebViewHelper.UrlType.RECOMMENDED_DEVICE); - }; - break; - } - if (text != null) - { - Text = text; - } - } - } - - [HideInInspector] - public NguiObjs InputAreaObjs; - - [SerializeField] - public UISprite WindowSprite; - - [SerializeField] - private UIButton CloseButton; - - [SerializeField] - private UILabel titleLabel; - - [SerializeField] - private GameObject backViewOriginal; - - [HideInInspector] - public GameObject backView; - - [SerializeField] - private GameObject _collider; - - [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; - - 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 bool isOpenAnim = true; - - public bool isNotCloseWindowButton1; - - public bool isNotCloseWindowButton2; - - public bool isNotCloseWindowButton3; - - private int _buttonNum; - - private List