diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index a44ba81d..859e0b8f 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -1298,6 +1298,7 @@ MonoBehaviour: Label: {fileID: 1003333793} SiteFilterName: Master downloadFilters: {fileID: 1416211317} + displayManager: {fileID: 332003134} --- !u!222 &246596744 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1614,6 +1615,7 @@ MonoBehaviour: ErrorText: {fileID: 383296245} FetchMapsButton: {fileID: 809281757} FetchMapsButtonText: {fileID: 1977747177} + DownloadFilters: {fileID: 1416211317} FixTimestampsButton: {fileID: 1657167283} MoveDownloadsButton: {fileID: 1414726938} --- !u!4 &332003135 @@ -4328,6 +4330,7 @@ MonoBehaviour: Label: {fileID: 232748594} SiteFilterName: Easy downloadFilters: {fileID: 1416211317} + displayManager: {fileID: 332003134} --- !u!1 &1414726936 GameObject: m_ObjectHideFlags: 0 @@ -4488,7 +4491,7 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1416211313} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -4506,8 +4509,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -0.15442} - m_SizeDelta: {x: 0, y: -0.30885} + m_AnchoredPosition: {x: 0, y: -0.15441996} + m_SizeDelta: {x: 0, y: -0.3088498} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1416211315 MonoBehaviour: @@ -5234,6 +5237,7 @@ MonoBehaviour: Label: {fileID: 82042874} SiteFilterName: Expert downloadFilters: {fileID: 1416211317} + displayManager: {fileID: 332003134} --- !u!222 &1613107734 CanvasRenderer: m_ObjectHideFlags: 0 @@ -5712,6 +5716,7 @@ MonoBehaviour: Label: {fileID: 888255825} SiteFilterName: Normal downloadFilters: {fileID: 1416211317} + displayManager: {fileID: 332003134} --- !u!222 &1679267653 CanvasRenderer: m_ObjectHideFlags: 0 @@ -6042,6 +6047,7 @@ MonoBehaviour: Label: {fileID: 1187464013} SiteFilterName: Hard downloadFilters: {fileID: 1416211317} + displayManager: {fileID: 332003134} --- !u!222 &1731186211 CanvasRenderer: m_ObjectHideFlags: 0 @@ -6296,6 +6302,7 @@ MonoBehaviour: Label: {fileID: 177211773} SiteFilterName: Custom downloadFilters: {fileID: 1416211317} + displayManager: {fileID: 332003134} --- !u!222 &1765915678 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/CustomFileManager.cs b/Assets/Scripts/CustomFileManager.cs index 17f8e838..101b178e 100644 --- a/Assets/Scripts/CustomFileManager.cs +++ b/Assets/Scripts/CustomFileManager.cs @@ -211,7 +211,7 @@ private IEnumerator MoveDownloadedFiles() { isMovingFiles = true; // Disable anything else while we do this - displayManager.DisableActions(); + displayManager.DisableActions("Moving Downloads..."); var downloadDir = "/sdcard/Download/"; diff --git a/Assets/Scripts/DisplayManager.cs b/Assets/Scripts/DisplayManager.cs index c5ea8022..148fc998 100644 --- a/Assets/Scripts/DisplayManager.cs +++ b/Assets/Scripts/DisplayManager.cs @@ -15,6 +15,7 @@ public class DisplayManager : MonoBehaviour, ILogHandler public TextMeshProUGUI ErrorText; public Button FetchMapsButton; public TextMeshProUGUI FetchMapsButtonText; + public DownloadFilters DownloadFilters; public Button FixTimestampsButton; public Button MoveDownloadsButton; @@ -50,7 +51,7 @@ public void UpdateLastFetchTime() { LastFetchText.SetText($"Last Fetch: {lastFetchTime:dd MMM yy H:mm:ss zzz}"); } - public void DisableActions(string fetchMapsText="Fetch Songs") { + public void DisableActions(string fetchMapsText) { FixTimestampsButton.interactable = false; MoveDownloadsButton.interactable = false; @@ -59,13 +60,24 @@ public void DisableActions(string fetchMapsText="Fetch Songs") { FetchMapsButtonText.SetText(fetchMapsText); } + public void UpdateFilterText() { + if (FetchMapsButton.interactable) { + var isFiltered = DownloadFilters.GetDifficultiesEnabled().Count != DownloadFilters.GetAllDifficulties().Count; + FetchMapsButtonText.SetText("Fetch " + (isFiltered ? "Filtered" : "All")); + } + else { + // Not interactable; must be doing something else. Don't update text yet. + // Whatever is disabling this will call EnableActions afterwards to call this again. + } + } + public void EnableActions() { FixTimestampsButton.interactable = true; MoveDownloadsButton.interactable = true; FetchMapsButton.interactable = true; - FetchMapsButtonText.SetText("Fetch Songs"); - FetchMapsButton.interactable = true; + FetchMapsButtonText.fontStyle = FontStyles.Normal; + UpdateFilterText(); } public void ClearDebugLogs() { diff --git a/Assets/Scripts/DownloadFilterDifficulty.cs b/Assets/Scripts/DownloadFilterDifficulty.cs index c6b0b450..2286e48d 100644 --- a/Assets/Scripts/DownloadFilterDifficulty.cs +++ b/Assets/Scripts/DownloadFilterDifficulty.cs @@ -5,6 +5,7 @@ public class DownloadFilterDifficulty : MonoBehaviour { public TextMeshProUGUI Label; public string SiteFilterName; public DownloadFilters downloadFilters; + public DisplayManager displayManager; public bool IsSelected { get; private set; } = true; private Color ColorSelected = Color.white; private Color ColorUnselected = Color.gray; @@ -17,7 +18,7 @@ public void SetSelected(bool isSelected) { IsSelected = isSelected; if (IsSelected) { - Label.fontStyle = FontStyles.Underline & FontStyles.Bold; + Label.fontStyle = FontStyles.Underline; Label.color = ColorSelected; } else { @@ -26,5 +27,6 @@ public void SetSelected(bool isSelected) { } downloadFilters.SaveDifficultyFiltersToPrefs(); + displayManager.UpdateFilterText(); } } \ No newline at end of file diff --git a/Assets/Scripts/DownloadFilters.cs b/Assets/Scripts/DownloadFilters.cs index 480b5a5b..3c517946 100644 --- a/Assets/Scripts/DownloadFilters.cs +++ b/Assets/Scripts/DownloadFilters.cs @@ -74,10 +74,18 @@ public DateTime GetDateCutoffFromCurrentSelection(DateTime nowUtc) { /// Gets difficulty filter names for Z site. /// Easy, Normal, Hard, Expert, Master, Custom public List GetDifficultiesEnabled() { - return difficultyFilters + var enabledDifficulties = difficultyFilters .Where(filter => filter.IsSelected) .Select(filter => filter.SiteFilterName) .ToList(); + + // No filters selected treated the same as all selected (not filtered) + if (enabledDifficulties.Count == 0) { + return GetAllDifficulties(); + } + else { + return enabledDifficulties; + } } /// Gets all difficult filter names diff --git a/Assets/Scripts/DownloadManager.cs b/Assets/Scripts/DownloadManager.cs index 04961d7e..9c82fb68 100644 --- a/Assets/Scripts/DownloadManager.cs +++ b/Assets/Scripts/DownloadManager.cs @@ -55,7 +55,7 @@ public async void StartDownloading() { public async void FixMapTimestamps() { displayManager.DebugLog("Fixing map timestamp..."); - displayManager.DisableActions(); + displayManager.DisableActions("Fixing Timestamps..."); try { var sinceTime = DateTime.UnixEpoch; diff --git a/Assets/Scripts/Preferences.cs b/Assets/Scripts/Preferences.cs index dcf5997b..2f28b936 100644 --- a/Assets/Scripts/Preferences.cs +++ b/Assets/Scripts/Preferences.cs @@ -27,7 +27,8 @@ public static void SetDifficultiesEnabled(List enabledDifficulties) { } public static HashSet GetDifficultiesEnabled() { - var csvDifficulties = PlayerPrefs.GetString(KEY_SELECTED_DIFFICULTIES, ""); + // Default to all difficulties + var csvDifficulties = PlayerPrefs.GetString(KEY_SELECTED_DIFFICULTIES, "Easy,Normal,Hard,Expert,Master,Custom"); return csvDifficulties.Split(",", StringSplitOptions.RemoveEmptyEntries).ToHashSet(); } } diff --git a/OVRAssetBundles/OVRMasterBundle/OVRMasterBundle b/OVRAssetBundles/OVRMasterBundle/OVRMasterBundle index 5ed1e533..6adf84c8 100644 Binary files a/OVRAssetBundles/OVRMasterBundle/OVRMasterBundle and b/OVRAssetBundles/OVRMasterBundle/OVRMasterBundle differ diff --git a/OVRAssetBundles/OVRMasterBundle/OVRMasterBundle.manifest b/OVRAssetBundles/OVRMasterBundle/OVRMasterBundle.manifest index 5ff04570..f3c99664 100644 --- a/OVRAssetBundles/OVRMasterBundle/OVRMasterBundle.manifest +++ b/OVRAssetBundles/OVRMasterBundle/OVRMasterBundle.manifest @@ -1,5 +1,5 @@ ManifestFileVersion: 0 -CRC: 2771904397 +CRC: 824051965 AssetBundleManifest: AssetBundleInfos: Info_0: diff --git a/OVRAssetBundles/OVRMasterBundle/scene_mainscene b/OVRAssetBundles/OVRMasterBundle/scene_mainscene index fef2ac71..d232ab72 100644 Binary files a/OVRAssetBundles/OVRMasterBundle/scene_mainscene and b/OVRAssetBundles/OVRMasterBundle/scene_mainscene differ diff --git a/OVRAssetBundles/OVRMasterBundle/scene_mainscene.manifest b/OVRAssetBundles/OVRMasterBundle/scene_mainscene.manifest index 0624ceaa..49cb935e 100644 --- a/OVRAssetBundles/OVRMasterBundle/scene_mainscene.manifest +++ b/OVRAssetBundles/OVRMasterBundle/scene_mainscene.manifest @@ -1,12 +1,12 @@ ManifestFileVersion: 0 -CRC: 304213647 +CRC: 366535923 Hashes: AssetFileHash: serializedVersion: 2 - Hash: 8123ba356be3ce75a08f113b5e998a9d + Hash: 40db9955f4ee71035d73bfbe6ead2c9d TypeTreeHash: serializedVersion: 2 - Hash: d6223479d9595ff1651ecf562ab78c4e + Hash: c33e7aa94068522f35a3b5cd27daf0a5 HashAppended: 0 ClassTypes: - Class: 1 diff --git a/OVRAssetBundles/Temp/OVRMasterBundle b/OVRAssetBundles/Temp/OVRMasterBundle index 5ed1e533..6adf84c8 100644 Binary files a/OVRAssetBundles/Temp/OVRMasterBundle and b/OVRAssetBundles/Temp/OVRMasterBundle differ diff --git a/OVRAssetBundles/Temp/SceneLoadData.txt b/OVRAssetBundles/Temp/SceneLoadData.txt index c7c0489a..f6c3c661 100644 --- a/OVRAssetBundles/Temp/SceneLoadData.txt +++ b/OVRAssetBundles/Temp/SceneLoadData.txt @@ -1,2 +1,2 @@ -1674249058 +1674389677 MainScene diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 2576e6ce..09b20251 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -135,7 +135,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 1.1.0 + bundleVersion: 1.1.1 preloadedAssets: - {fileID: 0} - {fileID: 0}