diff --git a/src/main/java/tsundere/Main.java b/src/main/java/tsundere/Main.java index 8658b58ac4..8f5512882d 100644 --- a/src/main/java/tsundere/Main.java +++ b/src/main/java/tsundere/Main.java @@ -1,10 +1,12 @@ package tsundere; import java.io.IOException; +import java.util.Objects; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; +import javafx.scene.image.Image; import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; import tsundere.gui.MainWindow; @@ -22,6 +24,10 @@ public class Main extends Application { @Override public void start(Stage stage) { try { + stage.setTitle("Tsundere Task Assistant"); + stage.getIcons().add(new Image(Objects.requireNonNull(getClass() + .getResourceAsStream("/images/chitoge2.png")))); + FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("/view/MainWindow.fxml")); AnchorPane ap = fxmlLoader.load(); Scene scene = new Scene(ap); diff --git a/src/main/java/tsundere/task/TaskList.java b/src/main/java/tsundere/task/TaskList.java index 7a6f574172..54c319f3e5 100644 --- a/src/main/java/tsundere/task/TaskList.java +++ b/src/main/java/tsundere/task/TaskList.java @@ -25,7 +25,7 @@ public class TaskList { public static String unmarkTask() throws GeneralException { if (TaskList.taskList.isEmpty()) { - throw new GeneralException("What you tryna unmark huh?"); + throw new GeneralException("There's nothing to unmark here"); } try { Task t = TaskList.taskList.get(Integer.parseInt(Parser.getName().substring(7, 8)) - 1); @@ -33,7 +33,7 @@ public static String unmarkTask() throws GeneralException { return "You haven't even started this task dummy!"; } else { t.unMarkTask(); - return t.toString(); + return getListSize("unmarked", t); } } catch (NumberFormatException e) { throw new GeneralException("Can't you even remember the proper format for this?\n" @@ -53,15 +53,15 @@ public static String unmarkTask() throws GeneralException { public static String markTask() throws GeneralException { if (TaskList.taskList.isEmpty()) { - throw new GeneralException("What you tryna mark huh?"); + throw new GeneralException("There's nothing to mark here!"); } try { Task t = TaskList.taskList.get(Integer.parseInt(Parser.getName().substring(5, 6)) - 1); if (t.isDone) { - return "You already finished this!"; + return "You already marked this!"; } else { t.markTaskAsDone(); - return t.toString(); + return getListSize("marked", t); } } catch (NumberFormatException e) { throw new GeneralException("Can't you even remember the proper format for this?\n" @@ -81,7 +81,7 @@ public static String markTask() throws GeneralException { public static String deleteTask() throws GeneralException { if (TaskList.taskList.isEmpty()) { - throw new GeneralException("What you tryna delete huh?"); + throw new GeneralException("There's nothing to delete here!"); } try { @@ -271,7 +271,7 @@ public static String untagTask() throws GeneralException { } /** - * Prints number of Tasks in TaskList. + * Returns number of Tasks in TaskList. * * @return String containing number of Tasks left if any in the TaskList. */ @@ -279,7 +279,7 @@ public static String getListSize(String str, Task t) { String response = ""; int size = TaskList.taskList.size(); response += "Noted..."; - response += " " + t.toString() + " has been " + str + "\n"; + response += " " + t.toString() + " has been " + str + ".\n"; if (size > 0) { response += "Get to work! You still have " + size + " " + (size > 1 ? "tasks" : "task") + " left!"; @@ -289,4 +289,25 @@ public static String getListSize(String str, Task t) { return response; } + + /** + * Returns a list of all possible command. + * + * @return String containing all the command formats. + */ + public static String listCommands() { + return "It's merely a coincidence I have the list of commands here...\n" + + "1. todo [task]\n" + + "2. event [task], from [ ], to [ ]\n" + + "3. deadline [task], by [yyyy-mm-dd]\n" + + "4. find [keyword]\n" + + "5. list\n" + + "6. mark [task no.]\n" + + "7. unmark [task no.]\n" + + "8. delete [task no.]\n" + + "9. tag [task no.] [tagname]\n" + + "10. untag [task no.] [tagname]\n" + + "11. help\n" + + "12. bye"; + } } diff --git a/src/main/java/tsundere/ui/Parser.java b/src/main/java/tsundere/ui/Parser.java index 35d8fc0735..c270df0fd2 100644 --- a/src/main/java/tsundere/ui/Parser.java +++ b/src/main/java/tsundere/ui/Parser.java @@ -44,8 +44,10 @@ public String execute() throws GeneralException { return TaskList.untagTask(); } else if (name.contains("tag")) { return TaskList.tagTask(); + } else if (name.contains("help")) { + return TaskList.listCommands(); } else { - return ("Don't talk to me!\nGive me proper instructions!"); + return "Don't talk to me!\nGive me proper instructions!\n Hint: type \"help\""; } } diff --git a/src/main/resources/images/chitoge2.png b/src/main/resources/images/chitoge2.png new file mode 100644 index 0000000000..f004178657 Binary files /dev/null and b/src/main/resources/images/chitoge2.png differ diff --git a/src/main/resources/images/npc.png b/src/main/resources/images/npc.png deleted file mode 100644 index b5a7b2c141..0000000000 Binary files a/src/main/resources/images/npc.png and /dev/null differ diff --git a/src/main/resources/view/DialogBox.fxml b/src/main/resources/view/DialogBox.fxml index 860cad20b9..276d643039 100644 --- a/src/main/resources/view/DialogBox.fxml +++ b/src/main/resources/view/DialogBox.fxml @@ -8,8 +8,8 @@ - - + +