Esempio n. 1
0
        internal static void SpecialOrdersBoardPatch(SpecialOrdersBoard __instance)
        {
            try
            {
                int x = Game1.getMouseX(true), y = Game1.getMouseY(true); // Mouse x and y position

                if (__instance.acceptLeftQuestButton.visible && __instance.acceptLeftQuestButton.containsPoint(x, y))
                {
                    string toSpeak = getSpecialOrderDetails(__instance.leftOrder);

                    toSpeak = $"Left Quest:\n\t{toSpeak}\n\tPress left click to accept this quest.";

                    MainClass.ScreenReader.SayWithMenuChecker(toSpeak, true);
                    return;
                }

                if (__instance.acceptRightQuestButton.visible && __instance.acceptRightQuestButton.containsPoint(x, y))
                {
                    string toSpeak = getSpecialOrderDetails(__instance.rightOrder);

                    toSpeak = $"Right Quest:\n\t{toSpeak}\n\tPress left click to accept this quest.";

                    MainClass.ScreenReader.SayWithMenuChecker(toSpeak, true);
                    return;
                }
            }
            catch (Exception e)
            {
                MainClass.ErrorLog($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}");
            }
        }
Esempio n. 2
0
        private static void SpecialOrdersBoard_GetPortrait_postfix(SpecialOrdersBoard __instance, string requester_name, ref KeyValuePair <Texture2D, Rectangle>?__result)
        {
            try
            {
                if (RSVemojis == null)
                {
                    RSVemojis = Helper.Content.Load <Texture2D>(PathUtilities.NormalizeAssetName("LooseSprites\\RSVemojis"), ContentSource.GameContent);
                    if (RSVemojis == null)
                    {
                        Log.Error($"Loading error: Couldn't load {PathUtilities.NormalizeAssetName("LooseSprites\\RSVemojis")}");
                        return;
                    }
                }

                if (__result == null)
                {
                    int index = NPCNames.FindIndex(name => name.Equals(requester_name, StringComparison.OrdinalIgnoreCase));
                    if (index != -1)
                    {
                        __result = new KeyValuePair <Texture2D, Rectangle>(UntimedSO.RSVemojis, new Rectangle(index % 14 * 9, index / 14 * 9, 9, 9));
                        return;
                    }
                }
                return;
            }
            catch (Exception e)
            {
                Log.Error("Error in SpecialOrdersBoard_GetPortrait_postifx");
                Log.Error(e.Message);
                Log.Error(e.StackTrace);
                return;
            }
        }