예제 #1
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (CheatSheet.ToggleCheatSheetHotbarHotKey.JustPressed)
     {
         if (CheatSheet.instance.hotbar.hidden)
         {
             CheatSheet.instance.hotbar.Show();
         }
         else
         {
             CheatSheet.instance.hotbar.Hide();
         }
     }
 }
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            //In here things like Main.MouseScreen are not correct (related to UI)
            //and in UpdateUI Main.mouseRight etc aren't correct
            //but you need both to properly interact with the UI
            //these two are used in PreUpdate, together with AllowedToOpenHistoryBookUI
            //since that also doesn't work in ProcessTriggers (set in PostUpdate)

            mouseLeftPressed = Main.mouseLeft && Main.mouseLeftRelease;

            mouseRightPressed = Main.mouseRight && Main.mouseRightRelease;

            justOpenedInventory = PlayerInput.Triggers.JustPressed.Inventory && !Main.playerInventory;
        }
예제 #3
0
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            ProcessRuneSelectionTriggers(triggersSet);

            ProcessOcarinaTriggers(triggersSet);

            if (HasParaglider && TLoZInput.EquipParaglider.JustPressed && !Exhausted)
            {
                player.mount?.Dismount(player);
                Paragliding = !Paragliding;
            }

            TLoZInput.Update();
        }
예제 #4
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (AerovelenceMod.ArmorHotKey.JustPressed)
     {
         if (MiningAbilityCooldown == false)
         {
             if (AmbrosiaBonus)
             {
                 Projectile.NewProjectile(player.Center, (Main.MouseWorld - player.Center) / 10, ModContent.ProjectileType <MiningEnergyBlast>(), 1, 0);
                 player.AddBuff(ModContent.BuffType <MiningAbilityCooldown>(), 600);
             }
         }
     }
 }
예제 #5
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (TeraCAD.instance.ToggleHotKeyMain.JustPressed)
     {
         ToolBoxUI.instance.Show = !ToolBoxUI.instance.Show;
         if (!ToolBoxUI.instance.Show)
         {
             ToolBox.Select(null);
             LinePropertyUI.instance.Show = false;
             SettingUI.instance.Show      = false;
             ImageUI.instance.Show        = false;
         }
     }
 }
예제 #6
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (VampKnives.HoodUpDownHotkey.JustPressed)
     {
         if (HoodKeyPressed == false)
         {
             HoodKeyPressed = true;
         }
         else
         {
             HoodKeyPressed = false;
         }
     }
 }
예제 #7
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (DamageLog.Recording.JustPressed && ModContent.GetInstance <CUConfig>().RecordLog)
     {
         Recording = !Recording;
         if (Recording)
         {
             Main.NewText("[RECORDING]", 255, 0, 0);
         }
         else
         {
             Main.NewText("[STOPPED RECORDING]", 100, 0, 0);
         }
     }
 }
예제 #8
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (TeamSpectate.prevPlayer.JustPressed && selectedTarget > 0)
     {
         selectedTarget--;
         Locked = true;
         Target = selectedTarget;
     }
     if (TeamSpectate.nextPlayer.JustPressed && selectedTarget < Main.player.Where(p => p?.active == true).Count())
     {
         selectedTarget++;
         Locked = true;
         Target = selectedTarget;
     }
 }
예제 #9
0
        public override bool HotKeyMatch(TriggersSet triggers, AbilityHotkeys abilityKeys)
        {
            if (abilityKeys.Get <Dash>().JustPressed&& triggers.DirectionsRaw != default)
            {
                Dir = Vector2.Normalize(triggers.DirectionsRaw);

                if (Player.HasBuff(BuffID.Confused))
                {
                    Dir = new Vector2(Dir.X * -1, Dir.Y);
                }

                return(true);
            }
            return(false);
        }
