Make play menu into a popup

This commit is contained in:
Lncvrt committed 2026-03-15 19:49:46 -07:00
1 parent f2c2a24bfe
commit 62ebeec2c4
32 files changed
+9895 -10304

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c9bfc084cf0a4481181349b979f74e43
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+2 -14
View File
@@ -2458,6 +2458,7 @@ MonoBehaviour:
accountsPrefab: {fileID: 690144046416174326, guid: 8980083d89fb7477b8d55aa9233f15b7, type: 3} accountsPrefab: {fileID: 690144046416174326, guid: 8980083d89fb7477b8d55aa9233f15b7, type: 3}
settingsPrefab: {fileID: 2128217568192272405, guid: 0d66068f9c9ce46b88b019a3aa64793f, type: 3} settingsPrefab: {fileID: 2128217568192272405, guid: 0d66068f9c9ce46b88b019a3aa64793f, type: 3}
statsPrefab: {fileID: 922734498401451496, guid: 33b706f9dca9d4d36be1cd5740f53b03, type: 3} statsPrefab: {fileID: 922734498401451496, guid: 33b706f9dca9d4d36be1cd5740f53b03, type: 3}
playModePrefab: {fileID: 5412203424544537898, guid: c9bfc084cf0a4481181349b979f74e43, type: 3}
copyrightText: {fileID: 319334213} copyrightText: {fileID: 319334213}
closePopup: {fileID: 60514371} closePopup: {fileID: 60514371}
closePopupCancelButton: {fileID: 1983964294} closePopupCancelButton: {fileID: 1983964294}
@@ -2467,6 +2468,7 @@ MonoBehaviour:
accountsButton: {fileID: 1582935349} accountsButton: {fileID: 1582935349}
settingsButton: {fileID: 1570123698} settingsButton: {fileID: 1570123698}
statsButton: {fileID: 462957726} statsButton: {fileID: 462957726}
playButton: {fileID: 1777696996}
--- !u!1 &600923169 --- !u!1 &600923169
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -6691,7 +6693,6 @@ GameObject:
- component: {fileID: 1777696998} - component: {fileID: 1777696998}
- component: {fileID: 1777696997} - component: {fileID: 1777696997}
- component: {fileID: 1777696996} - component: {fileID: 1777696996}
- component: {fileID: 1777696999}
- component: {fileID: 1777697000} - component: {fileID: 1777697000}
m_Layer: 5 m_Layer: 5
m_Name: Button m_Name: Button
@@ -6802,19 +6803,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1777696994} m_GameObject: {fileID: 1777696994}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &1777696999
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1777696994}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1a45465fc8803364d968dc6bec70fca8, type: 3}
m_Name:
m_EditorClassIdentifier:
sceneName: PlayMenu
--- !u!114 &1777697000 --- !u!114 &1777697000
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
+8 -1
View File
@@ -14,7 +14,8 @@ public class MainMenu : MonoBehaviour {
[SerializeField] private ProfileMenu profilePrefab; [SerializeField] private ProfileMenu profilePrefab;
[SerializeField] private AccountHandler accountsPrefab; [SerializeField] private AccountHandler accountsPrefab;
[SerializeField] private SettingsMenu settingsPrefab; [SerializeField] private SettingsMenu settingsPrefab;
[SerializeField] private StatsMenu statsPrefab; [SerializeField] private StatsPrefab statsPrefab;
[SerializeField] private PlayModePrefab playModePrefab;
[SerializeField] private TMP_Text copyrightText; [SerializeField] private TMP_Text copyrightText;
[SerializeField] private GameObject closePopup; [SerializeField] private GameObject closePopup;
[SerializeField] private Button closePopupCancelButton; [SerializeField] private Button closePopupCancelButton;
@@ -24,6 +25,7 @@ public class MainMenu : MonoBehaviour {
[SerializeField] private Button accountsButton; [SerializeField] private Button accountsButton;
[SerializeField] private Button settingsButton; [SerializeField] private Button settingsButton;
[SerializeField] private Button statsButton; [SerializeField] private Button statsButton;
[SerializeField] private Button playButton;
void Awake() { void Awake() {
if (PresistentData.latestVersion != null) { if (PresistentData.latestVersion != null) {
@@ -82,6 +84,11 @@ public class MainMenu : MonoBehaviour {
clone.name = "Prefab"; clone.name = "Prefab";
clone.SetActive(true); clone.SetActive(true);
}); });
playButton.onClick.AddListener(() => {
var clone = Instantiate(playModePrefab.gameObject, playModePrefab.gameObject.transform.parent);
clone.name = "Prefab";
clone.SetActive(true);
});
if (Tools.GetLevelInfo().level < 3) { if (Tools.GetLevelInfo().level < 3) {
iconMarketplaceButton.interactable = false; iconMarketplaceButton.interactable = false;
@@ -1,5 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 0d0c0e097b9d840f4b43c29611fc27e1 guid: 11fba61d32db34a00ad206365b097b6d
folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:
@@ -7,7 +7,7 @@ using UnityEngine.InputSystem;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using UnityEngine.UI; using UnityEngine.UI;
public class PlayMenu : MonoBehaviour { public class PlayModePrefab : MonoBehaviour {
[SerializeField] private GameObject selectionMenu; [SerializeField] private GameObject selectionMenu;
[SerializeField] private GameObject customMenu; [SerializeField] private GameObject customMenu;
[SerializeField] private GameObject autoWarningMenu; [SerializeField] private GameObject autoWarningMenu;
@@ -24,6 +24,7 @@ public class PlayMenu : MonoBehaviour {
[SerializeField] private Button autoButton; [SerializeField] private Button autoButton;
[SerializeField] private Button autoBackButton; [SerializeField] private Button autoBackButton;
[SerializeField] private Button autoPlayButton; [SerializeField] private Button autoPlayButton;
[SerializeField] private Button backButton;
[SerializeField] private TMP_InputField normalBerryChance; [SerializeField] private TMP_InputField normalBerryChance;
[SerializeField] private TMP_InputField poisonBerryChance; [SerializeField] private TMP_InputField poisonBerryChance;
@@ -220,6 +221,7 @@ public class PlayMenu : MonoBehaviour {
BazookaManager.Instance.SetReadAutoWarning(true); BazookaManager.Instance.SetReadAutoWarning(true);
await SceneManager.LoadSceneAsync("AutoGamePlayer"); await SceneManager.LoadSceneAsync("AutoGamePlayer");
}); });
backButton.onClick.AddListener(() => Destroy(gameObject));
normalBerryChance.onSelect.AddListener((value) => OnSelect(value, normalBerryChance)); normalBerryChance.onSelect.AddListener((value) => OnSelect(value, normalBerryChance));
normalBerryChance.onDeselect.AddListener((value) => OnDeselect(value, normalBerryChance)); normalBerryChance.onDeselect.AddListener((value) => OnDeselect(value, normalBerryChance));
@@ -368,13 +370,13 @@ public class PlayMenu : MonoBehaviour {
} }
} }
async void Update() { void Update() {
if (Keyboard.current.escapeKey.wasPressedThisFrame && customBackButton.interactable) { if (Keyboard.current.escapeKey.wasPressedThisFrame && customBackButton.interactable) {
if (customMenu.activeSelf) customBackButton.onClick.Invoke(); if (customMenu.activeSelf) customBackButton.onClick.Invoke();
else if (autoWarningMenu.activeSelf) autoBackButton.onClick.Invoke(); else if (autoWarningMenu.activeSelf) autoBackButton.onClick.Invoke();
else if (multiplayerJoinStatusPanel.activeSelf) { else if (multiplayerJoinStatusPanel.activeSelf) {
if (multiplayerDeniedPanel.activeSelf) multiplayerDeniedBackButton.onClick.Invoke(); if (multiplayerDeniedPanel.activeSelf) multiplayerDeniedBackButton.onClick.Invoke();
} else await SceneManager.LoadSceneAsync("MainMenu"); } else Destroy(gameObject);
} }
} }
} }
File renamed without changes.
@@ -4,7 +4,7 @@ using UnityEngine;
using UnityEngine.InputSystem; using UnityEngine.InputSystem;
using UnityEngine.UI; using UnityEngine.UI;
public class StatsMenu : MonoBehaviour { public class StatsPrefab : MonoBehaviour {
[SerializeField] private GameObject panel; [SerializeField] private GameObject panel;
[SerializeField] private TMP_Text normalBerryStat; [SerializeField] private TMP_Text normalBerryStat;