-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathItemControl.cs
More file actions
105 lines (90 loc) · 3.06 KB
/
ItemControl.cs
File metadata and controls
105 lines (90 loc) · 3.06 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
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
using Terraria.ModLoader;
using Terraria;
using System;
using Microsoft.Xna.Framework.Graphics;
namespace ItemControl
{
public class ItemControl : Mod
{
public Mod herosmod;
public static ItemControl instance;
public const string heropermission = "ItemControl";
public const string heropermissiondisplayname = "Item Control Mod";
public bool hasPermission;
public ItemControl()
{
}
public override void Unload()
{
instance = null;
herosmod = null;
hasPermission = new bool();
ItemEdit.unload();
}
public override void PostAddRecipes()/* tModPorter Note: Removed. Use ModSystem.PostAddRecipes */
{
SetupHerosMod();
}
public override void Load()
{
instance = this;
if (ModLoader.TryGetMod("HEROsMod", out Mod herosMod))
{
herosmod = ModLoader.GetMod("HEROsMod");
}
ItemEdit.init();
}
public ItemControl GetInstance()
{
return instance;
}
public void SetupHerosMod()
{
if (herosmod != null)
{
herosmod.Call(
// Special string
"AddPermission",
// Permission Name
heropermission,
// Permission Display Name
heropermissiondisplayname);
/*
if (!Main.dedServ)
{
herosmod.Call(
// Special string
"AddSimpleButton",
// Name of Permission governing the availability of the button/tool
heropermission,
// Texture of the button. 38x38 is recommended for HERO's Mod. Also, a white outline on the icon similar to the other icons will look good.
//GetTexture("ItemControl"),
Assets.Request<Texture2D>("ItemControl"),
// A method that will be called when the button is clicked
(Action)NPCControlButtonPressed,
// A method that will be called when the player's permissions have changed
(Action<bool>)NPCControlPermissionChanged,
// A method that will be called when the button is hovered, returning the Tooltip
(Func<string>)NPCControlTooltip
);
}*/
}
}
public void NPCControlButtonPressed()
{
//If herosmod button is pressed
}
public void NPCControlPermissionChanged(bool Permission)
{
hasPermission = Permission;
}
public string NPCControlTooltip()
{
return "This button doesn't have a function yet";
}
public bool getPermission()
{
return hasPermission;
}
}
}