예제 #10
0
        public int useAmmoSlot = 54; //ammo slots are 54 - 57 inventory slots (top to bottom)

        // switching slot and displaying message
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            if (AmmoSwitcher.useAmmo1.JustPressed)
            {
                useAmmoSlot = 54;
                if (ASUI.visible)
                {
                    Main.PlaySound(SoundID.MenuTick);
                }
            }

            if (AmmoSwitcher.useAmmo2.JustPressed)
            {
                useAmmoSlot = 55;
                if (ASUI.visible)
                {
                    Main.PlaySound(SoundID.MenuTick);
                }
            }

            if (AmmoSwitcher.useAmmo3.JustPressed)
            {
                useAmmoSlot = 56;
                if (ASUI.visible)
                {
                    Main.PlaySound(SoundID.MenuTick);
                }
            }

            if (AmmoSwitcher.useAmmo4.JustPressed)
            {
                useAmmoSlot = 57;
                if (ASUI.visible)
                {
                    Main.PlaySound(SoundID.MenuTick);
                }
            }

            ASUI.activeSlot = useAmmoSlot;
            if (player.HeldItem.useAmmo > 0 && !Main.playerInventory)
            {
                ASUI.visible = true;
            }
            else
            {
                ASUI.visible = false;
            }
        }
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (CheatSheet.ToggleCheatSheetHotbarHotKey.JustPressed)
     {
         // Debug refresh UI elements
         // CheatSheet.instance.paintToolsUI = new Menus.PaintToolsUI(CheatSheet.instance);
         if (CheatSheet.instance.hotbar.hidden)
         {
             CheatSheet.instance.hotbar.Show();
         }
         else
         {
             CheatSheet.instance.hotbar.Hide();
         }
     }
 }
예제 #12
0
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            if (!player.controlUseItem)
            {
                UseBulletSoul = 0;
            }

            if (player.controlUp && player.controlUseItem)
            {
                player.controlUseItem = false;
                if (UseBulletSoul < 2)
                {
                    UseBulletSoul++;
                }
            }
        }
        private void ProcessTriggersHotkeys(TriggersSet triggersSet)
        {
            foreach (KeyValuePair <ModHotKey, AbilitySlot> kvp in DoTariaMod.Instance.ModHotKeys)
            {
                if (kvp.Key.JustReleased)
                {
                    AbilityDefinition ability = GetAbilityForSlot(kvp.Value);
                    if (ability == null)
                    {
                        return;
                    }

                    TryActivateAbility(ability);
                }
            }
        }
예제 #14
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (CastledWorld.waitParti)
     {
         if (CastledsContent.JoinMinigame.JustPressed && !parti)
         {
             Main.NewText($"{player.name} is participating!");
             parti = true;
         }
         if (CastledsContent.JoinMinigame.JustPressed && parti)
         {
             Main.NewText($"{player.name} has withdrawn!");
             parti = false;
         }
     }
 }
예제 #15
0
        ////////////////

        public override void ProcessTriggers(TriggersSet triggers_set)
        {
            var mymod = (HamstarHelpersMod)this.mod;

            if (mymod.ControlPanelHotkey.JustPressed)
            {
                if (mymod.Config.DisableControlPanelHotkey)
                {
                    Main.NewText("Control panel hotkey disabled.", Color.Red);
                }
                else
                {
                    mymod.ControlPanel.Open();
                }
            }
        }
예제 #16
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (!SHAactive && cooldown == 0)
     {
         if (JoJoStands.ItemHotKey.JustPressed && player.HeldItem.type == mod.ItemType("KillerQueenT3"))       //KQ Tier 3 Sheer Heart Attack spawning
         {
             Projectile.NewProjectile(player.position, player.velocity, mod.ProjectileType("SheerHeartAttack"), 107, 7f, player.whoAmI);
             cooldown += 600;
         }
         if (JoJoStands.ItemHotKey.JustPressed && player.HeldItem.type == mod.ItemType("KillerQueenFinal"))    //KQ Final Tier Sheer Heart Attack spawning
         {
             Projectile.NewProjectile(player.position, player.velocity, mod.ProjectileType("SheerHeartAttack"), 142, 7f, player.whoAmI);
             cooldown += 240;
         }
     }
 }
