Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PlayerResourceSetsManager.cs
Go to the documentation of this file.
2using System.Linq;
4using Terraria.IO;
5
7
9{
11
13
14 private string _activeSetConfigKey;
15
16 private bool _loadedContent;
17
18 public string ActiveSetKeyName { get; private set; }
19
21 {
22 preferences.OnLoad += Configuration_OnLoad;
23 preferences.OnSave += Configuration_OnSave;
24 }
25
27 {
28 _activeSetConfigKey = obj.Get("PlayerResourcesSet", "New");
30 {
32 }
33 }
34
36 {
37 obj.Put("PlayerResourcesSet", _activeSetConfigKey);
38 }
39
40 public void LoadContent(AssetRequestMode mode)
41 {
42 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
43 //IL_005e: Unknown result type (might be due to invalid IL or missing references)
44 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
45 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
46 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
47 _sets["New"] = new FancyClassicPlayerResourcesDisplaySet("New", "New", "FancyClassic", mode);
48 _sets["Default"] = new ClassicPlayerResourcesDisplaySet("Default", "Default");
49 _sets["HorizontalBarsWithFullText"] = new HorizontalBarsPlayerResourcesDisplaySet("HorizontalBarsWithFullText", "HorizontalBarsWithFullText", "HorizontalBars", mode);
50 _sets["HorizontalBarsWithText"] = new HorizontalBarsPlayerResourcesDisplaySet("HorizontalBarsWithText", "HorizontalBarsWithText", "HorizontalBars", mode);
51 _sets["HorizontalBars"] = new HorizontalBarsPlayerResourcesDisplaySet("HorizontalBars", "HorizontalBars", "HorizontalBars", mode);
52 _sets["NewWithText"] = new FancyClassicPlayerResourcesDisplaySet("NewWithText", "NewWithText", "FancyClassic", mode);
53 _loadedContent = true;
55 }
56
61
71
73 {
74 _activeSet = set;
75 _activeSetConfigKey = set.ConfigKey;
76 ActiveSetKeyName = set.NameKey;
77 }
78
80 {
82 }
83
84 public void Draw()
85 {
87 }
88
89 public void CycleResourceSet()
90 {
93 {
94 if (frame == _activeSet)
95 {
96 return true;
97 }
98 lastFrame = frame;
99 return false;
100 });
101 if (lastFrame == null)
102 {
103 lastFrame = _sets.Values.Last();
104 }
106 }
107}