@@ -24,11 +24,12 @@ public class TaskSelectionController extends GenericController {
24
24
@ FXML
25
25
private BorderPane mainBorderPane ;
26
26
27
- private void connectButtonToCoding (Button codeBtn , String taskTitle , boolean isCompleted ) {
27
+ private void connectButtonToCoding (Label taskLabel , Button codeBtn , String taskTitle , boolean isCompleted ) {
28
28
// make the style change dynamically
29
29
PointsGiver .connectToTaskCompletion (event -> {
30
30
String incomingText = (String )event .value ();
31
- if (incomingText .equals (codeBtn .getText ()))
31
+
32
+ if (incomingText .equals (taskLabel .getText ()))
32
33
ResourceHandler .setStyleForUnlockedAsset (codeBtn );
33
34
});
34
35
if (isCompleted )
@@ -70,15 +71,15 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
70
71
try {
71
72
GridPane gridPane = FXMLLoader .load (ResourceHandler .TaskGridPane );
72
73
gridPane .setStyle ("-fx-cursor: hand" ); // adding this here as the hand cursor doesn't work in the children for some reason
73
-
74
+ //FIXME: the codeBtn has the "unclickableButton" class
74
75
var label = (Label )gridPane .getChildren ().get (0 );
75
76
var codeBtn = (Button )gridPane .getChildren ().get (2 );
76
77
var testsBtn = (Button )gridPane .getChildren ().get (1 );
77
78
78
79
label .setText (taskTitle );
79
80
label .setStyle ("-fx-font-size: 20px" );
80
81
label .setWrapText (true );
81
- connectButtonToCoding (codeBtn , taskTitle , completedTasks .contains (taskTitle ));
82
+ connectButtonToCoding (label , codeBtn , taskTitle , completedTasks .contains (taskTitle ));
82
83
connectButtonToTestSolving (testsBtn , taskTitle );
83
84
84
85
tasksVBox .getChildren ().add (gridPane );
0 commit comments