예제 #17
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     //if (!RecipeBrowser.instance.CheatSheetLoaded)
     {
         if (RecipeBrowser.instance.ToggleRecipeBrowserHotKey.JustPressed)
         {
             RecipeBrowserUI.instance.ShowRecipeBrowser = !RecipeBrowserUI.instance.ShowRecipeBrowser;
             // Debug assistance, allows for reinitializing RecipeBrowserUI
             //if (!RecipeBrowserUI.instance.ShowRecipeBrowser)
             //{
             //	RecipeBrowserUI.instance.RemoveAllChildren();
             //	var isInitializedFieldInfo = typeof(Terraria.UI.UIElement).GetField("_isInitialized", BindingFlags.Instance | BindingFlags.NonPublic);
             //	isInitializedFieldInfo.SetValue(RecipeBrowserUI.instance, false);
             //	RecipeBrowserUI.instance.Activate();
             //}
         }
         if (RecipeBrowser.instance.QueryHoveredItemHotKey.JustPressed)
         {
             if (!Main.HoverItem.IsAir)
             {
                 RecipeBrowserUI.instance.ShowRecipeBrowser = true;
                 if (RecipeBrowserUI.instance.CurrentPanel == RecipeBrowserUI.RecipeCatalogue)
                 {
                     RecipeCatalogueUI.instance.queryItem.ReplaceWithFake(Main.HoverItem.type);
                 }
                 else if (RecipeBrowserUI.instance.CurrentPanel == RecipeBrowserUI.ItemCatalogue)
                 {
                     ItemCatalogueUI.instance.itemGrid.Goto(delegate(UIElement element)
                     {
                         UIItemCatalogueItemSlot itemSlot = element as UIItemCatalogueItemSlot;
                         if (itemSlot != null && itemSlot.itemType == Main.HoverItem.type)
                         {
                             ItemCatalogueUI.instance.SetItem(itemSlot);
                             return(true);
                         }
                         return(false);
                     }, true);
                 }
                 else if (RecipeBrowserUI.instance.CurrentPanel == RecipeBrowserUI.Bestiary)
                 {
                     BestiaryUI.instance.queryItem.ReplaceWithFake(Main.HoverItem.type);
                 }
             }
         }
     }
 }
예제 #18
0
 //Hotkey
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (Laugicality.ToggleMystic.JustPressed && mysticHold)
     {
         mysticSwitch();
     }
     if (Laugicality.ToggleSoulStoneV.JustPressed)
     {
         SoulStoneV = !SoulStoneV;
         Main.NewText("Soul Stone and Potion Crystal visual effects: " + SoulStoneV.ToString(), 250, 250, 0);
     }
     if (Laugicality.ToggleSoulStoneM.JustPressed)
     {
         SoulStoneM = !SoulStoneM;
         Main.NewText("Soul Stone and Potion Crystal mobility effects: " + SoulStoneM.ToString(), 250, 250, 0);
     }
 }
예제 #19
0
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            if (Fargowiltas.CustomKey.JustPressed)
            {
                QuickUseItemAt(40);
            }

            if (Fargowiltas.RodKey.JustPressed)
            {
                AutoUseRod();
            }

            if (Fargowiltas.HomeKey.JustPressed)
            {
                AutoUseMirror();
            }
        }
예제 #20
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (ToggleTooltipsHotkey.JustPressed)
     {
         if (DisplayWorldTooltips)
         {
             DisplayWorldTooltips = false;
             Main.NewText(Language.GetTextValue("Mods.WTIT.WorldTooltipsOff"));
         }
         else
         {
             DisplayWorldTooltips = true;
             Main.NewText(Language.GetTextValue("Mods.WTIT.WorldTooltipsOn"));
         }
         Configuration.Put("DisplayWorldTooltips", DisplayWorldTooltips);
     }
 }
        ////////////////

        internal void ProcessTriggers(TriggersSet triggersSet)
        {
            if (this.Key1.JustPressed)
            {
                foreach (Action act in this.Key1Actions.Values)
                {
                    act();
                }
            }
            if (this.Key2.JustPressed)
            {
                foreach (Action act in this.Key2Actions.Values)
                {
                    act();
                }
            }
        }
