From c8e722a93db4c7cc9b5a45bff27287e34f5166e2 Mon Sep 17 00:00:00 2001 From: Reherc Date: Sun, 4 Jul 2021 04:50:46 +0200 Subject: [PATCH] Made the packs button open a (not yet modified) level select menu --- .../MainMenu/Buttons/ContentPacksButton.cs | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/Distance.AdventureMaker/Scripts/MainMenu/Buttons/ContentPacksButton.cs b/Distance.AdventureMaker/Scripts/MainMenu/Buttons/ContentPacksButton.cs index cc64062..ff873ec 100644 --- a/Distance.AdventureMaker/Scripts/MainMenu/Buttons/ContentPacksButton.cs +++ b/Distance.AdventureMaker/Scripts/MainMenu/Buttons/ContentPacksButton.cs @@ -1,4 +1,5 @@ using Centrifuge.Distance.Game; +using UnityEngine; namespace Distance.AdventureMaker.Scripts.MainMenu { @@ -10,14 +11,31 @@ public class ContentPacksButton : MainMenuButton protected override int ItemPosition => 5; + protected LevelSelectMenuAbstract levelSelect; + + public override void Setup(MainMenuLogic menuLogic) + { + base.Setup(menuLogic); + + LevelGridMenu levelGrid = menuLogic.levelSelectLogic_ as LevelGridMenu; + + GameObject levelSelectObj = Instantiate(levelGrid.advancedMenu_.gameObject); + levelSelectObj.name = "CampaignSelectRoot"; + levelSelect = levelSelectObj.GetComponent(); + } + protected override void OnButtonClick() { - MessageBox.Create("This feature isn't currently implemented.", ButtonText).Show(); - //SetVisible(false); + //MenuLogic.levelSelectLogic_ + levelSelect.Display(LevelSelectMenuAbstract.DisplayType.Arcade, new LevelSelectMenuAbstract.OnLevelSelectedDelegate((_, __) => { }), null); + + - return; - /* - var controller = MenuLogic.gameObject.GetComponent(); + //MessageBox.Create("This feature isn't currently implemented.", ButtonText).Show(); + + //return; + + /*var controller = MenuLogic.gameObject.GetComponent(); if (!controller) return; @@ -28,17 +46,15 @@ protected override void OnButtonClick() controller.Workshop.Visible = false; controller.ContentPacks.Visible = false; controller.Garage.Visible = false; - controller.ReportBug.Visible = true; + controller.ReportBug.Visible = false; controller.Options.Visible = false; - controller.Quit.Visible = true; - + controller.Quit.Visible = false; var title = MenuLogic.transform.Find("UI Root/Panel - Main/DistanceTitle").GetComponent(); - title.text = "N O"; + title.text = "S A M P L E T E X T"; var version = MenuLogic.transform.Find("UI Root/Panel - Main/VersionNumber").GetComponent(); - version.text = ""; - */ + version.text = "";*/ } } }