This repository has been archived by the owner on Apr 5, 2021. It is now read-only.
forked from tModLoader/tModLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
605 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
patches/Tea/Terraria/GameContent/Drawing/TileDrawing.cs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- src/Terraria/Terraria/GameContent/Drawing/TileDrawing.cs | ||
+++ src/Tea/Terraria/GameContent/Drawing/TileDrawing.cs | ||
@@ -10,6 +_,7 @@ | ||
using Terraria.Graphics.Capture; | ||
using Terraria.ID; | ||
using Terraria.ObjectData; | ||
+using Terraria.Tea; | ||
using Terraria.UI; | ||
using Terraria.Utilities; | ||
|
||
@@ -5336,7 +_,7 @@ | ||
item.netDefaults(num5); | ||
item.Prefix(frameX2); | ||
Main.instance.LoadItem(item.type); | ||
- Texture2D value = TextureAssets.Item[item.type].Value; | ||
+ Texture2D value = ItemLoader.itemTexture[item.type]; | ||
Rectangle value2 = (Main.itemAnimations[item.type] == null) ? value.Frame() : Main.itemAnimations[item.type].GetFrame(value); | ||
int width = value2.Width; | ||
int height = value2.Height; | ||
@@ -5366,7 +_,7 @@ | ||
Item item3 = ((TEFoodPlatter)TileEntity.ByPosition[new Point16(num, num2)]).item; | ||
if (!item3.IsAir) { | ||
Main.instance.LoadItem(item3.type); | ||
- Texture2D value3 = TextureAssets.Item[item3.type].Value; | ||
+ Texture2D value3 = ItemLoader.itemTexture[item3.type]; | ||
Rectangle value4 = (!ItemID.Sets.IsFood[item3.type]) ? value3.Frame() : value3.Frame(1, 3, 0, 2); | ||
int width2 = value4.Width; | ||
int height2 = value4.Height; | ||
@@ -5389,7 +_,7 @@ | ||
if (type == 471) { | ||
Item item4 = (TileEntity.ByPosition[new Point16(num, num2)] as TEWeaponsRack).item; | ||
Main.instance.LoadItem(item4.type); | ||
- Texture2D value5 = TextureAssets.Item[item4.type].Value; | ||
+ Texture2D value5 = ItemLoader.itemTexture[item4.type]; | ||
Rectangle value6 = (Main.itemAnimations[item4.type] == null) ? value5.Frame() : Main.itemAnimations[item4.type].GetFrame(value5); | ||
int width3 = value6.Width; | ||
int height3 = value6.Height; |
19 changes: 19 additions & 0 deletions
19
patches/Tea/Terraria/GameContent/UI/Chat/ItemTagHandler.cs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- src/Terraria/Terraria/GameContent/UI/Chat/ItemTagHandler.cs | ||
+++ src/Tea/Terraria/GameContent/UI/Chat/ItemTagHandler.cs | ||
@@ -1,6 +_,7 @@ | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Graphics; | ||
using ReLogic.Graphics; | ||
+using Terraria.Tea; | ||
using Terraria.UI; | ||
using Terraria.UI.Chat; | ||
|
||
@@ -27,7 +_,7 @@ | ||
float num2 = 1f; | ||
if (Main.netMode != 2 && !Main.dedServ) { | ||
Main.instance.LoadItem(_item.type); | ||
- Texture2D value = TextureAssets.Item[_item.type].Value; | ||
+ Texture2D value = ItemLoader.itemTexture[_item.type]; | ||
Rectangle rectangle = (Main.itemAnimations[_item.type] == null) ? value.Frame() : Main.itemAnimations[_item.type].GetFrame(value); | ||
if (rectangle.Height > 32) | ||
num2 = 32f / (float)rectangle.Height; |
31 changes: 31 additions & 0 deletions
31
patches/Tea/Terraria/GameContent/UI/CustomCurrencyManager.cs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- src/Terraria/Terraria/GameContent/UI/CustomCurrencyManager.cs | ||
+++ src/Tea/Terraria/GameContent/UI/CustomCurrencyManager.cs | ||
@@ -2,6 +_,7 @@ | ||
using Microsoft.Xna.Framework.Graphics; | ||
using System.Collections.Generic; | ||
using Terraria.ID; | ||
+using Terraria.Tea; | ||
|
||
namespace Terraria.GameContent.UI | ||
{ | ||
@@ -37,16 +_,16 @@ | ||
Main.instance.LoadItem(346); | ||
Main.instance.LoadItem(87); | ||
if (num4 > 0) | ||
- sb.Draw(TextureAssets.Item[4076].Value, Utils.CenteredRectangle(new Vector2(shopx + 96f, shopy + 50f), TextureAssets.Item[4076].Value.Size() * 0.65f), null, Color.White); | ||
+ sb.Draw(ItemLoader.itemTexture[4076], Utils.CenteredRectangle(new Vector2(shopx + 96f, shopy + 50f), ItemLoader.itemTexture[4076].Size() * 0.65f), null, Color.White); | ||
|
||
if (num3 > 0) | ||
- sb.Draw(TextureAssets.Item[3813].Value, Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), TextureAssets.Item[3813].Value.Size() * 0.65f), null, Color.White); | ||
+ sb.Draw(ItemLoader.itemTexture[3813], Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), ItemLoader.itemTexture[3813].Size() * 0.65f), null, Color.White); | ||
|
||
if (num2 > 0) | ||
- sb.Draw(TextureAssets.Item[346].Value, Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), TextureAssets.Item[346].Value.Size() * 0.65f), null, Color.White); | ||
+ sb.Draw(ItemLoader.itemTexture[346], Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), ItemLoader.itemTexture[346].Size() * 0.65f), null, Color.White); | ||
|
||
if (num > 0) | ||
- sb.Draw(TextureAssets.Item[87].Value, Utils.CenteredRectangle(new Vector2(shopx + 70f, shopy + 60f), TextureAssets.Item[87].Value.Size() * 0.65f), null, Color.White); | ||
+ sb.Draw(ItemLoader.itemTexture[87], Utils.CenteredRectangle(new Vector2(shopx + 70f, shopy + 60f), ItemLoader.itemTexture[87].Size() * 0.65f), null, Color.White); | ||
|
||
Utils.DrawBorderStringFourWay(sb, FontAssets.MouseText.Value, Lang.inter[66].Value, shopx, shopy + 40f, Color.White * ((float)(int)Main.mouseTextColor / 255f), Color.Black, Vector2.Zero); | ||
customCurrencySystem.DrawSavingsMoney(sb, Lang.inter[66].Value, shopx, shopy, num5, horizontal); |
19 changes: 19 additions & 0 deletions
19
patches/Tea/Terraria/GameContent/UI/CustomCurrencySingleCoin.cs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- src/Terraria/Terraria/GameContent/UI/CustomCurrencySingleCoin.cs | ||
+++ src/Tea/Terraria/GameContent/UI/CustomCurrencySingleCoin.cs | ||
@@ -4,6 +_,7 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Terraria.Localization; | ||
+using Terraria.Tea; | ||
using Terraria.UI.Chat; | ||
|
||
namespace Terraria.GameContent.UI | ||
@@ -68,7 +_,7 @@ | ||
public override void DrawSavingsMoney(SpriteBatch sb, string text, float shopx, float shopy, long totalCoins, bool horizontal = false) { | ||
int num = _valuePerUnit.Keys.ElementAt(0); | ||
Main.instance.LoadItem(num); | ||
- Texture2D value = TextureAssets.Item[num].Value; | ||
+ Texture2D value = ItemLoader.itemTexture[num]; | ||
if (horizontal) { | ||
_ = 99; | ||
Vector2 position = new Vector2(shopx + ChatManager.GetStringSize(FontAssets.MouseText.Value, text, Vector2.One).X + 45f, shopy + 50f); |
22 changes: 22 additions & 0 deletions
22
patches/Tea/Terraria/GameContent/UI/Elements/UIDynamicItemCollection.cs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- src/Terraria/Terraria/GameContent/UI/Elements/UIDynamicItemCollection.cs | ||
+++ src/Tea/Terraria/GameContent/UI/Elements/UIDynamicItemCollection.cs | ||
@@ -34,8 +_,6 @@ | ||
Rectangle itemSlotHitbox = GetItemSlotHitbox(startX, startY, startItemIndex, i); | ||
Item inv = ContentSamples.ItemsByType[num2]; | ||
int context = 29; | ||
- if (TextureAssets.Item[num2].State == AssetState.NotLoaded) | ||
- num--; | ||
|
||
bool cREATIVE_ItemSlotShouldHighlightAsSelected = false; | ||
if (base.IsMouseHovering && itemSlotHitbox.Contains(Main.MouseScreen.ToPoint()) && !PlayerInput.IgnoreMouseInterface) { | ||
@@ -56,10 +_,6 @@ | ||
while (_itemIdsToLoadTexturesFor.Count > 0 && num > 0) { | ||
int num3 = _itemIdsToLoadTexturesFor[0]; | ||
_itemIdsToLoadTexturesFor.RemoveAt(0); | ||
- if (TextureAssets.Item[num3].State == AssetState.NotLoaded) { | ||
- Main.instance.LoadItem(num3); | ||
- num -= 4; | ||
- } | ||
} | ||
} | ||
|
32 changes: 30 additions & 2 deletions
32
patches/Tea/Terraria/Initializers/AssetInitializer.cs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
--- src/Terraria/Terraria/Initializers/AssetInitializer.cs | ||
+++ src/Tea/Terraria/Initializers/AssetInitializer.cs | ||
@@ -54,6 +_,7 @@ | ||
@@ -14,6 +_,7 @@ | ||
using Terraria.GameContent.UI; | ||
using Terraria.ID; | ||
using Terraria.IO; | ||
+using Terraria.Tea; | ||
using Terraria.Utilities; | ||
|
||
namespace Terraria.Initializers | ||
@@ -52,8 +_,9 @@ | ||
TextureAssets.SplashTextureLegoBack = LoadAsset<Texture2D>("Images\\SplashScreens\\Splash_" + num + "_0", AssetRequestMode.ImmediateLoad); | ||
TextureAssets.SplashTextureLegoTree = LoadAsset<Texture2D>("Images\\SplashScreens\\Splash_" + num + "_1", AssetRequestMode.ImmediateLoad); | ||
TextureAssets.SplashTextureLegoFront = LoadAsset<Texture2D>("Images\\SplashScreens\\Splash_" + num + "_2", AssetRequestMode.ImmediateLoad); | ||
TextureAssets.Item[75] = LoadAsset<Texture2D>("Images\\Item_" + (short)75, AssetRequestMode.ImmediateLoad); | ||
- TextureAssets.Item[75] = LoadAsset<Texture2D>("Images\\Item_" + (short)75, AssetRequestMode.ImmediateLoad); | ||
+ ItemLoader.itemTexture[75] = Loader.GetTexture("Terraria/Item_" + 75); | ||
TextureAssets.LoadingSunflower = LoadAsset<Texture2D>("Images\\UI\\Sunflower_Loading", AssetRequestMode.ImmediateLoad); | ||
+ TextureAssets.TeaTexture = LoadAsset<Texture2D>("Tea\\UI\\Tea", AssetRequestMode.ImmediateLoad); | ||
} | ||
|
||
public static void LoadAssetsWhileInInitialBlackScreen() { | ||
@@ -91,10 +_,12 @@ | ||
private static void LoadTextures(AssetRequestMode mode) { | ||
for (int i = 0; i < TextureAssets.Item.Length; i++) { | ||
int num = ItemID.Sets.TextureCopyLoad[i]; | ||
- if (num != -1) | ||
- TextureAssets.Item[i] = TextureAssets.Item[num]; | ||
- else | ||
- TextureAssets.Item[i] = LoadAsset<Texture2D>("Images/Item_" + i, AssetRequestMode.DoNotLoad); | ||
+ if (num != -1) { | ||
+ ItemLoader.itemTexture[i] = ItemLoader.itemTexture[num]; | ||
+ } | ||
+ else { | ||
+ ItemLoader.itemTexture[i] = Loader.GetTexture("Terraria/Item_" + i); | ||
+ } | ||
} | ||
|
||
for (int j = 0; j < TextureAssets.Npc.Length; j++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.