Skip to content

Commit 0f363aa

Browse files
authored
Merge pull request #82 from FilipRuman/minor-hud-&-improvements
Minor hud improvements
2 parents 0b4002c + 38dac48 commit 0f363aa

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

godot/Bike/HUD/BikeHudMain.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public override void _Process(double delta) {
4545
workoutLength.Text = $"{(int)workout.totalTime_s / 60}";
4646
totalDescent.Text = $"{(int)workout.totalDescent}";
4747
totalAscent.Text = $"{(int)workout.totalAscent}";
48-
caloriesBurnt.Text = $"{(int)workout.caloriesBurnt}󰆘";
48+
caloriesBurnt.Text = $"{(int)(workout.caloriesBurnt)}󰆘";
4949

5050
cadence.Text = $" {bikeInput.currentCadence_RPM}";
51-
cadenceAvr.Text = $"{workout.averageCadence}";
51+
cadenceAvr.Text = $"{((int)workout.averageCadence)}";
5252

5353
speed.Text = $"{(int)bikePhysics.speed_kmH}󰓅";
5454
speedAvr.Text = $"{(int)workout.averageSpeed_kmH}";
@@ -57,7 +57,7 @@ public override void _Process(double delta) {
5757
powerAvr.Text = $"{(int)workout.averageWatts}";
5858

5959
heartRate.Text = $"{bikeInput.heartRate}";
60-
heartRateAvr.Text = $"{workout.averageHeartRate}";
60+
heartRateAvr.Text = $"{((int)workout.averageHeartRate)}";
6161

6262
fps.Text = $"FPS: {Engine.GetFramesPerSecond()}";
6363
base._Process(delta);

godot/Bike/HUD/hud.tscn

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,27 +287,35 @@ alignment = 1
287287
[node name="totalDescent" type="Label" parent="workout stat/VBoxContainer"]
288288
layout_mode = 2
289289
size_flags_vertical = 6
290+
tooltip_text = "total descent in meters made during whole activity"
291+
mouse_filter = 1
290292
theme_type_variation = &"H2Label"
291293
text = "100"
292294
horizontal_alignment = 1
293295

294296
[node name="totalAscent" type="Label" parent="workout stat/VBoxContainer"]
295297
layout_mode = 2
296298
size_flags_vertical = 6
299+
tooltip_text = "total ascent in meters made during whole activity"
300+
mouse_filter = 1
297301
theme_type_variation = &"H2Label"
298302
text = "200"
299303
horizontal_alignment = 1
300304

301305
[node name="caloriesBurnt" type="Label" parent="workout stat/VBoxContainer"]
302306
layout_mode = 2
303307
size_flags_vertical = 6
308+
tooltip_text = "kcalories burnt during whole activity"
309+
mouse_filter = 1
304310
theme_type_variation = &"H2Label"
305311
text = "1300󰆘"
306312
horizontal_alignment = 1
307313

308314
[node name="workoutLength" type="Label" parent="workout stat/VBoxContainer"]
309315
layout_mode = 2
310316
size_flags_vertical = 6
317+
tooltip_text = "total workout length in minutes"
318+
mouse_filter = 1
311319
theme_type_variation = &"H2Label"
312320
text = "120"
313321
horizontal_alignment = 1

godot/Menu/menu_main.tscn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ visible = false
235235
[node name="heart rate device type" type="Node" parent="Panel/contents/device connection/HSplitContainer/device types/VBoxContainer2/heart rate tracker " node_paths=PackedStringArray("display")]
236236
script = ExtResource("7_lqkny")
237237
display = NodePath("..")
238+
bluetoothDeviceTypeName = "hr tracker"
238239
glyphIcon = " "
239240

240241
[node name="other device type 󰤟" parent="Panel/contents/device connection/HSplitContainer/device types/VBoxContainer2" node_paths=PackedStringArray("icon") instance=ExtResource("6_bexj6")]

godot/Workout/Wourkout.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class Workout {
2222
public float averageWatts;
2323
public float caloriesBurnt;
2424
const float humanMetabolicEfficiency = .24f;
25-
const float julesToCalories = 4.184f;
25+
const float julesToCalories = 1f / 4184f;
2626

2727
public float totalAscent;
2828
public float totalDescent;
@@ -65,7 +65,8 @@ float currentHeight
6565
averageHeartRate = totalHeartRate / totalTime_s;
6666
averageSpeed_kmH = totalSpeed_kmH / totalTime_s;
6767
averageWatts = totalPower / totalTime_s;
68-
caloriesBurnt = averageWatts * totalTime_s * humanMetabolicEfficiency * julesToCalories;
68+
69+
caloriesBurnt = averageWatts * totalTime_s * julesToCalories / humanMetabolicEfficiency;
6970
}
7071

7172
public static Workout Load(string name) {

0 commit comments

Comments
 (0)