Skip to content

Commit 49421c6

Browse files
committed
Minor tweak
1 parent 3f3f351 commit 49421c6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Entities/CustomBirdTutorial.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public CustomBirdTutorial(EntityData data, Vector2 offset) : base(data, offset)
4747
}
4848

4949
int extraAdvance = 0;
50-
bool firstIsString = false;
5150

5251
// go ahead and parse the controls. Controls can be textures, VirtualButtons, directions or strings.
5352
string[] controlsStrings = data.Attr("controls").Split(',');
@@ -71,7 +70,9 @@ public CustomBirdTutorial(EntityData data, Vector2 offset) : base(data, offset)
7170
// width computation doesn't take this 1px into account, so we should add it back in.
7271
extraAdvance++;
7372
if (i == 0) {
74-
firstIsString = true;
73+
// as the text is rendered 1px to the right, if the first thing is a string, there will be 1px more padding on the left.
74+
// we should add that extra px on the right as well.
75+
extraAdvance++;
7576
}
7677

7778
if (controlString.StartsWith("dialog:")) {
@@ -92,11 +93,6 @@ public CustomBirdTutorial(EntityData data, Vector2 offset) : base(data, offset)
9293
if (string.IsNullOrEmpty(infoString)) {
9394
guiData["infoHeight"] = 0f;
9495
}
95-
// as the text is rendered 1px to the right, if the first thing is a string, there will be 1px padding on the left.
96-
// we should add that extra px on the right as well.
97-
if (firstIsString) {
98-
extraAdvance++;
99-
}
10096
// apply the extra width.
10197
guiData["controlsWidth"] = guiData.Get<float>("controlsWidth") + extraAdvance;
10298
}

0 commit comments

Comments
 (0)