-
Notifications
You must be signed in to change notification settings - Fork 0
/
AllItemsMenu.cs
140 lines (121 loc) · 4.84 KB
/
AllItemsMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
using SpawnSheet.Menus;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.ModLoader;
using Terraria.UI;
namespace SpawnSheet
{
internal class AllItemsMenu : GlobalItem
{
internal static Item[] singleSlotArray;
public AllItemsMenu() {
singleSlotArray = new Item[1];
}
//internal void UpdateInput()
//{
// try
// {
// UIView.UpdateUpdateInput();
// SpawnSheet.instance.npcBrowser.Update();
// SpawnSheet.instance.itemBrowser.Update();
// SpawnSheet.instance.recipeBrowser.Update();
// SpawnSheet.instance.extendedCheatMenu.Update();
// SpawnSheet.instance.hotbar.Update();
// SpawnSheet.instance.paintToolsHotbar.Update();
// SpawnSheet.instance.quickTeleportHotbar.Update();
// SpawnSheet.instance.quickClearHotbar.Update();
// SpawnSheet.instance.npcButchererHotbar.Update();
// ConfigurationTool.configurationWindow.Update();
// }
// catch (Exception e)
// {
// ErrorLogger.Log(e.Message + " " + e.StackTrace);
// }
//}
public void DrawUpdateAll(SpriteBatch spriteBatch) {
SpawnSheet.instance.itemBrowser.Draw(spriteBatch);
SpawnSheet.instance.npcBrowser.Draw(spriteBatch);
SpawnSheet.instance.recipeBrowser.Draw(spriteBatch);
SpawnSheet.instance.extendedCheatMenu.Draw(spriteBatch);
SpawnSheet.instance.paintToolsUI.Draw(spriteBatch);
// SpawnSheet.instance.itemBrowser.Update();
// spriteBatch.End();
// spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
SpawnSheet.instance.npcBrowser.Update();
SpawnSheet.instance.itemBrowser.Update();
SpawnSheet.instance.recipeBrowser.Update();
SpawnSheet.instance.extendedCheatMenu.Update();
SpawnSheet.instance.hotbar.Update();
SpawnSheet.instance.paintToolsHotbar.Update();
SpawnSheet.instance.paintToolsUI.Update();
SpawnSheet.instance.quickTeleportHotbar.Update();
SpawnSheet.instance.quickClearHotbar.Update();
SpawnSheet.instance.npcButchererHotbar.Update();
ConfigurationTool.configurationWindow.Update();
//BossDowner.bossDownerWindow.Update();
//SpawnSheet.instance.eventManagerHotbar.Update();
SpawnSheet.instance.hotbar.Draw(spriteBatch);
SpawnSheet.instance.paintToolsHotbar.Draw(spriteBatch);
SpawnSheet.instance.quickTeleportHotbar.Draw(spriteBatch);
SpawnSheet.instance.quickClearHotbar.Draw(spriteBatch);
SpawnSheet.instance.npcButchererHotbar.Draw(spriteBatch);
ConfigurationTool.configurationWindow.Draw(spriteBatch);
//BossDowner.bossDownerWindow.Draw(spriteBatch);
//SpawnSheet.instance.eventManagerHotbar.Draw(spriteBatch);
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
// DrawUpdateExtraAccessories(spriteBatch);
}
public void DrawUpdatePaintTools(SpriteBatch spriteBatch) {
SpawnSheet.instance.paintToolsHotbar.UpdateGameScale();
SpawnSheet.instance.paintToolsHotbar.DrawGameScale(spriteBatch);
}
internal void DrawUpdateExtraAccessories(SpriteBatch spriteBatch) {
if (Main.playerInventory && Main.EquipPage == 0) {
Point value = new Point(Main.mouseX, Main.mouseY);
Rectangle r = new Rectangle(0, 0, (int)((float)TextureAssets.InventoryBack.Value.Width * Main.inventoryScale), (int)((float)TextureAssets.InventoryBack.Value.Height * Main.inventoryScale));
SpawnSheetPlayer csp = Main.LocalPlayer.GetModPlayer<SpawnSheetPlayer>();
for (int i = 0; i < csp.numberExtraAccessoriesEnabled; i++) {
Main.inventoryScale = 0.85f;
Item accItem = csp.ExtraAccessories[i];
//if (accItem.type > 0)
//{
// ErrorLogger.Log("aaa " + i + " " + accItem.type);
//}
int mH = 0;
if (Main.mapEnabled) {
if (!Main.mapFullscreen && Main.mapStyle == 1) {
mH = 256;
}
if (mH + 600 > Main.screenHeight) {
mH = Main.screenHeight - 600;
}
}
int num17 = Main.screenWidth - 92 - (47 * 3);
int num18 = /*Main.mH +*/mH + 174;
if (Main.netMode == 1)
num17 -= 47;
r.X = num17/* + l * -47*/;
r.Y = num18 + (0 + i) * 47;
if (r.Contains(value)/* && !flag2*/) {
Main.LocalPlayer.mouseInterface = true;
Main.armorHide = true;
singleSlotArray[0] = accItem;
ItemSlot.Handle(singleSlotArray, ItemSlot.Context.EquipAccessory, 0);
accItem = singleSlotArray[0];
//ItemSlot.Handle(ref accItem, ItemSlot.Context.EquipAccessory);
}
singleSlotArray[0] = accItem;
ItemSlot.Draw(spriteBatch, singleSlotArray, 10, 0, new Vector2(r.X, r.Y));
accItem = singleSlotArray[0];
//ItemSlot.Draw(spriteBatch, ref accItem, 10, new Vector2(r.X, r.Y));
csp.ExtraAccessories[i] = accItem;
// ErrorLogger.Log("pd");
//player.VanillaUpdateAccessory(csp.ExtraAccessories[i], false, ref wallSpeedBuff, ref tileSpeedBuff, ref tileRangeBuff);
}
}
}
}
}