TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ DrawBuilderAccToggles_Inner()

void Terraria.Main.DrawBuilderAccToggles_Inner ( Vector2 start)
inlineprivate

Definition at line 83802 of file Main.cs.

83803 {
83804 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
83805 //IL_004d: Unknown result type (might be due to invalid IL or missing references)
83806 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
83807 //IL_0057: Unknown result type (might be due to invalid IL or missing references)
83808 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
83809 //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
83810 //IL_00be: Unknown result type (might be due to invalid IL or missing references)
83811 //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
83812 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
83813 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
83814 //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
83815 //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
83816 //IL_00f3: Unknown result type (might be due to invalid IL or missing references)
83817 //IL_0110: Unknown result type (might be due to invalid IL or missing references)
83818 //IL_0117: Unknown result type (might be due to invalid IL or missing references)
83819 //IL_011c: Unknown result type (might be due to invalid IL or missing references)
83820 //IL_0121: Unknown result type (might be due to invalid IL or missing references)
83821 //IL_0125: Unknown result type (might be due to invalid IL or missing references)
83822 //IL_012a: Unknown result type (might be due to invalid IL or missing references)
83823 //IL_01f1: Unknown result type (might be due to invalid IL or missing references)
83824 //IL_01dd: Unknown result type (might be due to invalid IL or missing references)
83825 //IL_01b1: Unknown result type (might be due to invalid IL or missing references)
83826 //IL_01b6: Unknown result type (might be due to invalid IL or missing references)
83827 //IL_0194: Unknown result type (might be due to invalid IL or missing references)
83828 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
83829 //IL_01f6: Unknown result type (might be due to invalid IL or missing references)
83830 //IL_01b8: Unknown result type (might be due to invalid IL or missing references)
83831 //IL_01c4: Unknown result type (might be due to invalid IL or missing references)
83832 //IL_01c9: Unknown result type (might be due to invalid IL or missing references)
83833 //IL_01ce: Unknown result type (might be due to invalid IL or missing references)
83834 //IL_01ff: Unknown result type (might be due to invalid IL or missing references)
83835 //IL_0201: Unknown result type (might be due to invalid IL or missing references)
83836 //IL_0208: Unknown result type (might be due to invalid IL or missing references)
83837 //IL_020f: Unknown result type (might be due to invalid IL or missing references)
83838 //IL_0211: Unknown result type (might be due to invalid IL or missing references)
83839 //IL_021b: Unknown result type (might be due to invalid IL or missing references)
83840 //IL_03cf: Unknown result type (might be due to invalid IL or missing references)
83841 //IL_03d1: Unknown result type (might be due to invalid IL or missing references)
83842 //IL_03d3: Unknown result type (might be due to invalid IL or missing references)
83843 //IL_03dd: Unknown result type (might be due to invalid IL or missing references)
83844 //IL_03e2: Unknown result type (might be due to invalid IL or missing references)
83845 //IL_02d1: Unknown result type (might be due to invalid IL or missing references)
83846 //IL_02db: Unknown result type (might be due to invalid IL or missing references)
83847 //IL_02e5: Unknown result type (might be due to invalid IL or missing references)
83848 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
83849 //IL_02f1: Unknown result type (might be due to invalid IL or missing references)
83850 //IL_02fb: Unknown result type (might be due to invalid IL or missing references)
83851 //IL_027b: Unknown result type (might be due to invalid IL or missing references)
83852 //IL_0287: Unknown result type (might be due to invalid IL or missing references)
83853 //IL_0298: Unknown result type (might be due to invalid IL or missing references)
83854 //IL_02a2: Unknown result type (might be due to invalid IL or missing references)
83855 //IL_0441: Unknown result type (might be due to invalid IL or missing references)
83856 //IL_0446: Unknown result type (might be due to invalid IL or missing references)
83857 //IL_044d: Unknown result type (might be due to invalid IL or missing references)
83858 //IL_0452: Unknown result type (might be due to invalid IL or missing references)
83859 //IL_0461: Unknown result type (might be due to invalid IL or missing references)
83860 //IL_0327: Unknown result type (might be due to invalid IL or missing references)
83861 //IL_033d: Unknown result type (might be due to invalid IL or missing references)
83862 //IL_0347: Unknown result type (might be due to invalid IL or missing references)
83863 //IL_0351: Unknown result type (might be due to invalid IL or missing references)
83864 //IL_0353: Unknown result type (might be due to invalid IL or missing references)
83865 //IL_035d: Unknown result type (might be due to invalid IL or missing references)
83866 Player player = Main.player[myPlayer];
83867 int[] builderAccStatus = player.builderAccStatus;
83869 bool shiftHotbarLock = activeToggles.Count / 12 != BuilderToggleLoader.BuilderTogglePage || activeToggles.Count % 12 >= 10;
83870 Vector2 startPosition = start - new Vector2(0f, (float)(shiftHotbarLock ? 42 : 21));
83871 string text = "";
83873 Rectangle rectangle = default(Rectangle);
83874 Color textColor = default(Color);
83875 for (int i = startIndex; i < endIndex; i++)
83876 {
83878 Texture2D texture = ModContent.Request<Texture2D>(builderToggle.Texture).Value;
83879 ((Rectangle)(ref rectangle))._002Ector(0, 0, texture.Width, texture.Height);
83880 Color color = builderToggle.DisplayColorTexture();
83881 Vector2 position = startPosition + new Vector2(0f, (float)(moveDownForButton ? 24 : 0)) + new Vector2(0f, (float)(i % 12 * 24));
83882 text = builderToggle.DisplayValue();
83883 int numberOfStates = builderToggle.NumberOfStates;
83884 int toggleType = builderToggle.Type;
83885 Rectangle val = Utils.CenteredRectangle(position, new Vector2(14f));
83886 bool hover = ((Rectangle)(ref val)).Contains(MouseScreen.ToPoint()) && !PlayerInput.IgnoreMouseInterface;
83887 bool num = hover && mouseLeft && mouseLeftRelease;
83889 {
83890 rectangle = ((toggleType != BuilderToggle.BlockSwap.Type) ? texture.Frame(4, 1, (builderToggle.CurrentState == 0) ? 1 : 0) : texture.Frame(3, 1, (builderToggle.CurrentState != 0) ? 1 : 0));
83891 position += new Vector2(1f, 0f);
83892 }
83893 else
83894 {
83895 rectangle = (Rectangle)((builderToggle.Type < 10) ? new Rectangle(builderToggle.Type * 16, 16, 14, 14) : rectangle);
83896 }
83897 spriteBatch.Draw(texture, position, (Rectangle?)rectangle, color, 0f, rectangle.Size() / 2f, 1f, (SpriteEffects)0, 0f);
83898 if (hover)
83899 {
83900 player.mouseInterface = true;
83901 mouseText = true;
83903 {
83904 Asset<Texture2D> iconHover = ModContent.Request<Texture2D>(builderToggle.HoverTexture);
83905 spriteBatch.Draw(iconHover.Value, position, (Rectangle?)null, OurFavoriteColor, 0f, iconHover.Value.Size() / 2f, 1f, (SpriteEffects)0, 0f);
83906 }
83907 else if (toggleType == BuilderToggle.BlockSwap.Type)
83908 {
83909 spriteBatch.Draw(texture, position, (Rectangle?)texture.Frame(3, 1, 2), OurFavoriteColor, 0f, rectangle.Size() / 2f, 0.9f, (SpriteEffects)0, 0f);
83910 }
83911 else if (toggleType == BuilderToggle.TorchBiome.Type)
83912 {
83913 spriteBatch.Draw(texture, position, (Rectangle?)texture.Frame(4, 1, (builderToggle.CurrentState == 0) ? 3 : 2), OurFavoriteColor, 0f, rectangle.Size() / 2f, 0.9f, (SpriteEffects)0, 0f);
83914 }
83915 }
83916 if (num)
83917 {
83918 builderAccStatus[toggleType] = (builderAccStatus[toggleType] + 1) % numberOfStates;
83919 SoundStyle style = ((toggleType == BuilderToggle.BlockSwap.Type || toggleType == BuilderToggle.TorchBiome.Type) ? SoundID.Unlock : SoundID.MenuTick);
83920 SoundEngine.PlaySound(in style);
83921 mouseLeftRelease = false;
83922 }
83923 UILinkPointNavigator.SetPosition(6000 + i % 12, position + rectangle.Size() * 0.15f);
83924 if (mouseText && hover && HoverItem.type <= 0)
83925 {
83926 float colorByte = (float)(int)mouseTextColor / 255f;
83928 ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.MouseText.Value, text, new Vector2((float)(mouseX + 14), (float)(mouseY + 14)), textColor, 0f, Vector2.Zero, Vector2.One);
83929 mouseText = false;
83930 }
83931 }
83932 UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT = endIndex - startIndex;
83933 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
static Asset< DynamicSpriteFont > MouseText
Definition FontAssets.cs:10
static readonly SoundStyle Unlock
Definition SoundID.cs:335
static void BuilderTogglePageHandler(int startY, int activeToggles, out bool moveDownForButton, out int startIndex, out int endIndex)
Definition Main.cs:83678
static SpriteBatch spriteBatch
Definition Main.cs:1043
static int myPlayer
The index in F:Terraria.Main.player of this client's Player. If this is 255, this client is the ser...
Definition Main.cs:1958
static bool mouseLeftRelease
Definition Main.cs:1908
static Vector2 MouseScreen
Fetches the position of the mouse cursor on the screen. Useful for making things visually happen nea...
Definition Main.cs:2938
static bool mouseText
Definition Main.cs:2536
static byte mouseTextColor
A value that oscillates between 190 and 255. It is used to drive the slight pulsing color effect seen...
Definition Main.cs:1904
static Color OurFavoriteColor
Definition Main.cs:971
static Item HoverItem
Definition Main.cs:2060
static int mouseY
Definition Main.cs:634
static Player[] player
Definition Main.cs:1960
static int mouseX
Definition Main.cs:632
static bool mouseLeft
Definition Main.cs:642
static List< BuilderToggle > ActiveBuilderTogglesList()
static BuilderToggle BlockSwap
static BuilderToggle TorchBiome
Represents a builder toggle button shown in the top left corner of the screen while the inventory is ...
Manages content added by mods. Liasons between mod content and Terraria's arrays and oversees the Loa...
Definition ModContent.cs:38
static Vector2 DrawColorCodedStringWithShadow(SpriteBatch spriteBatch, DynamicSpriteFont font, TextSnippet[] snippets, Vector2 position, float rotation, Vector2 origin, Vector2 baseScale, out int hoveredSnippet, float maxWidth=-1f, float spread=2f)
static void SetPosition(int ID, Vector2 Position)
This data type describes in detail how a sound should be played. Passable to the M:Terraria....
Definition SoundStyle.cs:19

References Terraria.ModLoader.BuilderToggleLoader.ActiveBuilderTogglesList(), Terraria.ModLoader.BuilderToggle.BlockSwap, Terraria.Main.BuilderTogglePageHandler(), Terraria.Utils.CenteredRectangle(), Terraria.Graphics.Light.Color, Terraria.UI.Chat.ChatManager.DrawColorCodedStringWithShadow(), Terraria.Main.HoverItem, Terraria.GameInput.PlayerInput.IgnoreMouseInterface, Terraria.ID.SoundID.MenuTick, Terraria.Main.mouseLeft, Terraria.Main.mouseLeftRelease, Terraria.Main.MouseScreen, Terraria.GameContent.FontAssets.MouseText, Terraria.Main.mouseText, Terraria.Main.mouseTextColor, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Main.myPlayer, Terraria.Main.OurFavoriteColor, Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.UI.Gamepad.UILinkPointNavigator.SetPosition(), Terraria.Main.spriteBatch, Terraria.ModLoader.BuilderToggle.TorchBiome, and Terraria.ID.SoundID.Unlock.

Referenced by Terraria.Main.DrawBuilderAccToggles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: