Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PowerStripUIElement.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
using
Microsoft.Xna.Framework
;
3
using
Terraria.UI
;
4
5
namespace
Terraria.GameContent.UI.Elements
;
6
7
public
class
PowerStripUIElement
:
UIElement
8
{
9
private
List<UIElement>
_buttonsBySorting
;
10
11
private
string
_gamepadPointGroupname
;
12
13
public
PowerStripUIElement
(
string
gamepadGroupName
,
List<UIElement>
buttons
)
14
{
15
_buttonsBySorting
=
new
List<UIElement>
(
buttons
);
16
_gamepadPointGroupname
=
gamepadGroupName
;
17
int
count =
buttons
.
Count
;
18
int
num = 4;
19
int
num2
= 40;
20
int
num3
= 40;
21
int
num4
=
num3
+ num;
22
UIPanel
uIPanel
=
new
UIPanel
23
{
24
Width
=
new
StyleDimension
(
num2
+ num * 2, 0f),
25
Height
=
new
StyleDimension
(
num3
* count + num * (1 + count), 0f)
26
};
27
SetPadding
(0f);
28
Width
=
uIPanel
.Width;
29
Height
=
uIPanel
.Height;
30
uIPanel.BorderColor =
new
Color
(89, 116, 213, 255) * 0.9f;
31
uIPanel.BackgroundColor =
new
Color
(73, 94, 171) * 0.9f;
32
uIPanel
.SetPadding(0f);
33
Append
(
uIPanel
);
34
for
(
int
i = 0; i < count; i++)
35
{
36
UIElement
uIElement
=
buttons
[i];
37
uIElement.HAlign = 0.5f;
38
uIElement.Top =
new
StyleDimension
(num +
num4
* i, 0f);
39
uIElement
.SetSnapPoint(
_gamepadPointGroupname
, i);
40
uIPanel
.Append(
uIElement
);
41
_buttonsBySorting
.
Add
(
uIElement
);
42
}
43
}
44
}
System.Collections.Generic.Dictionary.Count
int Count
Definition
Dictionary.cs:682
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Collections.Generic.List.Add
void Add(T item)
Definition
List.cs:236
Terraria.GameContent.UI.Elements.PowerStripUIElement._gamepadPointGroupname
string _gamepadPointGroupname
Definition
PowerStripUIElement.cs:11
Terraria.GameContent.UI.Elements.PowerStripUIElement.PowerStripUIElement
PowerStripUIElement(string gamepadGroupName, List< UIElement > buttons)
Definition
PowerStripUIElement.cs:13
Terraria.GameContent.UI.Elements.PowerStripUIElement._buttonsBySorting
List< UIElement > _buttonsBySorting
Definition
PowerStripUIElement.cs:9
Terraria.GameContent.UI.Elements.PowerStripUIElement
Definition
PowerStripUIElement.cs:8
Terraria.GameContent.UI.Elements.UIPanel
Definition
UIPanel.cs:9
Terraria.UI.UIElement.Height
StyleDimension Height
Definition
UIElement.cs:29
Terraria.UI.UIElement.Append
void Append(UIElement element)
Definition
UIElement.cs:166
Terraria.UI.UIElement.Width
StyleDimension Width
Definition
UIElement.cs:27
Terraria.UI.UIElement.SetPadding
void SetPadding(float pixels)
Definition
UIElement.cs:361
Terraria.UI.UIElement
Definition
UIElement.cs:12
Microsoft.Xna.Framework
Definition
AlphaTestEffect.cs:1
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
Terraria.GameContent.UI.Elements
Definition
AWorldListItem.cs:8
Terraria.UI
Definition
ChatLine.cs:3
Microsoft.Xna.Framework.Color
Definition
Color.cs:12
Terraria.UI.StyleDimension
Definition
StyleDimension.cs:4
source
Terraria.GameContent.UI.Elements
PowerStripUIElement.cs
Generated by
1.10.0