public static ModSettingsPopupMenuPanel Create(List <ScadMod> m)
        {
            Debug.Log("Constructing a ModSettings Popup Menu Panel!");
            GameObject   obj = SingletonManager.Get <OptionsPanel>(true).gameObject;
            OptionsPanel old = obj.GetComponent <OptionsPanel>();

            GameObject o = (GameObject)GameObject.Instantiate(obj);

            o.name = "ModSettingsPanel";
            foreach (Transform t in o.transform)
            {
                // Need to destroy all of the children of this GO
                Debug.Log("Destroying: " + t.gameObject);
                GameObject.DestroyImmediate(t.gameObject);
            }
            GameObject.DestroyImmediate(o.GetComponent <OptionsPanel>());
            ModSettingsPopupMenuPanel instanceForGO = o.AddComponent <ModSettingsPopupMenuPanel>();

            Debug.Log("Created InstanceForGO");
            instanceForGO.transform.SetParent(obj.transform.parent);
            instanceForGO.transform.GetComponent <AgeTransform>().Position = old.AgeTransform.Position;

            instanceForGO.SetupOptionsPanel(old);
            instanceForGO.SetupModlist(m);

            return(instanceForGO);
        }
Esempio n. 2
0
        private System.Collections.IEnumerator MainMenuPanel_OnLoad(On.MainMenuPanel.orig_OnLoad orig, MainMenuPanel self)
        {
            if (SettingsPanel == null)
            {
                SettingsPanel = ModSettingsPopupMenuPanel.Create(ModList);
            }
            System.Collections.IEnumerator temp = orig(self);
            yield return(temp);

            AgePrimitiveLabel label = new DynData <MainMenuPanel>(self).Get <AgePrimitiveLabel>("versionLabel");

            Debug.Log("Attempting to overwrite old version with DustDevil version!");
            Debug.Log("Current message is: " + label.Text);
            label.Text  = "#4D4D4D#Dungeon of the Endless, VERSION ";
            label.Text += string.Concat(new object[]
            {
                "#REVERT##4D4D4D#",
                Amplitude.Unity.Framework.Application.Version.Major,
                ".",
                Amplitude.Unity.Framework.Application.Version.Minor,
                ".",
                Amplitude.Unity.Framework.Application.Version.Revision,
                "\nDustDevil VERSION: ",
                DustDevil.MajorVersion,
                ".",
                DustDevil.MinorVersion,
                ".",
                DustDevil.Revision,
                "#REVERT#"
            });
            Debug.Log("Final message is: " + label.Text);
            CreateModList(label);
            CreateModSettingsMenu(self);
            yield break;
        }