예제 #22
0
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            //if: player has eaten Gum Gum Fruit and...
            //if: Empty hand, eaten fruit, not in water, and (using mouse -> can use mouse)
            if (player.GetModPlayer <DevilFruitUser>().eatenDevilFruit == 1 && player.HeldItem.type == ItemID.None && !(player.wet && !(player.honeyWet || player.lavaWet)) && (!Equals(DevilFruitMod.UsePowers1Hotkey.GetAssignedKeys(InputMode.Keyboard)[0], "Mouse1") || (Main.hasFocus && !Main.LocalPlayer.mouseInterface && !Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput && !Main.mapFullscreen && !Main.HoveringOverAnNPC && Main.LocalPlayer.talkNPC == -1)))
            {
                //Getting the shooting trajectory
                Vector2 dir = TMath.CalculateTrajectory();

                if (DevilFruitMod.MiscHotkey.JustPressed)
                {
                    GumGumMisc(dir.X, dir.Y);
                }

                if (DevilFruitMod.UsePowers1Hotkey.JustPressed)
                {
                    GumGumPowers(dir.X, dir.Y, 0);
                }

                if (DevilFruitMod.UsePowers2Hotkey.JustPressed)
                {
                    GumGumPowers(dir.X, dir.Y, 1);
                }

                if (DevilFruitMod.UsePowers3Hotkey.JustPressed)
                {
                    //if: No hands in use, Empty hand, eaten fruit, not in water, and (using mouse -> can use mouse)
                    if (DevilFruitMod.hands == 0)
                    {
                        gatlingPressed       = true; //refer to PreUpdate()
                        timer                = 0;
                        DevilFruitMod.hands += 2;
                    }
                }

                if (DevilFruitMod.UsePowers3Hotkey.JustReleased)
                {
                    if (gatlingPressed == true)
                    {
                        gatlingPressed       = false;
                        DevilFruitMod.hands -= 2;
                    }
                }
            }
        }
예제 #23
0
        public static List <Controls> GetReleasedKeys(TriggersSet inputState)
        {
            List <Controls> releasedKeys = new List <Controls>();

            foreach (Controls control in ControlTypes)
            {
                // block is just the combination of two keys, skip it.
                if (control == Controls.Block)
                {
                    continue;
                }
                bool pressed = false;
                switch (control)
                {
                case Controls.LightAttack:
                    pressed = inputState.MouseLeft;
                    break;

                case Controls.HeavyAttack:
                    pressed = inputState.MouseRight;
                    break;

                case Controls.Up:
                    pressed = inputState.Up;
                    break;

                case Controls.Down:
                    pressed = inputState.Down;
                    break;

                case Controls.Left:
                    pressed = inputState.Left;
                    break;

                case Controls.Right:
                    pressed = inputState.Right;
                    break;
                }
                if (!pressed)
                {
                    releasedKeys.Add(control);
                }
            }
            return(releasedKeys);
        }
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            reforgePub = reforge;
            //Player player = Main.player[Main.myPlayer];

            //Main.NewText(ExtraExplosives.TriggerUIReforge.GetAssignedKeys(InputMode.Keyboard)[0].ToString());
            if (reforge == true)
            {
                reforge = false;
            }

            if (ExtraExplosives.TriggerExplosion.JustReleased)
            {
                //ExtraExplosives.detonate = true;
                detonate = true;
                //Main.NewText("Detonate", (byte)30, (byte)255, (byte)10, false);
            }
            else
            {
                //ExtraExplosives.detonate = false;
                detonate = false;
            }

            if (ExtraExplosives.TriggerUIReforge.JustPressed)             //check to see if the button was just pressed
            {
                reforgeUIActive++;

                if (reforgeUIActive == 5)
                {
                    reforgeUIActive = 1;
                }
            }


            if (reforgeUIActive == 1)             //check to see if the reforge bomb key was pressed
            {
                GetInstance <ExtraExplosives>().ExtraExplosivesReforgeBombInterface.SetState(new UI.ExtraExplosivesReforgeBombUI());
                reforgeUIActive++;
            }
            if (reforgeUIActive == 3)
            {
                GetInstance <ExtraExplosives>().ExtraExplosivesReforgeBombInterface.SetState(null);
                reforgeUIActive = 4;
            }
        }
