Skip to content

Commit 83b3f00

Browse files
committed
Buttons are behaving as intended and have the possibility to reload the page if you click again on them.
1 parent b6bfc40 commit 83b3f00

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

data/core/lesson/LessonController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void ApplyNewLesson(LessonEntity lesson)
4242
/// </summary>
4343
public void UserRequestsChangeTo(PageCategory page)
4444
{
45-
if (_currentPage == null || _currentPage.ScenePage == page) return;
45+
if (_currentPage == null) return;
4646
_currentPage.OnUserRequestsChange(_mainNode, page);
4747
}
4848

data/core/scene_manager/navigation_steps/NavigationSteps.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class NavigationSteps : Node
1616
private Button _simulationStepButton;
1717
private Button _examinationStepButton;
1818
private Button _exitButton;
19+
private PageCategory _currentPage;
1920
#endregion
2021

2122

@@ -40,6 +41,7 @@ public override void _Ready()
4041
/// </summary>
4142
public void VisibleViewIs(PageCategory view)
4243
{
44+
_currentPage = view;
4345
_landingPageButton.Pressed = view == PageCategory.LandingPage;
4446
_sfcStepButton.Pressed = view == PageCategory.LogicEditor;
4547
_sfcStepButton.Disabled = view == PageCategory.LandingPage;
@@ -83,11 +85,13 @@ private void UpdateButtonState(Button button, PageCategory pages, bool pressed)
8385
if (pressed)
8486
{
8587
_mainNode.UserRequestsChangeTo(pages);
86-
button.MouseFilter = Control.MouseFilterEnum.Ignore;
8788
}
8889
else
8990
{
90-
button.MouseFilter = Control.MouseFilterEnum.Stop;
91+
if (_currentPage == pages)
92+
{
93+
_mainNode.UserRequestsChangeTo(pages);
94+
}
9195
}
9296
}
9397
#endregion

data/core/scene_manager/navigation_steps/NavigationSteps.tscn

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,53 +20,42 @@ hint_tooltip = "Exit the programm"
2020

2121
[node name="FillerButton" parent="." instance=ExtResource( 2 )]
2222
anchor_top = 0.0
23-
margin_top = 380.0
23+
margin_top = 320.0
2424
margin_bottom = -80.0
2525
disabled = true
2626
icon = null
2727

2828
[node name="ExaminationStepButton" parent="." instance=ExtResource( 2 )]
2929
anchor_top = 0.0
3030
anchor_bottom = 0.0
31-
margin_top = 300.0
32-
margin_bottom = 380.0
31+
margin_top = 240.0
32+
margin_bottom = 320.0
3333
hint_tooltip = "Open the test site"
3434
disabled = true
3535
icon = ExtResource( 3 )
3636

3737
[node name="SimulationStepButton" parent="." instance=ExtResource( 2 )]
3838
anchor_top = 0.0
3939
anchor_bottom = 0.0
40-
margin_top = 220.0
41-
margin_bottom = 300.0
40+
margin_top = 160.0
41+
margin_bottom = 240.0
4242
hint_tooltip = "Open simulation"
4343
disabled = true
4444
icon = ExtResource( 4 )
4545

4646
[node name="SfcStepButton" parent="." instance=ExtResource( 2 )]
4747
anchor_top = 0.0
4848
anchor_bottom = 0.0
49-
margin_top = 140.0
50-
margin_bottom = 220.0
49+
margin_top = 80.0
50+
margin_bottom = 160.0
5151
hint_tooltip = "Open SFC editor"
5252
disabled = true
5353
icon = ExtResource( 5 )
5454

5555
[node name="LandingPageButton" parent="." instance=ExtResource( 2 )]
5656
anchor_top = 0.0
5757
anchor_bottom = 0.0
58-
margin_top = 60.0
59-
margin_bottom = 134.277
60-
hint_tooltip = "Return to the menu"
61-
icon = ExtResource( 6 )
62-
63-
[node name="HeaderButton" parent="." instance=ExtResource( 2 )]
64-
anchor_top = 0.0
65-
anchor_bottom = 0.0
6658
margin_top = 0.0
67-
margin_bottom = 60.0
59+
margin_bottom = 80.0
6860
hint_tooltip = "Return to the menu"
69-
disabled = true
70-
toggle_mode = false
71-
text = "NW"
72-
icon = null
61+
icon = ExtResource( 6 )

0 commit comments

Comments
 (0)