Repository navigation
Expand file tree
/
Copy pathTool.cs
More file actions
76 lines (64 loc) · 1.73 KB
/
Copy pathTool.cs
File metadata and controls
76 lines (64 loc) · 1.73 KB
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
using DPSExtreme.UIElements;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.UI;
namespace DPSExtreme
{
// UIState needs UserInterface for Scrollbar fixes
// Tool should store data? does it even matter?
internal abstract class Tool
{
//internal bool visible;
//internal string toggleTooltip;
internal UserInterface userInterface;
internal UIModState uistate;
// Type uistateType;
public Tool(Type uistateType) {
userInterface = new UserInterface();
// this.uistateType = uistateType;
uistate = (UIModState)Activator.CreateInstance(uistateType, new object[] { userInterface });
//uistate = (UIModState)Activator.CreateInstance(uistateType);
//uistate = new LootUI(userInterface);
uistate.Activate();
//uistate.userInterface = userInterface;
userInterface.SetState(uistate);
}
/// <summary>
/// Initializes this Tool. Called during Load.
/// Useful for initializing data.
/// </summary>
internal virtual void Initialize() {
}
/// <summary>
/// Initializes this Tool. Called during Load after Initialize only on SP and Clients.
/// Useful for initializing UI.
/// </summary>
internal virtual void ClientInitialize() { }
internal virtual void ScreenResolutionChanged() {
userInterface?.Recalculate();
}
internal virtual void UIUpdate(GameTime gameTime) {
//if (visible)
{
userInterface?.Update(gameTime);
}
}
internal virtual void UIDraw() {
//if (visible)
{
uistate.ReverseChildren();
uistate.Draw(Main.spriteBatch);
uistate.ReverseChildren();
}
}
internal virtual void DrawUpdateToggle() {
}
internal virtual void Toggled() {
}
internal virtual void PostSetupContent() {
if (!Main.dedServ) {
}
}
}
}