예제 #25
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (Dominion)
     {
         if (Emperia.AccessoryKey.JustPressed)
         {
             if (dominionCooldown > 0)
             {
                 Main.NewText("This ability is on cooldown! Usable again in " + (dominionCooldown / 60) + " seconds.");
             }
             else
             {
                 noDeathTimer     = 360;
                 dominionCooldown = 3600;
             }
         }
     }
 }
예제 #26
0
        ////////////////

        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            var mymod = (PlayerStatisticsMod)this.mod;

            try {
                if (mymod.ControlPanelHotkey != null && mymod.ControlPanelHotkey.JustPressed)
                {
                    if (ControlPanelTabs.IsDialogOpen())
                    {
                        ControlPanelTabs.CloseDialog();
                    }
                    else
                    {
                        ControlPanelTabs.OpenTab(PlayerStatisticsMod.ControlPanelName);
                    }
                }
            } catch { }
        }
 public override void ProcessTriggers(TriggersSet triggersSet)      //runs hotkey effects
 {
     if (QwertysRandomContent.YetAnotherSpecialAbility.JustPressed) //hotkey is pressed
     {
         if (effect && damageTally >= damageTallyMax)
         {
             if (NPC.AnyNPCs(mod.NPCType("BladeBoss"))) //don't want to summon Imperious if he's already active!
             {
                 Main.NewText("You're already fighting Imperious!");
             }
             else
             {
                 Projectile.NewProjectile(player.Center, Vector2.Zero, mod.ProjectileType("Imperious"), (int)(500f * player.minionDamage), 8f * player.minionKB, player.whoAmI); //summons Imperious to fight!
                 damageTally = 0;                                                                                                                                                //resets the tally
             }
         }
     }
 }
예제 #28
0
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            var mymod = (ObjectivesMod)this.mod;

            try {
                if (mymod.UtilityPanelsHotkey != null && mymod.UtilityPanelsHotkey.JustPressed)
                {
                    if (UtilityPanelsTabs.IsDialogOpen())
                    {
                        UtilityPanelsTabs.CloseDialog();
                    }
                    else
                    {
                        UtilityPanelsTabs.OpenTab(ObjectivesMod.UtilityPanelsName);
                    }
                }
            } catch { }
        }
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     //if (!RecipeBrowser.instance.CheatSheetLoaded)
     {
         if (RecipeBrowser.instance.ToggleRecipeBrowserHotKey.JustPressed)
         {
             RecipeBrowserUI.instance.ShowRecipeBrowser = !RecipeBrowserUI.instance.ShowRecipeBrowser;
             // Debug assistance, allows for reinitializing RecipeBrowserUI
             //if (!RecipeBrowserUI.instance.ShowRecipeBrowser)
             //{
             //	RecipeBrowserUI.instance.RemoveAllChildren();
             //	var isInitializedFieldInfo = typeof(Terraria.UI.UIElement).GetField("_isInitialized", BindingFlags.Instance | BindingFlags.NonPublic);
             //	isInitializedFieldInfo.SetValue(RecipeBrowserUI.instance, false);
             //	RecipeBrowserUI.instance.Activate();
             //}
         }
     }
 }
예제 #30
0
 public override void ProcessTriggers(TriggersSet triggersSet)
 {
     if (AlchemistNPC.LampLight.JustPressed)
     {
         if (lamp == 0 && trigger)
         {
             trigger = false;
             lamp++;
             lf = true;
         }
         if (lamp == 1 && !trigger && !lf)
         {
             trigger = true;
             lamp    = 0;
         }
         lf = false;
     }
 }
예제 #31
0
 public virtual void ProcessTriggers(TriggersSet triggersSet)
 {
 }
예제 #32
0
 public static void ProcessTriggers(Player player, TriggersSet triggersSet)
 {
     foreach (ModPlayer modPlayer in player.modPlayers)
     {
         modPlayer.ProcessTriggers(triggersSet);
     }
 }