-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathWingSlotConfig.cs
More file actions
44 lines (35 loc) · 1.23 KB
/
WingSlotConfig.cs
File metadata and controls
44 lines (35 loc) · 1.23 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
using System.ComponentModel;
using Terraria.ModLoader.Config;
namespace WingSlot {
public class WingSlotConfig : ModConfig {
public enum Location {
Default,
Custom
}
public override ConfigScope Mode => ConfigScope.ClientSide;
[Header("SlotLocation")]
[DefaultValue(Location.Default)]
[DrawTicks]
public Location SlotLocation;
[DefaultValue(false)]
public bool ShowCustomLocationPanel;
[DefaultValue(false)]
public bool ResetCustomSlotLocation;
[Header("OtherOptions")]
[DefaultValue(false)]
public bool AllowEquippingInOtherSlots;
public override void OnChanged() {
if(SlotLocation == Location.Default) {
ShowCustomLocationPanel = false;
}
if(WingSlotSystem.UI != null) {
WingSlotSystem.UI.Panel.Visible = ShowCustomLocationPanel;
WingSlotSystem.UI.Panel.CanDrag = ShowCustomLocationPanel;
if(ResetCustomSlotLocation) {
WingSlotSystem.UI.ResetPosition();
ResetCustomSlotLocation = false;
}
}
}
}
}