- Adds support for renaming apps: By pressing A or X on the controller, you can choose an alternate app name / icon. You can reset these changes back to default in Settings.
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
namespace QuestAppLauncher
|
|
{
|
|
public class HideAppHandler : MonoBehaviour
|
|
{
|
|
public TextMeshProUGUI text;
|
|
private AppEntry appEntryToHide;
|
|
|
|
public void OnHideApp(AppEntry appEntryToHide)
|
|
{
|
|
this.appEntryToHide = appEntryToHide;
|
|
|
|
// Set dialog text
|
|
this.text.text = string.Format("Hide app '{0}'?", appEntryToHide.appName);
|
|
|
|
// Launch dialog
|
|
this.gameObject.SetActive(true);
|
|
}
|
|
|
|
public async void OnOk()
|
|
{
|
|
// Add package name to excluded file
|
|
Debug.Log("Hiding: " + this.appEntryToHide.appName + " (package id: " + this.appEntryToHide.packageId + ")");
|
|
AppProcessor.AddAppToExcludedFile(this.appEntryToHide.packageId);
|
|
|
|
// Reload the scene - this will force all the tabs to update
|
|
await SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().name);
|
|
}
|
|
|
|
public void OnCancel()
|
|
{
|
|
this.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
} |