Skip to content

Commit

Permalink
Fix regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
chaaaaun committed Feb 19, 2024
1 parent 82061be commit 009a7e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/chatbot/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void withArgs(String args) {

@Override
public String toString() {
return this.rep + this.args;
return this.rep;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/chatbot/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ public class Parser {
public static Command toCommand(String rep) throws InvalidCommandException, InvalidArgumentException {
String[] split = rep.split("\\s+", 2);
Command cmd = cmdStrMap.get(split[0]);
if (split.length > 1 && cmd.hasArgs()) {
cmd.withArgs(split[1]);
}
if (cmd == null) {
throw new InvalidCommandException();
}
if (split.length > 1 && cmd.hasArgs()) {
cmd.withArgs(split[1]);
}
if (split.length > 1 && !cmd.hasArgs()) {
throw new InvalidArgumentException();
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/chatbot/controllers/DialogBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundFill;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
Expand Down Expand Up @@ -67,6 +68,6 @@ private void flip() {
Collections.reverse(tmp);
message.getChildren().setAll(tmp);
setAlignment(Pos.TOP_LEFT);
messageBg.setBackground(Background.fill(Color.web("#F8EDFF")));
messageBg.setBackground(new Background(new BackgroundFill(Color.web("#F8EDFF"), null, null)));
}
}

0 comments on commit 009a7e2

Please sign in to comment.