forked from JavidPack/CheatSheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AllItemsMenu.cs
148 lines (129 loc) · 4.76 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
141
142
143
144
145
146
147
148
using CheatSheet.Menus;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.UI;
namespace CheatSheet
{
internal class AllItemsMenu : GlobalItem
{
private static Item[] singleSlotArray;
public AllItemsMenu()
{
singleSlotArray = new Item[1];
}
//internal void UpdateInput()
//{
// try
// {
// UIView.UpdateUpdateInput();
// ((CheatSheet)mod).npcBrowser.Update();
// ((CheatSheet)mod).itemBrowser.Update();
// ((CheatSheet)mod).recipeBrowser.Update();
// ((CheatSheet)mod).extendedCheatMenu.Update();
// ((CheatSheet)mod).hotbar.Update();
// ((CheatSheet)mod).paintToolsHotbar.Update();
// ((CheatSheet)mod).quickTeleportHotbar.Update();
// ((CheatSheet)mod).quickClearHotbar.Update();
// ((CheatSheet)mod).npcButchererHotbar.Update();
// ConfigurationTool.configurationWindow.Update();
// }
// catch (Exception e)
// {
// ErrorLogger.Log(e.Message + " " + e.StackTrace);
// }
//}
public void DrawUpdateAll(SpriteBatch spriteBatch)
{
((CheatSheet)mod).itemBrowser.Draw(spriteBatch);
((CheatSheet)mod).npcBrowser.Draw(spriteBatch);
((CheatSheet)mod).recipeBrowser.Draw(spriteBatch);
((CheatSheet)mod).extendedCheatMenu.Draw(spriteBatch);
((CheatSheet)mod).paintToolsUI.Draw(spriteBatch);
// ((CheatSheet)mod).itemBrowser.Update();
// spriteBatch.End();
// spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
((CheatSheet)mod).npcBrowser.Update();
((CheatSheet)mod).itemBrowser.Update();
((CheatSheet)mod).recipeBrowser.Update();
((CheatSheet)mod).extendedCheatMenu.Update();
((CheatSheet)mod).hotbar.Update();
((CheatSheet)mod).paintToolsHotbar.Update();
((CheatSheet)mod).paintToolsUI.Update();
((CheatSheet)mod).quickTeleportHotbar.Update();
((CheatSheet)mod).quickClearHotbar.Update();
((CheatSheet)mod).npcButchererHotbar.Update();
ConfigurationTool.configurationWindow.Update();
//BossDowner.bossDownerWindow.Update();
//((CheatSheet)mod).eventManagerHotbar.Update();
((CheatSheet)mod).hotbar.Draw(spriteBatch);
((CheatSheet)mod).paintToolsHotbar.Draw(spriteBatch);
((CheatSheet)mod).quickTeleportHotbar.Draw(spriteBatch);
((CheatSheet)mod).quickClearHotbar.Draw(spriteBatch);
((CheatSheet)mod).npcButchererHotbar.Draw(spriteBatch);
ConfigurationTool.configurationWindow.Draw(spriteBatch);
//BossDowner.bossDownerWindow.Draw(spriteBatch);
//((CheatSheet)mod).eventManagerHotbar.Draw(spriteBatch);
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
// DrawUpdateExtraAccessories(spriteBatch);
}
public void DrawUpdatePaintTools(SpriteBatch spriteBatch)
{
((CheatSheet)mod).paintToolsHotbar.UpdateGameScale();
((CheatSheet)mod).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)Main.inventoryBackTexture.Width * Main.inventoryScale), (int)((float)Main.inventoryBackTexture.Height * Main.inventoryScale));
CheatSheetPlayer csp = Main.LocalPlayer.GetModPlayer<CheatSheetPlayer>(mod);
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);
}
}
}
}
}