Skip to content

Commit

Permalink
Merge pull request monkeymanboy#87 from Meivyn/master
Browse files Browse the repository at this point in the history
Fix full screen bug... part 2
  • Loading branch information
monkeymanboy authored Mar 18, 2021
2 parents d984a37 + ca9d3d9 commit 8a23666
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions BeatSaberMarkupLanguage/Tags/Settings/ToggleSettingTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class ToggleSettingTag : BSMLTag
{
private GameObject toggleTemplate;
private BoolSettingsController templateController;
private Toggle templateControllerToggle;

public override string[] Aliases => new[] { "toggle-setting", "bool-setting", "checkbox-setting", "checkbox" };
public virtual string PrefabToggleName => "Fullscreen";
Expand All @@ -23,13 +24,16 @@ public override GameObject CreateObject(Transform parent)
{
toggleTemplate = Resources.FindObjectsOfTypeAll<Toggle>().Select(x => x.transform.parent.gameObject).First(p => p.name == PrefabToggleName);
templateController = toggleTemplate.GetComponent<BoolSettingsController>();
templateControllerToggle = templateController.GetComponentInChildren<Toggle>();
}

templateController.enabled = false;
templateControllerToggle.isOn = false;
GameObject gameObject = Object.Instantiate(toggleTemplate, parent, false);
GameObject nameText = gameObject.transform.Find("NameText").gameObject;
Object.Destroy(gameObject.GetComponent<BoolSettingsController>());
templateController.enabled = true;
templateControllerToggle.isOn = true;

gameObject.name = "BSMLToggle";
gameObject.SetActive(false);
Expand Down

0 comments on commit 8a23666

Please sign in to comment.