示例#1
0
        /// <summary>Prompt the player to apply a lotion item, or display a message if not allowed.</summary>
        /// <param name="item">The lotion item to check or apply</param>
        public void ApplyQuestion(Item item)
        {
            //Check if it can be applied (Aloe Vera Gel can only be applied once a day)
            if (item.ParentSheetIndex == JA.GetObjectId(ALOE_GEL_ITEM_NAME) && HasAppliedAloeToday)
            {
                string messagetext = i18n.Get("Error.AlreadyUsedLotionToday", new { lotionName = item.DisplayName });
                Game1.drawDialogueNoTyping(messagetext);
                Monitor.Log($"Can't use item: {messagetext}", LogLevel.Info);
                return;
            }

            //Check if it can be applied (Sunscreen can be applied once every 30 minutes, unless it washed off)
            if (item.ParentSheetIndex == JA.GetObjectId(SUNSCREEN_ITEM_NAME) && ModEntry.Instance.Sunscreen.AppliedSunscreenRecently())
            {
                string messagetext = i18n.Get("Error.UsedLotionVeryRecently", new { lotionName = item.DisplayName });
                Game1.drawDialogueNoTyping(messagetext);
                Monitor.Log($"Can't use item: {messagetext}", LogLevel.Info);
                return;
            }

            string question = i18n.Get("Question.ApplyLotion", new { lotionName = item.DisplayName });

            Response[] yesNoResponses = Game1.currentLocation.createYesNoResponses();
            GameLocation.afterQuestionBehavior afterAnswer = ApplyLotionAnswer;

            Game1.currentLocation.createQuestionDialogue(question, yesNoResponses, afterAnswer);
        }
示例#2
0
        /// <summary>Shows the menu that allows the player to choose Endless or Progress from Old JK</summary>
        public void ShowOldResponses()
        {
            Response[] answerChoices = new Response[3]
            {
                new Response("Progress Old Junimo Kart", "Progress Old Junimo Kart"),
                new Response("Endless Old Junimo Kart", "Endless Old Junimo Kart"),
                new Response("Exit", "Exit")
            };

            GameLocation.afterQuestionBehavior versionSelected = new GameLocation.afterQuestionBehavior(RecieveOldResponse);
            Game1.player.currentLocation.createQuestionDialogue("Old Junimo Kart", answerChoices, versionSelected);
        }
示例#3
0
        /// <summary>Shows the menu that allows the player to choose a specific level</summary>
        public void ShowLevelPickerMenu()
        {
            Response[] levelChooser = new Response[9];
            int        i            = 0;

            foreach (string levelName in LevelMap.KartLevelMap.Keys)
            {
                levelChooser[i] = new Response(levelName, levelName);
                i++;
            }
            GameLocation.afterQuestionBehavior levelSelected = new GameLocation.afterQuestionBehavior(RecieveResponse);
            Game1.player.currentLocation.createQuestionDialogue("Which Level?", levelChooser, levelSelected);
        }
        public void ShowSaveProgressResponses()
        {
            // Create the different responses
            Response[] answerChoices = new Response[3]
            {
                new Response("Progress (New)", "Progress (New)"),
                new Response("Progress (Resume)", "Progress (Resume)"),
                new Response("Exit", Game1.content.LoadString("Strings\\StringsFromCSFiles:TitleMenu.cs.11738"))
            };

            GameLocation.afterQuestionBehavior progressBehavior = new GameLocation.afterQuestionBehavior(RecieveResponse);
            //Show the question dialogue
            Game1.player.currentLocation.createQuestionDialogue("Save Progress Mode!", answerChoices, progressBehavior);
        }