Beispiel #1
0
        private static void Prefix(ref Player __instance)
        {
            //Show VPlus tutorial raven if not yet seen by the player's character.
            Tutorial.TutorialText introTutorial = new Tutorial.TutorialText()
            {
                m_label = "ValheimPlus Intro",
                m_name  = "vplus",
                m_text  = "We hope you enjoy the mod, please support our Patreon so we can continue to provide new updates!",
                m_topic = "Welcome to Valheim+"
            };

            if (!Tutorial.instance.m_texts.Contains(introTutorial))
            {
                Tutorial.instance.m_texts.Add(introTutorial);
            }

            Player.m_localPlayer.ShowTutorial("vplus");

            //Only sync on first spawn
            if (VPlusMapSync.ShouldSyncOnSpawn && Configuration.Current.Map.IsEnabled && Configuration.Current.Map.shareMapProgression)
            {
                //Send map data to the server
                VPlusMapSync.SendMapToServer();
                VPlusMapSync.ShouldSyncOnSpawn = false;
            }

            if (Configuration.Current.Player.IsEnabled && Configuration.Current.Player.skipIntro)
            {
                __instance.m_firstSpawn = false;
            }
        }
Beispiel #2
0
 // Token: 0x06000666 RID: 1638 RVA: 0x00035EF0 File Offset: 0x000340F0
 public void ShowText(string name, bool force)
 {
     Tutorial.TutorialText tutorialText = this.m_texts.Find((Tutorial.TutorialText x) => x.m_name == name);
     if (tutorialText != null)
     {
         this.SpawnRaven(tutorialText.m_name, tutorialText.m_topic, tutorialText.m_text, tutorialText.m_label);
     }
 }
 public static void QuestHintHugin(string messageName, string messageText)
 {
     Tutorial.TutorialText tutorialText = new Tutorial.TutorialText
     {
         m_label = "Quest Hints",
         m_name  = messageName + DateTimeOffset.Now.Millisecond + DateTimeOffset.Now.Day + DateTimeOffset.Now.Hour + DateTimeOffset.Now.Minute,
         m_text  = messageText,
         m_topic = "Quest Hints"
     };
     HuginSays(tutorialText.m_name, tutorialText.m_topic, tutorialText.m_text, tutorialText.m_label);
     addHints(messageName + "\n" + tutorialText.m_text + "\n");
 }
Beispiel #4
0
        private static void Prefix()
        {
            Tutorial.TutorialText introTutorial = new Tutorial.TutorialText()
            {
                m_label = "ValheimPlus Intro",
                m_name  = "vplus",
                m_text  = "We hope you enjoy the mod, please support our Patreon so we can continue to provide new updates!",
                m_topic = "Welcome to Valheim+"
            };

            if (!Tutorial.instance.m_texts.Contains(introTutorial))
            {
                Tutorial.instance.m_texts.Add(introTutorial);
            }

            Player.m_localPlayer.ShowTutorial("vplus");
        }
Beispiel #5
0
        private static void Prefix()
        {
            Tutorial.TutorialText introTutorial = new Tutorial.TutorialText()
            {
                m_label = "Hudini Test",
                m_name  = "hudini_1",
                m_text  = "Prout prout prout",
                m_topic = "Welcome to Hudini"
            };

            if (!Tutorial.instance.m_texts.Contains(introTutorial))
            {
                Tutorial.instance.m_texts.Add(introTutorial);
            }

            Player.m_localPlayer.ShowTutorial("hudini_1");
        }
Beispiel #6
0
        private static void Prefix()
        {
            Tutorial.TutorialText introTutorial = new Tutorial.TutorialText()
            {
                m_label = "Shared Map Intro",
                m_name  = "smap",
                m_text  = "This mod enables you to share your map with other players!",
                m_topic = "Welcome to MapShare"
            };

            if (!Tutorial.instance.m_texts.Contains(introTutorial))
            {
                Tutorial.instance.m_texts.Add(introTutorial);
            }

            Player.m_localPlayer.ShowTutorial("smap");
        }
Beispiel #7
0
        public static void Postfix(ref HashSet <string> ___m_shownTutorials)
        {
            // Show plugin intro
            Tutorial.TutorialText modIntro = new Tutorial.TutorialText()
            {
                m_name  = "vwsp_intro",
                m_label = "Welcome to Valheim WebSocket",
                m_topic = "Welcome to Valheim WebSocket",
                m_text  = "Follow me on twitch.tv/skarab42",
            };

            if (!Tutorial.instance.m_texts.Contains(modIntro))
            {
                UnityEngine.Debug.Log($"Add text {modIntro.m_label}");

                Tutorial.instance.m_texts.Add(modIntro);
            }

            Player.m_localPlayer.ShowTutorial(modIntro.m_name);
        }
        public static void QuestTopicHugin(string messageName, string messageText)
        {
            Tutorial.TutorialText tutorialText = new Tutorial.TutorialText
            {
                m_label = "Quest List",
                m_name  = messageName + DateTimeOffset.Now.Millisecond + DateTimeOffset.Now.Day + DateTimeOffset.Now.Hour + DateTimeOffset.Now.Minute,
                m_text  = messageText,
                m_topic = "Quest List"
            };
            HuginSays(tutorialText.m_name, tutorialText.m_topic, tutorialText.m_text, tutorialText.m_label);
            var m_knownTexts = Traverse.Create(Player.m_localPlayer).Field <Dictionary <string, string> >("m_knownTexts").Value;

            if (m_knownTexts.ContainsKey(tutorialText.m_topic))
            {
                m_knownTexts[tutorialText.m_topic] = tutorialText.m_text;
                return;
            }
            m_knownTexts.Add(tutorialText.m_topic, tutorialText.m_text);
            return;
        }