Exemple #1
0
 private void Input_ButtonReleased(object sender, StardewModdingAPI.Events.ButtonReleasedEventArgs e)
 {
     if (e.Button == SButton.MouseLeft)
     {
         if (draggingPhone)
         {
             Helper.WriteConfig(Config);
             draggingPhone = false;
         }
         else if (clickingPhoneIcon)
         {
             if (!draggingPhoneIcon)
             {
                 TogglePhone(true);
             }
             else
             {
                 Helper.WriteConfig(Config);
             }
             if (Game1.activeClickableMenu is DraggingPhoneIconMenu)
             {
                 Game1.activeClickableMenu = null;
             }
             clickingPhoneIcon = false;
             draggingPhoneIcon = false;
         }
     }
 }
        private static void Input_ButtonReleased(object sender, StardewModdingAPI.Events.ButtonReleasedEventArgs e)
        {
            if (e.Button == SButton.MouseLeft)
            {
                Monitor.Log($"unclicked toprow {topRow} callables {callableList.Count} width {ModEntry.gridWidth} tiles {ModEntry.gridWidth * ModEntry.gridHeight}");
                if (dragging)
                {
                    Monitor.Log($"was dragging");
                    dragging = false;
                    return;
                }

                for (int i = 0; i < callableList.Count; i++)
                {
                    Vector2   pos = GetNPCPos(i);
                    Rectangle r   = new Rectangle((int)pos.X, (int)pos.Y, Config.ContactWidth, Config.ContactHeight);
                    if (r.Contains(Game1.getMousePosition()))
                    {
                        Monitor.Log($"calling {callableList[i].npc.Name}");
                        CallNPC(callableList[i].npc);
                        Helper.Events.Input.ButtonPressed  -= Input_ButtonPressed;
                        Helper.Events.Input.ButtonReleased -= Input_ButtonReleased;
                        dragging = true;
                        return;
                    }
                }
            }
        }
Exemple #3
0
 private void Input_ButtonReleased(object sender, StardewModdingAPI.Events.ButtonReleasedEventArgs e)
 {
     if (e.Button != SButton.MouseLeft && e.Button != SButton.MouseRight)
     {
         return;
     }
     //AddButterflies(Game1.currentLocation);
 }
Exemple #4
0
 private void Input_ButtonReleased(object sender, StardewModdingAPI.Events.ButtonReleasedEventArgs e)
 {
     if (e.Button == Config.FireButton)
     {
         Monitor.Log("End fire breath");
         firing = false;
     }
 }
 private void Input_ButtonReleased(object sender, StardewModdingAPI.Events.ButtonReleasedEventArgs e)
 {
     if (e.Button == SButton.O && !railroadMapBlocked &&
         config.enableForceCreateTrain && isMainPlayer)
     {
         this.Monitor.Log("Player press O... Choo choo");
         forceNewTrain      = true;
         enableCreatedTrain = true;
     }
     else if (e.Button == SButton.Y && railroadMapBlocked)
     {
         this.Monitor.Log("Player press Y, but the railraod map is not available... No choo choo for you.");
     }
 }
Exemple #6
0
        static void Input_ButtonReleased(object sender, StardewModdingAPI.Events.ButtonReleasedEventArgs e)
        {
            if (!StardewModdingAPI.Context.IsWorldReady || Game1.activeClickableMenu != null)
            {
                return;
            }

            if ((int)Game1.options.inventorySlot1[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot2[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot3[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot4[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot5[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot6[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot7[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot8[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot9[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot10[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot11[0].key == (int)e.Button ||
                (int)Game1.options.inventorySlot12[0].key == (int)e.Button)
            {
                if (Game1.player.CurrentItem != null)
                {
                    TextToSpeech.Speak(TextToSpeech.ItemToSpeech(Game1.player.CurrentItem));
                }
            }
            else if (Inputs.IsTTSRepeatButton(e.Button))
            {
                TextToSpeech.Repeat();
            }
            else if (Inputs.IsTTSInfoButton(e.Button))
            {
                TextToSpeech.Speak(TextToSpeech.ItemToSpeech(Game1.player.CurrentItem) + " " + Game1.player.CurrentItem.getDescription());
            }
            else if (Inputs.IsTTSHealthButton(e.Button))
            {
                string percent(float f)
                {
                    return(1 - f < 0.001 ? "full" : ((int)System.Math.Round(f * 100)) + "%");
                }

                TextToSpeech.Speak("health: " + percent(Game1.player.health / Game1.player.maxHealth) + ", stamina: " + percent(Game1.player.Stamina / Game1.player.MaxStamina));
            }
            else if (Inputs.IsTTSTimeButton(e.Button))
            {
                TextToSpeech.Speak("Time: " + Game1.getTimeOfDayString(Game1.timeOfDay) + ", Day " + Game1.dayOfMonth + " of " + Game1.CurrentSeasonDisplayName + " in year " + Game1.year);
            }
        }
Exemple #7
0
 private void Input_ButtonReleased(object sender, StardewModdingAPI.Events.ButtonReleasedEventArgs e)
 {
     UpdateInteraction(false, e.Button);
 }