diff --git a/CustomMenuText/Plugin.cs b/CustomMenuText/Plugin.cs index 4f30e11..fbca388 100644 --- a/CustomMenuText/Plugin.cs +++ b/CustomMenuText/Plugin.cs @@ -493,6 +493,8 @@ public static void setText(string[] lines) public void reloadFile() { allEntries = readFromFile(FILE_PATH); + Configuration.PluginConfig.Instance.SelectionType = selection_type; + Configuration.PluginConfig.Instance.SelectedEntry = choice; } /// @@ -550,6 +552,8 @@ public void restoreDefaultConfig() [OnExit] public void OnApplicationQuit() { + Configuration.PluginConfig.Instance.SelectionType = selection_type; + Configuration.PluginConfig.Instance.SelectedEntry = choice; SceneManager.activeSceneChanged -= SceneManagerOnActiveSceneChanged; SceneManager.sceneLoaded -= SceneManager_sceneLoaded; } diff --git a/CustomMenuText/Views/TextSelector/TextSelectorViewController.cs b/CustomMenuText/Views/TextSelector/TextSelectorViewController.cs index e1819f2..0df720d 100644 --- a/CustomMenuText/Views/TextSelector/TextSelectorViewController.cs +++ b/CustomMenuText/Views/TextSelector/TextSelectorViewController.cs @@ -91,6 +91,35 @@ public void SetupList() } textListData.tableView.ReloadData(); + + switch (Configuration.PluginConfig.Instance.SelectionType) + { + case 0: + textListData.tableView.SelectCellWithIdx(0); + break; + case 1: + textListData.tableView.SelectCellWithIdx(1); + break; + case 2: + textListData.tableView.SelectCellWithIdx(Configuration.PluginConfig.Instance.SelectedEntry + 2); + break; + } + } + + public void SelectCorrectCell(int selType, int choice) + { + switch (selType) + { + case 0: + textListData.tableView.SelectCellWithIdx(0); + break; + case 1: + textListData.tableView.SelectCellWithIdx(1); + break; + case 2: + textListData.tableView.SelectCellWithIdx(choice + 2); + break; + } } } } diff --git a/CustomMenuText/manifest.json b/CustomMenuText/manifest.json index 099a653..780ce08 100644 --- a/CustomMenuText/manifest.json +++ b/CustomMenuText/manifest.json @@ -8,8 +8,7 @@ "gameVersion": "1.13.2", "dependsOn": { "BSIPA": "^4.0.5", - "BeatSaberMarkupLanguage": "^1.4.5", - "HMUI": "^0" + "BeatSaberMarkupLanguage": "^1.4.5" }, "features": [] } \ No newline at end of file