diff --git a/Assets/Resources/Fgui/Common/Common_fui.bytes b/Assets/Resources/Fgui/Common/Common_fui.bytes index 5d1c247f3..dbf5711ab 100644 Binary files a/Assets/Resources/Fgui/Common/Common_fui.bytes and b/Assets/Resources/Fgui/Common/Common_fui.bytes differ diff --git a/Assets/Resources/Fgui/Main/Main_fui.bytes b/Assets/Resources/Fgui/Main/Main_fui.bytes index 44603d7e0..e6f6fcc5b 100644 Binary files a/Assets/Resources/Fgui/Main/Main_fui.bytes and b/Assets/Resources/Fgui/Main/Main_fui.bytes differ diff --git a/Assets/Scripts/Common/Attrobites/Attributes.cs b/Assets/Scripts/Common/Attrobites/Attributes.cs index 74d54fa3f..ed5a94c6a 100644 --- a/Assets/Scripts/Common/Attrobites/Attributes.cs +++ b/Assets/Scripts/Common/Attrobites/Attributes.cs @@ -57,4 +57,9 @@ namespace NBF Sort = sort; } } + + [AttributeUsage(AttributeTargets.Field)] + public class UIInputAttribute : BaseAttribute + { + } } \ No newline at end of file diff --git a/Assets/Scripts/Def/UIDef.cs b/Assets/Scripts/Def/UIDef.cs index 5b0d370a8..565405ac2 100644 --- a/Assets/Scripts/Def/UIDef.cs +++ b/Assets/Scripts/Def/UIDef.cs @@ -20,8 +20,6 @@ namespace NBF public class UIOrder { - public const int MeteorChest = 90; - public const int MainPanel = 100; public const int CommonTopPanel = 200; public const int Loading = 500; public const int Guide = 900; diff --git a/Assets/Scripts/NBC/Language/Runtime/Lan.cs b/Assets/Scripts/NBC/Language/Runtime/Lan.cs index 3417f1966..80b8fdbb6 100644 --- a/Assets/Scripts/NBC/Language/Runtime/Lan.cs +++ b/Assets/Scripts/NBC/Language/Runtime/Lan.cs @@ -2,7 +2,7 @@ { public class Lan { - public static LanguageManager _inst; + private static LanguageManager _inst; public static LanguageManager Inst { diff --git a/Assets/Scripts/NBC/Language/Runtime/LanguageManager.cs b/Assets/Scripts/NBC/Language/Runtime/LanguageManager.cs index ce8c90f56..89fef6079 100644 --- a/Assets/Scripts/NBC/Language/Runtime/LanguageManager.cs +++ b/Assets/Scripts/NBC/Language/Runtime/LanguageManager.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using UnityEngine; namespace NBC @@ -47,9 +48,17 @@ namespace NBC language = (SystemLanguage)value; } } + + var list = LanguageConst.languageMap.Values.ToList(); + var findLan = list.FindIndex(t => t.Language == language); + if (findLan < 0) + { + language = SystemLanguage.English; + } + UseLanguage(language); } - + public void UseLanguage(SystemLanguage language) { _currentLanguage = language; diff --git a/Assets/Scripts/NBC/UI/Runtime/Component/IUIPanel.cs b/Assets/Scripts/NBC/UI/Runtime/Component/IUIPanel.cs index b20cbad8d..4baadeba6 100644 --- a/Assets/Scripts/NBC/UI/Runtime/Component/IUIPanel.cs +++ b/Assets/Scripts/NBC/UI/Runtime/Component/IUIPanel.cs @@ -17,6 +17,11 @@ namespace NBC bool IsCanVisible { get; } bool IsDotDel { get; } + /// + /// 不能返回 + /// + bool IsDontBack { get; } + bool IsModal { get; } bool IsShowCursor { get; } @@ -25,7 +30,7 @@ namespace NBC void SetData(object args); object GetData(); string[] GetDependPackages(); - System.Collections.Generic.Dictionary GetLanguageConfig(); + void Init(); void Show(); void Hide(); diff --git a/Assets/Scripts/NBC/UI/Runtime/Component/UIPanel.cs b/Assets/Scripts/NBC/UI/Runtime/Component/UIPanel.cs index 5dadbf4b7..d4f2f3b44 100644 --- a/Assets/Scripts/NBC/UI/Runtime/Component/UIPanel.cs +++ b/Assets/Scripts/NBC/UI/Runtime/Component/UIPanel.cs @@ -24,7 +24,7 @@ namespace NBC public virtual bool IsCanVisible => ContentPane != null && ContentPane.parent != null && ContentPane.visible; public bool IsDotDel { get; protected set; } - + public bool IsDontBack { get; protected set; } public virtual string UIPackRootUrl => string.Empty; public virtual string UIPackName { get; set; } @@ -76,10 +76,6 @@ namespace NBC return new string[] { }; } - public virtual Dictionary GetLanguageConfig() - { - return new Dictionary(); - } public void Init() { @@ -194,6 +190,15 @@ namespace NBC Show(); } + /// + /// 设置刷新多语言 + /// + public void SetLanguage() + { + _ui.TrySetPanelLanguage(ContentPane); + OnSetLanguage(); + } + public void HideImmediately() { // ContentPane.visible = false; @@ -227,6 +232,7 @@ namespace NBC private void OpenAnimBegin() { OnShow(); + SetLanguage(); _ui?.DispatchEventWith(UIEvents.UIShow, this); } @@ -257,6 +263,13 @@ namespace NBC { } + /// + /// 代码设置多语言,OnShow后和语言变化时会调用 + /// + protected virtual void OnSetLanguage() + { + } + /// /// 显示界面显示 /// @@ -264,13 +277,12 @@ namespace NBC protected virtual void OnShow() { } - + /// /// 显示界面完成(动画后) /// protected virtual void OnShowed() { - } protected virtual void OnUpdate() diff --git a/Assets/Scripts/NBC/UI/Runtime/UILanguage/UIComponentLanguagePack.cs b/Assets/Scripts/NBC/UI/Runtime/UILanguage/UIComponentLanguagePack.cs index ed6fd685b..30b385f8c 100644 --- a/Assets/Scripts/NBC/UI/Runtime/UILanguage/UIComponentLanguagePack.cs +++ b/Assets/Scripts/NBC/UI/Runtime/UILanguage/UIComponentLanguagePack.cs @@ -131,12 +131,12 @@ namespace NBC curField = gtextField; } - if (curField != null) - { - // var textFormat = curField.textFormat; - // textFormat.font = Lan.GetLanFontByCurFont(textFormat.font); - // curField.textFormat = textFormat; - } + if (curField == null) return; + var textFormat = curField.textFormat; + var font = Lan.GetLanFontByCurFont(textFormat.font); + if (font == null) return; + textFormat.font = font; + curField.textFormat = textFormat; } } } \ No newline at end of file diff --git a/Assets/Scripts/Old.meta b/Assets/Scripts/Old.meta deleted file mode 100644 index 433b36db9..000000000 --- a/Assets/Scripts/Old.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 6f1a2150bd924a06ab285e5e5b2f7878 -timeCreated: 1742647242 \ No newline at end of file diff --git a/Assets/Scripts/Old/InputManager.cs b/Assets/Scripts/Old/InputManager.cs deleted file mode 100644 index a2fd418b2..000000000 --- a/Assets/Scripts/Old/InputManager.cs +++ /dev/null @@ -1,651 +0,0 @@ -// using System.Collections.Generic; -// using System.Runtime.InteropServices; -// // using Rewired; -// using UnityEngine; -// using UnityEngine.SceneManagement; -// -// public class InputManager : MonoBehaviour -// { -// public struct POINT -// { -// public int X; -// -// public int Y; -// } -// -// -// // [Tooltip("Rewired Input Manager's player used for handling player's input")] -// // private Player player; -// -// public bool IgnoreAllInput = false; -// -// -// public static bool IsMouseLeft; -// public static bool IsMouseRight; -// -// -// private bool isPaused; -// -// private float MouseX = Screen.width / 2; -// -// private float MouseY = Screen.height / 2; -// -// private float deltaMouseX; -// -// private float deltaMouseY; -// -// private float slowDownReeling; -// -// private float slowDownFloat; -// -// private bool reelUpClicked; -// -// private bool reelDownClicked; -// -// -// public static Vector2 movementAxis; -// -// public static bool isJumping; -// -// public static bool isCameraChange; -// -// public static bool isUnderwaterCamera; -// -// public static bool isUnderwaterCameraZoomUp; -// -// public static bool isUnderwaterCameraZoomDown; -// -// public static bool isUnderwaterCameraFloatZoom; -// -// public static bool LT; -// -// public static bool showUI = true; -// -// -// public static bool underwaterCameraMini; -// -// public static bool isHeadFlashLight; -// -// public static bool quickHelp; -// -// public static bool isEagleEye; -// -// public static bool isRunning; -// -// public static bool isReelReeling; -// -// public static bool isReelSpeedUp; -// -// public static bool isReelSpeedDown; -// -// public static bool isReelSpeedMax; -// -// public static bool isReelDragUp; -// -// public static bool isReelDragDown; -// -// public static bool isCastNear; -// -// public static bool isCastFar; -// -// public static bool isPullUpRod; -// -// -// public static bool isCastReset; -// -// public static bool isDeepthFloatUp; -// -// public static bool isDeepthFloatDown; -// -// -// public static bool isShowSlot0; -// -// public static bool isShowSlot1; -// -// public static bool isShowSlot2; -// -// public static bool isShowSlot3; -// -// public static bool isShowSlot4; -// -// -// public static bool RB; -// -// [DllImport("user32.dll")] -// private static extern bool SetCursorPos(int X, int Y); -// -// [DllImport("user32.dll")] -// private static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo); -// -// [DllImport("user32.dll")] -// public static extern bool GetCursorPos(out POINT lpPoint); -// -// private void Start() -// { -// player = ReInput.players.GetPlayer(0); -// MouseMap mouseMapInstance = ReInput.mapping.GetMouseMapInstance(0, 0); -// MouseMap mouseMapInstanceSavedOrDefault = ReInput.mapping.GetMouseMapInstanceSavedOrDefault(0, 0, 0); -// KeyboardMap keyboardMapInstance = ReInput.mapping.GetKeyboardMapInstance(0, 0); -// KeyboardMap keyboardMapInstanceSavedOrDefault = ReInput.mapping.GetKeyboardMapInstanceSavedOrDefault(0, 0, 0); -// int num = mouseMapInstance.ButtonMaps.Count - mouseMapInstanceSavedOrDefault.ButtonMaps.Count; -// for (int i = 0; i < num; i++) -// { -// Debug.Log("Added new map: " + mouseMapInstance.ButtonMaps[mouseMapInstance.ButtonMaps.Count - 1 - i] -// .actionDescriptiveName); -// mouseMapInstanceSavedOrDefault.ButtonMaps.Add( -// mouseMapInstance.ButtonMaps[mouseMapInstance.ButtonMaps.Count - 1 - i]); -// } -// -// num = keyboardMapInstance.ButtonMaps.Count - keyboardMapInstanceSavedOrDefault.ButtonMaps.Count; -// for (int j = 0; j < num; j++) -// { -// Debug.Log("Added new map: " + keyboardMapInstance.ButtonMaps[keyboardMapInstance.ButtonMaps.Count - 1 - j] -// .actionDescriptiveName); -// keyboardMapInstanceSavedOrDefault.ButtonMaps.Add( -// keyboardMapInstance.ButtonMaps[keyboardMapInstance.ButtonMaps.Count - 1 - j]); -// } -// -// num = mouseMapInstance.AxisMaps.Count - mouseMapInstanceSavedOrDefault.AxisMaps.Count; -// for (int k = 0; k < num; k++) -// { -// Debug.Log(mouseMapInstance.AxisMaps[mouseMapInstance.AxisMaps.Count - 1 - k].actionDescriptiveName); -// mouseMapInstanceSavedOrDefault.AxisMaps.Add( -// mouseMapInstance.ButtonMaps[mouseMapInstance.ButtonMaps.Count - 1 - k]); -// } -// -// ReInput.userDataStore?.Save(); -// ReInput.userDataStore?.SavePlayerData(0); -// ReInput.userDataStore?.Load(); -// } -// -// private void recheckMouseDeltaPosition() -// { -// GetCursorPos(out var lpPoint); -// deltaMouseX = Mathf.Abs((float)lpPoint.X - Input.mousePosition.x); -// deltaMouseY = Mathf.Abs((float)lpPoint.Y + (Input.mousePosition.y - (float)Screen.height)); -// } -// -// public void SetCursorPositionToScreenCenter() -// { -// recheckMouseDeltaPosition(); -// MouseX = Screen.width / 2; -// MouseY = Screen.height / 2; -// SetCursorPos((int)(deltaMouseX + (float)(Screen.width / 2)), (int)(deltaMouseY + (float)(Screen.height / 2))); -// } -// -// private void Update() -// { -// if (IgnoreAllInput) -// { -// return; -// } -// -// if (Input.GetMouseButtonDown(0)) -// { -// IsMouseLeft = true; -// } -// -// if (Input.GetMouseButtonUp(0)) -// { -// IsMouseLeft = false; -// } -// -// if (Input.GetMouseButtonDown(1)) -// { -// IsMouseRight = true; -// } -// -// if (Input.GetMouseButtonUp(1)) -// { -// IsMouseRight = false; -// } -// -// // if (player.GetButtonDown("PressRMB")) -// // { -// // Debug.Log("PRESSEDDDDD"); -// // } -// -// -// if (player.GetButtonDown("rodPullUpButton") && CanPullUpRod()) -// { -// isPullUpRod = true; -// } -// -// if (player.GetButtonUp("rodPullUpButton")) -// { -// isPullUpRod = false; -// } -// -// if (player.GetButtonDown("LT")) -// { -// LT = true; -// } -// -// if (player.GetButtonUp("LT")) -// { -// LT = false; -// } -// -// if (player.GetButtonDown("RB")) -// { -// RB = true; -// } -// -// if (player.GetButtonUp("RB")) -// { -// RB = false; -// } -// -// if (player.GetButtonDown("reelSpeedMax")) -// { -// isReelSpeedMax = true; -// // isreelSpeedMaxHold = true; -// } -// else if (player.GetButtonUp("reelSpeedMax")) -// { -// isReelSpeedMax = false; -// // isreelSpeedMaxHold = false; -// } -// else if (RB) -// { -// if (reelUpClicked) -// { -// isReelSpeedMax = true; -// } -// else -// { -// isReelSpeedMax = false; -// } -// } -// -// // if (!isreelSpeedMaxHold) -// // { -// // isReelSpeedMax = false; -// // } -// -// if (player.GetButtonDown("quickHelpKey")) -// { -// quickHelp = !quickHelp; -// } -// -// -// movementAxis = Vector2.zero; -// // if (!SRDebug.Instance.IsDebugPanelVisible) -// { -// if (Application.isFocused) -// { -// movementAxis.x = player.GetAxis("moveHorizontal") * Time.deltaTime * 500f; -// movementAxis.y = player.GetAxis("moveVertical") * Time.deltaTime * 500f; -// } -// } -// -// -// if (player.GetButtonDown("reelSpeedUp")) -// { -// reelUpClicked = true; -// } -// -// if (player.GetButtonUp("reelSpeedUp")) -// { -// isReelSpeedUp = false; -// reelUpClicked = false; -// } -// -// if (player.GetButtonDown("reelSpeedDown")) -// { -// reelDownClicked = true; -// } -// -// if (player.GetButtonUp("reelSpeedDown")) -// { -// isReelSpeedDown = false; -// reelDownClicked = false; -// } -// -// // if (FScriptsHandler.Instance != null && FScriptsHandler.Instance.m_PlayerMain.currentRod != null && -// // (!LT || FScriptsHandler.Instance.m_PlayerMain.currentRod.rodType != 0) && !RB) -// // { -// // if (reelUpClicked) -// // { -// // if (slowDownReeling >= 1f) -// // { -// // isReelSpeedUp = true; -// // slowDownReeling = 0f; -// // } -// // else -// // { -// // isReelSpeedUp = false; -// // slowDownReeling += Time.deltaTime * 100f; -// // } -// // } -// // -// // if (reelDownClicked) -// // { -// // if (slowDownReeling >= 1f) -// // { -// // isReelSpeedDown = true; -// // slowDownReeling = 0f; -// // } -// // else -// // { -// // isReelSpeedDown = false; -// // slowDownReeling += Time.deltaTime * 100f; -// // } -// // } -// // } -// -// -// if (player.GetButtonDown("jumping")) -// { -// isJumping = true; -// } -// else -// { -// isJumping = false; -// } -// -// -// -// if (player.GetButtonDown("runKey")) -// { -// isRunning = true; -// } -// -// if (player.GetButtonUp("runKey")) -// { -// isRunning = false; -// } -// -// if (player.GetButtonDown("cameraTypeViewKey")) -// { -// isCameraChange = !isCameraChange; -// } -// -// if (player.GetButtonDown("showGUIKey")) -// { -// showUI = !showUI; -// } -// -// -// if (player.GetButtonDown("eagleEye")) -// { -// isEagleEye = true; -// } -// -// if (player.GetButtonUp("eagleEye")) -// { -// isEagleEye = false; -// } -// -// if (player.GetButtonDown("underwaterCameraKey")) -// { -// isUnderwaterCamera = !isUnderwaterCamera; -// } -// -// if (player.GetButtonDown("underwaterMiniCameraKey")) -// { -// underwaterCameraMini = !underwaterCameraMini; -// } -// -// if (player.GetButtonDown("underwaterZoomUpCameraKey")) -// { -// isUnderwaterCameraZoomUp = true; -// } -// -// if (player.GetButtonUp("underwaterZoomUpCameraKey")) -// { -// isUnderwaterCameraZoomUp = false; -// } -// -// if (player.GetButtonDown("underwaterZoomDownCameraKey")) -// { -// isUnderwaterCameraZoomDown = true; -// } -// -// if (player.GetButtonUp("underwaterZoomDownCameraKey")) -// { -// isUnderwaterCameraZoomDown = false; -// } -// -// if (player.GetButtonDown("underwaterZoomFloat")) -// { -// isUnderwaterCameraFloatZoom = true; -// } -// else -// { -// isUnderwaterCameraFloatZoom = false; -// } -// -// if (player.GetButtonDown("showSlot0")) -// { -// isShowSlot0 = true; -// Debug.LogError("showSlot0======"); -// } -// else -// { -// isShowSlot0 = false; -// } -// -// if (player.GetButtonDown("showSlot1")) -// { -// isShowSlot1 = true; -// Debug.LogError("showSlot1======"); -// } -// else -// { -// isShowSlot1 = false; -// } -// -// if (player.GetButtonDown("showSlot2")) -// { -// isShowSlot2 = true; -// Debug.LogError("showSlot2======"); -// } -// else -// { -// isShowSlot2 = false; -// } -// -// if (player.GetButtonDown("showSlot3")) -// { -// isShowSlot3 = true; -// } -// else -// { -// isShowSlot3 = false; -// } -// -// if (player.GetButtonDown("showSlot4")) -// { -// isShowSlot4 = true; -// } -// else -// { -// isShowSlot4 = false; -// } -// -// -// // if (!isCastFar) -// // { -// // if (GameManager.Instance.currentLevelPopUp != null) -// // { -// // return; -// // } -// // -// // if (player.GetButtonDown("NearCastButton")) -// // { -// // isCastNear = true; -// // } -// // else if (player.GetButtonUp("NearCastButton") && isCastNear) -// // { -// // isCastNear = false; -// // } -// // } -// // -// // if (!isCastNear) -// // { -// // if (GameManager.Instance.currentLevelPopUp != null) -// // { -// // return; -// // } -// // -// // if (player.GetButtonDown("FarCastButton")) -// // { -// // isCastFar = true; -// // } -// // else if (player.GetButtonUp("FarCastButton") && isCastFar) -// // { -// // isCastFar = false; -// // } -// // } -// // -// -// if (player.GetButtonTimePressed("resetCast") >= 1.0) -// { -// isCastReset = true; -// } -// else -// { -// isCastReset = false; -// } -// -// -// if (player.GetButtonDown("reelDragUp")) -// { -// isReelDragUp = true; -// } -// else -// { -// isReelDragUp = false; -// } -// -// if (player.GetButtonDown("reelDragDown")) -// { -// isReelDragDown = true; -// } -// else -// { -// isReelDragDown = false; -// } -// -// -// if (player.GetButtonDown("headFlashLight")) -// { -// isHeadFlashLight = !isHeadFlashLight; -// } -// -// -// if (player.GetButtonDown("floatDeepthUp")) -// { -// isDeepthFloatUp = true; -// } -// else -// { -// isDeepthFloatUp = false; -// } -// -// if (player.GetButtonDown("floatDeepthDown")) -// { -// isDeepthFloatDown = true; -// } -// else -// { -// isDeepthFloatDown = false; -// } -// -// if (player.GetButtonDown("Reeling")) -// { -// isReelReeling = true; -// } -// -// if (player.GetButtonUp("Reeling")) -// { -// isReelReeling = false; -// } -// -// if (LT && !RB) -// { -// if (reelUpClicked) -// { -// if (slowDownFloat >= 1f) -// { -// isDeepthFloatUp = true; -// slowDownFloat = 0f; -// } -// else -// { -// isDeepthFloatUp = false; -// slowDownFloat += Time.deltaTime * 10f; -// } -// } -// -// if (reelDownClicked) -// { -// if (slowDownFloat >= 1f) -// { -// isDeepthFloatDown = true; -// slowDownFloat = 0f; -// } -// else -// { -// isDeepthFloatDown = false; -// slowDownFloat += Time.deltaTime * 10f; -// } -// } -// } -// -// } -// -// private bool CanPullUpRod() -// { -// // if (FScriptsHandler.Instance == null) -// // { -// // return false; -// // } -// // -// // if (FScriptsHandler.Instance.m_PlayerMain == null) -// // { -// // return false; -// // } -// // -// // if (FScriptsHandler.Instance.m_PlayerMain.currentRod == null) -// // { -// // return false; -// // } -// // -// // if (FScriptsHandler.Instance.m_PlayerMain.currentRod.fishingLine == null) -// // { -// // return false; -// // } -// // -// // if (FScriptsHandler.Instance.m_PlayerMain.currentRod.fishingLine.ropeToHookDistance <= 1f) -// // { -// // if (FScriptsHandler.Instance.m_PlayerMain.currentRod.currentFish != null || -// // FScriptsHandler.Instance.m_PlayerMain.currentRod.takeFish != null) -// // { -// // return true; -// // } -// // -// // return false; -// // } -// -// return true; -// } -// -// public static void ResetMouseButtonsTriggers() -// { -// isCastNear = false; -// isCastFar = false; -// isReelReeling = false; -// } -// -// private void OnApplicationFocus(bool hasFocus) -// { -// isPaused = !hasFocus; -// } -// -// private void OnApplicationPause(bool pauseStatus) -// { -// isPaused = pauseStatus; -// } -// } \ No newline at end of file diff --git a/Assets/Scripts/Old/InputManager.cs.meta b/Assets/Scripts/Old/InputManager.cs.meta deleted file mode 100644 index 62c5faf50..000000000 --- a/Assets/Scripts/Old/InputManager.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 06ccb0a1e4364d43bf431b652400cd31 -timeCreated: 1742311542 \ No newline at end of file diff --git a/Assets/Scripts/Startup/App.cs b/Assets/Scripts/Startup/App.cs index f87997816..96dd95d46 100644 --- a/Assets/Scripts/Startup/App.cs +++ b/Assets/Scripts/Startup/App.cs @@ -61,9 +61,27 @@ namespace NBF private void Init() { InitService(); + InitLanguage(); InitUI(); } + #region 多语言 + + private void InitLanguage() + { + Lan.Inst.AddLanguageModule((int)LanguageModuleType.Text, new LanguageText()); + Lan.Inst.AddLanguageModule((int)LanguageModuleType.Image, new LanguageImage()); + Lan.Inst.AddLanguageModule((int)LanguageModuleType.Font, new LanguageFont()); + + foreach (var key in LanguageConst.languageMap.Keys) + { + Lan.Inst.AddLanguage(key); + } + + UI.Inst.SetUILanguage(); + } + + #endregion #region UI @@ -118,6 +136,7 @@ namespace NBF InputDef.LoadIcon(); // UI.Inst.OpenUI(); LoadData(); + UI.Inst.OpenUI(); // Fishing.Inst.Go(1); // UI.Inst.OpenUI(); UI.Inst.OpenUI(); diff --git a/Assets/Scripts/UI/Bag/BagPanel.cs b/Assets/Scripts/UI/Bag/BagPanel.cs index e6122b5fa..a2ba2722b 100644 --- a/Assets/Scripts/UI/Bag/BagPanel.cs +++ b/Assets/Scripts/UI/Bag/BagPanel.cs @@ -24,6 +24,7 @@ namespace NBF private void OnUICanceled(string action) { + if (!IsTop) return; if (action == InputDef.UI.SubPrev) { } @@ -46,59 +47,11 @@ namespace NBF private void UseBottomMenu() { - BottomMenu.OnTab += () => - { - var i = Random.Range(1, 13); - if (i < 3) - { - Notices.Success("离开晶科科技看就看"); - } - else if (i < 6) - { - Notices.Warning("离开晶科科技看就看"); - } - else if (i < 9) - { - Notices.Error("离开晶科科技看就看"); - } - else if (i < 12) - { - Notices.Info("离开晶科科技看就看"); - } - }; - BottomMenu.OnBack += OnBack; - BottomMenu.OnEnter += OnApplySettings; - BottomMenu.Use(); - } - - private void OnApplySettings() - { - } - - private void OnBack() - { - if (Settings.Instance.HaveNotAppleSettings()) - { - MessageBox.Show("还有未保存的信息", (b) => - { - if (b) - { - Hide(); - } - }); - } - else - { - Hide(); - } + BottomMenu.Use(this); } protected override void OnHide() { - BottomMenu.OnBack -= OnBack; - // BottomMenu.OnTab -= OnResetSettings; - BottomMenu.OnEnter -= OnApplySettings; - BottomMenu.UnUse(); InputManager.OnUICanceled -= OnUICanceled; } diff --git a/Assets/Scripts/UI/Binders/CommonBinder.cs b/Assets/Scripts/UI/Binders/CommonBinder.cs index cdc01e2e1..d03266723 100644 --- a/Assets/Scripts/UI/Binders/CommonBinder.cs +++ b/Assets/Scripts/UI/Binders/CommonBinder.cs @@ -11,6 +11,7 @@ namespace NBF UIObjectFactory.SetPackageItemExtension(BottomMenu.URL, typeof(BottomMenu)); UIObjectFactory.SetPackageItemExtension(ClassifyList.URL, typeof(ClassifyList)); UIObjectFactory.SetPackageItemExtension(CommonMenu.URL, typeof(CommonMenu)); + UIObjectFactory.SetPackageItemExtension(MarqueeTag.URL, typeof(MarqueeTag)); UIObjectFactory.SetPackageItemExtension(BtnTextInputControl.URL, typeof(BtnTextInputControl)); UIObjectFactory.SetPackageItemExtension(BtnTitleInputControl.URL, typeof(BtnTitleInputControl)); UIObjectFactory.SetPackageItemExtension(NoticeItem.URL, typeof(NoticeItem)); diff --git a/Assets/Scripts/UI/Binders/MainBinder.cs b/Assets/Scripts/UI/Binders/MainBinder.cs index a1145c6ce..ba43589cf 100644 --- a/Assets/Scripts/UI/Binders/MainBinder.cs +++ b/Assets/Scripts/UI/Binders/MainBinder.cs @@ -13,6 +13,7 @@ namespace NBF UIObjectFactory.SetPackageItemExtension(HomeMainPage.URL, typeof(HomeMainPage)); UIObjectFactory.SetPackageItemExtension(HomeActivityPage.URL, typeof(HomeActivityPage)); UIObjectFactory.SetPackageItemExtension(HomeRankPage.URL, typeof(HomeRankPage)); + UIObjectFactory.SetPackageItemExtension(HomeStatisticsPage.URL, typeof(HomeStatisticsPage)); UIObjectFactory.SetPackageItemExtension(HomeButtonGroups.URL, typeof(HomeButtonGroups)); } } diff --git a/Assets/Scripts/UI/BtnTextInputControl.Designer.cs b/Assets/Scripts/UI/Common/BtnTextInputControl.Designer.cs similarity index 100% rename from Assets/Scripts/UI/BtnTextInputControl.Designer.cs rename to Assets/Scripts/UI/Common/BtnTextInputControl.Designer.cs diff --git a/Assets/Scripts/UI/BtnTextInputControl.Designer.cs.meta b/Assets/Scripts/UI/Common/BtnTextInputControl.Designer.cs.meta similarity index 100% rename from Assets/Scripts/UI/BtnTextInputControl.Designer.cs.meta rename to Assets/Scripts/UI/Common/BtnTextInputControl.Designer.cs.meta diff --git a/Assets/Scripts/UI/BtnTextInputControl.cs b/Assets/Scripts/UI/Common/BtnTextInputControl.cs similarity index 100% rename from Assets/Scripts/UI/BtnTextInputControl.cs rename to Assets/Scripts/UI/Common/BtnTextInputControl.cs diff --git a/Assets/Scripts/UI/BtnTextInputControl.cs.meta b/Assets/Scripts/UI/Common/BtnTextInputControl.cs.meta similarity index 100% rename from Assets/Scripts/UI/BtnTextInputControl.cs.meta rename to Assets/Scripts/UI/Common/BtnTextInputControl.cs.meta diff --git a/Assets/Scripts/UI/Common/MarqueeTag.Designer.cs b/Assets/Scripts/UI/Common/MarqueeTag.Designer.cs new file mode 100644 index 000000000..a3d6f648a --- /dev/null +++ b/Assets/Scripts/UI/Common/MarqueeTag.Designer.cs @@ -0,0 +1,27 @@ +/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/ + + +using FairyGUI; +using FairyGUI.Utils; +using NBC; + +namespace NBF +{ + public partial class MarqueeTag + { + public const string URL = "ui://6hgkvlaulvqll9"; + + public GRichTextField TextContent1; + public GRichTextField TextContent2; + + public override void ConstructFromXML(XML xml) + { + base.ConstructFromXML(xml); + + TextContent1 = (GRichTextField)GetChild("TextContent1"); + TextContent2 = (GRichTextField)GetChild("TextContent2"); + OnInited(); + UILanguage.TrySetComponentLanguage(this); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/MarqueeTag.Designer.cs.meta b/Assets/Scripts/UI/Common/MarqueeTag.Designer.cs.meta new file mode 100644 index 000000000..1ef7f25e6 --- /dev/null +++ b/Assets/Scripts/UI/Common/MarqueeTag.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6a9cfe2c247599a4aacfea389e45ce14 \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/MarqueeTag.cs b/Assets/Scripts/UI/Common/MarqueeTag.cs new file mode 100644 index 000000000..1cb73cb7d --- /dev/null +++ b/Assets/Scripts/UI/Common/MarqueeTag.cs @@ -0,0 +1,15 @@ +// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 + +using UnityEngine; +using FairyGUI; +using NBC; + +namespace NBF +{ + public partial class MarqueeTag : GComponent + { + private void OnInited() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/MarqueeTag.cs.meta b/Assets/Scripts/UI/Common/MarqueeTag.cs.meta new file mode 100644 index 000000000..cde6fc784 --- /dev/null +++ b/Assets/Scripts/UI/Common/MarqueeTag.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 70a1e1d821a7bc24e8eac7cc9bbf074b \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/Menu/BottomMenu.cs b/Assets/Scripts/UI/Common/Menu/BottomMenu.cs index 68ed60fb4..ffcfc030a 100644 --- a/Assets/Scripts/UI/Common/Menu/BottomMenu.cs +++ b/Assets/Scripts/UI/Common/Menu/BottomMenu.cs @@ -9,10 +9,7 @@ namespace NBF { public partial class BottomMenu : GComponent { - public event Action OnBack; - public event Action OnEnter; - public event Action OnTab; - public event Action OnUse; + private IUIPanel _panel; private void OnInited() { @@ -26,27 +23,18 @@ namespace NBF item.OnAction?.Invoke(); } - public void UnUse() - { - OnBack = null; - OnEnter = null; - OnTab = null; - OnUse = null; - - InputManager.OnUICanceled -= OnAction; - } - - public void Use() + public void Use(IUIPanel panel) { + _panel = panel; List.RemoveChildrenToPool(); LeftList.RemoveChildrenToPool(); InputManager.OnUICanceled += OnAction; - AddButtonItem(OnUse, ""); - AddButtonItem(OnTab, InputDef.UI.Tab); - AddButtonItem(OnEnter, InputDef.UI.Enter); - AddButtonItem(OnBack, InputDef.UI.Back); + // AddButtonItem(OnUse, ""); + // AddButtonItem(OnTab, InputDef.UI.Tab); + // AddButtonItem(OnEnter, InputDef.UI.Enter); + // AddButtonItem(OnBack, InputDef.UI.Back); } private void AddButtonItem(Action action, string actionName) @@ -63,6 +51,7 @@ namespace NBF private void OnAction(string action) { + if (_panel == null || !_panel.IsShowing || !_panel.IsTop) return; var children = List.GetChildren(); foreach (var child in children) { diff --git a/Assets/Scripts/UI/Common/Panel.meta b/Assets/Scripts/UI/Common/Panel.meta new file mode 100644 index 000000000..fdcfe4816 --- /dev/null +++ b/Assets/Scripts/UI/Common/Panel.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 059888fe216d4a789f01c3289be01645 +timeCreated: 1748933992 \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/Panel/CommonTopPanel.Designer.cs b/Assets/Scripts/UI/Common/Panel/CommonTopPanel.Designer.cs new file mode 100644 index 000000000..cb46b9880 --- /dev/null +++ b/Assets/Scripts/UI/Common/Panel/CommonTopPanel.Designer.cs @@ -0,0 +1,20 @@ +/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/ + +using FairyGUI; +using FairyGUI.Utils; +using NBC; +using System.Collections.Generic; + +namespace NBF +{ + /// + public partial class CommonTopPanel + { + public GObject this[string aKey] => ContentPane.GetChild(aKey); + [AutoFind(Name = "Marquee")] + public MarqueeTag Marquee; + public override string[] GetDependPackages(){ return new string[] {}; } + + + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/Panel/CommonTopPanel.Designer.cs.meta b/Assets/Scripts/UI/Common/Panel/CommonTopPanel.Designer.cs.meta new file mode 100644 index 000000000..cdd853772 --- /dev/null +++ b/Assets/Scripts/UI/Common/Panel/CommonTopPanel.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bbb8f680eb100a84c957fad39fae2e96 \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/Panel/CommonTopPanel.cs b/Assets/Scripts/UI/Common/Panel/CommonTopPanel.cs new file mode 100644 index 000000000..8e05064bd --- /dev/null +++ b/Assets/Scripts/UI/Common/Panel/CommonTopPanel.cs @@ -0,0 +1,49 @@ +// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖 + +using UnityEngine; +using NBC; + +namespace NBF +{ + public partial class CommonTopPanel : UIPanel + { + public override string UIPackName => "Common"; + public override string UIResName => "CommonTopPanel"; + + protected override void OnInit() + { + ContentPane.sortingOrder = UIDef.UIOrder.CommonTopPanel; + } + + protected override void OnShow() + { + InputManager.OnUICanceled += OnUICanceled; + } + + private void OnUICanceled(string action) + { + if (action == InputDef.UI.Back) + { + var uis = UI.Inst.GetAllUI(); + foreach (var ui in uis) + { + if (ui.ContentPane.sortingOrder > 0) continue; + if (ui.IsTop && !IsDontBack) + { + ui.Hide(); + } + } + } + } + + protected override void OnHide() + { + InputManager.OnUICanceled -= OnUICanceled; + } + + protected override void OnDestroy() + { + base.OnDestroy(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/Panel/CommonTopPanel.cs.meta b/Assets/Scripts/UI/Common/Panel/CommonTopPanel.cs.meta new file mode 100644 index 000000000..c10d4169a --- /dev/null +++ b/Assets/Scripts/UI/Common/Panel/CommonTopPanel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b07b25d31dce1224e913094a95196cbb \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/GMPanel.Designer.cs b/Assets/Scripts/UI/Common/Panel/GMPanel.Designer.cs similarity index 100% rename from Assets/Scripts/UI/Common/GMPanel.Designer.cs rename to Assets/Scripts/UI/Common/Panel/GMPanel.Designer.cs diff --git a/Assets/Scripts/UI/Common/GMPanel.Designer.cs.meta b/Assets/Scripts/UI/Common/Panel/GMPanel.Designer.cs.meta similarity index 100% rename from Assets/Scripts/UI/Common/GMPanel.Designer.cs.meta rename to Assets/Scripts/UI/Common/Panel/GMPanel.Designer.cs.meta diff --git a/Assets/Scripts/UI/Common/GMPanel.cs b/Assets/Scripts/UI/Common/Panel/GMPanel.cs similarity index 100% rename from Assets/Scripts/UI/Common/GMPanel.cs rename to Assets/Scripts/UI/Common/Panel/GMPanel.cs diff --git a/Assets/Scripts/UI/Common/GMPanel.cs.meta b/Assets/Scripts/UI/Common/Panel/GMPanel.cs.meta similarity index 100% rename from Assets/Scripts/UI/Common/GMPanel.cs.meta rename to Assets/Scripts/UI/Common/Panel/GMPanel.cs.meta diff --git a/Assets/Scripts/UI/Common/MessageBox.Designer.cs b/Assets/Scripts/UI/Common/Panel/MessageBox.Designer.cs similarity index 100% rename from Assets/Scripts/UI/Common/MessageBox.Designer.cs rename to Assets/Scripts/UI/Common/Panel/MessageBox.Designer.cs diff --git a/Assets/Scripts/UI/Common/MessageBox.Designer.cs.meta b/Assets/Scripts/UI/Common/Panel/MessageBox.Designer.cs.meta similarity index 100% rename from Assets/Scripts/UI/Common/MessageBox.Designer.cs.meta rename to Assets/Scripts/UI/Common/Panel/MessageBox.Designer.cs.meta diff --git a/Assets/Scripts/UI/Common/MessageBox.cs b/Assets/Scripts/UI/Common/Panel/MessageBox.cs similarity index 98% rename from Assets/Scripts/UI/Common/MessageBox.cs rename to Assets/Scripts/UI/Common/Panel/MessageBox.cs index 047bfd71c..4c3847dc5 100644 --- a/Assets/Scripts/UI/Common/MessageBox.cs +++ b/Assets/Scripts/UI/Common/Panel/MessageBox.cs @@ -53,8 +53,9 @@ namespace NBF ShowAnim = UIPanelAnimation.GetCenterScaleBig(this); HideAnim = UIPanelAnimation.GetCenterScaleBig(this, true); IsModal = true; + IsDontBack = true; } - + protected override void OnShow() { TextTitle.text = _title; diff --git a/Assets/Scripts/UI/Common/MessageBox.cs.meta b/Assets/Scripts/UI/Common/Panel/MessageBox.cs.meta similarity index 100% rename from Assets/Scripts/UI/Common/MessageBox.cs.meta rename to Assets/Scripts/UI/Common/Panel/MessageBox.cs.meta diff --git a/Assets/Scripts/UI/Common/Notices.Designer.cs b/Assets/Scripts/UI/Common/Panel/Notices.Designer.cs similarity index 100% rename from Assets/Scripts/UI/Common/Notices.Designer.cs rename to Assets/Scripts/UI/Common/Panel/Notices.Designer.cs diff --git a/Assets/Scripts/UI/Common/Notices.Designer.cs.meta b/Assets/Scripts/UI/Common/Panel/Notices.Designer.cs.meta similarity index 100% rename from Assets/Scripts/UI/Common/Notices.Designer.cs.meta rename to Assets/Scripts/UI/Common/Panel/Notices.Designer.cs.meta diff --git a/Assets/Scripts/UI/Common/Notices.cs b/Assets/Scripts/UI/Common/Panel/Notices.cs similarity index 100% rename from Assets/Scripts/UI/Common/Notices.cs rename to Assets/Scripts/UI/Common/Panel/Notices.cs diff --git a/Assets/Scripts/UI/Common/Notices.cs.meta b/Assets/Scripts/UI/Common/Panel/Notices.cs.meta similarity index 100% rename from Assets/Scripts/UI/Common/Notices.cs.meta rename to Assets/Scripts/UI/Common/Panel/Notices.cs.meta diff --git a/Assets/Scripts/UI/UILangeageConfig.cs b/Assets/Scripts/UI/Common/UILangeageConfig.cs similarity index 100% rename from Assets/Scripts/UI/UILangeageConfig.cs rename to Assets/Scripts/UI/Common/UILangeageConfig.cs diff --git a/Assets/Scripts/UI/UILangeageConfig.cs.meta b/Assets/Scripts/UI/Common/UILangeageConfig.cs.meta similarity index 100% rename from Assets/Scripts/UI/UILangeageConfig.cs.meta rename to Assets/Scripts/UI/Common/UILangeageConfig.cs.meta diff --git a/Assets/Scripts/UI/FishBag.meta b/Assets/Scripts/UI/FishBag.meta new file mode 100644 index 000000000..5ce1739d8 --- /dev/null +++ b/Assets/Scripts/UI/FishBag.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4021be5a688e4880815366add9c9e2fd +timeCreated: 1748941707 \ No newline at end of file diff --git a/Assets/Scripts/UI/FishBag/FishBagPanel.Designer.cs b/Assets/Scripts/UI/FishBag/FishBagPanel.Designer.cs new file mode 100644 index 000000000..ce945609f --- /dev/null +++ b/Assets/Scripts/UI/FishBag/FishBagPanel.Designer.cs @@ -0,0 +1,22 @@ +/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/ + +using FairyGUI; +using FairyGUI.Utils; +using NBC; +using System.Collections.Generic; + +namespace NBF +{ + /// + public partial class FishBagPanel + { + public GObject this[string aKey] => ContentPane.GetChild(aKey); + [AutoFind(Name = "back")] + public GImage back; + [AutoFind(Name = "BottomMenu")] + public BottomMenu BottomMenu; + public override string[] GetDependPackages(){ return new string[] {"Common"}; } + + + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/FishBag/FishBagPanel.Designer.cs.meta b/Assets/Scripts/UI/FishBag/FishBagPanel.Designer.cs.meta new file mode 100644 index 000000000..a4bd76dfd --- /dev/null +++ b/Assets/Scripts/UI/FishBag/FishBagPanel.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 55a42f040765e1948898ff81902abff4 \ No newline at end of file diff --git a/Assets/Scripts/UI/FishBag/FishBagPanel.cs b/Assets/Scripts/UI/FishBag/FishBagPanel.cs new file mode 100644 index 000000000..a6359295b --- /dev/null +++ b/Assets/Scripts/UI/FishBag/FishBagPanel.cs @@ -0,0 +1,33 @@ +// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖 + +using UnityEngine; +using NBC; + +namespace NBF +{ + public partial class FishBagPanel : UIPanel + { + public override string UIPackName => "Main"; + public override string UIResName => "FishBagPanel"; + + protected override void OnInit() + { + base.OnInit(); + } + + protected override void OnShow() + { + base.OnShow(); + } + + protected override void OnHide() + { + base.OnHide(); + } + + protected override void OnDestroy() + { + base.OnDestroy(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/FishBag/FishBagPanel.cs.meta b/Assets/Scripts/UI/FishBag/FishBagPanel.cs.meta new file mode 100644 index 000000000..355e0e57b --- /dev/null +++ b/Assets/Scripts/UI/FishBag/FishBagPanel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6de4d8117b1b09340b4d11dd47e74b32 \ No newline at end of file diff --git a/Assets/Scripts/UI/Fishing/FishingPanel.cs b/Assets/Scripts/UI/Fishing/FishingPanel.cs index e72d8e4a2..35e202dae 100644 --- a/Assets/Scripts/UI/Fishing/FishingPanel.cs +++ b/Assets/Scripts/UI/Fishing/FishingPanel.cs @@ -14,6 +14,7 @@ namespace NBF protected override void OnInit() { IsShowCursor = false; + IsDontBack = true; } protected override void OnShow() diff --git a/Assets/Scripts/UI/FishingPower.Designer.cs b/Assets/Scripts/UI/Fishing/FishingPower.Designer.cs similarity index 100% rename from Assets/Scripts/UI/FishingPower.Designer.cs rename to Assets/Scripts/UI/Fishing/FishingPower.Designer.cs diff --git a/Assets/Scripts/UI/FishingPower.Designer.cs.meta b/Assets/Scripts/UI/Fishing/FishingPower.Designer.cs.meta similarity index 100% rename from Assets/Scripts/UI/FishingPower.Designer.cs.meta rename to Assets/Scripts/UI/Fishing/FishingPower.Designer.cs.meta diff --git a/Assets/Scripts/UI/FishingPower.cs b/Assets/Scripts/UI/Fishing/FishingPower.cs similarity index 100% rename from Assets/Scripts/UI/FishingPower.cs rename to Assets/Scripts/UI/Fishing/FishingPower.cs diff --git a/Assets/Scripts/UI/FishingPower.cs.meta b/Assets/Scripts/UI/Fishing/FishingPower.cs.meta similarity index 100% rename from Assets/Scripts/UI/FishingPower.cs.meta rename to Assets/Scripts/UI/Fishing/FishingPower.cs.meta diff --git a/Assets/Scripts/UI/FishingStateInfo.Designer.cs b/Assets/Scripts/UI/Fishing/FishingStateInfo.Designer.cs similarity index 100% rename from Assets/Scripts/UI/FishingStateInfo.Designer.cs rename to Assets/Scripts/UI/Fishing/FishingStateInfo.Designer.cs diff --git a/Assets/Scripts/UI/FishingStateInfo.Designer.cs.meta b/Assets/Scripts/UI/Fishing/FishingStateInfo.Designer.cs.meta similarity index 100% rename from Assets/Scripts/UI/FishingStateInfo.Designer.cs.meta rename to Assets/Scripts/UI/Fishing/FishingStateInfo.Designer.cs.meta diff --git a/Assets/Scripts/UI/FishingStateInfo.cs b/Assets/Scripts/UI/Fishing/FishingStateInfo.cs similarity index 100% rename from Assets/Scripts/UI/FishingStateInfo.cs rename to Assets/Scripts/UI/Fishing/FishingStateInfo.cs diff --git a/Assets/Scripts/UI/FishingStateInfo.cs.meta b/Assets/Scripts/UI/Fishing/FishingStateInfo.cs.meta similarity index 100% rename from Assets/Scripts/UI/FishingStateInfo.cs.meta rename to Assets/Scripts/UI/Fishing/FishingStateInfo.cs.meta diff --git a/Assets/Scripts/UI/Home/Com/HomeButtonGroups.Designer.cs b/Assets/Scripts/UI/Home/Com/HomeButtonGroups.Designer.cs index 92f9b2ccd..0173331d3 100644 --- a/Assets/Scripts/UI/Home/Com/HomeButtonGroups.Designer.cs +++ b/Assets/Scripts/UI/Home/Com/HomeButtonGroups.Designer.cs @@ -11,13 +11,13 @@ namespace NBF { public const string URL = "ui://hxr7rc7plvqln"; - public GButton BtnMap; - public GButton BtnMessage; + public GButton BtnGo; + public GButton BtnMake; public GButton BtnExit; public GButton BtnSettings; - public GButton BtnStatistics; + public GButton BtnFishBag; public GButton BtnBag; - public GButton BtnSkill; + public GButton BtnMap; public GButton BtnPass; public GButton BtnMission; public GButton BtnTournament; @@ -26,13 +26,13 @@ namespace NBF { base.ConstructFromXML(xml); - BtnMap = (GButton)GetChild("BtnMap"); - BtnMessage = (GButton)GetChild("BtnMessage"); + BtnGo = (GButton)GetChild("BtnGo"); + BtnMake = (GButton)GetChild("BtnMake"); BtnExit = (GButton)GetChild("BtnExit"); BtnSettings = (GButton)GetChild("BtnSettings"); - BtnStatistics = (GButton)GetChild("BtnStatistics"); + BtnFishBag = (GButton)GetChild("BtnFishBag"); BtnBag = (GButton)GetChild("BtnBag"); - BtnSkill = (GButton)GetChild("BtnSkill"); + BtnMap = (GButton)GetChild("BtnMap"); BtnPass = (GButton)GetChild("BtnPass"); BtnMission = (GButton)GetChild("BtnMission"); BtnTournament = (GButton)GetChild("BtnTournament"); diff --git a/Assets/Scripts/UI/Home/Com/HomeButtonGroups.cs b/Assets/Scripts/UI/Home/Com/HomeButtonGroups.cs index b398adcb2..3d5bebc0d 100644 --- a/Assets/Scripts/UI/Home/Com/HomeButtonGroups.cs +++ b/Assets/Scripts/UI/Home/Com/HomeButtonGroups.cs @@ -17,7 +17,7 @@ namespace NBF { if (btn == BtnExit) { - MessageBox.Show("确定推出到桌面吗?", (b) => + MessageBox.Show("确定退出吗?", (b) => { if (b) Application.Quit(); }); @@ -30,6 +30,18 @@ namespace NBF { UI.Inst.OpenUI(); } + else if (btn == BtnFishBag) + { + UI.Inst.OpenUI(); + } + else if (btn == BtnMake) + { + UI.Inst.OpenUI(); + } + else if (btn == BtnMap) + { + UI.Inst.OpenUI(); + } } } } \ No newline at end of file diff --git a/Assets/Scripts/UI/Home/HomePanel.cs b/Assets/Scripts/UI/Home/HomePanel.cs index e62222b8a..bff2548ac 100644 --- a/Assets/Scripts/UI/Home/HomePanel.cs +++ b/Assets/Scripts/UI/Home/HomePanel.cs @@ -56,7 +56,7 @@ namespace NBF var nowPage = GetPage(index); if (nowPage != null) { - nowPage.Show(); + nowPage.Show(this); _currentPage = nowPage; } } diff --git a/Assets/Scripts/UI/Home/Pages/HomeMainPage.cs b/Assets/Scripts/UI/Home/Pages/HomeMainPage.cs index baf7bc131..0acbaebc6 100644 --- a/Assets/Scripts/UI/Home/Pages/HomeMainPage.cs +++ b/Assets/Scripts/UI/Home/Pages/HomeMainPage.cs @@ -1,15 +1,11 @@ // 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 -using System.Collections.Generic; -using UnityEngine; -using FairyGUI; using NBC; namespace NBF { public partial class HomeMainPage : HomePageBase { - private void OnInited() { } @@ -22,15 +18,12 @@ namespace NBF protected override void OnHide() { - BottomMenu.OnBack -= OnBack; - BottomMenu.OnEnter -= OnApplySettings; - BottomMenu.UnUse(); InputManager.OnUICanceled -= OnUICanceled; } - private void OnUICanceled(string action) { + if (!Panel.IsTop) return; if (action == InputDef.UI.SubPrev) { } @@ -47,18 +40,7 @@ namespace NBF private void UseBottomMenu() { - BottomMenu.OnBack += OnBack; - BottomMenu.OnEnter += OnApplySettings; - BottomMenu.Use(); - } - - private void OnApplySettings() - { - } - - private void OnBack() - { - UI.Inst.HideUI(); + BottomMenu.Use(Panel); } } } \ No newline at end of file diff --git a/Assets/Scripts/UI/Home/Pages/HomePageBase.cs b/Assets/Scripts/UI/Home/Pages/HomePageBase.cs index 058061281..24d45c7c9 100644 --- a/Assets/Scripts/UI/Home/Pages/HomePageBase.cs +++ b/Assets/Scripts/UI/Home/Pages/HomePageBase.cs @@ -6,8 +6,11 @@ namespace NBF { public int Page; - public void Show() + public HomePanel Panel; + + public void Show(HomePanel panel) { + Panel = panel; ShowAnimation(); OnShow(); } @@ -34,10 +37,7 @@ namespace NBF private void HideAnimation() { GTween.Kill(this); - TweenFade(0, 0.2f).OnComplete(() => - { - visible = false; - }); + TweenFade(0, 0.2f).OnComplete(() => { visible = false; }); } #endregion diff --git a/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.Designer.cs b/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.Designer.cs new file mode 100644 index 000000000..cc44290c8 --- /dev/null +++ b/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.Designer.cs @@ -0,0 +1,25 @@ +/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/ + + +using FairyGUI; +using FairyGUI.Utils; +using NBC; + +namespace NBF +{ + public partial class HomeStatisticsPage + { + public const string URL = "ui://hxr7rc7plvql13"; + + public BottomMenu BottomMenu; + + public override void ConstructFromXML(XML xml) + { + base.ConstructFromXML(xml); + + BottomMenu = (BottomMenu)GetChild("BottomMenu"); + OnInited(); + UILanguage.TrySetComponentLanguage(this); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.Designer.cs.meta b/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.Designer.cs.meta new file mode 100644 index 000000000..caf0d31ea --- /dev/null +++ b/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 06d572bce2eeaf24d8a2d235976dc02c \ No newline at end of file diff --git a/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.cs b/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.cs new file mode 100644 index 000000000..4d4a9243d --- /dev/null +++ b/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.cs @@ -0,0 +1,15 @@ +// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 + +using UnityEngine; +using FairyGUI; +using NBC; + +namespace NBF +{ + public partial class HomeStatisticsPage : GComponent + { + private void OnInited() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.cs.meta b/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.cs.meta new file mode 100644 index 000000000..df5f653eb --- /dev/null +++ b/Assets/Scripts/UI/Home/Pages/HomeStatisticsPage.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1b12895a3e4e7fb4287cbf7a026d7887 \ No newline at end of file diff --git a/Assets/Scripts/UI/Loading/LoadingPanel.cs b/Assets/Scripts/UI/Loading/LoadingPanel.cs index ec6ad338e..fe7589b9a 100644 --- a/Assets/Scripts/UI/Loading/LoadingPanel.cs +++ b/Assets/Scripts/UI/Loading/LoadingPanel.cs @@ -26,7 +26,7 @@ namespace NBF protected override void OnInit() { - base.OnInit(); + ContentPane.sortingOrder = UIDef.UIOrder.Loading; } protected override void OnShow() diff --git a/Assets/Scripts/UI/Make.meta b/Assets/Scripts/UI/Make.meta new file mode 100644 index 000000000..cea7fadae --- /dev/null +++ b/Assets/Scripts/UI/Make.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 40364b7c47864017827ec33f9d7333b1 +timeCreated: 1748941666 \ No newline at end of file diff --git a/Assets/Scripts/UI/Make/MakePanel.Designer.cs b/Assets/Scripts/UI/Make/MakePanel.Designer.cs new file mode 100644 index 000000000..5812c0370 --- /dev/null +++ b/Assets/Scripts/UI/Make/MakePanel.Designer.cs @@ -0,0 +1,24 @@ +/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/ + +using FairyGUI; +using FairyGUI.Utils; +using NBC; +using System.Collections.Generic; + +namespace NBF +{ + /// + public partial class MakePanel + { + public GObject this[string aKey] => ContentPane.GetChild(aKey); + [AutoFind(Name = "back")] + public GImage back; + [AutoFind(Name = "Menu")] + public CommonMenu Menu; + [AutoFind(Name = "BottomMenu")] + public BottomMenu BottomMenu; + public override string[] GetDependPackages(){ return new string[] {"Common"}; } + + + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Make/MakePanel.Designer.cs.meta b/Assets/Scripts/UI/Make/MakePanel.Designer.cs.meta new file mode 100644 index 000000000..3dbbb561a --- /dev/null +++ b/Assets/Scripts/UI/Make/MakePanel.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0325840d66749994ca0ba6436eaef4aa \ No newline at end of file diff --git a/Assets/Scripts/UI/Make/MakePanel.cs b/Assets/Scripts/UI/Make/MakePanel.cs new file mode 100644 index 000000000..71a55ae88 --- /dev/null +++ b/Assets/Scripts/UI/Make/MakePanel.cs @@ -0,0 +1,33 @@ +// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖 + +using UnityEngine; +using NBC; + +namespace NBF +{ + public partial class MakePanel : UIPanel + { + public override string UIPackName => "Main"; + public override string UIResName => "MakePanel"; + + protected override void OnInit() + { + base.OnInit(); + } + + protected override void OnShow() + { + base.OnShow(); + } + + protected override void OnHide() + { + base.OnHide(); + } + + protected override void OnDestroy() + { + base.OnDestroy(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Make/MakePanel.cs.meta b/Assets/Scripts/UI/Make/MakePanel.cs.meta new file mode 100644 index 000000000..fe3d75d48 --- /dev/null +++ b/Assets/Scripts/UI/Make/MakePanel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 12d3dad5e220cfd47907482e50d15e13 \ No newline at end of file diff --git a/Assets/Scripts/UI/MapPanel.Designer.cs b/Assets/Scripts/UI/MapPanel.Designer.cs new file mode 100644 index 000000000..6bf7f5161 --- /dev/null +++ b/Assets/Scripts/UI/MapPanel.Designer.cs @@ -0,0 +1,22 @@ +/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/ + +using FairyGUI; +using FairyGUI.Utils; +using NBC; +using System.Collections.Generic; + +namespace NBF +{ + /// + public partial class MapPanel + { + public GObject this[string aKey] => ContentPane.GetChild(aKey); + [AutoFind(Name = "back")] + public GImage back; + [AutoFind(Name = "BottomMenu")] + public BottomMenu BottomMenu; + public override string[] GetDependPackages(){ return new string[] {"Common"}; } + + + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/MapPanel.Designer.cs.meta b/Assets/Scripts/UI/MapPanel.Designer.cs.meta new file mode 100644 index 000000000..da9270cb6 --- /dev/null +++ b/Assets/Scripts/UI/MapPanel.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e4254804b3cc16d44bcafcd96139ab90 \ No newline at end of file diff --git a/Assets/Scripts/UI/MapPanel.cs b/Assets/Scripts/UI/MapPanel.cs new file mode 100644 index 000000000..ee5b4f2dd --- /dev/null +++ b/Assets/Scripts/UI/MapPanel.cs @@ -0,0 +1,33 @@ +// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖 + +using UnityEngine; +using NBC; + +namespace NBF +{ + public partial class MapPanel : UIPanel + { + public override string UIPackName => "Main"; + public override string UIResName => "MapPanel"; + + protected override void OnInit() + { + base.OnInit(); + } + + protected override void OnShow() + { + base.OnShow(); + } + + protected override void OnHide() + { + base.OnHide(); + } + + protected override void OnDestroy() + { + base.OnDestroy(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/MapPanel.cs.meta b/Assets/Scripts/UI/MapPanel.cs.meta new file mode 100644 index 000000000..9bc52cc24 --- /dev/null +++ b/Assets/Scripts/UI/MapPanel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 69a29998a66d1ec4cb15ebb8e5de9cb6 \ No newline at end of file diff --git a/Assets/Scripts/UI/Settings/SettingPanel.cs b/Assets/Scripts/UI/Settings/SettingPanel.cs index bdcd2a267..b2b81725c 100644 --- a/Assets/Scripts/UI/Settings/SettingPanel.cs +++ b/Assets/Scripts/UI/Settings/SettingPanel.cs @@ -21,6 +21,7 @@ namespace NBF { base.OnInit(); IsShowCursor = true; + IsDontBack = true; var groupNames = Settings.Instance.GetAllGroups(); foreach (var group in groupNames) @@ -73,29 +74,7 @@ namespace NBF private void UseBottomMenu() { - BottomMenu.OnTab += () => - { - var i = Random.Range(1, 13); - if (i < 3) - { - Notices.Success("离开晶科科技看就看"); - } - else if (i < 6) - { - Notices.Warning("离开晶科科技看就看"); - } - else if (i < 9) - { - Notices.Error("离开晶科科技看就看"); - } - else if (i < 12) - { - Notices.Info("离开晶科科技看就看"); - } - }; - BottomMenu.OnBack += OnBack; - BottomMenu.OnEnter += OnApplySettings; - BottomMenu.Use(); + BottomMenu.Use(this); } private void OnApplySettings() @@ -149,6 +128,14 @@ namespace NBF SetListSelected(List.selectedIndex + 1); } } + else if (action == InputDef.UI.Back) + { + OnBack(); + } + else if (action == InputDef.UI.Enter) + { + OnApplySettings(); + } } private void SetListSelected(int selectedIndex) @@ -181,7 +168,6 @@ namespace NBF private void OnBack() { - if (Settings.Instance.HaveNotAppleSettings()) { MessageBox.Show("还有未保存的信息", (b) => @@ -201,10 +187,6 @@ namespace NBF protected override void OnHide() { base.OnHide(); - BottomMenu.OnBack -= OnBack; - BottomMenu.OnTab -= OnResetSettings; - BottomMenu.OnEnter -= OnApplySettings; - BottomMenu.UnUse(); InputManager.OnUICanceled -= OnUICanceled; } diff --git a/Assets/Scripts/UI/Shops/FishingShopPanel.cs b/Assets/Scripts/UI/Shops/FishingShopPanel.cs index 26337400b..7278845d5 100644 --- a/Assets/Scripts/UI/Shops/FishingShopPanel.cs +++ b/Assets/Scripts/UI/Shops/FishingShopPanel.cs @@ -47,11 +47,9 @@ namespace NBF private void UseBottomMenu() { - BottomMenu.OnBack += Hide; - - BottomMenu.Use(); + BottomMenu.Use(this); } - + private void ChangeTab(int index) { @@ -81,12 +79,6 @@ namespace NBF // } } - protected override void OnHide() - { - base.OnHide(); - BottomMenu.UnUse(); - } - protected override void OnDestroy() { base.OnDestroy(); diff --git a/Assets/Scripts/Utils/Extends/UIInputExtensions.cs b/Assets/Scripts/Utils/Extends/UIInputExtensions.cs new file mode 100644 index 000000000..704bd423a --- /dev/null +++ b/Assets/Scripts/Utils/Extends/UIInputExtensions.cs @@ -0,0 +1,7 @@ +namespace NBF +{ + public static class UIInputExtensions + { + + } +} \ No newline at end of file diff --git a/Assets/Scripts/Utils/Extends/UIInputExtensions.cs.meta b/Assets/Scripts/Utils/Extends/UIInputExtensions.cs.meta new file mode 100644 index 000000000..8d87b4530 --- /dev/null +++ b/Assets/Scripts/Utils/Extends/UIInputExtensions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e9bfb9f042814fb787428551c801aada +timeCreated: 1748944711 \ No newline at end of file diff --git a/Assets/Scripts/Utils/Reflection.cs b/Assets/Scripts/Utils/Reflection.cs index 9699f8352..926bcc755 100644 --- a/Assets/Scripts/Utils/Reflection.cs +++ b/Assets/Scripts/Utils/Reflection.cs @@ -36,5 +36,35 @@ namespace NBF return derivedTypes; } + + + /// + /// 获取所有标记指定特性的方法 + /// + /// 查找类 + /// 特性类 + /// + public static List GetMethodsWithUIInputAttribute(Type classType, Type attributeType) + { + List methodsWithAttribute = new List(); + + if (classType == null) + { + return methodsWithAttribute; + } + + // 获取所有方法,包括公共、非公共、实例和静态方法 + MethodInfo[] allMethods = classType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic); + + foreach (MethodInfo method in allMethods) + { + if (method.GetCustomAttributes(attributeType, false).Length > 0) + { + methodsWithAttribute.Add(method); + } + } + + return methodsWithAttribute; + } } } \ No newline at end of file diff --git a/FGUIProject/assets/Common/Com/MarqueeTag.xml b/FGUIProject/assets/Common/Com/MarqueeTag.xml new file mode 100644 index 000000000..5df85e873 --- /dev/null +++ b/FGUIProject/assets/Common/Com/MarqueeTag.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/FGUIProject/assets/Common/Panel/CommonTopPanel.xml b/FGUIProject/assets/Common/Panel/CommonTopPanel.xml new file mode 100644 index 000000000..880c427da --- /dev/null +++ b/FGUIProject/assets/Common/Panel/CommonTopPanel.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/FGUIProject/assets/Common/package.xml b/FGUIProject/assets/Common/package.xml index 308652779..6963012bb 100644 --- a/FGUIProject/assets/Common/package.xml +++ b/FGUIProject/assets/Common/package.xml @@ -192,6 +192,8 @@ + + \ No newline at end of file diff --git a/FGUIProject/assets/Main/Com/Home/BtnHomeMap.xml b/FGUIProject/assets/Main/Com/Home/BtnHomeMap.xml index 0101e87c0..2a8437e63 100644 --- a/FGUIProject/assets/Main/Com/Home/BtnHomeMap.xml +++ b/FGUIProject/assets/Main/Com/Home/BtnHomeMap.xml @@ -6,9 +6,10 @@ + -