From 0c6401cb6411a14f9e28382dc5d695b8e5ff573c Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Mon, 2 Jun 2025 15:18:52 -0700 Subject: [PATCH] Tweaks and uncommitted stuff I forgor --- Assets/Scenes/IconsMenu.unity | 88 +++++++++++++++--------------- Assets/Scenes/MainMenu.unity | 23 ++++++-- Assets/Scripts/GamePlayer.cs | 17 +----- Assets/Scripts/IconsMenu.cs | 30 ++-------- Assets/Scripts/Tools.cs | 23 ++++++++ Assets/Scripts/Tools.cs.meta | 2 + Assets/Scripts/VersionText.cs | 10 ++++ Assets/Scripts/VersionText.cs.meta | 2 + 8 files changed, 105 insertions(+), 90 deletions(-) create mode 100644 Assets/Scripts/Tools.cs create mode 100644 Assets/Scripts/Tools.cs.meta create mode 100644 Assets/Scripts/VersionText.cs create mode 100644 Assets/Scripts/VersionText.cs.meta diff --git a/Assets/Scenes/IconsMenu.unity b/Assets/Scenes/IconsMenu.unity index 1f5c6c7..a713abf 100644 --- a/Assets/Scenes/IconsMenu.unity +++ b/Assets/Scenes/IconsMenu.unity @@ -764,10 +764,10 @@ RectTransform: - {fileID: 817018165} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 239, y: -68} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &388694500 MonoBehaviour: @@ -1035,10 +1035,10 @@ RectTransform: - {fileID: 101802633} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 361, y: -262} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &420083143 MonoBehaviour: @@ -1156,10 +1156,10 @@ RectTransform: - {fileID: 1192083984} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 117, y: -68} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &437256206 MonoBehaviour: @@ -1353,10 +1353,10 @@ RectTransform: - {fileID: 1161182523} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 483, y: -165} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &490807504 MonoBehaviour: @@ -1699,10 +1699,10 @@ RectTransform: - {fileID: 179291871} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 239, y: -165} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &519880727 MonoBehaviour: @@ -1966,10 +1966,10 @@ RectTransform: - {fileID: 887236669} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 361, y: -68} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &606851916 MonoBehaviour: @@ -2083,10 +2083,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 117, y: -262} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &817018164 GameObject: @@ -2885,10 +2885,10 @@ RectTransform: - {fileID: 2034452621} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 239, y: -262} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1197784014 MonoBehaviour: @@ -4024,10 +4024,10 @@ RectTransform: - {fileID: 504555114} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 483, y: -68} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1721135576 MonoBehaviour: @@ -4145,10 +4145,10 @@ RectTransform: - {fileID: 863775564} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 117, y: -165} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1786729680 MonoBehaviour: @@ -5077,10 +5077,10 @@ RectTransform: - {fileID: 839120341} m_Father: {fileID: 529729329} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 361, y: -165} + m_SizeDelta: {x: 72, y: 72} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2122644443 MonoBehaviour: diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index e321aaa..2e8ecf6 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -1392,6 +1392,7 @@ GameObject: - component: {fileID: 1401523578} - component: {fileID: 1401523580} - component: {fileID: 1401523579} + - component: {fileID: 1401523581} m_Layer: 5 m_Name: VersionText m_TagString: Untagged @@ -1415,7 +1416,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 489.8991, y: 320} + m_AnchoredPosition: {x: 499.93, y: 330} m_SizeDelta: {x: 260, y: 40} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1401523579 @@ -1438,7 +1439,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: v1.34 + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 4fd546dd0900395408d2de20f5025882, type: 2} m_sharedMaterial: {fileID: -1476194838487357290, guid: 4fd546dd0900395408d2de20f5025882, type: 2} @@ -1517,6 +1518,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1401523577} m_CullTransparentMesh: 1 +--- !u!114 &1401523581 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1401523577} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 613488aac53690d45b649b002c6180b2, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1513462402 GameObject: m_ObjectHideFlags: 0 @@ -1633,7 +1646,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -137.5, y: -103.7} + m_AnchoredPosition: {x: -137.5, y: -100} m_SizeDelta: {x: 250, y: 75} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1572234421 @@ -1730,7 +1743,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1a45465fc8803364d968dc6bec70fca8, type: 3} m_Name: m_EditorClassIdentifier: - sceneName: LeaderboardsMenu + sceneName: LeaderboardMenu --- !u!1 &1777696994 GameObject: m_ObjectHideFlags: 0 @@ -2311,7 +2324,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 137.5, y: -103.7} + m_AnchoredPosition: {x: 137.5, y: -100} m_SizeDelta: {x: 250, y: 75} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1997401229 diff --git a/Assets/Scripts/GamePlayer.cs b/Assets/Scripts/GamePlayer.cs index 21ee1f9..463a701 100644 --- a/Assets/Scripts/GamePlayer.cs +++ b/Assets/Scripts/GamePlayer.cs @@ -37,22 +37,7 @@ public class GamePlayer : MonoBehaviour int num2 = PlayerPrefs.GetInt("overlay", 0); if (num == 1) { - if (PlayerPrefs.GetInt("userID", 0) == 1) - { - component.sprite = Resources.Load("Icons/Icons/bird_-1"); - } - else if (PlayerPrefs.GetInt("userID", 0) == 2) - { - component.sprite = Resources.Load("Icons/Icons/bird_-2"); - } - else if (PlayerPrefs.GetInt("userID", 0) == 4) - { - component.sprite = Resources.Load("Icons/Icons/bird_-3"); - } - else - { - component.sprite = Resources.Load("Icons/Icons/bird_1"); - } + component.sprite = Tools.GetIconForUser(PlayerPrefs.GetInt("userId", 0)); } else { diff --git a/Assets/Scripts/IconsMenu.cs b/Assets/Scripts/IconsMenu.cs index 3f06e45..cc90a38 100644 --- a/Assets/Scripts/IconsMenu.cs +++ b/Assets/Scripts/IconsMenu.cs @@ -1,3 +1,4 @@ +using System.Text; using TMPro; using UnityEngine; using UnityEngine.SceneManagement; @@ -35,6 +36,8 @@ public class Iconsmenu : MonoBehaviour private void Start() { + defaultIcon = Tools.GetIconForUser(PlayerPrefs.GetInt("userId", 0)); + icon1.transform.GetChild(0).GetComponent().sprite = defaultIcon; SwitchToIcon(); SelectOverlay(PlayerPrefs.GetInt("overlay", Mathf.Clamp(PlayerPrefs.GetInt("overlay", 0), 0, 9))); SelectIcon(PlayerPrefs.GetInt("icon", Mathf.Clamp(PlayerPrefs.GetInt("icon", 0), 1, 8))); @@ -43,18 +46,6 @@ public class Iconsmenu : MonoBehaviour SelectOverlay(0); placeholderButton.interactable = false; } - if (PlayerPrefs.GetInt("userID", 0) == 1) - { - defaultIcon = Resources.Load("Icons/Icons/bird_-1"); - } - else if (PlayerPrefs.GetInt("userID", 0) == 2) - { - defaultIcon = Resources.Load("Icons/Icons/bird_-2"); - } - else if (PlayerPrefs.GetInt("userID", 0) == 4) - { - defaultIcon = Resources.Load("Icons/Icons/bird_-3"); - } placeholderButton.onClick.AddListener(ToggleKit); backButton.onClick.AddListener(() => { @@ -164,18 +155,7 @@ public class Iconsmenu : MonoBehaviour previewBird.sprite = Resources.Load("Icons/Icons/bird_" + iconID); if (iconID == 1) { - if (PlayerPrefs.GetInt("userID", 0) == 1) - { - previewBird.sprite = Resources.Load("Icons/Icons/bird_-1"); - } - else if (PlayerPrefs.GetInt("userID", 0) == 2) - { - previewBird.sprite = Resources.Load("Icons/Icons/bird_-2"); - } - else if (PlayerPrefs.GetInt("userID", 0) == 4) - { - previewBird.sprite = Resources.Load("Icons/Icons/bird_-3"); - } + previewBird.sprite = defaultIcon; } if (iconID == 7) { @@ -205,7 +185,7 @@ public class Iconsmenu : MonoBehaviour overlay5.interactable = (overlayID != 5); overlay6.interactable = (overlayID != 6); overlay7.interactable = (overlayID != 7); - overlay8.interactable = (overlayID != 8); + overlay8.interactable = (!(PlayerPrefs.GetInt("userId", 0) == 1 && PlayerPrefs.GetInt("icon", 0) == 1) && overlayID != 8); overlay9.interactable = (overlayID != 9); previewOverlay.rectTransform.localPosition = new Vector3(-32f, 44.66f, 0f); previewOverlay.gameObject.SetActive(true); diff --git a/Assets/Scripts/Tools.cs b/Assets/Scripts/Tools.cs new file mode 100644 index 0000000..32d2e77 --- /dev/null +++ b/Assets/Scripts/Tools.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +public static class Tools +{ + public static Sprite GetIconForUser(int user) + { + if (user == 1) + { + return Resources.Load("Icons/Icons/bird_-1"); + } + else if (user == 2) + { + return Resources.Load("Icons/Icons/bird_-2"); + } + else if (user == 4) + { + return Resources.Load("Icons/Icons/bird_-3"); + } else + { + return Resources.Load("Icons/Icons/bird_1"); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools.cs.meta b/Assets/Scripts/Tools.cs.meta new file mode 100644 index 0000000..6de960d --- /dev/null +++ b/Assets/Scripts/Tools.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: deda68a80e559ac449fed42451588143 \ No newline at end of file diff --git a/Assets/Scripts/VersionText.cs b/Assets/Scripts/VersionText.cs new file mode 100644 index 0000000..e6757c5 --- /dev/null +++ b/Assets/Scripts/VersionText.cs @@ -0,0 +1,10 @@ +using TMPro; +using UnityEngine; + +public class VersionText : MonoBehaviour +{ + void Awake() + { + gameObject.GetComponent().text = "v" + Application.version; + } +} diff --git a/Assets/Scripts/VersionText.cs.meta b/Assets/Scripts/VersionText.cs.meta new file mode 100644 index 0000000..386af6d --- /dev/null +++ b/Assets/Scripts/VersionText.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 613488aac53690d45b649b002c6180b2 \ No newline at end of file